diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2013-05-13 21:07:26 +0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-06-11 15:47:21 -0700 |
commit | 3f0bcaa5e91d0752ccaf2d8d6aa1514dae5e8264 (patch) | |
tree | 7a7c21b2c047200922338d992831b8bca93f6578 /arch/arm/mach-clps711x | |
parent | ba18ec214e4a8a45a164bbb4b2a8af401dd5b408 (diff) |
ARM: clps711x: autcpu12: Add support for NOR flash
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-clps711x')
-rw-r--r-- | arch/arm/mach-clps711x/board-autcpu12.c | 39 | ||||
-rw-r--r-- | arch/arm/mach-clps711x/include/mach/autcpu12.h | 5 |
2 files changed, 37 insertions, 7 deletions
diff --git a/arch/arm/mach-clps711x/board-autcpu12.c b/arch/arm/mach-clps711x/board-autcpu12.c index 78b528aa3ba7..3e22d0b1a9c5 100644 --- a/arch/arm/mach-clps711x/board-autcpu12.c +++ b/arch/arm/mach-clps711x/board-autcpu12.c @@ -26,6 +26,7 @@ #include <linux/gpio.h> #include <linux/ioport.h> #include <linux/interrupt.h> +#include <linux/mtd/physmap.h> #include <linux/mtd/partitions.h> #include <linux/mtd/nand-gpio.h> #include <linux/platform_device.h> @@ -45,12 +46,17 @@ #include "common.h" #include "devices.h" -#define AUTCPU12_CS8900_BASE (CS2_PHYS_BASE + 0x300) -#define AUTCPU12_CS8900_IRQ (IRQ_EINT3) +/* NOR flash */ +#define AUTCPU12_FLASH_BASE (CS0_PHYS_BASE) +/* SmartMedia flash */ #define AUTCPU12_SMC_BASE (CS1_PHYS_BASE + 0x06000000) #define AUTCPU12_SMC_SEL_BASE (AUTCPU12_SMC_BASE + 0x10) +/* Ethernet */ +#define AUTCPU12_CS8900_BASE (CS2_PHYS_BASE + 0x300) +#define AUTCPU12_CS8900_IRQ (IRQ_EINT3) + /* NAND flash */ #define AUTCPU12_MMGPIO_BASE (CLPS711X_NR_GPIO) #define AUTCPU12_SMC_NCE (AUTCPU12_MMGPIO_BASE + 0) /* Bit 0 */ @@ -160,9 +166,38 @@ static const struct gpio autcpu12_gpios[] __initconst = { { AUTCPU12_DPOT_UD, GPIOF_OUT_INIT_LOW, "DPOT UD" }, }; +static struct mtd_partition autcpu12_flash_partitions[] = { + { + .name = "NOR.0", + .offset = 0, + .size = MTDPART_SIZ_FULL, + }, +}; + +static struct physmap_flash_data autcpu12_flash_pdata = { + .width = 4, + .parts = autcpu12_flash_partitions, + .nr_parts = ARRAY_SIZE(autcpu12_flash_partitions), +}; + +static struct resource autcpu12_flash_resources[] __initdata = { + DEFINE_RES_MEM(AUTCPU12_FLASH_BASE, SZ_8M), +}; + +static struct platform_device autcpu12_flash_pdev __initdata = { + .name = "physmap-flash", + .id = 0, + .resource = autcpu12_flash_resources, + .num_resources = ARRAY_SIZE(autcpu12_flash_resources), + .dev = { + .platform_data = &autcpu12_flash_pdata, + }, +}; + static void __init autcpu12_init(void) { clps711x_devices_init(); + platform_device_register(&autcpu12_flash_pdev); platform_device_register_simple("video-clps711x", 0, NULL, 0); platform_device_register_simple("cs89x0", 0, autcpu12_cs8900_resource, ARRAY_SIZE(autcpu12_cs8900_resource)); diff --git a/arch/arm/mach-clps711x/include/mach/autcpu12.h b/arch/arm/mach-clps711x/include/mach/autcpu12.h index b95d60a79b30..0db6f1869f01 100644 --- a/arch/arm/mach-clps711x/include/mach/autcpu12.h +++ b/arch/arm/mach-clps711x/include/mach/autcpu12.h @@ -20,11 +20,6 @@ #ifndef __ASM_ARCH_AUTCPU12_H #define __ASM_ARCH_AUTCPU12_H -/* - * The flash bank is wired to chip select 0 - */ -#define AUTCPU12_PHYS_FLASH CS0_PHYS_BASE /* physical */ - /* offset for device specific information structure */ #define AUTCPU12_LCDINFO_OFFS (0x00010000) |