
29 Apr
2014
29 Apr
'14
6:28 a.m.
Hi Tim,
On 04/28/2014 01:17 PM, Tim Harvey wrote:
Add a common spl.c file to support boot device functions needed for SPL such as detecting the boot device.
<snip>
diff --git a/arch/arm/imx-common/spl.c b/arch/arm/imx-common/spl.c new file mode 100644 index 0000000..5c1667c --- /dev/null +++ b/arch/arm/imx-common/spl.c @@ -0,0 +1,79 @@
<snip>
+u32 spl_boot_device(void) +{
- struct src *psrc = (struct src *)SRC_BASE_ADDR;
- unsigned reg = readl(&psrc->sbmr1);
- /* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
- switch ((reg & 0x000000FF) >> 4) {
<snip>
- case 0x3:
/* BOOT_CFG4[2:0] */
switch ((reg & 0x07000000) >> 24) {
This made me want a language lawyer, although I do see case ranges used in arch/blackfin/cpu/traps.c
case 0x0 ... 0x4:
return BOOT_DEVICE_SPI;
case 0x5 ... 0x7:
return BOOT_DEVICE_I2C;
}
Regards,
Eric