aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--arch/arm/mach-ep93xx/Kconfig14
-rw-r--r--arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h11
-rw-r--r--arch/arm/mach-ep93xx/micro9.c108
3 files changed, 75 insertions, 58 deletions
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index 6675c051f62f..4ad0380ff806 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -130,28 +130,28 @@ config MACH_MICRO9
130 bool 130 bool
131 131
132config MACH_MICRO9H 132config MACH_MICRO9H
133 bool "Support Contec Hypercontrol Micro9-H" 133 bool "Support Contec Micro9-High"
134 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 134 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
135 select MACH_MICRO9 135 select MACH_MICRO9
136 help 136 help
137 Say 'Y' here if you want your kernel to support the 137 Say 'Y' here if you want your kernel to support the
138 Contec Hypercontrol Micro9-H board. 138 Contec Micro9-High board.
139 139
140config MACH_MICRO9M 140config MACH_MICRO9M
141 bool "Support Contec Hypercontrol Micro9-M" 141 bool "Support Contec Micro9-Mid"
142 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 142 depends on EP93XX_SDCE3_ASYNC_PHYS_OFFSET
143 select MACH_MICRO9 143 select MACH_MICRO9
144 help 144 help
145 Say 'Y' here if you want your kernel to support the 145 Say 'Y' here if you want your kernel to support the
146 Contec Hypercontrol Micro9-M board. 146 Contec Micro9-Mid board.
147 147
148config MACH_MICRO9L 148config MACH_MICRO9L
149 bool "Support Contec Hypercontrol Micro9-L" 149 bool "Support Contec Micro9-Lite"
150 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET 150 depends on EP93XX_SDCE3_SYNC_PHYS_OFFSET
151 select MACH_MICRO9 151 select MACH_MICRO9
152 help 152 help
153 Say 'Y' here if you want your kernel to support the 153 Say 'Y' here if you want your kernel to support the
154 Contec Hypercontrol Micro9-L board. 154 Contec Micro9-Lite board.
155 155
156config MACH_TS72XX 156config MACH_TS72XX
157 bool "Support Technologic Systems TS-72xx SBC" 157 bool "Support Technologic Systems TS-72xx SBC"
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
index 0fbf87b16338..587756dbd6f6 100644
--- a/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
+++ b/arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h
@@ -218,6 +218,17 @@
218#define EP93XX_SYSCON_KEYTCHCLKDIV_ADIV (1<<16) 218#define EP93XX_SYSCON_KEYTCHCLKDIV_ADIV (1<<16)
219#define EP93XX_SYSCON_KEYTCHCLKDIV_KEN (1<<15) 219#define EP93XX_SYSCON_KEYTCHCLKDIV_KEN (1<<15)
220#define EP93XX_SYSCON_KEYTCHCLKDIV_KDIV (1<<0) 220#define EP93XX_SYSCON_KEYTCHCLKDIV_KDIV (1<<0)
221#define EP93XX_SYSCON_SYSCFG EP93XX_SYSCON_REG(0x9c)
222#define EP93XX_SYSCON_SYSCFG_REV_MASK (0xf0000000)
223#define EP93XX_SYSCON_SYSCFG_REV_SHIFT (28)
224#define EP93XX_SYSCON_SYSCFG_SBOOT (1<<8)
225#define EP93XX_SYSCON_SYSCFG_LCSN7 (1<<7)
226#define EP93XX_SYSCON_SYSCFG_LCSN6 (1<<6)
227#define EP93XX_SYSCON_SYSCFG_LASDO (1<<5)
228#define EP93XX_SYSCON_SYSCFG_LEEDA (1<<4)
229#define EP93XX_SYSCON_SYSCFG_LEECLK (1<<3)
230#define EP93XX_SYSCON_SYSCFG_LCSN2 (1<<1)
231#define EP93XX_SYSCON_SYSCFG_LCSN1 (1<<0)
221#define EP93XX_SYSCON_SWLOCK EP93XX_SYSCON_REG(0xc0) 232#define EP93XX_SYSCON_SWLOCK EP93XX_SYSCON_REG(0xc0)
222 233
223#define EP93XX_WATCHDOG_BASE EP93XX_APB_IOMEM(0x00140000) 234#define EP93XX_WATCHDOG_BASE EP93XX_APB_IOMEM(0x00140000)
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