Skip to contentSkip to conversation

mtd: nand: omap: clean omap_gpmc.h headers

PATCH New Pekon Gupta 1 participant 6 messages Nov 22, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover mtd: nand: omap: clean omap_gpmc.h headers

This patch series aims are cleaning and consolidationg GPMC declarations and macros in common file by:

(1) Merges multiple omap_gpmc.h header files
- arch/arm/include/asm/arch-xx/omap_gpmc.h: for individual SoC platform
- arch/arm/include/asm/arch/omap_gpmc.h: common for all ARM SoC platform

(2) removes legacy board configs and #defines macros which are no more used

(3) consolidate common GPMC macros and declarations spread in platform specific header files. (like arch/arm/include/asm/arch-xx/cpu.h)

(4) move consolidate header file arch/omap_gpmc.h to linux/mtd/omap_gpmc.h to make it architecture independent

(5) move arch/omap_elm.h to linux/mtd/omap_elm.h)
to make it architecture independent

This patch series is build tested using following utility ./MAKEALL -s am33xx -s omap3 -s omap4 -s omap5

Note: Though this patch series is functionally independent. But it should be
applied above previous series given below, otherwise there would be minor conflict seen in file arch/arm/include/asm/omap_gpmc.h
http://lists.denx.de/pipermail/u-boot/2013-November/167445.html

Pekon Gupta (5):
mtd: nand: omap: remove redundant platform specific header:
arch-xx/omap_gpmc.h
mtd: nand: omap: remove unused #defines from common omap_gpmc.h
mtd: nand: omap: merge duplicate GPMC data from different arch-xx
headers into common omap_gpmc.h
mtd: nand: omap: move omap_gpmc.h from arch/arm/include/asm to
drivers/mtd/nand
mtd: nand: omap: move omap_elm.h from arch/arm/include/asm to
drivers/mtd/nand

 arch/arm/include/asm/arch-am33xx/cpu.h             | 51 -------------
 arch/arm/include/asm/arch-am33xx/omap_gpmc.h       | 48 -------------
 arch/arm/include/asm/arch-am33xx/sys_proto.h       |  1 +
 arch/arm/include/asm/arch-omap3/cpu.h              | 54 +-------------
 arch/arm/include/asm/arch-omap3/mem.h              | 10 +++
 arch/arm/include/asm/arch-omap3/omap_gpmc.h        | 36 ----------
 arch/arm/include/asm/arch-omap3/sys_proto.h        |  1 +
 arch/arm/include/asm/arch-omap4/cpu.h              | 45 ------------
 arch/arm/include/asm/arch-omap4/sys_proto.h        |  1 +
 arch/arm/include/asm/arch-omap5/cpu.h              | 45 ------------
 arch/arm/include/asm/arch-omap5/sys_proto.h        |  1 +
 arch/arm/include/asm/omap_gpmc.h                   | 80 ---------------------
 board/isee/igep00x0/igep00x0.c                     |  1 -
 board/overo/overo.c                                |  1 -
 drivers/mtd/nand/omap_elm.c                        |  6 +-
 drivers/mtd/nand/omap_gpmc.c                       |  5 +-
 include/configs/am335x_evm.h                       |  1 -
 include/configs/am335x_igep0033.h                  |  1 -
 include/configs/am3517_crane.h                     |  1 -
 include/configs/am3517_evm.h                       |  1 -
 include/configs/cm_t35.h                           |  2 -
 include/configs/devkit8000.h                       |  2 -
 include/configs/dig297.h                           |  2 -
 include/configs/mcx.h                              |  1 -
 include/configs/omap3_beagle.h                     |  2 -
 include/configs/omap3_evm_common.h                 |  1 -
 include/configs/omap3_igep00x0.h                   |  1 -
 include/configs/omap3_logic.h                      |  1 -
 include/configs/omap3_overo.h                      |  2 -
 include/configs/omap3_pandora.h                    |  2 -
 include/configs/omap3_zoom1.h                      |  2 -
 include/configs/omap3_zoom2.h                      |  1 -
 include/configs/siemens-am33x-common.h             |  1 -
 include/configs/tam3517-common.h                   |  1 -
 include/configs/tricorder.h                        |  2 -
 .../include/asm => include/linux/mtd}/omap_elm.h   |  0
 include/linux/mtd/omap_gpmc.h                      | 84 ++++++++++++++++++++++
 37 files changed, 104 insertions(+), 393 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-am33xx/omap_gpmc.h
 delete mode 100644 arch/arm/include/asm/arch-omap3/omap_gpmc.h
 delete mode 100644 arch/arm/include/asm/omap_gpmc.h
 rename {arch/arm/include/asm => include/linux/mtd}/omap_elm.h (100%)
 create mode 100644 include/linux/mtd/omap_gpmc.h
