Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] 5393/1: Add W90P910 EVB NOR flash driver

Add W90P910 Evaluate Board NOR flash driver support,
The EV Board default support W19B320ABT7H of Winbond inc.

Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

wanzongshun and committed by
Russell King
a12370f1 9ee8c9f0

+48
+48
arch/arm/mach-w90x900/mach-w90p910evb.c
··· 22 22 #include <linux/timer.h> 23 23 #include <linux/init.h> 24 24 #include <linux/platform_device.h> 25 + #include <linux/mtd/physmap.h> 25 26 26 27 #include <asm/mach/arch.h> 27 28 #include <asm/mach/map.h> ··· 33 32 #include <mach/map.h> 34 33 35 34 #include "cpu.h" 35 + /*w90p910 evb norflash driver data */ 36 + 37 + #define W90P910_FLASH_BASE 0xA0000000 38 + #define W90P910_FLASH_SIZE 0x400000 39 + 40 + static struct mtd_partition w90p910_flash_partitions[] = { 41 + { 42 + .name = "NOR Partition 1 for kernel (960K)", 43 + .size = 0xF0000, 44 + .offset = 0x10000, 45 + }, 46 + { 47 + .name = "NOR Partition 2 for image (1M)", 48 + .size = 0x100000, 49 + .offset = 0x100000, 50 + }, 51 + { 52 + .name = "NOR Partition 3 for user (2M)", 53 + .size = 0x200000, 54 + .offset = 0x00200000, 55 + } 56 + }; 57 + 58 + static struct physmap_flash_data w90p910_flash_data = { 59 + .width = 2, 60 + .parts = w90p910_flash_partitions, 61 + .nr_parts = ARRAY_SIZE(w90p910_flash_partitions), 62 + }; 63 + 64 + static struct resource w90p910_flash_resources[] = { 65 + { 66 + .start = W90P910_FLASH_BASE, 67 + .end = W90P910_FLASH_BASE + W90P910_FLASH_SIZE - 1, 68 + .flags = IORESOURCE_MEM, 69 + } 70 + }; 71 + 72 + static struct platform_device w90p910_flash_device = { 73 + .name = "physmap-flash", 74 + .id = 0, 75 + .dev = { 76 + .platform_data = &w90p910_flash_data, 77 + }, 78 + .resource = w90p910_flash_resources, 79 + .num_resources = ARRAY_SIZE(w90p910_flash_resources), 80 + }; 36 81 37 82 static struct map_desc w90p910_iodesc[] __initdata = { 38 83 }; ··· 87 40 88 41 static struct platform_device *w90p910evb_dev[] __initdata = { 89 42 &w90p910_serial_device, 43 + &w90p910_flash_device, 90 44 }; 91 45 92 46 static void __init w90p910evb_map_io(void)