Other Parts Discussed in Thread: AM3352
Dear all,
I am working at bringing up an AM3352 custom design, loosely based on the BeagleBone Black and the EVK, but using SPI NOR (Micron N25Q512) as the primary boot mechanism. SYSBOOT[4:0] are configured as 10110b (SPI0 -> MMC0 -> UART0 -> EMAC1) U-Boot is mainline git master as of 4th September 2015 (targeted for 2015.10-rc2).
When using UART peripheral boot (we have switch options for boot mode 01111b instead of the above), I can xmodem is SPL, ymodem u-boot and boot linux normally. It is only the SPI configuration that is giving me problems.
The problem is that when booting from the MLO from SPI Flash, it refuses to load U-Boot, citing: "SPL: Unsupported Boot Device!"
The relevant code is common/slp/spl.c:
switch (boot_device) {
/* snip */
default:
#if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
puts("SPL: Unsupported Boot Device!\n");
#endif
hang();
}
The boot_device reports as (decimal) 11, which is not any of the boot devices listed in arch/arm/include/asm/arch-arm-am33xx/spl.h:
#elif defined(CONFIG_AM33XX) #define BOOT_DEVICE_XIP 0x01 #define BOOT_DEVICE_XIPWAIT 0x02 #define BOOT_DEVICE_NAND 0x05 #define BOOT_DEVICE_NAND_I2C 0x06 #define BOOT_DEVICE_MMC1 0x08 #define BOOT_DEVICE_MMC2 0x09 #define BOOT_DEVICE_SPI 0x15 #define BOOT_DEVICE_UART 0x41 #define BOOT_DEVICE_USBETH 0x44 #define BOOT_DEVICE_CPGMAC 0x46 #define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1 #define MMC_BOOT_DEVICES_END BOOT_DEVICE_MMC2
(The UART boot report as 65, which is exactly as expected).
Following through, this value appears to be read from arch/arm/cpu/armv7/omap-common/boot-common.c from a specific location in SRAM:
u32 boot_params = *((u32 *)OMAP_SRAM_SCRATCH_BOOT_PARAMS); omap_boot_params = (struct omap_boot_parameters *)boot_params; boot_device = omap_boot_params->boot_device;
This location is a:
./arch/arm/include/asm/omap_common.h:#define OMAP_SRAM_SCRATCH_BOOT_PARAMS (SRAM_SCRATCH_SPACE_ADDR + 0x24)
where:
SRAM_SCRATCH_SPACE_ADDR 0x4030B800
The only place where this address can be found in the TRM is in Figure 26-4 (section 26.1.3.2). The actual values appear not to be documented, so I have no idea what the value of 11 refers to.
So, my question is: what is this magic value of 11, and why would it not be reporting as 0x15, which would be expected for an SPI boot?
EDIT:
Note that forcing the boot mode from 11 to 0x15 (i.e. BOOT_DEVICE_SPI) allows u-boot to load from SPI flash normally, i.e. changing arch/arm/cpu/armv7/omap-common/boot-common.c:
if (boot_device == 11)
{
boot_device = BOOT_DEVICE_SPI;
}