Signature · 1 line
1.8.1
#1 lore raw

PATCH 1/5 mtd: nand: omap: remove redundant platform specific header: arch-xx/omap_gpmc.h

Currently there are two sets of omap_gpmc.h header files
(a) arch/arm/include/asm/omap_gpmc.h
common header file for all platforms, containing defines and declarations used by GPMC NAND driver.

(b) arch/arm/include/asm/arch-xx/omap_gpmc.h
SoC platform specific header file containing defines like ECC layout.

This patch removes platform specific arch-xx/omap_gpmc.c because:
- GPMC hardware engine is common for all SoC platforms hence only (a) is enough
- ECC layout is now defined in omap_nand.c driver itself based on ecc-scheme selected. Hence all ECC layout declarations in (b) are redundant.

Build tested using: ./MAKEALL -s am33xx -s omap3 -s omap4 -s omap5

---
 arch/arm/include/asm/arch-am33xx/omap_gpmc.h | 48 ----------------------------
 arch/arm/include/asm/arch-omap3/mem.h        | 10 ++++++
 arch/arm/include/asm/arch-omap3/omap_gpmc.h  | 36 ---------------------
 arch/arm/include/asm/omap_gpmc.h             |  2 --
 4 files changed, 10 insertions(+), 86 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-am33xx/omap_gpmc.h
 delete mode 100644 arch/arm/include/asm/arch-omap3/omap_gpmc.h
arch/arm/include/asm/arch-am33xx/omap_gpmc.h deleted +0 -48
deleted file mode 100644
index 00ad1d0..0000000
@@ -1,48 +0,0 @@
-/*
- * (C) Copyright 2004-2008 Texas Instruments, <www.ti.com>
- * Rohit Choraria <[email protected]>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-#ifndef __ASM_ARCH_OMAP_GPMC_H
-#define __ASM_ARCH_OMAP_GPMC_H
-
-/* These GPMC_NAND_HW_BCHx_ECC_LAYOUT defines are based on AM33xx ELM */
-#define GPMC_NAND_HW_BCH4_ECC_LAYOUT {\
-	.eccbytes = 32,\
-	.eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
-				16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
-				28, 29, 30, 31, 32, 33},\
-	.oobfree = {\
-		{.offset = 34,\
-		 .length = 30 } } \
-}
-
-#define GPMC_NAND_HW_BCH8_ECC_LAYOUT {\
-	.eccbytes = 56,\
-	.eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
-				16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
-				28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\
-				40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\
-				52, 53, 54, 55, 56, 57},\
-	.oobfree = {\
-		{.offset = 58,\
-		 .length = 6 } } \
-}
-
-#define GPMC_NAND_HW_BCH16_ECC_LAYOUT {\
-	.eccbytes = 104,\
-	.eccpos = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\
-				16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,\
-				28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,\
-				40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\
-				52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,\
-				64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,\
-				76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,\
-				88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,\
-				100, 101, 102, 103, 104, 105},\
-	.oobfree = {\
-		{.offset = 106,\
-		 .length = 8 } } \
-}
-#endif /* __ASM_ARCH_OMAP_GPMC_H */
arch/arm/include/asm/arch-omap3/mem.h +10 -0
index bcc22c4..1804191 100644
@@ -419,6 +419,16 @@ enum {
 #define NET_GPMC_CONFIG6	0x00000FCF
 #define NET_GPMC_CONFIG7	0x00000f6c
 
+/* GPMC CS configuration for an SMSC LAN9221 ethernet controller */
+#define NET_LAN9221_GPMC_CONFIG1    0x00001000
+#define NET_LAN9221_GPMC_CONFIG2    0x00060700
+#define NET_LAN9221_GPMC_CONFIG3    0x00020201
+#define NET_LAN9221_GPMC_CONFIG4    0x06000700
+#define NET_LAN9221_GPMC_CONFIG5    0x0006090A
+#define NET_LAN9221_GPMC_CONFIG6    0x87030000
+#define NET_LAN9221_GPMC_CONFIG7    0x00000f6c
+
+
 /* max number of GPMC Chip Selects */
 #define GPMC_MAX_CS	8
 /* max number of GPMC regs */
arch/arm/include/asm/arch-omap3/omap_gpmc.h deleted +0 -36
deleted file mode 100644
index bf23219..0000000
@@ -1,36 +0,0 @@
-/*
- * (C) Copyright 2004-2008 Texas Instruments, <www.ti.com>
- * Rohit Choraria <[email protected]>
- *
- * SPDX-License-Identifier:	GPL-2.0+
- */
-#ifndef __ASM_ARCH_OMAP_GPMC_H
-#define __ASM_ARCH_OMAP_GPMC_H
-
-/*
- * These GPMC_NAND_HW_BCHx_ECC_LAYOUT defines using the BCH library.
- * The OOB layout was first defined by linx kernel in commit
- * 0e618ef0a6a33cf7ef96c2c824402088dd8ef48c, we have to reuse it here cause
- * we want to be compatible.
- */
-#define GPMC_NAND_HW_BCH8_ECC_LAYOUT {\
-	.eccbytes = 56,\
-	.eccpos = {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,\
-			23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,\
-			37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,\
-			51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63},\
-	.oobfree = {\
-		{.offset = 2,\
-		 .length = 10 } } \
-}
-
-/* GPMC CS configuration for an SMSC LAN9221 ethernet controller */
-#define NET_LAN9221_GPMC_CONFIG1    0x00001000
-#define NET_LAN9221_GPMC_CONFIG2    0x00060700
-#define NET_LAN9221_GPMC_CONFIG3    0x00020201
-#define NET_LAN9221_GPMC_CONFIG4    0x06000700
-#define NET_LAN9221_GPMC_CONFIG5    0x0006090A
-#define NET_LAN9221_GPMC_CONFIG6    0x87030000
-#define NET_LAN9221_GPMC_CONFIG7    0x00000f6c
-
-#endif /* __ASM_ARCH_OMAP_GPMC_H */
arch/arm/include/asm/omap_gpmc.h +0 -2
index 6ce5e65..5250109 100644
@@ -9,8 +9,6 @@
 #ifndef __ASM_OMAP_GPMC_H
 #define __ASM_OMAP_GPMC_H
 
