aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ep93xx/micro9.c
diff options
context:
space:
mode:
authorHubert Feurstein <hubert.feurstein@contec.at>2009-10-07 03:39:09 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-10-07 08:15:15 -0400
commit14636005fff800d4131dfe89927207a564efcc17 (patch)
treecdccbe42eef6557462aae7d405d7667a14676b4a /arch/arm/mach-ep93xx/micro9.c
parent941500954470e04679ff6e3cff0f82d8dbd2b6c3 (diff)
ARM: 5750/1: ep93xx/micro9: Update platform code
Update Contec Micro9 platform code Cc: Ryan Mallon <ryan@bluewatersys.com> Requires: 5749/1 Signed-off-by: Hubert Feurstein <hubert.feurstein@contec.at> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-ep93xx/micro9.c')
-rw-r--r--arch/arm/mach-ep93xx/micro9.c108
1 files changed, 57 insertions, 51 deletions
diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c
index 72e7a7dfd7bf..49fbee5adde2 100644
--- a/arch/arm/mach-ep93xx/micro9.c
+++ b/arch/arm/mach-ep93xx/micro9.c
@@ -22,52 +22,77 @@
22#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
23 23
24 24
25static struct ep93xx_eth_data micro9_eth_data = { 25/*************************************************************************
26 .phy_id = 0x1f, 26 * Micro9 NOR Flash
27}; 27 *
28 28 * Micro9-High has up to 64MB of 32-bit flash on CS1
29static void __init micro9_init(void) 29 * Micro9-Mid has up to 64MB of either 32-bit or 16-bit flash on CS1
30{ 30 * Micro9-Lite uses a seperate MTD map driver for flash support
31 ep93xx_register_eth(&micro9_eth_data, 1); 31 *************************************************************************/
32} 32static struct physmap_flash_data micro9_flash_data;
33
34/*
35 * Micro9-H
36 */
37#ifdef CONFIG_MACH_MICRO9H
38static struct physmap_flash_data micro9h_flash_data = {
39 .width = 4,
40};
41 33
42static struct resource micro9h_flash_resource = { 34static struct resource micro9_flash_resource = {
43 .start = EP93XX_CS1_PHYS_BASE, 35 .start = EP93XX_CS1_PHYS_BASE,
44 .end = EP93XX_CS1_PHYS_BASE + SZ_64M - 1, 36 .end = EP93XX_CS1_PHYS_BASE + SZ_64M - 1,
45 .flags = IORESOURCE_MEM, 37 .flags = IORESOURCE_MEM,
46}; 38};
47 39
48static struct platform_device micro9h_flash = { 40static struct platform_device micro9_flash = {
49 .name = "physmap-flash", 41 .name = "physmap-flash",
50 .id = 0, 42 .id = 0,
51 .dev = { 43 .dev = {
52 .platform_data = &micro9h_flash_data, 44 .platform_data = &micro9_flash_data,
53 }, 45 },
54 .num_resources = 1, 46 .num_resources = 1,
55 .resource = &micro9h_flash_resource, 47 .resource = &micro9_flash_resource,
56}; 48};
57 49
58static void __init micro9h_init(void) 50static void __init __micro9_register_flash(unsigned int width)
51{
52 micro9_flash_data.width = width;
53
54 platform_device_register(&micro9_flash);
55}
56
57static unsigned int __init micro9_detect_bootwidth(void)
59{ 58{
60 platform_device_register(&micro9h_flash); 59 u32 v;
60
61 /* Detect the bus width of the external flash memory */
62 v = __raw_readl(EP93XX_SYSCON_SYSCFG);
63 if (v & EP93XX_SYSCON_SYSCFG_LCSN7)
64 return 4; /* 32-bit */
65 else
66 return 2; /* 16-bit */
61} 67}
62 68
63static void __init micro9h_init_machine(void) 69static void __init micro9_register_flash(void)
70{
71 if (machine_is_micro9())
72 __micro9_register_flash(4);
73 else if (machine_is_micro9m())
74 __micro9_register_flash(micro9_detect_bootwidth());
75}
76
77
78/*************************************************************************
79 * Micro9 Ethernet
80 *************************************************************************/
81static struct ep93xx_eth_data micro9_eth_data = {
82 .phy_id = 0x1f,
83};
84
85
86static void __init micro9_init_machine(void)
64{ 87{
65 ep93xx_init_devices(); 88 ep93xx_init_devices();
66 micro9_init(); 89 ep93xx_register_eth(&micro9_eth_data, 1);
67 micro9h_init(); 90 micro9_register_flash();
68} 91}
69 92
70MACHINE_START(MICRO9, "Contec Hypercontrol Micro9-H") 93
94#ifdef CONFIG_MACH_MICRO9H
95MACHINE_START(MICRO9, "Contec Micro9-High")
71 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */ 96 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
72 .phys_io = EP93XX_APB_PHYS_BASE, 97 .phys_io = EP93XX_APB_PHYS_BASE,
73 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, 98 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
@@ -75,43 +100,25 @@ MACHINE_START(MICRO9, "Contec Hypercontrol Micro9-H")
75 .map_io = ep93xx_map_io, 100 .map_io = ep93xx_map_io,
76 .init_irq = ep93xx_init_irq, 101 .init_irq = ep93xx_init_irq,
77 .timer = &ep93xx_timer, 102 .timer = &ep93xx_timer,
78 .init_machine = micro9h_init_machine, 103 .init_machine = micro9_init_machine,
79MACHINE_END 104MACHINE_END
80#endif 105#endif
81 106
82/*
83 * Micro9-M
84 */
85#ifdef CONFIG_MACH_MICRO9M 107#ifdef CONFIG_MACH_MICRO9M
86static void __init micro9m_init_machine(void) 108MACHINE_START(MICRO9M, "Contec Micro9-Mid")
87{
88 ep93xx_init_devices();
89 micro9_init();
90}
91
92MACHINE_START(MICRO9M, "Contec Hypercontrol Micro9-M")
93 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */ 109 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
94 .phys_io = EP93XX_APB_PHYS_BASE, 110 .phys_io = EP93XX_APB_PHYS_BASE,
95 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, 111 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
96 .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100, 112 .boot_params = EP93XX_SDCE3_PHYS_BASE_ASYNC + 0x100,
97 .map_io = ep93xx_map_io, 113 .map_io = ep93xx_map_io,
98 .init_irq = ep93xx_init_irq, 114 .init_irq = ep93xx_init_irq,
99 .timer = &ep93xx_timer, 115 .timer = &ep93xx_timer,
100 .init_machine = micro9m_init_machine, 116 .init_machine = micro9_init_machine,
101MACHINE_END 117MACHINE_END
102#endif 118#endif
103 119
104/*
105 * Micro9-L
106 */
107#ifdef CONFIG_MACH_MICRO9L 120#ifdef CONFIG_MACH_MICRO9L
108static void __init micro9l_init_machine(void) 121MACHINE_START(MICRO9L, "Contec Micro9-Lite")
109{
110 ep93xx_init_devices();
111 micro9_init();
112}
113
114MACHINE_START(MICRO9L, "Contec Hypercontrol Micro9-L")
115 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */ 122 /* Maintainer: Hubert Feurstein <hubert.feurstein@contec.at> */
116 .phys_io = EP93XX_APB_PHYS_BASE, 123 .phys_io = EP93XX_APB_PHYS_BASE,
117 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, 124 .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
@@ -119,7 +126,6 @@ MACHINE_START(MICRO9L, "Contec Hypercontrol Micro9-L")
119 .map_io = ep93xx_map_io, 126 .map_io = ep93xx_map_io,
120 .init_irq = ep93xx_init_irq, 127 .init_irq = ep93xx_init_irq,
121 .timer = &ep93xx_timer, 128 .timer = &ep93xx_timer,
122 .init_machine = micro9l_init_machine, 129 .init_machine = micro9_init_machine,
123MACHINE_END 130MACHINE_END
124#endif 131#endif
125