From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Nelson Date: Mon, 28 Apr 2014 21:28:19 -0700 Subject: [U-Boot] [PATCH 05/12] MX6: add boot device support for SPL In-Reply-To: <1398716258-8420-6-git-send-email-tharvey@gateworks.com> References: <1398716258-8420-1-git-send-email-tharvey@gateworks.com> <1398716258-8420-6-git-send-email-tharvey@gateworks.com> Message-ID: <535F2A63.5040203@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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. > > > > 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 @@ > > > > +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) { > > > > + 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