summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorThomas Skibo <thomas-git@skibo.net>2021-11-24 14:32:09 -0800
committerLeo Yu-Chi Liang <ycliang@andestech.com>2021-12-02 16:43:56 +0800
commit6a863894ad53b2d0e6c6d47ad105850053757fec (patch)
tree6b3c388872fce40712b633a34f8beab04e3d76e1 /board
parentffb78a7c71d555be31c8f8f2bb0fcc2fcfe3892e (diff)
riscv: Support booting SiFive Unmatched from SPI.
Configure SPI flash devices into SPL. Add SPI boot option to spl.c. Document how to format flash for booting. Signed-off-by: Thomas Skibo <thomas-git@skibo.net> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Diffstat (limited to 'board')
-rw-r--r--board/sifive/unmatched/spl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/board/sifive/unmatched/spl.c b/board/sifive/unmatched/spl.c
index d5663274cd..7c0beedc08 100644
--- a/board/sifive/unmatched/spl.c
+++ b/board/sifive/unmatched/spl.c
@@ -22,6 +22,7 @@
#define GEM_PHY_RESET SIFIVE_GENERIC_GPIO_NR(0, 12)
#define MODE_SELECT_REG 0x1000
+#define MODE_SELECT_SPI 0x6
#define MODE_SELECT_SD 0xb
#define MODE_SELECT_MASK GENMASK(3, 0)
@@ -123,6 +124,8 @@ u32 spl_boot_device(void)
u32 boot_device = mode_select & MODE_SELECT_MASK;
switch (boot_device) {
+ case MODE_SELECT_SPI:
+ return BOOT_DEVICE_SPI;
case MODE_SELECT_SD:
return BOOT_DEVICE_MMC1;
default: