From 8359fd73131d74e510b281408b0de2fdbf2f62bd Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov Date: Mon, 26 Jul 2021 11:20:17 +0100 Subject: qemu-riscv64_smode: fix extlinux (define preboot) Commit 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") removed preboot commands in RISC-V targets and broke extlinux support as reported by Fu Wei . The patch finishes migration of CONFIG_USE_PREBOOT and CONFIG_REBOOT to Kconfig. Fixes: 37304aaf60bf ("Convert CONFIG_USE_PREBOOT and CONFIG_PREBOOT to Kconfig") Reported-By: Fu Wei Signed-off-by: David Abdurachmanov Signed-off-by: Dimitri John Ledkov Reviewed-by: Leo Yu-Chi Liang --- configs/qemu-riscv64_smode_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/qemu-riscv64_smode_defconfig b/configs/qemu-riscv64_smode_defconfig index 0000564e41..4a6416e254 100644 --- a/configs/qemu-riscv64_smode_defconfig +++ b/configs/qemu-riscv64_smode_defconfig @@ -6,6 +6,8 @@ CONFIG_ARCH_RV64I=y CONFIG_RISCV_SMODE=y CONFIG_DISTRO_DEFAULTS=y CONFIG_FIT=y +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};" CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y CONFIG_CMD_BOOTEFI_SELFTEST=y -- cgit v1.2.1 From 662e300bc060205a54c7c8ba34b19af53f87fa9c Mon Sep 17 00:00:00 2001 From: Zong Li Date: Mon, 2 Aug 2021 15:34:14 +0800 Subject: riscv: cpu: fu740: Fix typo of date Fixed the typo of date of copyright declaration. Signed-off-by: Zong Li Reviewed-by: Bin Meng --- arch/riscv/cpu/fu740/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/cpu/fu740/spl.c b/arch/riscv/cpu/fu740/spl.c index 55e30346ff..c6816e9ed4 100644 --- a/arch/riscv/cpu/fu740/spl.c +++ b/arch/riscv/cpu/fu740/spl.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2020-201 SiFive, Inc + * Copyright (C) 2020-2021 SiFive, Inc * Pragnesh Patel */ -- cgit v1.2.1 From 87e84818857db1d710002217eea66bb3596f5571 Mon Sep 17 00:00:00 2001 From: Zong Li Date: Tue, 27 Jul 2021 17:06:58 +0800 Subject: board: sifive: compile stuff only related to SPL in SPL build As (3581811dc26f "riscv: sifive/fu540: Move SPL related functions to spl.c"), we put the SPL stuff in spl.c, we don't need to compile unleashed.c and unmatched.c in SPL build. Signed-off-by: Zong Li Reviewed-by: Leo Yu-Chi Liang --- board/sifive/unleashed/Makefile | 4 ++-- board/sifive/unmatched/Makefile | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/board/sifive/unleashed/Makefile b/board/sifive/unleashed/Makefile index 5821679dd9..98e9111cbc 100644 --- a/board/sifive/unleashed/Makefile +++ b/board/sifive/unleashed/Makefile @@ -2,8 +2,8 @@ # # Copyright (c) 2019 Western Digital Corporation or its affiliates. -obj-y += unleashed.o - ifdef CONFIG_SPL_BUILD obj-y += spl.o +else +obj-y += unleashed.o endif diff --git a/board/sifive/unmatched/Makefile b/board/sifive/unmatched/Makefile index e00b330e8c..1345330089 100644 --- a/board/sifive/unmatched/Makefile +++ b/board/sifive/unmatched/Makefile @@ -2,9 +2,10 @@ # # Copyright (c) 2020-2021 SiFive, Inc -obj-y += unmatched.o obj-$(CONFIG_ID_EEPROM) += hifive-platform-i2c-eeprom.o ifdef CONFIG_SPL_BUILD obj-y += spl.o +else +obj-y += unmatched.o endif -- cgit v1.2.1 From 47d73ba4f4a40f17622d93f96b48e285b73c3061 Mon Sep 17 00:00:00 2001 From: Zong Li Date: Tue, 27 Jul 2021 17:06:59 +0800 Subject: board: sifive: overwrite board_fdt_blob_setup in u-boot proper Add board_fdt_blob_setup to return the device tree location which is passed by prior stage in u-boot proper. The generic board_fdt_blob_setup always returns _end, it mignt be ok because u-boot SPL would currently put the dtb there, but it would be broken if we put the dtb to another place and assigned the location into a1 register for u-boot proper. Use the location passed by prior stage would make more sence, because we actually pass the location to u-boot proper and want to use that one, rather than the dtb which in _end. We can't use CONFIG_OF_PRIOR_STAGE because it doens't distinguish the implementation of u-boot SPL and u-boot proper, so u-boot SPL need to reply on the prior stage to pass device tree location as well, but we don't pass the DT from boot rom now. In addition, when CONFIG_OF_PRIOR_STAGE is enabled, the u-boot-spl.bin and u-boot.itb won't include the device tree. Signed-off-by: Zong Li Reviewed-by: Leo Yu-Chi Liang --- board/sifive/unleashed/unleashed.c | 11 +++++++++++ board/sifive/unmatched/unmatched.c | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/board/sifive/unleashed/unleashed.c b/board/sifive/unleashed/unleashed.c index a4e78220cb..fa65fcade0 100644 --- a/board/sifive/unleashed/unleashed.c +++ b/board/sifive/unleashed/unleashed.c @@ -16,6 +16,7 @@ #include #include #include +#include /* * This define is a value used for error/unknown serial. @@ -113,6 +114,16 @@ int misc_init_r(void) #endif +void *board_fdt_blob_setup(void) +{ + if (IS_ENABLED(CONFIG_OF_SEPARATE)) { + if (gd->arch.firmware_fdt_addr) + return (ulong *)gd->arch.firmware_fdt_addr; + else + return (ulong *)&_end; + } +} + int board_init(void) { int ret; diff --git a/board/sifive/unmatched/unmatched.c b/board/sifive/unmatched/unmatched.c index 6d60559588..da23a6ce24 100644 --- a/board/sifive/unmatched/unmatched.c +++ b/board/sifive/unmatched/unmatched.c @@ -9,6 +9,17 @@ #include #include #include +#include + +void *board_fdt_blob_setup(void) +{ + if (IS_ENABLED(CONFIG_OF_SEPARATE)) { + if (gd->arch.firmware_fdt_addr) + return (ulong *)gd->arch.firmware_fdt_addr; + else + return (ulong *)&_end; + } +} int board_init(void) { -- cgit v1.2.1