diff options
| author | Andrew Victor <andrew@sanpeople.com> | 2007-02-08 04:44:46 -0500 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-02-08 09:55:28 -0500 |
| commit | 127a7ec69c9ce17a5add2e3c8c2f1a2733fb88d8 (patch) | |
| tree | 567a4afea8e41ab8e8f97bc0e919a2cd9ede5903 | |
| parent | c177a1e75a07237efe1f68fbf430892fdf2bb868 (diff) | |
[ARM] 4148/1: AT91: Physically mapped flash on CSB337 and CSB637 boards.
Define the physically mapped flash on the Cogent CSB337 and CSB637
boards.
Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| -rw-r--r-- | arch/arm/configs/csb337_defconfig | 6 | ||||
| -rw-r--r-- | arch/arm/configs/csb637_defconfig | 6 | ||||
| -rw-r--r-- | arch/arm/mach-at91/board-csb337.c | 39 | ||||
| -rw-r--r-- | arch/arm/mach-at91/board-csb637.c | 39 |
4 files changed, 86 insertions, 4 deletions
diff --git a/arch/arm/configs/csb337_defconfig b/arch/arm/configs/csb337_defconfig index 2cadd51506bb..8e55f55333be 100644 --- a/arch/arm/configs/csb337_defconfig +++ b/arch/arm/configs/csb337_defconfig | |||
| @@ -355,10 +355,12 @@ CONFIG_MTD_CFI_UTIL=y | |||
| 355 | # Mapping drivers for chip access | 355 | # Mapping drivers for chip access |
| 356 | # | 356 | # |
| 357 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set | 357 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set |
| 358 | # CONFIG_MTD_PHYSMAP is not set | 358 | CONFIG_MTD_PHYSMAP=y |
| 359 | CONFIG_MTD_PHYSMAP_START=0 | ||
| 360 | CONFIG_MTD_PHYSMAP_LEN=0 | ||
| 361 | CONFIG_MTD_PHYSMAP_BANKWIDTH=0 | ||
| 359 | # CONFIG_MTD_ARM_INTEGRATOR is not set | 362 | # CONFIG_MTD_ARM_INTEGRATOR is not set |
| 360 | # CONFIG_MTD_PLATRAM is not set | 363 | # CONFIG_MTD_PLATRAM is not set |
| 361 | CONFIG_MTD_CSB337=y | ||
| 362 | 364 | ||
| 363 | # | 365 | # |
| 364 | # Self-contained MTD device drivers | 366 | # Self-contained MTD device drivers |
diff --git a/arch/arm/configs/csb637_defconfig b/arch/arm/configs/csb637_defconfig index 94908c1df4cf..669f035896f9 100644 --- a/arch/arm/configs/csb637_defconfig +++ b/arch/arm/configs/csb637_defconfig | |||
| @@ -355,10 +355,12 @@ CONFIG_MTD_CFI_UTIL=y | |||
| 355 | # Mapping drivers for chip access | 355 | # Mapping drivers for chip access |
| 356 | # | 356 | # |
| 357 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set | 357 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set |
| 358 | # CONFIG_MTD_PHYSMAP is not set | 358 | CONFIG_MTD_PHYSMAP=y |
| 359 | CONFIG_MTD_PHYSMAP_START=0 | ||
| 360 | CONFIG_MTD_PHYSMAP_LEN=0 | ||
| 361 | CONFIG_MTD_PHYSMAP_BANKWIDTH=0 | ||
| 359 | # CONFIG_MTD_ARM_INTEGRATOR is not set | 362 | # CONFIG_MTD_ARM_INTEGRATOR is not set |
| 360 | # CONFIG_MTD_PLATRAM is not set | 363 | # CONFIG_MTD_PLATRAM is not set |
| 361 | CONFIG_MTD_CSB637=y | ||
| 362 | 364 | ||
| 363 | # | 365 | # |
| 364 | # Self-contained MTD device drivers | 366 | # Self-contained MTD device drivers |
diff --git a/arch/arm/mach-at91/board-csb337.c b/arch/arm/mach-at91/board-csb337.c index 871c6609d6ec..e18a41e61f0c 100644 --- a/arch/arm/mach-at91/board-csb337.c +++ b/arch/arm/mach-at91/board-csb337.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
| 25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
| 26 | #include <linux/spi/spi.h> | 26 | #include <linux/spi/spi.h> |
| 27 | #include <linux/mtd/physmap.h> | ||
| 27 | 28 | ||
| 28 | #include <asm/hardware.h> | 29 | #include <asm/hardware.h> |
| 29 | #include <asm/setup.h> | 30 | #include <asm/setup.h> |
| @@ -112,6 +113,42 @@ static struct spi_board_info csb337_spi_devices[] = { | |||
| 112 | }, | 113 | }, |
| 113 | }; | 114 | }; |
| 114 | 115 | ||
| 116 | #define CSB_FLASH_BASE AT91_CHIPSELECT_0 | ||
| 117 | #define CSB_FLASH_SIZE 0x800000 | ||
| 118 | |||
| 119 | static struct mtd_partition csb_flash_partitions[] = { | ||
| 120 | { | ||
| 121 | .name = "uMON flash", | ||
| 122 | .offset = 0, | ||
| 123 | .size = MTDPART_SIZ_FULL, | ||
| 124 | .mask_flags = MTD_WRITEABLE, /* read only */ | ||
| 125 | } | ||
| 126 | }; | ||
| 127 | |||
| 128 | static struct physmap_flash_data csb_flash_data = { | ||
| 129 | .width = 2, | ||
| 130 | .parts = csb_flash_partitions, | ||
| 131 | .nr_parts = ARRAY_SIZE(csb_flash_partitions), | ||
| 132 | }; | ||
| 133 | |||
| 134 | static struct resource csb_flash_resources[] = { | ||
| 135 | { | ||
| 136 | .start = CSB_FLASH_BASE, | ||
| 137 | .end = CSB_FLASH_BASE + CSB_FLASH_SIZE - 1, | ||
| 138 | .flags = IORESOURCE_MEM, | ||
| 139 | } | ||
| 140 | }; | ||
| 141 | |||
| 142 | static struct platform_device csb_flash = { | ||
| 143 | .name = "physmap-flash", | ||
| 144 | .id = 0, | ||
| 145 | .dev = { | ||
| 146 | .platform_data = &csb_flash_data, | ||
| 147 | }, | ||
| 148 | .resource = csb_flash_resources, | ||
| 149 | .num_resources = ARRAY_SIZE(csb_flash_resources), | ||
| 150 | }; | ||
| 151 | |||
| 115 | static void __init csb337_board_init(void) | 152 | static void __init csb337_board_init(void) |
| 116 | { | 153 | { |
| 117 | /* Serial */ | 154 | /* Serial */ |
| @@ -131,6 +168,8 @@ static void __init csb337_board_init(void) | |||
| 131 | at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices)); | 168 | at91_add_device_spi(csb337_spi_devices, ARRAY_SIZE(csb337_spi_devices)); |
| 132 | /* MMC */ | 169 | /* MMC */ |
| 133 | at91_add_device_mmc(0, &csb337_mmc_data); | 170 | at91_add_device_mmc(0, &csb337_mmc_data); |
| 171 | /* NOR flash */ | ||
| 172 | platform_device_register(&csb_flash); | ||
| 134 | } | 173 | } |
| 135 | 174 | ||
| 136 | MACHINE_START(CSB337, "Cogent CSB337") | 175 | MACHINE_START(CSB337, "Cogent CSB337") |
diff --git a/arch/arm/mach-at91/board-csb637.c b/arch/arm/mach-at91/board-csb637.c index 774609479c74..77f04b935b3a 100644 --- a/arch/arm/mach-at91/board-csb637.c +++ b/arch/arm/mach-at91/board-csb637.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
| 24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
| 25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
| 26 | #include <linux/mtd/physmap.h> | ||
| 26 | 27 | ||
| 27 | #include <asm/hardware.h> | 28 | #include <asm/hardware.h> |
| 28 | #include <asm/setup.h> | 29 | #include <asm/setup.h> |
| @@ -81,6 +82,42 @@ static struct at91_udc_data __initdata csb637_udc_data = { | |||
| 81 | .pullup_pin = AT91_PIN_PB1, | 82 | .pullup_pin = AT91_PIN_PB1, |
| 82 | }; | 83 | }; |
| 83 | 84 | ||
| 85 | #define CSB_FLASH_BASE AT91_CHIPSELECT_0 | ||
| 86 | #define CSB_FLASH_SIZE 0x1000000 | ||
| 87 | |||
| 88 | static struct mtd_partition csb_flash_partitions[] = { | ||
| 89 | { | ||
| 90 | .name = "uMON flash", | ||
| 91 | .offset = 0, | ||
| 92 | .size = MTDPART_SIZ_FULL, | ||
| 93 | .mask_flags = MTD_WRITEABLE, /* read only */ | ||
| 94 | } | ||
| 95 | }; | ||
| 96 | |||
| 97 | static struct physmap_flash_data csb_flash_data = { | ||
| 98 | .width = 2, | ||
| 99 | .parts = csb_flash_partitions, | ||
| 100 | .nr_parts = ARRAY_SIZE(csb_flash_partitions), | ||
| 101 | }; | ||
| 102 | |||
| 103 | static struct resource csb_flash_resources[] = { | ||
| 104 | { | ||
| 105 | .start = CSB_FLASH_BASE, | ||
| 106 | .end = CSB_FLASH_BASE + CSB_FLASH_SIZE - 1, | ||
| 107 | .flags = IORESOURCE_MEM, | ||
| 108 | } | ||
| 109 | }; | ||
| 110 | |||
| 111 | static struct platform_device csb_flash = { | ||
| 112 | .name = "physmap-flash", | ||
| 113 | .id = 0, | ||
| 114 | .dev = { | ||
| 115 | .platform_data = &csb_flash_data, | ||
| 116 | }, | ||
| 117 | .resource = csb_flash_resources, | ||
| 118 | .num_resources = ARRAY_SIZE(csb_flash_resources), | ||
| 119 | }; | ||
| 120 | |||
| 84 | static void __init csb637_board_init(void) | 121 | static void __init csb637_board_init(void) |
| 85 | { | 122 | { |
| 86 | /* Serial */ | 123 | /* Serial */ |
| @@ -95,6 +132,8 @@ static void __init csb637_board_init(void) | |||
| 95 | at91_add_device_i2c(); | 132 | at91_add_device_i2c(); |
| 96 | /* SPI */ | 133 | /* SPI */ |
| 97 | at91_add_device_spi(NULL, 0); | 134 | at91_add_device_spi(NULL, 0); |
| 135 | /* NOR flash */ | ||
| 136 | platform_device_register(&csb_flash); | ||
| 98 | } | 137 | } |
| 99 | 138 | ||
| 100 | MACHINE_START(CSB637, "Cogent CSB637") | 139 | MACHINE_START(CSB637, "Cogent CSB637") |
