]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
tegra: nand: add board pinmux
authorLucas Stach <dev@lynxeye.de>
Sat, 29 Sep 2012 10:02:09 +0000 (10:02 +0000)
committerTom Rini <trini@ti.com>
Mon, 15 Oct 2012 18:54:07 +0000 (11:54 -0700)
Boards may require a different pinmux setup for NAND than the default one.
Add a way to call into board specific code to set this up.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Tom Warren <twarren@nvidia.com>
arch/arm/include/asm/arch-tegra/board.h
board/nvidia/common/board.c
drivers/mtd/nand/tegra_nand.c

index 7e56df78b123e5f071c3873996ee6b2c3dc4b8ed..be6bf25f0bfc8e78162fcf8d6eb7060e986544cf 100644 (file)
@@ -43,5 +43,6 @@ void gpio_early_init(void);  /* overrideable GPIO config        */
 
 void pin_mux_usb(void);      /* overrideable USB pinmux setup   */
 void pin_mux_spi(void);      /* overrideable SPI pinmux setup   */
+void pin_mux_nand(void);     /* overrideable NAND pinmux setup  */
 
 #endif
index dc301e741bbb20e4766c85638b58598fca1facff..2c7cd0d401f790d0cba72ed32c89e37891e30ffd 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/emc.h>
+#include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
 #include <asm/arch/pmu.h>
 #include <asm/arch/tegra.h>
@@ -77,6 +78,13 @@ void __gpio_early_init_uart(void)
 void gpio_early_init_uart(void)
 __attribute__((weak, alias("__gpio_early_init_uart")));
 
+void __pin_mux_nand(void)
+{
+       funcmux_select(PERIPH_ID_NDFLASH, FUNCMUX_DEFAULT);
+}
+
+void pin_mux_nand(void) __attribute__((weak, alias("__pin_mux_nand")));
+
 /*
  * Routine: power_det_init
  * Description: turn off power detects
@@ -137,6 +145,10 @@ int board_init(void)
        board_usb_init(gd->fdt_blob);
 #endif
 
+#ifdef CONFIG_TEGRA_NAND
+       pin_mux_nand();
+#endif
+
 #ifdef CONFIG_TEGRA_LP0
        /* save Sdram params to PMC 2, 4, and 24 for WB0 */
        warmboot_save_sdram_params();
index 2c1b533bb0470cbc4f1fa9dccd7c8da2717e848c..5408c51ffb52a12c1884468ab71cf8f9af4d8ac2 100644 (file)
@@ -992,7 +992,6 @@ int tegra_nand_init(struct nand_chip *nand, int devnum)
        /* Adjust timing for NAND device */
        setup_timing(config->timing, info->reg);
 
-       funcmux_select(PERIPH_ID_NDFLASH, FUNCMUX_DEFAULT);
        fdtdec_setup_gpio(&config->wp_gpio);
        gpio_direction_output(config->wp_gpio.gpio, 1);