aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndrew Victor <andrew@sanpeople.com>2006-12-01 04:55:15 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-12-01 08:53:58 -0500
commitfcc63716a5ee93ec3d1043890e38753d53313b80 (patch)
tree551d914e4b2825594f79c43429f5317a6f75d2d7 /arch
parent330d741b0632960e7853a2cb3b2899e94e696f12 (diff)
[ARM] 3957/1: AT91: Physically mapped flash on DK and EK boards
This patch converts the old CONFIG_MTD_PHYSMAP_ options to the new physmap API by creating a physmap platform device for the NOR flash found on the Atmel AT91RM9200-DK and AT91RM9200-EK boards. Signed-off-by: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/configs/at91rm9200dk_defconfig10
-rw-r--r--arch/arm/configs/at91rm9200ek_defconfig10
-rw-r--r--arch/arm/mach-at91rm9200/board-dk.c28
-rw-r--r--arch/arm/mach-at91rm9200/board-ek.c28
4 files changed, 68 insertions, 8 deletions
diff --git a/arch/arm/configs/at91rm9200dk_defconfig b/arch/arm/configs/at91rm9200dk_defconfig
index b43041476e02..1d79360f3eba 100644
--- a/arch/arm/configs/at91rm9200dk_defconfig
+++ b/arch/arm/configs/at91rm9200dk_defconfig
@@ -357,9 +357,9 @@ CONFIG_MTD_CFI_UTIL=y
357# 357#
358# CONFIG_MTD_COMPLEX_MAPPINGS is not set 358# CONFIG_MTD_COMPLEX_MAPPINGS is not set
359CONFIG_MTD_PHYSMAP=y 359CONFIG_MTD_PHYSMAP=y
360CONFIG_MTD_PHYSMAP_START=0x10000000 360CONFIG_MTD_PHYSMAP_START=0
361CONFIG_MTD_PHYSMAP_LEN=0x200000 361CONFIG_MTD_PHYSMAP_LEN=0
362CONFIG_MTD_PHYSMAP_BANKWIDTH=2 362CONFIG_MTD_PHYSMAP_BANKWIDTH=0
363# CONFIG_MTD_ARM_INTEGRATOR is not set 363# CONFIG_MTD_ARM_INTEGRATOR is not set
364# CONFIG_MTD_IMPA7 is not set 364# CONFIG_MTD_IMPA7 is not set
365# CONFIG_MTD_PLATRAM is not set 365# CONFIG_MTD_PLATRAM is not set
@@ -585,7 +585,9 @@ CONFIG_AT91RM9200_WATCHDOG=y
585# CONFIG_USBPCWATCHDOG is not set 585# CONFIG_USBPCWATCHDOG is not set
586# CONFIG_NVRAM is not set 586# CONFIG_NVRAM is not set
587# CONFIG_RTC is not set 587# CONFIG_RTC is not set
588CONFIG_AT91_RTC=y 588CONFIG_RTC_LIB=y
589CONFIG_RTC_CLASS=y
590CONFIG_RTC_DRV_AT91RM9200=y
589# CONFIG_DTLK is not set 591# CONFIG_DTLK is not set
590# CONFIG_R3964 is not set 592# CONFIG_R3964 is not set
591 593
diff --git a/arch/arm/configs/at91rm9200ek_defconfig b/arch/arm/configs/at91rm9200ek_defconfig
index d96fc8386e2f..16120bca3cb7 100644
--- a/arch/arm/configs/at91rm9200ek_defconfig
+++ b/arch/arm/configs/at91rm9200ek_defconfig
@@ -348,9 +348,9 @@ CONFIG_MTD_CFI_UTIL=y
348# 348#
349# CONFIG_MTD_COMPLEX_MAPPINGS is not set 349# CONFIG_MTD_COMPLEX_MAPPINGS is not set
350CONFIG_MTD_PHYSMAP=y 350CONFIG_MTD_PHYSMAP=y
351CONFIG_MTD_PHYSMAP_START=0x10000000 351CONFIG_MTD_PHYSMAP_START=0
352CONFIG_MTD_PHYSMAP_LEN=0x800000 352CONFIG_MTD_PHYSMAP_LEN=0
353CONFIG_MTD_PHYSMAP_BANKWIDTH=2 353CONFIG_MTD_PHYSMAP_BANKWIDTH=0
354# CONFIG_MTD_ARM_INTEGRATOR is not set 354# CONFIG_MTD_ARM_INTEGRATOR is not set
355# CONFIG_MTD_IMPA7 is not set 355# CONFIG_MTD_IMPA7 is not set
356# CONFIG_MTD_PLATRAM is not set 356# CONFIG_MTD_PLATRAM is not set
@@ -566,7 +566,9 @@ CONFIG_AT91RM9200_WATCHDOG=y
566# CONFIG_USBPCWATCHDOG is not set 566# CONFIG_USBPCWATCHDOG is not set
567# CONFIG_NVRAM is not set 567# CONFIG_NVRAM is not set
568# CONFIG_RTC is not set 568# CONFIG_RTC is not set
569CONFIG_AT91_RTC=y 569CONFIG_RTC_LIB=y
570CONFIG_RTC_CLASS=y
571CONFIG_RTC_DRV_AT91RM9200=y
570# CONFIG_DTLK is not set 572# CONFIG_DTLK is not set
571# CONFIG_R3964 is not set 573# CONFIG_R3964 is not set
572 574
diff --git a/arch/arm/mach-at91rm9200/board-dk.c b/arch/arm/mach-at91rm9200/board-dk.c
index c699f3984d4b..314e1f769ea6 100644
--- a/arch/arm/mach-at91rm9200/board-dk.c
+++ b/arch/arm/mach-at91rm9200/board-dk.c
@@ -27,6 +27,7 @@
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/spi/spi.h> 29#include <linux/spi/spi.h>
30#include <linux/mtd/physmap.h>
30 31
31#include <asm/hardware.h> 32#include <asm/hardware.h>
32#include <asm/setup.h> 33#include <asm/setup.h>
@@ -39,6 +40,7 @@
39 40
40#include <asm/arch/board.h> 41#include <asm/arch/board.h>
41#include <asm/arch/gpio.h> 42#include <asm/arch/gpio.h>
43#include <asm/arch/at91rm9200_mc.h>
42 44
43#include "generic.h" 45#include "generic.h"
44 46
@@ -145,6 +147,30 @@ static struct at91_nand_data __initdata dk_nand_data = {
145 .partition_info = nand_partitions, 147 .partition_info = nand_partitions,
146}; 148};
147 149
150#define DK_FLASH_BASE AT91_CHIPSELECT_0
151#define DK_FLASH_SIZE 0x200000
152
153static struct physmap_flash_data dk_flash_data = {
154 .width = 2,
155};
156
157static struct resource dk_flash_resource = {
158 .start = DK_FLASH_BASE,
159 .end = DK_FLASH_BASE + DK_FLASH_SIZE - 1,
160 .flags = IORESOURCE_MEM,
161};
162
163static struct platform_device dk_flash = {
164 .name = "physmap-flash",
165 .id = 0,
166 .dev = {
167 .platform_data = &dk_flash_data,
168 },
169 .resource = &dk_flash_resource,
170 .num_resources = 1,
171};
172
173
148static void __init dk_board_init(void) 174static void __init dk_board_init(void)
149{ 175{
150 /* Serial */ 176 /* Serial */
@@ -172,6 +198,8 @@ static void __init dk_board_init(void)
172#endif 198#endif
173 /* NAND */ 199 /* NAND */
174 at91_add_device_nand(&dk_nand_data); 200 at91_add_device_nand(&dk_nand_data);
201 /* NOR Flash */
202 platform_device_register(&dk_flash);
175 /* VGA */ 203 /* VGA */
176// dk_add_device_video(); 204// dk_add_device_video();
177} 205}
diff --git a/arch/arm/mach-at91rm9200/board-ek.c b/arch/arm/mach-at91rm9200/board-ek.c
index 830eb7932178..9fcfa0666351 100644
--- a/arch/arm/mach-at91rm9200/board-ek.c
+++ b/arch/arm/mach-at91rm9200/board-ek.c
@@ -27,6 +27,7 @@
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/spi/spi.h> 29#include <linux/spi/spi.h>
30#include <linux/mtd/physmap.h>
30 31
31#include <asm/hardware.h> 32#include <asm/hardware.h>
32#include <asm/setup.h> 33#include <asm/setup.h>
@@ -39,6 +40,7 @@
39 40
40#include <asm/arch/board.h> 41#include <asm/arch/board.h>
41#include <asm/arch/gpio.h> 42#include <asm/arch/gpio.h>
43#include <asm/arch/at91rm9200_mc.h>
42 44
43#include "generic.h" 45#include "generic.h"
44 46
@@ -107,6 +109,30 @@ static struct spi_board_info ek_spi_devices[] = {
107#endif 109#endif
108}; 110};
109 111
112#define EK_FLASH_BASE AT91_CHIPSELECT_0
113#define EK_FLASH_SIZE 0x200000
114
115static struct physmap_flash_data ek_flash_data = {
116 .width = 2,
117};
118
119static struct resource ek_flash_resource = {
120 .start = EK_FLASH_BASE,
121 .end = EK_FLASH_BASE + EK_FLASH_SIZE - 1,
122 .flags = IORESOURCE_MEM,
123};
124
125static struct platform_device ek_flash = {
126 .name = "physmap-flash",
127 .id = 0,
128 .dev = {
129 .platform_data = &ek_flash_data,
130 },
131 .resource = &ek_flash_resource,
132 .num_resources = 1,
133};
134
135
110static void __init ek_board_init(void) 136static void __init ek_board_init(void)
111{ 137{
112 /* Serial */ 138 /* Serial */
@@ -130,6 +156,8 @@ static void __init ek_board_init(void)
130 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ 156 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
131 at91_add_device_mmc(&ek_mmc_data); 157 at91_add_device_mmc(&ek_mmc_data);
132#endif 158#endif
159 /* NOR Flash */
160 platform_device_register(&ek_flash);
133 /* VGA */ 161 /* VGA */
134// ek_add_device_video(); 162// ek_add_device_video();
135} 163}