]> err.no Git - linux-2.6/commitdiff
[ARM] 4904/1: [AT91] Pass ECC controller to NAND driver
authorAndrew Victor <linux@maxim.org.za>
Wed, 2 Apr 2008 20:44:44 +0000 (21:44 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 4 Apr 2008 08:52:20 +0000 (09:52 +0100)
On AT91 processors that include an ECC controller, pass its base
address to the NAND driver via platform_device resources.

Signed-off-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-at91/at91cap9_devices.c
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/at91sam9263_devices.c
arch/arm/mach-at91/at91sam9rl_devices.c
include/asm-arm/arch-at91/at91_ecc.h

index 0c341a4624ff28b5234cbd1ac1e6b2761badcd96..10f15f3a56cab3bdab14d2ffb58b801931945f1f 100644 (file)
@@ -283,10 +283,15 @@ static struct at91_nand_data nand_data;
 #define NAND_BASE      AT91_CHIPSELECT_3
 
 static struct resource nand_resources[] = {
-       {
+       [0] = {
                .start  = NAND_BASE,
                .end    = NAND_BASE + SZ_256M - 1,
                .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_BASE_SYS + AT91_ECC,
+               .end    = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
+               .flags  = IORESOURCE_MEM,
        }
 };
 
index b758e66c60f86fea7bf523fb9d5b04bbd24c8093..d613761dc2f8e624edc5e7b095e038c4a0b72b7f 100644 (file)
@@ -288,10 +288,15 @@ static struct at91_nand_data nand_data;
 #define NAND_BASE      AT91_CHIPSELECT_3
 
 static struct resource nand_resources[] = {
-       {
+       [0] = {
                .start  = NAND_BASE,
                .end    = NAND_BASE + SZ_256M - 1,
                .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_BASE_SYS + AT91_ECC,
+               .end    = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
+               .flags  = IORESOURCE_MEM,
        }
 };
 
index fc14af8617f04dd6705f9ee923ca9822a4e5e0a6..64aab9c9b97e14c3f217c6baee038761c4ef615e 100644 (file)
@@ -358,10 +358,15 @@ static struct at91_nand_data nand_data;
 #define NAND_BASE      AT91_CHIPSELECT_3
 
 static struct resource nand_resources[] = {
-       {
+       [0] = {
                .start  = NAND_BASE,
                .end    = NAND_BASE + SZ_256M - 1,
                .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_BASE_SYS + AT91_ECC0,
+               .end    = AT91_BASE_SYS + AT91_ECC0 + SZ_512 - 1,
+               .flags  = IORESOURCE_MEM,
        }
 };
 
index fb74b33bba68ac590f2e74907aab9e726e898696..2a0abd25e7734280c1b2bff70cf11af8ab1d8e30 100644 (file)
@@ -105,10 +105,15 @@ static struct at91_nand_data nand_data;
 #define NAND_BASE      AT91_CHIPSELECT_3
 
 static struct resource nand_resources[] = {
-       {
+       [0] = {
                .start  = NAND_BASE,
                .end    = NAND_BASE + SZ_256M - 1,
                .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = AT91_BASE_SYS + AT91_ECC,
+               .end    = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
+               .flags  = IORESOURCE_MEM,
        }
 };
 
index ff93df516d6df11c419bf4767c3860aa941d392a..1e5a8caca2d15bf42470d52a5dbb489a472093d3 100644 (file)
 #ifndef AT91_ECC_H
 #define AT91_ECC_H
 
-#define AT91_ECC_CR            (AT91_ECC + 0x00)       /* Control register */
+#define AT91_ECC_CR            0x00                    /* Control register */
 #define                AT91_ECC_RST            (1 << 0)                /* Reset parity */
 
-#define AT91_ECC_MR            (AT91_ECC + 0x04)       /* Mode register */
+#define AT91_ECC_MR            0x04                    /* Mode register */
 #define                AT91_ECC_PAGESIZE       (3 << 0)                /* Page Size */
 #define                        AT91_ECC_PAGESIZE_528           (0)
 #define                        AT91_ECC_PAGESIZE_1056          (1)
 #define                        AT91_ECC_PAGESIZE_2112          (2)
 #define                        AT91_ECC_PAGESIZE_4224          (3)
 
-#define AT91_ECC_SR            (AT91_ECC + 0x08)       /* Status register */
+#define AT91_ECC_SR            0x08                    /* Status register */
 #define                AT91_ECC_RECERR         (1 << 0)                /* Recoverable Error */
 #define                AT91_ECC_ECCERR         (1 << 1)                /* ECC Single Bit Error */
 #define                AT91_ECC_MULERR         (1 << 2)                /* Multiple Errors */
 
-#define AT91_ECC_PR            (AT91_ECC + 0x0c)       /* Parity register */
+#define AT91_ECC_PR            0x0c                    /* Parity register */
 #define                AT91_ECC_BITADDR        (0xf << 0)              /* Bit Error Address */
 #define                AT91_ECC_WORDADDR       (0xfff << 4)            /* Word Error Address */
 
-#define AT91_ECC_NPR           (AT91_ECC + 0x10)       /* NParity register */
+#define AT91_ECC_NPR           0x10                    /* NParity register */
 #define                AT91_ECC_NPARITY        (0xffff << 0)           /* NParity */
 
 #endif