]> git.sur5r.net Git - u-boot/commitdiff
ARM: omap3_logic: Unlock NAND automatically in U-Boot
authorAdam Ford <aford173@gmail.com>
Sun, 3 Dec 2017 12:24:53 +0000 (06:24 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 13 Dec 2017 02:33:38 +0000 (21:33 -0500)
The Micron Flash is locked by default.  This will automaticlly
unlock so manually unlocking is unnecessary in U-Boot.

Signed-off-by: Adam Ford <aford173@gmail.com>
board/logicpd/omap3som/omap3logic.c
include/configs/omap3_logic.h

index a55a520e63e512a69f237599b6311766feb69078..cebb200c5ff8d2eabbebd85d092e7c2e947c2e38 100644 (file)
@@ -207,6 +207,16 @@ int board_init(void)
 }
 
 #ifdef CONFIG_BOARD_LATE_INIT
+
+static void unlock_nand(void)
+{
+       int dev = nand_curr_device;
+       struct mtd_info *mtd;
+
+       mtd = get_nand_dev_by_index(dev);
+       nand_unlock(mtd, 0, mtd->size, 0);
+}
+
 int board_late_init(void)
 {
        struct board_id *board;
@@ -256,6 +266,10 @@ int board_late_init(void)
 
        /* restore hsusb0_data5 pin as hsusb0_data5 */
        MUX_VAL(CP(HSUSB0_DATA5),       (IEN  | PTD | DIS | M0));
+
+#ifdef CONFIG_CMD_NAND_LOCK_UNLOCK
+       unlock_nand();
+#endif
        return 0;
 }
 #endif
index 3ecfb58918604968f432e91fa6de7e6ed4a34601..b095814cda8d32efcb179084db95eaa7376da07b 100644 (file)
@@ -93,7 +93,6 @@
 
 #define CONFIG_PREBOOT \
        "setenv preboot;"                                               \
-       "nand unlock;"                                                  \
        "saveenv;"
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
                "tftpboot $loadaddr zImage;" \
                "bootz $loadaddr\0" \
        "nandbootcommon=echo 'Booting kernel from NAND...';" \
-               "nand unlock;" \
                "run nandargs;" \
                "run common_bootargs;" \
                "run dump_bootargs;" \