blob: e333bd52ea28f0b497999def1e46e5e542a74c20 [file] [log] [blame]
Heinrich Schuchardt6742bc82021-08-28 11:42:09 +02001// SPDX-License-Identifier: GPL-2.0+
2
3#define LOG_CATEGORY LOGC_ARCH
4
Heinrich Schuchardt6742bc82021-08-28 11:42:09 +02005#include <fdt_support.h>
6#include <log.h>
7
8#if defined(__riscv)
9int 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;
20err:
21 log_err("Setting /chosen/boot-hartid failed: %s\n", fdt_strerror(ret));
22 return ret;
23}
24#endif