1139825Simp// SPDX-License-Identifier: GPL-2.0+ 2168191Sjhb 3168191Sjhb#define LOG_CATEGORY LOGC_ARCH 4168191Sjhb 573782Sjasone#include <fdt_support.h> 673782Sjasone#include <log.h> 773782Sjasone 873782Sjasone#if defined(__riscv) 973782Sjasoneint arch_fixup_fdt(void *blob) 1073782Sjasone{ 1173782Sjasone int ret; 1273782Sjasone 1373782Sjasone ret = fdt_find_or_add_subnode(blob, 0, "chosen");; 1473782Sjasone if (ret < 0) 1573782Sjasone goto err; 1673782Sjasone ret = fdt_setprop_u32(blob, ret, "boot-hartid", 1); 1773782Sjasone if (ret < 0) 1873782Sjasone goto err; 1973782Sjasone return 0; 2073782Sjasoneerr: 2173782Sjasone log_err("Setting /chosen/boot-hartid failed: %s\n", fdt_strerror(ret)); 2273782Sjasone return ret; 2373782Sjasone} 2473782Sjasone#endif 2573782Sjasone