aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-07-24 08:43:08 -0400
committerTom Rini <trini@konsulko.com>2020-07-24 08:43:08 -0400
commitada61f1ee2a4eaa1b29d699b5ba940483171df8a (patch)
tree929b89181385f858187b207f82a46aea2d367e90 /board
parent7208396bbf1df1c7a85d263b7ff054e6b45d8240 (diff)
parentecb70bdb9f12b694e3a50895a759119b3fc27507 (diff)
downloadu-boot-ada61f1ee2a4eaa1b29d699b5ba940483171df8a.zip
u-boot-ada61f1ee2a4eaa1b29d699b5ba940483171df8a.tar.gz
u-boot-ada61f1ee2a4eaa1b29d699b5ba940483171df8a.tar.bz2
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
- Fix SiFive HiFive Unleashed board booting failure problem. - Enable SiFive fu540 PWM driver. - Support SiFive fu540: SPI boot. - Update OpenSBI used for RISC-V CI testing. - Revert "riscv: Allow use of reset drivers". - Revert "Revert "riscv: sifive: fu540: Add gpio-restart support"". - sysreset: syscon: - Don't assume default value for offset and mask property. - Support value property. - qemu: Add syscon reboot and poweroff support. - Fix SIFIVE debug serial dependency. - Fix linking error when building u-boot-spl with no SMP support. - AE350 use fdtdec_get_addr_size_auto_noparent to parse smc reg. - Make memory node available to SPL in hifive-unleashed-a00-u-boot.dtsi - SiFive fu540 avoid using hardcoded ram base and size.
Diffstat (limited to 'board')
-rw-r--r--board/AndesTech/ax25-ae350/ax25-ae350.c3
-rw-r--r--board/emulation/qemu-riscv/Kconfig4
-rw-r--r--board/sifive/fu540/Kconfig5
-rw-r--r--board/sifive/fu540/fu540.c25
4 files changed, 30 insertions, 7 deletions
diff --git a/board/AndesTech/ax25-ae350/ax25-ae350.c b/board/AndesTech/ax25-ae350/ax25-ae350.c
index add0d56..59a43e4 100644
--- a/board/AndesTech/ax25-ae350/ax25-ae350.c
+++ b/board/AndesTech/ax25-ae350/ax25-ae350.c
@@ -71,7 +71,8 @@ int smc_init(void)
if (node < 0)
return -FDT_ERR_NOTFOUND;
- addr = fdtdec_get_addr(blob, node, "reg");
+ addr = fdtdec_get_addr_size_auto_noparent(blob, node,
+ "reg", 0, NULL, false);
if (addr == FDT_ADDR_T_NONE)
return -EINVAL;
diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig
index ad99b08..617c4aa 100644
--- a/board/emulation/qemu-riscv/Kconfig
+++ b/board/emulation/qemu-riscv/Kconfig
@@ -53,5 +53,9 @@ config BOARD_SPECIFIC_OPTIONS # dummy
imply NVME
imply SPL_RAM_SUPPORT
imply SPL_RAM_DEVICE
+ imply SYSRESET
+ imply SYSRESET_SYSCON
+ imply CMD_POWEROFF
+ imply SYSRESET_CMD_POWEROFF
endif
diff --git a/board/sifive/fu540/Kconfig b/board/sifive/fu540/Kconfig
index 86193d7..f3217f6 100644
--- a/board/sifive/fu540/Kconfig
+++ b/board/sifive/fu540/Kconfig
@@ -27,6 +27,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
def_bool y
select SIFIVE_FU540
select SUPPORT_SPL
+ select ENV_IS_IN_SPI_FLASH
select RAM
select SPL_RAM if SPL
imply CMD_DHCP
@@ -65,5 +66,9 @@ config BOARD_SPECIFIC_OPTIONS # dummy
imply SMP
imply MISC
imply SIFIVE_OTP
+ imply DM_PWM
+ imply PWM_SIFIVE
+ imply SYSRESET
+ imply SYSRESET_GPIO
endif
diff --git a/board/sifive/fu540/fu540.c b/board/sifive/fu540/fu540.c
index 27ff52f..57753ba 100644
--- a/board/sifive/fu540/fu540.c
+++ b/board/sifive/fu540/fu540.c
@@ -10,6 +10,7 @@
#include <env.h>
#include <init.h>
#include <log.h>
+#include <linux/bitops.h>
#include <linux/bug.h>
#include <linux/delay.h>
#include <linux/io.h>
@@ -128,14 +129,26 @@ int board_init(void)
}
#ifdef CONFIG_SPL
+#define MODE_SELECT_REG 0x1000
+#define MODE_SELECT_QSPI 0x6
+#define MODE_SELECT_SD 0xb
+#define MODE_SELECT_MASK GENMASK(3, 0)
+
u32 spl_boot_device(void)
{
-#ifdef CONFIG_SPL_MMC_SUPPORT
- return BOOT_DEVICE_MMC1;
-#else
- puts("Unknown boot device\n");
- hang();
-#endif
+ u32 mode_select = readl((void *)MODE_SELECT_REG);
+ u32 boot_device = mode_select & MODE_SELECT_MASK;
+
+ switch (boot_device) {
+ case MODE_SELECT_QSPI:
+ return BOOT_DEVICE_SPI;
+ case MODE_SELECT_SD:
+ return BOOT_DEVICE_MMC1;
+ default:
+ debug("Unsupported boot device 0x%x but trying MMC1\n",
+ boot_device);
+ return BOOT_DEVICE_MMC1;
+ }
}
#endif