[U-Boot] [PATCH 05/12] MX6: add boot device support for SPL
Eric Nelson
eric.nelson at boundarydevices.com
Tue Apr 29 06:28:19 CEST 2014
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
More information about the U-Boot
mailing list