blob: a646f2059c2ce81dcf74ed82a28aa4cc7ec0688f [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
5#include <common.h>
6#include <fdt_support.h>
7#include <log.h>
8
9#if defined(__riscv)
10int arch_fixup_fdt(void *blob)
11{
12 int ret;
13
14 ret = fdt_find_or_add_subnode(blob, 0, "chosen");;
15 if (ret < 0)
16 goto err;
17 ret = fdt_setprop_u32(blob, ret, "boot-hartid", 1);
18 if (ret < 0)
19 goto err;
20 return 0;
21err:
22 log_err("Setting /chosen/boot-hartid failed: %s\n", fdt_strerror(ret));
23 return ret;
24}
25#endif