diff options
-rw-r--r-- | arch/riscv/lib/Makefile | 1 | ||||
-rw-r--r-- | arch/riscv/lib/board.c | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/riscv/lib/Makefile b/arch/riscv/lib/Makefile index 22b675ffe82..189b35c24d3 100644 --- a/arch/riscv/lib/Makefile +++ b/arch/riscv/lib/Makefile @@ -27,6 +27,7 @@ obj-$(CONFIG_$(PHASE_)SMP) += smp.o obj-$(CONFIG_XPL_BUILD) += spl.o obj-y += fdt_fixup.o obj-$(CONFIG_$(SPL)CMD_BDI) += bdinfo.o +obj-$(CONFIG_OF_BOARD) += board.o # For building EFI apps CFLAGS_NON_EFI := -fstack-protector-strong diff --git a/arch/riscv/lib/board.c b/arch/riscv/lib/board.c new file mode 100644 index 00000000000..624c4eaaf4d --- /dev/null +++ b/arch/riscv/lib/board.c @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * RISC-V-specific handling of firmware FDT + */ + +#include <asm/global_data.h> +#include <linux/errno.h> + +DECLARE_GLOBAL_DATA_PTR; + +__weak int board_fdt_blob_setup(void **fdtp) +{ + if (!gd->arch.firmware_fdt_addr) + return -EEXIST; + + *fdtp = (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; + + return 0; +} |