-#include <asm/arch/omap_gpmc.h>
-
 #define GPMC_BUF_EMPTY	0
 #define GPMC_BUF_FULL	1
 
Signature · 1 line
1.8.1
#2 lore raw

PATCH 2/5 mtd: nand: omap: remove unused #defines from common omap_gpmc.h

In reply to Pekon Gupta

OMAP NAND driver can detect Page-size and OOB-size of NAND device from ONFI params or nand_id[] table. And based on that it defines ECC layout. This patch
1) removes following board configs used for defining NAND ECC layout
- GPMC_NAND_ECC_LP_x16_LAYOUT (for large page x16 NAND)
- GPMC_NAND_ECC_LP_x8_LAYOUT (for large page x8 NAND)
- GPMC_NAND_ECC_SP_x16_LAYOUT (for small page x16 NAND)
- GPMC_NAND_ECC_SP_x8_LAYOUT (for small page x8 NAND)

2) removes unused #defines in common omap_gpmc.h depending on above configs

Build tested using: ./MAKEALL -s am33xx -s omap3 -s omap4 -s omap5

---
 arch/arm/include/asm/omap_gpmc.h       | 47 ----------------------------------
 include/configs/am335x_evm.h           |  1 -
 include/configs/am335x_igep0033.h      |  1 -
 include/configs/am3517_crane.h         |  1 -
 include/configs/am3517_evm.h           |  1 -
 include/configs/cm_t35.h               |  2 --
 include/configs/devkit8000.h           |  2 --
 include/configs/dig297.h               |  2 --
 include/configs/mcx.h                  |  1 -
 include/configs/omap3_beagle.h         |  2 --
 include/configs/omap3_evm_common.h     |  1 -
 include/configs/omap3_igep00x0.h       |  1 -
 include/configs/omap3_logic.h          |  1 -
 include/configs/omap3_overo.h          |  2 --
 include/configs/omap3_pandora.h        |  2 --
 include/configs/omap3_zoom1.h          |  2 --
 include/configs/omap3_zoom2.h          |  1 -
 include/configs/siemens-am33x-common.h |  1 -
 include/configs/tam3517-common.h       |  1 -
 include/configs/tricorder.h            |  2 --
 20 files changed, 74 deletions(-)
arch/arm/include/asm/omap_gpmc.h +0 -47
index 5250109..3caaed8 100644
@@ -12,53 +12,6 @@
 #define GPMC_BUF_EMPTY	0
 #define GPMC_BUF_FULL	1
 
