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 <sean@xobs.io>
This commit is contained in:
Sean Cross 2022-12-31 23:21:08 +08:00
parent 46556c1edf
commit dfa09fc84b

View File

@ -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();