From dfa09fc84b0acb4d9a2d409f3a381274a1551e9f Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sat, 31 Dec 2022 23:21:08 +0800 Subject: [PATCH] sw: picorvspi: fix invalid constant in main.c The previous picorvspi code used an incorrect constant when examining the CFM_EN bit. As a result, this mode would never work. Use the correct constant, in case anyone builds foboot using a picorvspi hardware block. This addresses #333. Signed-off-by: Sean Cross --- sw/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/src/main.c b/sw/src/main.c index 932a47c..c244541 100644 --- a/sw/src/main.c +++ b/sw/src/main.c @@ -54,7 +54,7 @@ static void riscv_reboot_to(const void *addr, uint32_t boot_config) { } if (boot_config & 0x00000002) // DDR_EN picorvspi_cfg3_write(picorvspi_cfg3_read() | 0x40); - if (boot_config & 0x00000002) // CFM_EN + if (boot_config & 0x00000004) // CFM_EN picorvspi_cfg3_write(picorvspi_cfg3_read() | 0x10); #endif rgb_mode_error();