-/* Generic ECC Layouts */
-/* Large Page x8 NAND device Layout */
-#ifdef GPMC_NAND_ECC_LP_x8_LAYOUT
-#define GPMC_NAND_HW_ECC_LAYOUT {\
-	.eccbytes = 12,\
-	.eccpos = {1, 2, 3, 4, 5, 6, 7, 8,\
-		9, 10, 11, 12},\
-	.oobfree = {\
-		{.offset = 13,\
-		 .length = 51 } } \
-}
-#endif
-
-/* Large Page x16 NAND device Layout */
-#ifdef GPMC_NAND_ECC_LP_x16_LAYOUT
-#define GPMC_NAND_HW_ECC_LAYOUT {\
-	.eccbytes = 12,\
-	.eccpos = {2, 3, 4, 5, 6, 7, 8, 9,\
-		10, 11, 12, 13},\
-	.oobfree = {\
-		{.offset = 14,\
-		 .length = 50 } } \
-}
-#endif
-
-/* Small Page x8 NAND device Layout */
-#ifdef GPMC_NAND_ECC_SP_x8_LAYOUT
-#define GPMC_NAND_HW_ECC_LAYOUT {\
-	.eccbytes = 3,\
-	.eccpos = {1, 2, 3},\
-	.oobfree = {\
-		{.offset = 4,\
-		 .length = 12 } } \
-}
-#endif
-
-/* Small Page x16 NAND device Layout */
-#ifdef GPMC_NAND_ECC_SP_x16_LAYOUT
-#define GPMC_NAND_HW_ECC_LAYOUT {\
-	.eccbytes = 3,\
-	.eccpos = {2, 3, 4},\
-	.oobfree = {\
-		{.offset = 5,\
-		 .length = 11 } } \
-}
-#endif
-
 enum omap_ecc {
 	/* 1-bit  ECC calculation by Software, Error detection by Software */
 	OMAP_ECC_HAM1_CODE_SW = 1, /* avoid un-initialized int can be 0x0 */
include/configs/am335x_evm.h +0 -1
index d75df92..9ccbc20 100644
@@ -381,7 +381,6 @@
 /* NAND support */
 #ifdef CONFIG_NAND
 #define CONFIG_CMD_NAND
-#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
 #if !defined(CONFIG_SPI_BOOT) && !defined(CONFIG_NOR_BOOT)
 #define MTDIDS_DEFAULT			"nand0=omap2-nand.0"
 #define MTDPARTS_DEFAULT		"mtdparts=omap2-nand.0:128k(SPL)," \
include/configs/am335x_igep0033.h +0 -1
index 115d1b3..c00d54f 100644
@@ -188,7 +188,6 @@
 #define CONFIG_NAND
 #define CONFIG_NAND_OMAP_GPMC
 #define CONFIG_NAND_OMAP_ELM
-#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
 #define CONFIG_SYS_NAND_BASE		(0x08000000)	/* phys address CS0 */
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 #define CONFIG_SYS_NAND_ONFI_DETECTION	1
include/configs/am3517_crane.h +0 -1
index 468fb43..4407b45 100644
@@ -268,7 +268,6 @@
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
 
 #define CONFIG_NAND_OMAP_GPMC
-#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
 #define CONFIG_ENV_IS_IN_NAND		1
 #define SMNAND_ENV_OFFSET		0x260000 /* environment starts here */
 
include/configs/am3517_evm.h +0 -1
index a3473b5..7f52ce4 100644
@@ -262,7 +262,6 @@
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
 
 #define CONFIG_NAND_OMAP_GPMC
-#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
 #define CONFIG_ENV_IS_IN_NAND		1
 #define SMNAND_ENV_OFFSET		0x260000 /* environment starts here */
 
include/configs/cm_t35.h +0 -2
index f4ecd0d..52a1f05 100644
@@ -165,8 +165,6 @@
 #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
 							/* to access nand at */
 							/* CS0 */
-#define GPMC_NAND_ECC_LP_x8_LAYOUT
-
 #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
 							/* devices */
 /* Environment information */
include/configs/devkit8000.h +0 -2
index 4f43ba9..16a00eb 100644
@@ -116,8 +116,6 @@
 #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
 							/* to access nand at */
 							/* CS0 */
-#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
-
 #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
 							/* devices */
 #define CONFIG_JFFS2_NAND
include/configs/dig297.h +0 -2
index 5049afc..af6f56b 100644
@@ -143,8 +143,6 @@
 #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
 							/* to access nand at */
 							/* CS0 */
-#define GPMC_NAND_ECC_LP_x16_LAYOUT
-
 #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
 
 #if defined(CONFIG_CMD_NET)
include/configs/mcx.h +0 -1
index dcd29ce..dd4afb8 100644
@@ -321,7 +321,6 @@
 #define PISMO1_NAND_SIZE		GPMC_SIZE_128M
 
 #define CONFIG_NAND_OMAP_GPMC
-#define GPMC_NAND_ECC_LP_x16_LAYOUT
 #define CONFIG_ENV_IS_IN_NAND
 #define SMNAND_ENV_OFFSET		0x180000 /* environment starts here */
 
include/configs/omap3_beagle.h +0 -2
index 9eab190..8127f87 100644
@@ -183,8 +183,6 @@
 #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
 							/* to access nand at */
 							/* CS0 */
-#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
-
 #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
 							/* devices */
 
include/configs/omap3_evm_common.h +0 -1
index 43616e2..7f3424b 100644
@@ -208,7 +208,6 @@
 #define CONFIG_SYS_FLASH_BASE		PISMO1_NAND_BASE
 
 #define CONFIG_NAND_OMAP_GPMC
-#define GPMC_NAND_ECC_LP_x16_LAYOUT
 #define CONFIG_ENV_OFFSET		SMNAND_ENV_OFFSET
 #elif defined(CONFIG_CMD_ONENAND)
 #define CONFIG_SYS_FLASH_BASE		PISMO1_ONEN_BASE
include/configs/omap3_igep00x0.h +0 -1
index 71062a6..172c3a3 100644
@@ -267,7 +267,6 @@
 #define PISMO1_NAND_SIZE		GPMC_SIZE_128M /* Configure the PISMO */
 #define CONFIG_NAND_OMAP_GPMC
 #define CONFIG_SYS_NAND_BASE		NAND_BASE
-#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
 #define CONFIG_ENV_OFFSET		0x260000 /* environment starts here */
 #define CONFIG_ENV_IS_IN_NAND	        1
 #define CONFIG_ENV_SIZE			(512 << 10) /* Total Size Environment */
include/configs/omap3_logic.h +0 -1
index bedd6f9..0d03c75 100644
@@ -295,7 +295,6 @@
 
 #if defined(CONFIG_CMD_NAND)
 #define CONFIG_NAND_OMAP_GPMC
-#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
 #define CONFIG_ENV_IS_IN_NAND
 #define CONFIG_ENV_OFFSET		SMNAND_ENV_OFFSET
 #endif
include/configs/omap3_overo.h +0 -2
index e0f0262..007e27f 100644
@@ -119,8 +119,6 @@
 #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
 							/* to access nand */
 							/* at CS0 */
-#define GPMC_NAND_ECC_LP_x16_LAYOUT
-
 #define CONFIG_SYS_MAX_NAND_DEVICE	1	/* Max number of NAND */
 						/* devices */
 #define CONFIG_JFFS2_NAND
include/configs/omap3_pandora.h +0 -2
index eacdfaa..da67787 100644
@@ -131,8 +131,6 @@
 #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
 							/* to access nand */
 							/* at CS0 */
-#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
-
 #define CONFIG_SYS_MAX_NAND_DEVICE	1	/* Max number of NAND */
 						/* devices */
 
include/configs/omap3_zoom1.h +0 -2
index 1dd53fa..f0fa96e 100644
@@ -138,8 +138,6 @@
 #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
 							/* to access nand at */
 							/* CS0 */
-#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
-
 #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
 							/* devices */
 #define CONFIG_JFFS2_NAND
include/configs/omap3_zoom2.h +0 -1
index f749740..8b0ac3d 100644
@@ -158,7 +158,6 @@
 #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
 							/* to access nand at */
 							/* CS0 */
-#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 
 /* Environment information */
include/configs/siemens-am33x-common.h +0 -1
index f37653f..018e22b 100644
@@ -432,7 +432,6 @@
 
 #define CONFIG_NAND_OMAP_GPMC
 #define CONFIG_NAND_OMAP_ELM
-#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
 #define CONFIG_SYS_NAND_BASE		(0x08000000)	/* physical address */
 							/* to access nand at */
 							/* CS0 */
include/configs/tam3517-common.h +0 -1
index 439fc47..d3f9a4e 100644
@@ -186,7 +186,6 @@
 #define PISMO1_NAND_SIZE		GPMC_SIZE_128M
 
 #define CONFIG_NAND_OMAP_GPMC
-#define GPMC_NAND_ECC_LP_x16_LAYOUT
 #define CONFIG_ENV_IS_IN_NAND
 #define SMNAND_ENV_OFFSET		0x180000 /* environment starts here */
 
include/configs/tricorder.h +0 -2
index b38b955..5940c03 100644
@@ -134,8 +134,6 @@
 #define CONFIG_SYS_NAND_BASE		NAND_BASE	/* physical address */
 							/* to access nand@*/
 							/* CS0 */
-#define GPMC_NAND_ECC_LP_x16_LAYOUT	1
-
 #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
 							/* devices */
 #define CONFIG_BCH
Signature · 1 line
1.8.1
#3 lore raw

PATCH 3/5 mtd: nand: omap: merge duplicate GPMC data from different arch-xx headers into common omap_gpmc.h

In reply to Pekon Gupta

Each SoC platform (AM33xx, OMAP3, OMAP4, OMAP5) has its own copy of GPMC related defines and declarations scattered in SoC platform specific header files like include/asm/arch-xx/cpu.h
However, GPMC hardware remains same across all platforms thus this patch merges GPMC data scattered across different arch-xx specific header files into single header file include/asm/arch/omap_gpmc.h

Build tested using: ./MAKEALL -s am33xx -s omap3 -s omap4 -s omap5

---
 arch/arm/include/asm/arch-am33xx/cpu.h       | 51 --------------------------
 arch/arm/include/asm/arch-am33xx/sys_proto.h |  1 +
 arch/arm/include/asm/arch-omap3/cpu.h        | 54 +---------------------------
 arch/arm/include/asm/arch-omap3/sys_proto.h  |  1 +
 arch/arm/include/asm/arch-omap4/cpu.h        | 45 -----------------------
 arch/arm/include/asm/arch-omap4/sys_proto.h  |  1 +
 arch/arm/include/asm/arch-omap5/cpu.h        | 45 -----------------------
 arch/arm/include/asm/arch-omap5/sys_proto.h  |  1 +
 arch/arm/include/asm/omap_gpmc.h             | 53 +++++++++++++++++++++++++++
 drivers/mtd/nand/omap_elm.c                  |  2 +-
 drivers/mtd/nand/omap_gpmc.c                 |  1 -
 11 files changed, 59 insertions(+), 196 deletions(-)
arch/arm/include/asm/arch-am33xx/cpu.h +0 -51
index 05752ce..bdc634d 100644
@@ -78,58 +78,7 @@
 
 #ifndef __KERNEL_STRICT_NAMES
 #ifndef __ASSEMBLY__
-struct gpmc_cs {
-	u32 config1;		/* 0x00 */
-	u32 config2;		/* 0x04 */
-	u32 config3;		/* 0x08 */
-	u32 config4;		/* 0x0C */
-	u32 config5;		/* 0x10 */
-	u32 config6;		/* 0x14 */
-	u32 config7;		/* 0x18 */
-	u32 nand_cmd;		/* 0x1C */
-	u32 nand_adr;		/* 0x20 */
-	u32 nand_dat;		/* 0x24 */
-	u8 res[8];		/* blow up to 0x30 byte */
-};
-
-struct bch_res_0_3 {
-	u32 bch_result_x[4];
-};
-
-struct gpmc {
-	u8 res1[0x10];
-	u32 sysconfig;		/* 0x10 */
-	u8 res2[0x4];
-	u32 irqstatus;		/* 0x18 */
-	u32 irqenable;		/* 0x1C */
-	u8 res3[0x20];
-	u32 timeout_control;	/* 0x40 */
-	u8 res4[0xC];
-	u32 config;		/* 0x50 */
-	u32 status;		/* 0x54 */
-	u8 res5[0x8];		/* 0x58 */
-	struct gpmc_cs cs[8];	/* 0x60, 0x90, .. */
-	u8 res6[0x14];		/* 0x1E0 */
-	u32 ecc_config;		/* 0x1F4 */
-	u32 ecc_control;	/* 0x1F8 */
-	u32 ecc_size_config;	/* 0x1FC */
-	u32 ecc1_result;	/* 0x200 */
-	u32 ecc2_result;	/* 0x204 */
-	u32 ecc3_result;	/* 0x208 */
-	u32 ecc4_result;	/* 0x20C */
-	u32 ecc5_result;	/* 0x210 */
-	u32 ecc6_result;	/* 0x214 */
-	u32 ecc7_result;	/* 0x218 */
-	u32 ecc8_result;	/* 0x21C */
-	u32 ecc9_result;	/* 0x220 */
-	u8 res7[12];		/* 0x224 */
-	u32 testmomde_ctrl;	/* 0x230 */
-	u8 res8[12];		/* 0x234 */
-	struct bch_res_0_3 bch_result_0_3[2];	/* 0x240 */
-};
 
-/* Used for board specific gpmc initialization */
-extern struct gpmc *gpmc_cfg;
 
 #ifndef CONFIG_AM43XX
 /* Encapsulating core pll registers */
arch/arm/include/asm/arch-am33xx/sys_proto.h +1 -0
index 87b7d36..c427909 100644
@@ -10,6 +10,7 @@
 
 #ifndef _SYS_PROTO_H_
 #define _SYS_PROTO_H_
+#include <asm/omap_gpmc.h>
 #include <asm/arch/cpu.h>
 
 #define BOARD_REV_ID	0x0
arch/arm/include/asm/arch-omap3/cpu.h +1 -53

60 lines not on this page · raw message

arch/arm/include/asm/arch-omap3/sys_proto.h +1 -0
index 43b54f7..83d7f11 100644
@@ -7,6 +7,7 @@
  */
 #ifndef _SYS_PROTO_H_
 #define _SYS_PROTO_H_
+#include <asm/omap_gpmc.h>
 
 typedef struct {
 	u32 mtype;
arch/arm/include/asm/arch-omap4/cpu.h +0 -45

51 lines not on this page · raw message

arch/arm/include/asm/arch-omap4/sys_proto.h +1 -0
index 39c5316..768453d 100644
@@ -12,6 +12,7 @@
 #include <asm/arch/clock.h>
 #include <asm/io.h>
 #include <asm/omap_common.h>
+#include <asm/omap_gpmc.h>
 #include <asm/arch/mux_omap4.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/include/asm/arch-omap5/cpu.h +0 -45

51 lines not on this page · raw message

arch/arm/include/asm/arch-omap5/sys_proto.h +1 -0
index 9e70d48..5ed7e6a 100644
@@ -12,6 +12,7 @@
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/omap_common.h>
+#include <asm/omap_gpmc.h>
 #include <asm/arch/clock.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/include/asm/omap_gpmc.h +53 -0

57 lines not on this page · raw message

drivers/mtd/nand/omap_elm.c +1 -1
index 2aa7807..64dca4f 100644
@@ -16,9 +16,9 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/errno.h>
-#include <asm/arch/cpu.h>
 #include <asm/omap_gpmc.h>
 #include <asm/omap_elm.h>
+#include <asm/arch/hardware.h>
 
 #define ELM_DEFAULT_POLY (0)
 
drivers/mtd/nand/omap_gpmc.c +0 -1
index 3bf4fb0..5bcb242 100644
@@ -9,7 +9,6 @@
 #include <asm/io.h>
 #include <asm/errno.h>
 #include <asm/arch/mem.h>
-#include <asm/arch/cpu.h>
 #include <asm/omap_gpmc.h>
 #include <linux/mtd/nand_ecc.h>
 #include <linux/bch.h>
Signature · 1 line
1.8.1
#4 lore raw

PATCH 4/5 mtd: nand: omap: move omap_gpmc.h from arch/arm/include/asm to drivers/mtd/nand

In reply to Pekon Gupta

omap_gpmc.h is a generic header used by OMAP NAND driver for all TI platfoms. Hence this file should be present in generic folder instead of architecture specific include folder.
Build tested using: ./MAKEALL -s am33xx -s omap3 -s omap4 -s omap5

---
 arch/arm/include/asm/arch-am33xx/sys_proto.h            | 2 +-
 arch/arm/include/asm/arch-omap3/sys_proto.h             | 2 +-
 arch/arm/include/asm/arch-omap4/sys_proto.h             | 2 +-
 arch/arm/include/asm/arch-omap5/sys_proto.h             | 2 +-
 board/isee/igep00x0/igep00x0.c                          | 1 -
 board/overo/overo.c                                     | 1 -
 drivers/mtd/nand/omap_elm.c                             | 2 +-
 drivers/mtd/nand/omap_gpmc.c                            | 2 +-
 {arch/arm/include/asm => include/linux/mtd}/omap_gpmc.h | 0
 9 files changed, 6 insertions(+), 8 deletions(-)
 rename {arch/arm/include/asm => include/linux/mtd}/omap_gpmc.h (100%)
arch/arm/include/asm/arch-am33xx/sys_proto.h +1 -1
index c427909..f785bb9 100644
@@ -10,7 +10,7 @@
 
 #ifndef _SYS_PROTO_H_
 #define _SYS_PROTO_H_
-#include <asm/omap_gpmc.h>
+#include <linux/mtd/omap_gpmc.h>
 #include <asm/arch/cpu.h>
 
 #define BOARD_REV_ID	0x0
arch/arm/include/asm/arch-omap3/sys_proto.h +1 -1
index 83d7f11..44fa66f 100644
@@ -7,7 +7,7 @@
  */
 #ifndef _SYS_PROTO_H_
 #define _SYS_PROTO_H_
-#include <asm/omap_gpmc.h>
+#include <linux/mtd/omap_gpmc.h>
 
 typedef struct {
 	u32 mtype;
arch/arm/include/asm/arch-omap4/sys_proto.h +1 -1
index 768453d..eb9a104 100644
@@ -12,7 +12,7 @@
 #include <asm/arch/clock.h>
 #include <asm/io.h>
 #include <asm/omap_common.h>
-#include <asm/omap_gpmc.h>
+#include <linux/mtd/omap_gpmc.h>
 #include <asm/arch/mux_omap4.h>
 
 DECLARE_GLOBAL_DATA_PTR;
arch/arm/include/asm/arch-omap5/sys_proto.h +1 -1
index 5ed7e6a..9097303 100644
@@ -12,7 +12,7 @@
 #include <asm/io.h>
 #include <asm/arch/clock.h>
 #include <asm/omap_common.h>
-#include <asm/omap_gpmc.h>
+#include <linux/mtd/omap_gpmc.h>
 #include <asm/arch/clock.h>
 
 DECLARE_GLOBAL_DATA_PTR;
board/isee/igep00x0/igep00x0.c +0 -1
index 7a7500b..3b2b1f1 100644
@@ -8,7 +8,6 @@
 #include <twl4030.h>
 #include <netdev.h>
 #include <asm/gpio.h>
-#include <asm/omap_gpmc.h>
 #include <asm/io.h>
 #include <asm/arch/mem.h>
 #include <asm/arch/mmc_host_def.h>
board/overo/overo.c +0 -1
index 9ac35d2..1192d02 100644
@@ -21,7 +21,6 @@
 #include <asm/arch/mux.h>
 #include <asm/arch/mem.h>
 #include <asm/arch/sys_proto.h>
-#include <asm/omap_gpmc.h>
 #include <asm/gpio.h>
 #include <asm/mach-types.h>
 #include "overo.h"
drivers/mtd/nand/omap_elm.c +1 -1
index 64dca4f..55a631d 100644
@@ -16,7 +16,7 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/errno.h>
-#include <asm/omap_gpmc.h>
+#include <linux/mtd/omap_gpmc.h>
 #include <asm/omap_elm.h>
 #include <asm/arch/hardware.h>
 
drivers/mtd/nand/omap_gpmc.c +1 -1
index 5bcb242..6bf8242 100644
@@ -9,7 +9,7 @@
 #include <asm/io.h>
 #include <asm/errno.h>
 #include <asm/arch/mem.h>
-#include <asm/omap_gpmc.h>
+#include <linux/mtd/omap_gpmc.h>
 #include <linux/mtd/nand_ecc.h>
 #include <linux/bch.h>
 #include <linux/compiler.h>
include/linux/mtd/omap_gpmc.h renamed from arch/arm/include/asm/omap_gpmc.h +0 -0
similarity index 100%
rename from arch/arm/include/asm/omap_gpmc.h
rename to include/linux/mtd/omap_gpmc.h
Signature · 1 line
1.8.1
#5 lore raw

PATCH 5/5 mtd: nand: omap: move omap_elm.h from arch/arm/include/asm to drivers/mtd/nand

In reply to Pekon Gupta

omap_elm.h is a generic header used by OMAP ELM driver for all TI platfoms. Hence this file should be present in generic folder instead of architecture specific include folder.
Build tested using: ./MAKEALL -s am33xx -s omap3 -s omap4 -s omap5

---
 drivers/mtd/nand/omap_elm.c                            | 2 +-
 drivers/mtd/nand/omap_gpmc.c                           | 2 +-
 {arch/arm/include/asm => include/linux/mtd}/omap_elm.h | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename {arch/arm/include/asm => include/linux/mtd}/omap_elm.h (100%)
drivers/mtd/nand/omap_elm.c +1 -1
index 55a631d..47b1f1b 100644
@@ -17,7 +17,7 @@
 #include <asm/io.h>
 #include <asm/errno.h>
 #include <linux/mtd/omap_gpmc.h>
-#include <asm/omap_elm.h>
+#include <linux/mtd/omap_elm.h>
 #include <asm/arch/hardware.h>
 
 #define ELM_DEFAULT_POLY (0)
drivers/mtd/nand/omap_gpmc.c +1 -1
index 6bf8242..c1ce771 100644
@@ -14,7 +14,7 @@
 #include <linux/bch.h>
 #include <linux/compiler.h>
 #include <nand.h>
-#include <asm/omap_elm.h>
+#include <linux/mtd/omap_elm.h>
 
 #define BADBLOCK_MARKER_LENGTH	2
 #define SECTOR_BYTES		512
include/linux/mtd/omap_elm.h renamed from arch/arm/include/asm/omap_elm.h +0 -0
similarity index 100%
rename from arch/arm/include/asm/omap_elm.h
rename to include/linux/mtd/omap_elm.h
Signature · 1 line
1.8.1