Heinrich Schuchardt | 6742bc8 | 2021-08-28 11:42:09 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
| 3 | #define LOG_CATEGORY LOGC_ARCH |
| 4 | |
Heinrich Schuchardt | 6742bc8 | 2021-08-28 11:42:09 +0200 | [diff] [blame] | 5 | #include <fdt_support.h> |
| 6 | #include <log.h> |
| 7 | |
| 8 | #if defined(__riscv) |
| 9 | int arch_fixup_fdt(void *blob) |
| 10 | { |
| 11 | int ret; |
| 12 | |
| 13 | ret = fdt_find_or_add_subnode(blob, 0, "chosen");; |
| 14 | if (ret < 0) |
| 15 | goto err; |
| 16 | ret = fdt_setprop_u32(blob, ret, "boot-hartid", 1); |
| 17 | if (ret < 0) |
| 18 | goto err; |
| 19 | return 0; |
| 20 | err: |
| 21 | log_err("Setting /chosen/boot-hartid failed: %s\n", fdt_strerror(ret)); |
| 22 | return ret; |
| 23 | } |
| 24 | #endif |