summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeresa Gámez <t.gamez@phytec.de>2013-07-09 11:23:11 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-07-09 19:33:15 +0200
commit63ae7219e9782b33099f104b7f54ad60db8aa10b (patch)
tree73d30f8b3b1c33fa3ffaebdaf0c1e3133ef989ab
parent1f6ec400f7e685b2f352fa7fb445b6680eedff1a (diff)
downloadbarebox-63ae7219e9782b33099f104b7f54ad60db8aa10b.tar.gz
barebox-63ae7219e9782b33099f104b7f54ad60db8aa10b.tar.xz
ARM: OMAP: AM33xx: Add basic NAND support
Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-omap/am33xx_generic.c15
-rw-r--r--arch/arm/mach-omap/am33xx_mux.c8
-rw-r--r--arch/arm/mach-omap/include/mach/am33xx-mux.h1
-rw-r--r--arch/arm/mach-omap/include/mach/gpmc_nand.h1
4 files changed, 22 insertions, 3 deletions
diff --git a/arch/arm/mach-omap/am33xx_generic.c b/arch/arm/mach-omap/am33xx_generic.c
index 96432c9ff2..9806fbe677 100644
--- a/arch/arm/mach-omap/am33xx_generic.c
+++ b/arch/arm/mach-omap/am33xx_generic.c
@@ -27,6 +27,7 @@
#include <mach/am33xx-clock.h>
#include <mach/sys_info.h>
#include <mach/am33xx-generic.h>
+#include <mach/gpmc.h>
void __noreturn reset_cpu(unsigned long addr)
{
@@ -126,3 +127,17 @@ int am33xx_register_ethaddr(int eth_id, int mac_id)
return -ENODEV;
}
+
+/* GPMC timing for AM33XX nand device */
+const struct gpmc_config am33xx_nand_cfg = {
+ .cfg = {
+ 0x00000800, /* CONF1 */
+ 0x001e1e00, /* CONF2 */
+ 0x001e1e00, /* CONF3 */
+ 0x16051807, /* CONF4 */
+ 0x00151e1e, /* CONF5 */
+ 0x16000f80, /* CONF6 */
+ },
+ .base = 0x08000000,
+ .size = GPMC_SIZE_16M,
+};
diff --git a/arch/arm/mach-omap/am33xx_mux.c b/arch/arm/mach-omap/am33xx_mux.c
index abc858668b..8318713799 100644
--- a/arch/arm/mach-omap/am33xx_mux.c
+++ b/arch/arm/mach-omap/am33xx_mux.c
@@ -39,8 +39,6 @@ static const __maybe_unused struct module_pin_mux uart3_pin_mux[] = {
{-1},
};
-
-#ifdef CONFIG_NAND
static const __maybe_unused struct module_pin_mux nand_pin_mux[] = {
{OFFSET(gpmc_ad0), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* NAND AD0 */
{OFFSET(gpmc_ad1), (MODE(0) | PULLUP_EN | RXACTIVE)}, /* NAND AD1 */
@@ -59,7 +57,6 @@ static const __maybe_unused struct module_pin_mux nand_pin_mux[] = {
{OFFSET(gpmc_be0n_cle), (MODE(0) | PULLUDEN)}, /* NAND_BE_CLE */
{-1},
};
-#endif
static const __maybe_unused struct module_pin_mux i2c0_pin_mux[] = {
{OFFSET(i2c0_sda), (MODE(0) | RXACTIVE | PULLUDEN | SLEWCTRL)}, /* I2C_DATA */
@@ -319,3 +316,8 @@ void am33xx_enable_spi0_pin_mux(void)
{
configure_module_pin_mux(spi0_pin_mux);
}
+
+void am33xx_enable_nand_pin_mux(void)
+{
+ configure_module_pin_mux(nand_pin_mux);
+}
diff --git a/arch/arm/mach-omap/include/mach/am33xx-mux.h b/arch/arm/mach-omap/include/mach/am33xx-mux.h
index d6b19ddf86..fe3168b68a 100644
--- a/arch/arm/mach-omap/include/mach/am33xx-mux.h
+++ b/arch/arm/mach-omap/include/mach/am33xx-mux.h
@@ -257,5 +257,6 @@ extern void am33xx_enable_uart0_pin_mux(void);
extern void am33xx_enable_uart2_pin_mux(void);
extern void am33xx_enable_mmc0_pin_mux(void);
extern void am33xx_enable_spi0_pin_mux(void);
+extern void am33xx_enable_nand_pin_mux(void);
#endif /*__AM33XX_MUX_H__ */
diff --git a/arch/arm/mach-omap/include/mach/gpmc_nand.h b/arch/arm/mach-omap/include/mach/gpmc_nand.h
index 4a9346597c..8d138ec9bf 100644
--- a/arch/arm/mach-omap/include/mach/gpmc_nand.h
+++ b/arch/arm/mach-omap/include/mach/gpmc_nand.h
@@ -65,5 +65,6 @@ int omap_add_gpmc_nand_device(struct gpmc_nand_platform_data *pdata);
extern struct gpmc_config omap3_nand_cfg;
extern struct gpmc_config omap4_nand_cfg;
+extern struct gpmc_config am33xx_nand_cfg;
#endif /* __ASM_OMAP_NAND_GPMC_H */