]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
ti816x: Add additional boot device detection logic
authorTom Rini <trini@konsulko.com>
Thu, 15 Jun 2017 17:57:00 +0000 (13:57 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 23 Jun 2017 14:38:03 +0000 (10:38 -0400)
It has been observed that between PG1.0 and PG2.0/2.1 depending on
which device we boot from, we may see a different value here than is
documented in the TRM.  Update the values for NAND and MMC1 based on
real life usage on each revision.

Signed-off-by: Tom Rini <trini@konsulko.com>
arch/arm/mach-omap2/boot-common.c

index 29c8f231917b265fdf52222ab7b4c144ba99a30b..b77506df832f5359337badad30194bbe502dbc45 100644 (file)
@@ -64,6 +64,23 @@ void save_omap_boot_params(void)
         */
        if (boot_device == BOOT_DEVICE_QSPI_4)
                boot_device = BOOT_DEVICE_SPI;
+#endif
+#ifdef CONFIG_TI816X
+       /*
+        * On PG2.0 and later TI816x the values we get when booting are not the
+        * same as on PG1.0, which is what the defines are based on.  Update
+        * them as needed.
+        */
+       if (get_cpu_rev() != 1) {
+               if (boot_device == 0x05) {
+                       omap_boot_params->boot_device = BOOT_DEVICE_NAND;
+                       boot_device = BOOT_DEVICE_NAND;
+               }
+               if (boot_device == 0x08) {
+                       omap_boot_params->boot_device = BOOT_DEVICE_MMC1;
+                       boot_device = BOOT_DEVICE_MMC1;
+               }
+       }
 #endif
        /*
         * When booting from peripheral booting, the boot device is not usable