Re: [U-Boot] [PATCH 1/3] OMAP3/4/5/AM33xx: Correct logic for checking FAT or RAW MMC
Hi Tom, On Friday 05 April 2013 09:51 PM, Tom Rini wrote: > In the case of booting from certain peripherals, such as UART, we must > not see what the device descriptor says for RAW or FAT mode because in > addition to being nonsensical, it leads to a hang. This is why we have > a test currently for the boot mode being within range. The problem > however is that on some platforms we get MMC2_2 as the boot mode and not > the defined value for MMC2, and in others we get the value for MMC2_2. > This is required to fix eMMC booting on omap5_uevm. > > Tested on am335x_evm (UART, NAND, SD), omap3_beagle (NAND, SD on > classic, SD only on xM rev C5) and omap5_uevm (SD, eMMC). > > Signed-off-by: Tom Rini > --- > arch/arm/cpu/armv7/omap-common/lowlevel_init.S | 10 +++--- > arch/arm/include/asm/arch-am33xx/spl.h |3 +++ > arch/arm/include/asm/arch-omap3/spl.h |3 +++ > arch/arm/include/asm/arch-omap4/spl.h |2 ++ > arch/arm/include/asm/arch-omap5/spl.h |2 ++ > 5 files changed, 17 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S > b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S > index b933fe8..90b3c8a 100644 > --- a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S > +++ b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S > @@ -60,10 +60,14 @@ ENTRY(save_boot_params) > ldr r3, =boot_params > strbr2, [r3, #BOOT_DEVICE_OFFSET] @ spl_boot_device <- r1 > > - /* boot mode is passed only for devices that can raw/fat mode */ > - cmp r2, #BOOT_DEVICE_XIP > + /* > + * boot mode is only valid for device that can be raw or FAT booted. > + * in other cases it may be fatal to look. While platforms differ > + * in the values used for each MMC slot, they are contiguous. > + */ > + cmp r2, #MMC_BOOT_DEVICES_START > blt 2f > - cmp r2, #BOOT_DEVICE_MMC2 > + cmp r2, #MMC_BOOT_DEVICES_END > bgt 2f > /* Store the boot mode (raw/FAT) in omap_bootmode */ > ldr r2, [r0, #DEV_DESC_PTR_OFFSET] @ get the device descriptor ptr > diff --git a/arch/arm/include/asm/arch-am33xx/spl.h > b/arch/arm/include/asm/arch-am33xx/spl.h > index f60b086..14a2c7c 100644 > --- a/arch/arm/include/asm/arch-am33xx/spl.h > +++ b/arch/arm/include/asm/arch-am33xx/spl.h > @@ -37,4 +37,7 @@ > #define BOOT_DEVICE_USBETH 68 > #define BOOT_DEVICE_CPGMAC 70 > #define BOOT_DEVICE_MMC2_2 0xFF > + > +#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1 > +#define MMC_BOOT_DEVICES_END BOOT_DEVICE_MMC2 > #endif > diff --git a/arch/arm/include/asm/arch-omap3/spl.h > b/arch/arm/include/asm/arch-omap3/spl.h > index dec4dac..84e6d7b 100644 > --- a/arch/arm/include/asm/arch-omap3/spl.h > +++ b/arch/arm/include/asm/arch-omap3/spl.h > @@ -31,4 +31,7 @@ > #define BOOT_DEVICE_MMC1 6 > #define BOOT_DEVICE_XIPWAIT 7 > #define BOOT_DEVICE_MMC2_2 0xFF > + > +#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC2 > +#define MMC_BOOT_DEVICES_END BOOT_DEVICE_MMC1 > #endif > diff --git a/arch/arm/include/asm/arch-omap4/spl.h > b/arch/arm/include/asm/arch-omap4/spl.h > index 4e094f9..f61627f 100644 > --- a/arch/arm/include/asm/arch-omap4/spl.h > +++ b/arch/arm/include/asm/arch-omap4/spl.h > @@ -32,4 +32,6 @@ > #define BOOT_DEVICE_MMC2 6 > #define BOOT_DEVICE_MMC2_2 0xFF > > +#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1 > +#define MMC_BOOT_DEVICES_END BOOT_DEVICE_MMC2 > #endif > diff --git a/arch/arm/include/asm/arch-omap5/spl.h > b/arch/arm/include/asm/arch-omap5/spl.h > index 323cd63..d4d353c 100644 > --- a/arch/arm/include/asm/arch-omap5/spl.h > +++ b/arch/arm/include/asm/arch-omap5/spl.h > @@ -32,4 +32,6 @@ > #define BOOT_DEVICE_MMC26 > #define BOOT_DEVICE_MMC2_2 7 > > +#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1 > +#define MMC_BOOT_DEVICES_END BOOT_DEVICE_MMC2_2 > #endif Acked-by: R Sricharan ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] OMAP3/4/5/AM33xx: Correct logic for checking FAT or RAW MMC
> "Tom" == Tom Rini writes: Tom> In the case of booting from certain peripherals, such as UART, we must Tom> not see what the device descriptor says for RAW or FAT mode because in Tom> addition to being nonsensical, it leads to a hang. This is why we have Tom> a test currently for the boot mode being within range. The problem Tom> however is that on some platforms we get MMC2_2 as the boot mode and not Tom> the defined value for MMC2, and in others we get the value for MMC2_2. Tom> This is required to fix eMMC booting on omap5_uevm. Tom> Tested on am335x_evm (UART, NAND, SD), omap3_beagle (NAND, SD on Tom> classic, SD only on xM rev C5) and omap5_uevm (SD, eMMC). Tom> Signed-off-by: Tom Rini Tom> --- Tom> arch/arm/cpu/armv7/omap-common/lowlevel_init.S | 10 +++--- Tom> arch/arm/include/asm/arch-am33xx/spl.h |3 +++ Tom> arch/arm/include/asm/arch-omap3/spl.h |3 +++ Tom> arch/arm/include/asm/arch-omap4/spl.h |2 ++ Tom> arch/arm/include/asm/arch-omap5/spl.h |2 ++ Tom> 5 files changed, 17 insertions(+), 3 deletions(-) Tom> diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S Tom> index b933fe8..90b3c8a 100644 Tom> --- a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S Tom> +++ b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S Tom> @@ -60,10 +60,14 @@ ENTRY(save_boot_params) Tom> ldr r3, =boot_params Tom> strbr2, [r3, #BOOT_DEVICE_OFFSET] @ spl_boot_device <- r1 Tom> - /* boot mode is passed only for devices that can raw/fat mode */ Tom> - cmp r2, #BOOT_DEVICE_XIP Tom> + /* Tom> + * boot mode is only valid for device that can be raw or FAT booted. Tom> + * in other cases it may be fatal to look. While platforms differ Tom> + * in the values used for each MMC slot, they are contiguous. Tom> + */ Tom> + cmp r2, #MMC_BOOT_DEVICES_START Tom> blt 2f Tom> - cmp r2, #BOOT_DEVICE_MMC2 Tom> + cmp r2, #MMC_BOOT_DEVICES_END Tom> bgt 2f Tom> /* Store the boot mode (raw/FAT) in omap_bootmode */ Tom> ldr r2, [r0, #DEV_DESC_PTR_OFFSET] @ get the device descriptor ptr Tom> diff --git a/arch/arm/include/asm/arch-am33xx/spl.h b/arch/arm/include/asm/arch-am33xx/spl.h Tom> index f60b086..14a2c7c 100644 Tom> --- a/arch/arm/include/asm/arch-am33xx/spl.h Tom> +++ b/arch/arm/include/asm/arch-am33xx/spl.h Tom> @@ -37,4 +37,7 @@ Tom> #define BOOT_DEVICE_USBETH 68 Tom> #define BOOT_DEVICE_CPGMAC 70 Tom> #define BOOT_DEVICE_MMC2_2 0xFF Tom> + Tom> +#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1 Tom> +#define MMC_BOOT_DEVICES_END BOOT_DEVICE_MMC2 Doesn't this break ti814x with the funky inverted mmc1/mmc2? -- Bye, Peter Korsgaard ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] OMAP3/4/5/AM33xx: Correct logic for checking FAT or RAW MMC
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/09/2013 10:52 AM, Peter Korsgaard wrote: >> "Tom" == Tom Rini writes: > > Tom> In the case of booting from certain peripherals, such as UART, > we must Tom> not see what the device descriptor says for RAW or FAT > mode because in Tom> addition to being nonsensical, it leads to a > hang. This is why we have Tom> a test currently for the boot mode > being within range. The problem Tom> however is that on some > platforms we get MMC2_2 as the boot mode and not Tom> the defined > value for MMC2, and in others we get the value for MMC2_2. Tom> > This is required to fix eMMC booting on omap5_uevm. > > Tom> Tested on am335x_evm (UART, NAND, SD), omap3_beagle (NAND, SD > on Tom> classic, SD only on xM rev C5) and omap5_uevm (SD, eMMC). > > Tom> Signed-off-by: Tom Rini Tom> --- Tom> > arch/arm/cpu/armv7/omap-common/lowlevel_init.S | 10 +++--- > Tom> arch/arm/include/asm/arch-am33xx/spl.h |3 +++ > Tom> arch/arm/include/asm/arch-omap3/spl.h |3 +++ > Tom> arch/arm/include/asm/arch-omap4/spl.h |2 ++ Tom> > arch/arm/include/asm/arch-omap5/spl.h |2 ++ Tom> 5 > files changed, 17 insertions(+), 3 deletions(-) > > Tom> diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S > b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S Tom> index > b933fe8..90b3c8a 100644 Tom> --- > a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S Tom> +++ > b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S Tom> @@ -60,10 > +60,14 @@ ENTRY(save_boot_params) Tom>ldr r3, =boot_params Tom> > strb r2, [r3, #BOOT_DEVICE_OFFSET] @ spl_boot_device <- r1 > > Tom> -/* boot mode is passed only for devices that can raw/fat > mode */ Tom> -cmp r2, #BOOT_DEVICE_XIP Tom> + /* Tom> + > * boot > mode is only valid for device that can be raw or FAT booted. Tom> + > * in other cases it may be fatal to look. While platforms differ > Tom> + * in the values used for each MMC slot, they are > contiguous. Tom> + */ Tom> + cmp r2, #MMC_BOOT_DEVICES_START Tom> > blt 2f Tom> - cmp r2, #BOOT_DEVICE_MMC2 Tom> +cmp r2, > #MMC_BOOT_DEVICES_END Tom>bgt 2f Tom> /* Store the boot mode > (raw/FAT) in omap_bootmode */ Tom>ldr r2, [r0, > #DEV_DESC_PTR_OFFSET] @ get the device descriptor ptr Tom> diff > --git a/arch/arm/include/asm/arch-am33xx/spl.h > b/arch/arm/include/asm/arch-am33xx/spl.h Tom> index > f60b086..14a2c7c 100644 Tom> --- > a/arch/arm/include/asm/arch-am33xx/spl.h Tom> +++ > b/arch/arm/include/asm/arch-am33xx/spl.h Tom> @@ -37,4 +37,7 @@ > Tom> #define BOOT_DEVICE_USBETH 68 Tom> #define > BOOT_DEVICE_CPGMAC70 Tom> #define BOOT_DEVICE_MMC2_2 0xFF > Tom> + Tom> +#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1 Tom> > +#define MMC_BOOT_DEVICES_END BOOT_DEVICE_MMC2 > > Doesn't this break ti814x with the funky inverted mmc1/mmc2? That's probably true, dang. I knew OMAP3 also had them swapped, number-wise but didn't recall until you said this that it doesn't use that code at all. I'll V2 this part. Thanks! - -- Tom -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJRZDY4AAoJENk4IS6UOR1WUBoP/1wPoJ5C0ZCSpEDmm7YFs5b2 XaafK0dIJ/aw7K264vYY8tHBj/ku6mbgNOvfRUL9rxGAPPStESMQynkwF/H7llbd 7GkFlsWpLAgotPnCSwHGqQnApCeUeu0BGCAGvaB8NK0uFlU+D0bsWBdgRe/sML+m LjF0/2eQmm2rTo8ifkDTvCdldaeyGqUo0amefEvfW2cLMxPlYGWcfPh/MW1X35ib RnnBUhdVM38XPKmktjSQMQ4IBkLnd2Hu64KFkZl3ejyMPDjr/uOkm+1UawL34IPH wgSC5Y1+w7HvnxM+D3pre4yrpRSYq+dcg3m9CLb7HcrGFCjLxtTEEcy6DOCF3RG0 aK62JQ0itrXcGCnwMYO6t/w7JlNj/flqCTQW4qU4HJ/ixaICRrg30IePqqcJ0Rj0 69EA4BjgR8JhRZOWRuCkwirz0LQpg7DY43Ioax7EmZ6qjve7/ryEnPxdfSEWTPgr ZcqhsYCwoc0wkADW894UveUW49qXhQCBR0C1eXbynfbpdWSu0ObHX4ErAH1JP4x/ ihtuMZAoTcpYTM0b/Fg+A9t45QhIZBMRKLWar4h5zFrMGyfIODPUjXLqJRSI6Lef kTcUZY9Fy837Vok1NlllTMFxGd8Ot5mRgDehvZiZlTjzbRUfPdC212NUQQ/px7C8 7KPGRHhQds5Fsur7bnXJ =2NME -END PGP SIGNATURE- ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot