From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/6] asm/omap_gpmc.h: consolidate common defines
Date: Tue, 2 Apr 2013 18:05:54 +0200 [thread overview]
Message-ID: <1364918758-17778-2-git-send-email-andreas.devel@googlemail.com> (raw)
In-Reply-To: <1364918758-17778-1-git-send-email-andreas.devel@googlemail.com>
arch/arm/include/asm/arch-am33xx/omap_gpmc.h and
arch/arm/include/asm/arch-omap3/omap_gpmc.h are almost the same, consolidate
the common parts into a new header.
Introduce a new asm/omap_gpmc.h which defines the command part and pulls in
the architecture specific one.
Signed-off-by: Andreas Bie?mann <andreas.devel@googlemail.com>
Cc: Tom Rini <trini@ti.com>
---
new in v2
arch/arm/cpu/armv7/am33xx/elm.c | 2 +-
arch/arm/include/asm/arch-am33xx/omap_gpmc.h | 58 +--------------------
arch/arm/include/asm/arch-omap3/omap_gpmc.h | 57 --------------------
arch/arm/include/asm/{arch-omap3 => }/omap_gpmc.h | 19 +++----
board/isee/igep00x0/igep00x0.c | 2 +-
board/overo/overo.c | 2 +-
drivers/mtd/nand/omap_gpmc.c | 2 +-
7 files changed, 12 insertions(+), 130 deletions(-)
copy arch/arm/include/asm/{arch-omap3 => }/omap_gpmc.h (80%)
diff --git a/arch/arm/cpu/armv7/am33xx/elm.c b/arch/arm/cpu/armv7/am33xx/elm.c
index 9eed23d..41df612 100644
--- a/arch/arm/cpu/armv7/am33xx/elm.c
+++ b/arch/arm/cpu/armv7/am33xx/elm.c
@@ -33,7 +33,7 @@
#include <asm/io.h>
#include <asm/errno.h>
#include <asm/arch/cpu.h>
-#include <asm/arch/omap_gpmc.h>
+#include <asm/omap_gpmc.h>
#include <asm/arch/elm.h>
#define ELM_DEFAULT_POLY (0)
diff --git a/arch/arm/include/asm/arch-am33xx/omap_gpmc.h b/arch/arm/include/asm/arch-am33xx/omap_gpmc.h
index 572f9d0..d03f1db 100644
--- a/arch/arm/include/asm/arch-am33xx/omap_gpmc.h
+++ b/arch/arm/include/asm/arch-am33xx/omap_gpmc.h
@@ -23,63 +23,7 @@
#ifndef __ASM_ARCH_OMAP_GPMC_H
#define __ASM_ARCH_OMAP_GPMC_H
-#define GPMC_BUF_EMPTY 0
-#define GPMC_BUF_FULL 1
-
-#define ECCCLEAR (0x1 << 8)
-#define ECCRESULTREG1 (0x1 << 0)
-#define ECCSIZE512BYTE 0xFF
-#define ECCSIZE1 (ECCSIZE512BYTE << 22)
-#define ECCSIZE0 (ECCSIZE512BYTE << 12)
-#define ECCSIZE0SEL (0x000 << 0)
-
-/* 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
-
+/* 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,\
diff --git a/arch/arm/include/asm/arch-omap3/omap_gpmc.h b/arch/arm/include/asm/arch-omap3/omap_gpmc.h
index 800e4ee..13efab0 100644
--- a/arch/arm/include/asm/arch-omap3/omap_gpmc.h
+++ b/arch/arm/include/asm/arch-omap3/omap_gpmc.h
@@ -23,63 +23,6 @@
#ifndef __ASM_ARCH_OMAP_GPMC_H
#define __ASM_ARCH_OMAP_GPMC_H
-#define GPMC_BUF_EMPTY 0
-#define GPMC_BUF_FULL 1
-
-#define ECCCLEAR (0x1 << 8)
-#define ECCRESULTREG1 (0x1 << 0)
-#define ECCSIZE512BYTE 0xFF
-#define ECCSIZE1 (ECCSIZE512BYTE << 22)
-#define ECCSIZE0 (ECCSIZE512BYTE << 12)
-#define ECCSIZE0SEL (0x000 << 0)
-
-/* 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
-
/* GPMC CS configuration for an SMSC LAN9221 ethernet controller */
#define NET_LAN9221_GPMC_CONFIG1 0x00001000
#define NET_LAN9221_GPMC_CONFIG2 0x00060700
diff --git a/arch/arm/include/asm/arch-omap3/omap_gpmc.h b/arch/arm/include/asm/omap_gpmc.h
similarity index 80%
copy from arch/arm/include/asm/arch-omap3/omap_gpmc.h
copy to arch/arm/include/asm/omap_gpmc.h
index 800e4ee..5cb1df1 100644
--- a/arch/arm/include/asm/arch-omap3/omap_gpmc.h
+++ b/arch/arm/include/asm/omap_gpmc.h
@@ -2,6 +2,8 @@
* (C) Copyright 2004-2008 Texas Instruments, <www.ti.com>
* Rohit Choraria <rohitkc@ti.com>
*
+ * (C) Copyright 2013 Andreas Bie?mann <andreas.devel@googlemail.com>
+ *
* See file CREDITS for list of people who contributed to this
* project.
*
@@ -20,8 +22,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
-#ifndef __ASM_ARCH_OMAP_GPMC_H
-#define __ASM_ARCH_OMAP_GPMC_H
+#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
@@ -80,13 +84,4 @@
}
#endif
-/* 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 */
+#endif /* __ASM_OMAP_GPMC_H */
diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c
index 2bac916..0d4679d 100644
--- a/board/isee/igep00x0/igep00x0.c
+++ b/board/isee/igep00x0/igep00x0.c
@@ -24,7 +24,7 @@
#include <twl4030.h>
#include <netdev.h>
#include <asm/gpio.h>
-#include <asm/arch/omap_gpmc.h>
+#include <asm/omap_gpmc.h>
#include <asm/io.h>
#include <asm/arch/mem.h>
#include <asm/arch/mmc_host_def.h>
diff --git a/board/overo/overo.c b/board/overo/overo.c
index 8690450..c10c44c 100644
--- a/board/overo/overo.c
+++ b/board/overo/overo.c
@@ -37,7 +37,7 @@
#include <asm/arch/mux.h>
#include <asm/arch/mem.h>
#include <asm/arch/sys_proto.h>
-#include <asm/arch/omap_gpmc.h>
+#include <asm/omap_gpmc.h>
#include <asm/gpio.h>
#include <asm/mach-types.h>
#include "overo.h"
diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
index bbf5443..c7d4999 100644
--- a/drivers/mtd/nand/omap_gpmc.c
+++ b/drivers/mtd/nand/omap_gpmc.c
@@ -26,7 +26,7 @@
#include <asm/errno.h>
#include <asm/arch/mem.h>
#include <asm/arch/cpu.h>
-#include <asm/arch/omap_gpmc.h>
+#include <asm/omap_gpmc.h>
#include <linux/mtd/nand_ecc.h>
#include <linux/compiler.h>
#include <nand.h>
--
1.7.10.4
next prev parent reply other threads:[~2013-04-02 16:05 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-23 15:14 [U-Boot] [RFC/PATCH 0/4] BCH8 support for OMAP3 Andreas Bießmann
2012-11-23 15:14 ` [U-Boot] [RFC/PATCH 1/4] omap3/cpu.h: add BCH support Andreas Bießmann
2012-11-23 15:14 ` [U-Boot] [RFC/PATCH 2/4] omap3/omap_gpmc.h: add ooblayout for BCH8 as in kernel Andreas Bießmann
2012-11-23 15:14 ` [U-Boot] [RFC/PATCH 3/4] omap_gpmc: add support for hw assisted BCH8 Andreas Bießmann
2012-11-26 21:09 ` Scott Wood
2012-11-23 15:14 ` [U-Boot] [RFC/PATCH 4/4] tricorder: enable hw assisted BCH8 in SPL and u-boot Andreas Bießmann
2013-03-28 10:49 ` [U-Boot] [RFC/PATCH 0/4] BCH8 support for OMAP3 Andreas Bießmann
2013-03-28 14:21 ` Tom Rini
2013-04-02 8:49 ` Andreas Bießmann
2013-04-02 16:13 ` Tom Rini
2013-04-02 16:05 ` [U-Boot] [PATCH v2 1/6] omap3/cpu.h: add BCH support Andreas Bießmann
2013-04-02 16:05 ` Andreas Bießmann [this message]
2013-04-02 21:19 ` [U-Boot] [PATCH v2 2/6] asm/omap_gpmc.h: consolidate common defines Tom Rini
2013-04-02 16:05 ` [U-Boot] [PATCH v2 3/6] omap3/omap_gpmc.h: add ooblayout for BCH8 as in kernel Andreas Bießmann
2013-04-02 21:19 ` Tom Rini
2013-04-02 16:05 ` [U-Boot] [PATCH v2 4/6] omap_gpmc: change nandecc command Andreas Bießmann
2013-04-02 21:19 ` Tom Rini
2013-04-03 14:50 ` [U-Boot] [PATCH v3 " Andreas Bießmann
2013-04-03 14:50 ` [U-Boot] [PATCH v3 5/6] omap_gpmc: add support for hw assisted BCH8 Andreas Bießmann
2013-04-05 8:13 ` Thomas Weber
2013-04-05 9:15 ` Andreas Bießmann
2013-04-05 11:44 ` Thomas Weber
2013-04-05 13:42 ` Andreas Bießmann
2013-04-05 14:55 ` [U-Boot] [PATCH v4 " Andreas Bießmann
2013-04-05 9:52 ` [U-Boot] [PATCH v4 4/6] omap_gpmc: change nandecc command Andreas Bießmann
2013-04-05 11:48 ` Thomas Weber
2013-04-05 13:39 ` Andreas Bießmann
2013-04-02 16:05 ` [U-Boot] [PATCH v2 5/6] omap_gpmc: add support for hw assisted BCH8 Andreas Bießmann
2013-04-02 21:19 ` Tom Rini
2013-04-02 16:05 ` [U-Boot] [PATCH v2 6/6] tricorder: enable hw assisted BCH8 in SPL and u-boot Andreas Bießmann
2013-04-02 21:19 ` [U-Boot] [PATCH v2 1/6] omap3/cpu.h: add BCH support Tom Rini
2013-04-08 16:58 ` Tom Rini
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=1364918758-17778-2-git-send-email-andreas.devel@googlemail.com \
--to=andreas.devel@googlemail.com \
--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.