From: Lucas Stach <dev@lynxeye.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] tegra: nand: add board pinmux
Date: Thu, 27 Sep 2012 23:52:04 +0200 [thread overview]
Message-ID: <1348782724-19151-2-git-send-email-dev@lynxeye.de> (raw)
In-Reply-To: <1348782724-19151-1-git-send-email-dev@lynxeye.de>
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>
---
arch/arm/include/asm/arch-tegra/board.h | 1 +
drivers/mtd/nand/tegra_nand.c | 11 ++++++++++-
2 Dateien ge?ndert, 11 Zeilen hinzugef?gt(+), 1 Zeile entfernt(-)
diff --git a/arch/arm/include/asm/arch-tegra/board.h b/arch/arm/include/asm/arch-tegra/board.h
index 7e56df7..be6bf25 100644
--- a/arch/arm/include/asm/arch-tegra/board.h
+++ b/arch/arm/include/asm/arch-tegra/board.h
@@ -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
diff --git a/drivers/mtd/nand/tegra_nand.c b/drivers/mtd/nand/tegra_nand.c
index 2c1b533..baaea4f 100644
--- a/drivers/mtd/nand/tegra_nand.c
+++ b/drivers/mtd/nand/tegra_nand.c
@@ -28,6 +28,7 @@
#include <nand.h>
#include <asm/arch/clock.h>
#include <asm/arch/funcmux.h>
+#include <asm/arch-tegra/board.h>
#include <asm/arch-tegra/clk_rst.h>
#include <asm/errno.h>
#include <asm/gpio.h>
@@ -992,7 +993,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);
@@ -1016,10 +1016,19 @@ int tegra_nand_init(struct nand_chip *nand, int devnum)
return 0;
}
+void __pin_mux_nand(void)
+{
+ funcmux_select(PERIPH_ID_NDFLASH, FUNCMUX_DEFAULT);
+}
+
+void pin_mux_nand(void) __attribute__((weak, alias("__pin_mux_nand")));
+
void board_nand_init(void)
{
struct nand_chip *nand = &nand_chip[0];
+ pin_mux_nand();
+
if (tegra_nand_init(nand, 0))
puts("Tegra NAND init failed\n");
}
--
1.7.11.4
next prev parent reply other threads:[~2012-09-27 21:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-27 21:52 [U-Boot] [PATCH 1/2] tegra: clean up board include hell Lucas Stach
2012-09-27 21:52 ` Lucas Stach [this message]
2012-09-27 22:38 ` [U-Boot] [PATCH 2/2] tegra: nand: add board pinmux Stephen Warren
2012-09-27 23:08 ` Simon Glass
2012-09-27 22:32 ` [U-Boot] [PATCH 1/2] tegra: clean up board include hell Stephen Warren
2012-09-27 22:42 ` Lucas Stach
2012-09-27 22:59 ` Simon Glass
2012-09-27 23:25 ` Stephen Warren
2012-09-27 23:40 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1348782724-19151-2-git-send-email-dev@lynxeye.de \
--to=dev@lynxeye.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.