aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ep93xx/micro9.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ep93xx/micro9.c')
-rw-r--r--arch/arm/mach-ep93xx/micro9.c37
1 files changed, 9 insertions, 28 deletions
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 *************************************************************************/
34static struct physmap_flash_data micro9_flash_data;
35
36static 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
42static struct platform_device micro9_flash = {
43 .name = "physmap-flash",
44 .id = 0,
45 .dev = {
46 .platform_data = &micro9_flash_data,
47 },
48 .num_resources = 1,
49 .resource = &micro9_flash_resource,
50};
51
52static void __init __micro9_register_flash(unsigned int width)
53{
54 micro9_flash_data.width = width;
55
56 platform_device_register(&micro9_flash);
57}
58
59static unsigned int __init micro9_detect_bootwidth(void) 33static 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
71static void __init micro9_register_flash(void) 45static 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