[U-Boot] [PATCH] Revert "arm: mvebu: fix boot from UART when in fallback mode"

This reverts commit e83e2b390038c9075642cb243a6292241beb8d73. This prevents kwboot from overriding the hardware strapped boot source.
Signed-off-by: Chris Packham judge.packham@gmail.com --- Sean,
I take it your use case was for when the default boot source doesn't have a valid image and it falls back to UART? If that's the case I think we need something in addition to the existing code not instead of.
arch/arm/mach-mvebu/include/mach/soc.h | 6 ------ arch/arm/mach-mvebu/spl.c | 9 --------- 2 files changed, 15 deletions(-)
diff --git a/arch/arm/mach-mvebu/include/mach/soc.h b/arch/arm/mach-mvebu/include/mach/soc.h index 623ab4eb8d93..660dd148abc5 100644 --- a/arch/arm/mach-mvebu/include/mach/soc.h +++ b/arch/arm/mach-mvebu/include/mach/soc.h @@ -110,16 +110,10 @@ #define COMPHY_REFCLK_ALIGNMENT (MVEBU_REGISTER(0x182f8))
/* BootROM error register (also includes some status infos) */ -#if defined(CONFIG_ARMADA_38X) -#define CONFIG_BOOTROM_ERR_REG (MVEBU_REGISTER(0x182d0)) -#define BOOTROM_ERR_MODE_OFFS 0 -#define BOOTROM_ERR_MODE_MASK (0xf << BOOTROM_ERR_MODE_OFFS) -#else #define CONFIG_BOOTROM_ERR_REG (MVEBU_REGISTER(0x182d0)) #define BOOTROM_ERR_MODE_OFFS 28 #define BOOTROM_ERR_MODE_MASK (0xf << BOOTROM_ERR_MODE_OFFS) #define BOOTROM_ERR_MODE_UART 0x6 -#endif
#if defined(CONFIG_ARMADA_375) /* SAR values for Armada 375 */ diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c index 50b24f5760b7..4c3933b8354d 100644 --- a/arch/arm/mach-mvebu/spl.c +++ b/arch/arm/mach-mvebu/spl.c @@ -25,16 +25,7 @@ static u32 get_boot_device(void) val = readl(CONFIG_BOOTROM_ERR_REG); boot_device = (val & BOOTROM_ERR_MODE_MASK) >> BOOTROM_ERR_MODE_OFFS; debug("BOOTROM_REG=0x%08x boot_device=0x%x\n", val, boot_device); -#if defined(CONFIG_ARMADA_38X) - /* - * If the bootrom error register contains any else than zeros - * in the first 8 bits it's an error condition. And in that case - * try to boot from UART. - */ - if (boot_device) -#else if (boot_device == BOOTROM_ERR_MODE_UART) -#endif return BOOT_DEVICE_UART;
/*

On 17/08/2018 01.30, Chris Packham wrote:
This reverts commit e83e2b390038c9075642cb243a6292241beb8d73. This prevents kwboot from overriding the hardware strapped boot source.
Signed-off-by: Chris Packham judge.packham@gmail.com
Sean,
I take it your use case was for when the default boot source doesn't have a valid image and it falls back to UART? If that's the case I think we need something in addition to the existing code not instead of.
Hi,
My use case was exactly what you are describing. If the default boot source doesn't have a valid image it falls back til UART and without this patch the SPL will try default boot source which in most cases are the old image or non existing. What kind of use case do you have? It's really hard to read in the datasheet as it's not entirely accurate on this.
/Sean

On Fri, Aug 17, 2018 at 5:41 PM Sean Nyekjær sean.nyekjaer@prevas.dk wrote:
On 17/08/2018 01.30, Chris Packham wrote:
This reverts commit e83e2b390038c9075642cb243a6292241beb8d73. This prevents kwboot from overriding the hardware strapped boot source.
Signed-off-by: Chris Packham judge.packham@gmail.com
Sean,
I take it your use case was for when the default boot source doesn't have a valid image and it falls back to UART? If that's the case I think we need something in addition to the existing code not instead of.
Hi,
My use case was exactly what you are describing. If the default boot source doesn't have a valid image it falls back til UART and without this patch the SPL will try default boot source which in most cases are the old image or non existing. What kind of use case do you have? It's really hard to read in the datasheet as it's not entirely accurate on this.
Yeah for some reason Marvell deemed it unnecessary to document the fields of that particular register.
I can confirm from experience that bits 31:28 do reflect the current boot source when using kwboot to override the HW strapped boot source. I can also confirm your observation that if you manage to kill the boot header but not the final stage u-boot you end up booting the spl over UART but then the next stage boots from SPI.
I'll see if I can come up with something that covers both cases.
participants (2)
-
Chris Packham
-
Sean Nyekjær