diff options
-rw-r--r-- | arch/arm/mach-ep93xx/adssphere.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-ep93xx/core.c | 38 | ||||
-rw-r--r-- | arch/arm/mach-ep93xx/edb93xx.c | 31 | ||||
-rw-r--r-- | arch/arm/mach-ep93xx/gesbc9312.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-ep93xx/include/mach/platform.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-ep93xx/micro9.c | 37 | ||||
-rw-r--r-- | arch/arm/mach-ep93xx/simone.c | 24 | ||||
-rw-r--r-- | arch/arm/mach-ep93xx/ts72xx.c | 27 |
8 files changed, 59 insertions, 149 deletions
diff --git a/arch/arm/mach-ep93xx/adssphere.c b/arch/arm/mach-ep93xx/adssphere.c index 3a1a855bfdca..f744f676783f 100644 --- a/arch/arm/mach-ep93xx/adssphere.c +++ b/arch/arm/mach-ep93xx/adssphere.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/mtd/physmap.h> | ||
17 | 16 | ||
18 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
19 | 18 | ||
@@ -21,26 +20,6 @@ | |||
21 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
22 | 21 | ||
23 | 22 | ||
24 | static struct physmap_flash_data adssphere_flash_data = { | ||
25 | .width = 4, | ||
26 | }; | ||
27 | |||
28 | static struct resource adssphere_flash_resource = { | ||
29 | .start = EP93XX_CS6_PHYS_BASE, | ||
30 | .end = EP93XX_CS6_PHYS_BASE + SZ_32M - 1, | ||
31 | .flags = IORESOURCE_MEM, | ||
32 | }; | ||
33 | |||
34 | static struct platform_device adssphere_flash = { | ||
35 | .name = "physmap-flash", | ||
36 | .id = 0, | ||
37 | .dev = { | ||
38 | .platform_data = &adssphere_flash_data, | ||
39 | }, | ||
40 | .num_resources = 1, | ||
41 | .resource = &adssphere_flash_resource, | ||
42 | }; | ||
43 | |||
44 | static struct ep93xx_eth_data __initdata adssphere_eth_data = { | 23 | static struct ep93xx_eth_data __initdata adssphere_eth_data = { |
45 | .phy_id = 1, | 24 | .phy_id = 1, |
46 | }; | 25 | }; |
@@ -48,8 +27,7 @@ static struct ep93xx_eth_data __initdata adssphere_eth_data = { | |||
48 | static void __init adssphere_init_machine(void) | 27 | static void __init adssphere_init_machine(void) |
49 | { | 28 | { |
50 | ep93xx_init_devices(); | 29 | ep93xx_init_devices(); |
51 | platform_device_register(&adssphere_flash); | 30 | ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M); |
52 | |||
53 | ep93xx_register_eth(&adssphere_eth_data, 1); | 31 | ep93xx_register_eth(&adssphere_eth_data, 1); |
54 | } | 32 | } |
55 | 33 | ||
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index ac6aeeb974d6..f4b25bf00b64 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/termios.h> | 29 | #include <linux/termios.h> |
30 | #include <linux/amba/bus.h> | 30 | #include <linux/amba/bus.h> |
31 | #include <linux/amba/serial.h> | 31 | #include <linux/amba/serial.h> |
32 | #include <linux/mtd/physmap.h> | ||
32 | #include <linux/i2c.h> | 33 | #include <linux/i2c.h> |
33 | #include <linux/i2c-gpio.h> | 34 | #include <linux/i2c-gpio.h> |
34 | #include <linux/spi/spi.h> | 35 | #include <linux/spi/spi.h> |
@@ -348,6 +349,43 @@ static struct platform_device ep93xx_ohci_device = { | |||
348 | 349 | ||
349 | 350 | ||
350 | /************************************************************************* | 351 | /************************************************************************* |
352 | * EP93xx physmap'ed flash | ||
353 | *************************************************************************/ | ||
354 | static struct physmap_flash_data ep93xx_flash_data; | ||
355 | |||
356 | static struct resource ep93xx_flash_resource = { | ||
357 | .flags = IORESOURCE_MEM, | ||
358 | }; | ||
359 | |||
360 | static struct platform_device ep93xx_flash = { | ||
361 | .name = "physmap-flash", | ||
362 | .id = 0, | ||
363 | .dev = { | ||
364 | .platform_data = &ep93xx_flash_data, | ||
365 | }, | ||
366 | .num_resources = 1, | ||
367 | .resource = &ep93xx_flash_resource, | ||
368 | }; | ||
369 | |||
370 | /** | ||
371 | * ep93xx_register_flash() - Register the external flash device. | ||
372 | * @width: bank width in octets | ||
373 | * @start: resource start address | ||
374 | * @size: resource size | ||
375 | */ | ||
376 | void __init ep93xx_register_flash(unsigned int width, | ||
377 | resource_size_t start, resource_size_t size) | ||
378 | { | ||
379 | ep93xx_flash_data.width = width; | ||
380 | |||
381 | ep93xx_flash_resource.start = start; | ||
382 | ep93xx_flash_resource.end = start + size - 1; | ||
383 | |||
384 | platform_device_register(&ep93xx_flash); | ||
385 | } | ||
386 | |||
387 | |||
388 | /************************************************************************* | ||
351 | * EP93xx ethernet peripheral handling | 389 | * EP93xx ethernet peripheral handling |
352 | *************************************************************************/ | 390 | *************************************************************************/ |
353 | static struct ep93xx_eth_data ep93xx_eth_data; | 391 | static struct ep93xx_eth_data ep93xx_eth_data; |
diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c index 3884182cd362..c2ce9034ba87 100644 --- a/arch/arm/mach-ep93xx/edb93xx.c +++ b/arch/arm/mach-ep93xx/edb93xx.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
30 | #include <linux/mtd/physmap.h> | ||
31 | #include <linux/gpio.h> | 30 | #include <linux/gpio.h> |
32 | #include <linux/i2c.h> | 31 | #include <linux/i2c.h> |
33 | #include <linux/i2c-gpio.h> | 32 | #include <linux/i2c-gpio.h> |
@@ -38,39 +37,13 @@ | |||
38 | #include <asm/mach/arch.h> | 37 | #include <asm/mach/arch.h> |
39 | 38 | ||
40 | 39 | ||
41 | static struct physmap_flash_data edb93xx_flash_data; | ||
42 | |||
43 | static struct resource edb93xx_flash_resource = { | ||
44 | .flags = IORESOURCE_MEM, | ||
45 | }; | ||
46 | |||
47 | static struct platform_device edb93xx_flash = { | ||
48 | .name = "physmap-flash", | ||
49 | .id = 0, | ||
50 | .dev = { | ||
51 | .platform_data = &edb93xx_flash_data, | ||
52 | }, | ||
53 | .num_resources = 1, | ||
54 | .resource = &edb93xx_flash_resource, | ||
55 | }; | ||
56 | |||
57 | static void __init __edb93xx_register_flash(unsigned int width, | ||
58 | resource_size_t start, resource_size_t size) | ||
59 | { | ||
60 | edb93xx_flash_data.width = width; | ||
61 | edb93xx_flash_resource.start = start; | ||
62 | edb93xx_flash_resource.end = start + size - 1; | ||
63 | |||
64 | platform_device_register(&edb93xx_flash); | ||
65 | } | ||
66 | |||
67 | static void __init edb93xx_register_flash(void) | 40 | static void __init edb93xx_register_flash(void) |
68 | { | 41 | { |
69 | if (machine_is_edb9307() || machine_is_edb9312() || | 42 | if (machine_is_edb9307() || machine_is_edb9312() || |
70 | machine_is_edb9315()) { | 43 | machine_is_edb9315()) { |
71 | __edb93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M); | 44 | ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M); |
72 | } else { | 45 | } else { |
73 | __edb93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M); | 46 | ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M); |
74 | } | 47 | } |
75 | } | 48 | } |
76 | 49 | ||
diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c index a809618e9f05..d97168c0ba33 100644 --- a/arch/arm/mach-ep93xx/gesbc9312.c +++ b/arch/arm/mach-ep93xx/gesbc9312.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/mtd/physmap.h> | ||
17 | 16 | ||
18 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
19 | 18 | ||
@@ -21,26 +20,6 @@ | |||
21 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
22 | 21 | ||
23 | 22 | ||
24 | static struct physmap_flash_data gesbc9312_flash_data = { | ||
25 | .width = 4, | ||
26 | }; | ||
27 | |||
28 | static struct resource gesbc9312_flash_resource = { | ||
29 | .start = EP93XX_CS6_PHYS_BASE, | ||
30 | .end = EP93XX_CS6_PHYS_BASE + SZ_8M - 1, | ||
31 | .flags = IORESOURCE_MEM, | ||
32 | }; | ||
33 | |||
34 | static struct platform_device gesbc9312_flash = { | ||
35 | .name = "physmap-flash", | ||
36 | .id = 0, | ||
37 | .dev = { | ||
38 | .platform_data = &gesbc9312_flash_data, | ||
39 | }, | ||
40 | .num_resources = 1, | ||
41 | .resource = &gesbc9312_flash_resource, | ||
42 | }; | ||
43 | |||
44 | static struct ep93xx_eth_data __initdata gesbc9312_eth_data = { | 23 | static struct ep93xx_eth_data __initdata gesbc9312_eth_data = { |
45 | .phy_id = 1, | 24 | .phy_id = 1, |
46 | }; | 25 | }; |
@@ -48,8 +27,7 @@ static struct ep93xx_eth_data __initdata gesbc9312_eth_data = { | |||
48 | static void __init gesbc9312_init_machine(void) | 27 | static void __init gesbc9312_init_machine(void) |
49 | { | 28 | { |
50 | ep93xx_init_devices(); | 29 | ep93xx_init_devices(); |
51 | platform_device_register(&gesbc9312_flash); | 30 | ep93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_8M); |
52 | |||
53 | ep93xx_register_eth(&gesbc9312_eth_data, 0); | 31 | ep93xx_register_eth(&gesbc9312_eth_data, 0); |
54 | } | 32 | } |
55 | 33 | ||
diff --git a/arch/arm/mach-ep93xx/include/mach/platform.h b/arch/arm/mach-ep93xx/include/mach/platform.h index 9a4413dd44bb..a6c09176334c 100644 --- a/arch/arm/mach-ep93xx/include/mach/platform.h +++ b/arch/arm/mach-ep93xx/include/mach/platform.h | |||
@@ -43,6 +43,9 @@ static inline void ep93xx_devcfg_clear_bits(unsigned int bits) | |||
43 | 43 | ||
44 | unsigned int ep93xx_chip_revision(void); | 44 | unsigned int ep93xx_chip_revision(void); |
45 | 45 | ||
46 | void ep93xx_register_flash(unsigned int width, | ||
47 | resource_size_t start, resource_size_t size); | ||
48 | |||
46 | void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); | 49 | void ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr); |
47 | void ep93xx_register_i2c(struct i2c_gpio_platform_data *data, | 50 | void ep93xx_register_i2c(struct i2c_gpio_platform_data *data, |
48 | struct i2c_board_info *devices, int num); | 51 | struct i2c_board_info *devices, int num); |
diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c index 1cc911b4efa6..2ba776320a82 100644 --- a/arch/arm/mach-ep93xx/micro9.c +++ b/arch/arm/mach-ep93xx/micro9.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/mtd/physmap.h> | ||
18 | #include <linux/io.h> | 17 | #include <linux/io.h> |
19 | 18 | ||
20 | #include <mach/hardware.h> | 19 | #include <mach/hardware.h> |
@@ -31,31 +30,6 @@ | |||
31 | * Micro9-Lite uses a separate MTD map driver for flash support | 30 | * Micro9-Lite uses a separate MTD map driver for flash support |
32 | * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1 | 31 | * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1 |
33 | *************************************************************************/ | 32 | *************************************************************************/ |
34 | static struct physmap_flash_data micro9_flash_data; | ||
35 | |||
36 | static struct resource micro9_flash_resource = { | ||
37 | .start = EP93XX_CS1_PHYS_BASE, | ||
38 | .end = EP93XX_CS1_PHYS_BASE + SZ_64M - 1, | ||
39 | .flags = IORESOURCE_MEM, | ||
40 | }; | ||
41 | |||
42 | static struct platform_device micro9_flash = { | ||
43 | .name = "physmap-flash", | ||
44 | .id = 0, | ||
45 | .dev = { | ||
46 | .platform_data = µ9_flash_data, | ||
47 | }, | ||
48 | .num_resources = 1, | ||
49 | .resource = µ9_flash_resource, | ||
50 | }; | ||
51 | |||
52 | static void __init __micro9_register_flash(unsigned int width) | ||
53 | { | ||
54 | micro9_flash_data.width = width; | ||
55 | |||
56 | platform_device_register(µ9_flash); | ||
57 | } | ||
58 | |||
59 | static unsigned int __init micro9_detect_bootwidth(void) | 33 | static unsigned int __init micro9_detect_bootwidth(void) |
60 | { | 34 | { |
61 | u32 v; | 35 | u32 v; |
@@ -70,10 +44,17 @@ static unsigned int __init micro9_detect_bootwidth(void) | |||
70 | 44 | ||
71 | static void __init micro9_register_flash(void) | 45 | static void __init micro9_register_flash(void) |
72 | { | 46 | { |
47 | unsigned int width; | ||
48 | |||
73 | if (machine_is_micro9()) | 49 | if (machine_is_micro9()) |
74 | __micro9_register_flash(4); | 50 | width = 4; |
75 | else if (machine_is_micro9m() || machine_is_micro9s()) | 51 | else if (machine_is_micro9m() || machine_is_micro9s()) |
76 | __micro9_register_flash(micro9_detect_bootwidth()); | 52 | width = micro9_detect_bootwidth(); |
53 | else | ||
54 | width = 0; | ||
55 | |||
56 | if (width) | ||
57 | ep93xx_register_flash(width, EP93XX_CS1_PHYS_BASE, SZ_64M); | ||
77 | } | 58 | } |
78 | 59 | ||
79 | 60 | ||
diff --git a/arch/arm/mach-ep93xx/simone.c b/arch/arm/mach-ep93xx/simone.c index 388aec95f60e..5dded5884133 100644 --- a/arch/arm/mach-ep93xx/simone.c +++ b/arch/arm/mach-ep93xx/simone.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/mtd/physmap.h> | ||
22 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
23 | #include <linux/i2c.h> | 22 | #include <linux/i2c.h> |
24 | #include <linux/i2c-gpio.h> | 23 | #include <linux/i2c-gpio.h> |
@@ -29,26 +28,6 @@ | |||
29 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
30 | #include <asm/mach/arch.h> | 29 | #include <asm/mach/arch.h> |
31 | 30 | ||
32 | static struct physmap_flash_data simone_flash_data = { | ||
33 | .width = 2, | ||
34 | }; | ||
35 | |||
36 | static struct resource simone_flash_resource = { | ||
37 | .start = EP93XX_CS6_PHYS_BASE, | ||
38 | .end = EP93XX_CS6_PHYS_BASE + SZ_8M - 1, | ||
39 | .flags = IORESOURCE_MEM, | ||
40 | }; | ||
41 | |||
42 | static struct platform_device simone_flash = { | ||
43 | .name = "physmap-flash", | ||
44 | .id = 0, | ||
45 | .num_resources = 1, | ||
46 | .resource = &simone_flash_resource, | ||
47 | .dev = { | ||
48 | .platform_data = &simone_flash_data, | ||
49 | }, | ||
50 | }; | ||
51 | |||
52 | static struct ep93xx_eth_data __initdata simone_eth_data = { | 31 | static struct ep93xx_eth_data __initdata simone_eth_data = { |
53 | .phy_id = 1, | 32 | .phy_id = 1, |
54 | }; | 33 | }; |
@@ -77,8 +56,7 @@ static struct i2c_board_info __initdata simone_i2c_board_info[] = { | |||
77 | static void __init simone_init_machine(void) | 56 | static void __init simone_init_machine(void) |
78 | { | 57 | { |
79 | ep93xx_init_devices(); | 58 | ep93xx_init_devices(); |
80 | 59 | ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_8M); | |
81 | platform_device_register(&simone_flash); | ||
82 | ep93xx_register_eth(&simone_eth_data, 1); | 60 | ep93xx_register_eth(&simone_eth_data, 1); |
83 | ep93xx_register_fb(&simone_fb_info); | 61 | ep93xx_register_fb(&simone_fb_info); |
84 | ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info, | 62 | ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info, |
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index ae7319e588c7..93aeab8af705 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <linux/m48t86.h> | 19 | #include <linux/m48t86.h> |
20 | #include <linux/mtd/physmap.h> | ||
21 | #include <linux/mtd/nand.h> | 20 | #include <linux/mtd/nand.h> |
22 | #include <linux/mtd/partitions.h> | 21 | #include <linux/mtd/partitions.h> |
23 | 22 | ||
@@ -173,31 +172,13 @@ static struct platform_device ts72xx_nand_flash = { | |||
173 | }; | 172 | }; |
174 | 173 | ||
175 | 174 | ||
176 | /************************************************************************* | ||
177 | * NOR flash (TS-7200 only) | ||
178 | *************************************************************************/ | ||
179 | static struct physmap_flash_data ts72xx_nor_data = { | ||
180 | .width = 2, | ||
181 | }; | ||
182 | |||
183 | static struct resource ts72xx_nor_resource = { | ||
184 | .start = EP93XX_CS6_PHYS_BASE, | ||
185 | .end = EP93XX_CS6_PHYS_BASE + SZ_16M - 1, | ||
186 | .flags = IORESOURCE_MEM, | ||
187 | }; | ||
188 | |||
189 | static struct platform_device ts72xx_nor_flash = { | ||
190 | .name = "physmap-flash", | ||
191 | .id = 0, | ||
192 | .dev.platform_data = &ts72xx_nor_data, | ||
193 | .resource = &ts72xx_nor_resource, | ||
194 | .num_resources = 1, | ||
195 | }; | ||
196 | |||
197 | static void __init ts72xx_register_flash(void) | 175 | static void __init ts72xx_register_flash(void) |
198 | { | 176 | { |
177 | /* | ||
178 | * TS7200 has NOR flash all other TS72xx board have NAND flash. | ||
179 | */ | ||
199 | if (board_is_ts7200()) { | 180 | if (board_is_ts7200()) { |
200 | platform_device_register(&ts72xx_nor_flash); | 181 | ep93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M); |
201 | } else { | 182 | } else { |
202 | resource_size_t start; | 183 | resource_size_t start; |
203 | 184 | ||