summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap
diff options
context:
space:
mode:
authorTeresa Gámez <t.gamez@phytec.de>2012-03-15 13:49:26 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-03-15 20:55:07 +0100
commit1bdce4699fc3ce1c954602b57f4b81f6993a9e2e (patch)
tree1254fb1ec1f55740852c1dba1e535c51ab0fe992 /arch/arm/mach-omap
parentb071db2367f7a849a39087a51fe73d4e1272bd57 (diff)
downloadbarebox-1bdce4699fc3ce1c954602b57f4b81f6993a9e2e.tar.gz
barebox-1bdce4699fc3ce1c954602b57f4b81f6993a9e2e.tar.xz
devices-gpmc-nand: Add OMAP4 gpmc nand timings
Add a OMAP4 specific GMPC nand config for pcm049 and phyCARD-A-XL2 to increase performance. Also add the possiblility to pass a board GPMC nand config. Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-omap')
-rw-r--r--arch/arm/mach-omap/devices-gpmc-nand.c33
-rw-r--r--arch/arm/mach-omap/include/mach/gpmc_nand.h6
-rw-r--r--arch/arm/mach-omap/omap3_generic.c16
-rw-r--r--arch/arm/mach-omap/omap4_generic.c16
4 files changed, 42 insertions, 29 deletions
diff --git a/arch/arm/mach-omap/devices-gpmc-nand.c b/arch/arm/mach-omap/devices-gpmc-nand.c
index 197d4be418..54625ca9ab 100644
--- a/arch/arm/mach-omap/devices-gpmc-nand.c
+++ b/arch/arm/mach-omap/devices-gpmc-nand.c
@@ -4,7 +4,6 @@
*
* FileName: arch/arm/boards/omap/devices-gpmc-nand.c
*
- * GPMC NAND Devices such as those from Micron, Samsung are listed here
*/
/*
* (C) Copyright 2006-2008
@@ -39,35 +38,12 @@
#define GPMC_CONF1_VALx8 0x00000800
#define GPMC_CONF1_VALx16 0x00001800
-/* Set up the generic params */
-
-/** GPMC timing for our nand device */
-static struct gpmc_config nand_cfg = {
- .cfg = {
- 0, /*CONF1 */
- 0x00141400, /*CONF2 */
- 0x00141400, /*CONF3 */
- 0x0F010F01, /*CONF4 */
- 0x010C1414, /*CONF5 */
-#ifdef CONFIG_ARCH_OMAP3
- /* Additional bits in OMAP3 */
- 0x1F040000 |
-#endif
- 0x00000A80, /*CONF6 */
- },
-
- /* Nand: dont care about base address */
- .base = 0x28000000,
- /* GPMC address map as small as possible */
- .size = GPMC_SIZE_16M,
-};
/** NAND platform specific settings settings */
static struct gpmc_nand_platform_data nand_plat = {
.cs = 0,
.max_timeout = MSECOND,
.wait_mon_pin = 0,
- .priv = (void *)&nand_cfg,
};
/**
@@ -76,20 +52,21 @@ static struct gpmc_nand_platform_data nand_plat = {
* @return success/fail based on device funtion
*/
int gpmc_generic_nand_devices_init(int cs, int width,
- enum gpmc_ecc_mode eccmode)
+ enum gpmc_ecc_mode eccmode, struct gpmc_config *nand_cfg)
{
nand_plat.cs = cs;
if (width == 16)
- nand_cfg.cfg[0] = GPMC_CONF1_VALx16;
+ nand_cfg->cfg[0] = GPMC_CONF1_VALx16;
else
- nand_cfg.cfg[0] = GPMC_CONF1_VALx8;
+ nand_cfg->cfg[0] = GPMC_CONF1_VALx8;
nand_plat.device_width = width;
nand_plat.ecc_mode = eccmode;
+ nand_plat.priv = nand_cfg;
/* Configure GPMC CS before register */
- gpmc_cs_config(nand_plat.cs, &nand_cfg);
+ gpmc_cs_config(nand_plat.cs, nand_cfg);
add_generic_device("gpmc_nand", -1, NULL, OMAP_GPMC_BASE, 1024 * 4,
IORESOURCE_MEM, &nand_plat);
diff --git a/arch/arm/mach-omap/include/mach/gpmc_nand.h b/arch/arm/mach-omap/include/mach/gpmc_nand.h
index 1bc52ffe00..b9c659d1a9 100644
--- a/arch/arm/mach-omap/include/mach/gpmc_nand.h
+++ b/arch/arm/mach-omap/include/mach/gpmc_nand.h
@@ -78,6 +78,10 @@ struct gpmc_nand_platform_data {
#define NAND_WAITPOL_HIGH (1 << 0)
#define NAND_WAITPOL_MASK (1 << 0)
-int gpmc_generic_nand_devices_init(int cs, int width, enum gpmc_ecc_mode);
+int gpmc_generic_nand_devices_init(int cs, int width,
+ enum gpmc_ecc_mode, struct gpmc_config *nand_cfg);
+
+extern struct gpmc_config omap3_nand_cfg;
+extern struct gpmc_config omap4_nand_cfg;
#endif /* __ASM_OMAP_NAND_GPMC_H */
diff --git a/arch/arm/mach-omap/omap3_generic.c b/arch/arm/mach-omap/omap3_generic.c
index fe7363a59b..4ab265a9ba 100644
--- a/arch/arm/mach-omap/omap3_generic.c
+++ b/arch/arm/mach-omap/omap3_generic.c
@@ -499,3 +499,19 @@ enum omap_boot_src omap3_bootsrc(void)
return OMAP_BOOTSRC_MMC1;
return OMAP_BOOTSRC_UNKNOWN;
}
+
+/* GPMC timing for OMAP3 nand device */
+const struct gpmc_config omap3_nand_cfg = {
+ .cfg = {
+ 0x00000000, /* CONF1 */
+ 0x00141400, /* CONF2 */
+ 0x00141400, /* CONF3 */
+ 0x0F010F01, /* CONF4 */
+ 0x010C1414, /* CONF5 */
+ 0x1F040000 |
+ 0x00000A80, /* CONF6 */
+ },
+ /* GPMC address map as small as possible */
+ .base = 0x28000000,
+ .size = GPMC_SIZE_16M,
+};
diff --git a/arch/arm/mach-omap/omap4_generic.c b/arch/arm/mach-omap/omap4_generic.c
index baa138da5b..db26a594ab 100644
--- a/arch/arm/mach-omap/omap4_generic.c
+++ b/arch/arm/mach-omap/omap4_generic.c
@@ -7,6 +7,7 @@
#include <mach/omap4-clock.h>
#include <mach/syslib.h>
#include <mach/xload.h>
+#include <mach/gpmc.h>
void __noreturn reset_cpu(unsigned long addr)
{
@@ -460,3 +461,18 @@ void omap4_do_set_mux(u32 base, struct pad_conf_entry const *array, int size)
for (i = 0; i < size; i++, pad++)
writew(pad->val, base + pad->offset);
}
+
+/* GPMC timing for OMAP4 nand device */
+const struct gpmc_config omap4_nand_cfg = {
+ .cfg = {
+ 0x00000800, /* CONF1 */
+ 0x00050500, /* CONF2 */
+ 0x00040400, /* CONF3 */
+ 0x03000300, /* CONF4 */
+ 0x00050808, /* CONF5 */
+ 0x00000000, /* CONF6 */
+ },
+ /* GPMC address map as small as possible */
+ .base = 0x28000000,
+ .size = GPMC_SIZE_16M,
+};