diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2011-01-27 19:39:45 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-01-27 19:39:48 -0500 |
commit | ee54dba9c360944b34e06478c05c6f283bf64eda (patch) | |
tree | 78b52c057f5adb414582456217836ca14cd0b0d9 /arch/arm/mach-omap1 | |
parent | 277a28567fe928bd94e9953a187002f5041c34a4 (diff) |
ARM: OMAP: Allow platforms to hook reset cleanly
This adds a clean method to allow platforms to hook into the reset
code if they require to.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r-- | arch/arm/mach-omap1/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-voiceblue.c | 106 | ||||
-rw-r--r-- | arch/arm/mach-omap1/reset.c | 25 |
3 files changed, 85 insertions, 48 deletions
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile index ba6009f27677..af98117043d2 100644 --- a/arch/arm/mach-omap1/Makefile +++ b/arch/arm/mach-omap1/Makefile | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | # Common support | 5 | # Common support |
6 | obj-y := io.o id.o sram.o time.o irq.o mux.o flash.o serial.o devices.o dma.o | 6 | obj-y := io.o id.o sram.o time.o irq.o mux.o flash.o serial.o devices.o dma.o |
7 | obj-y += clock.o clock_data.o opp_data.o | 7 | obj-y += clock.o clock_data.o opp_data.o reset.o |
8 | 8 | ||
9 | obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o | 9 | obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o |
10 | 10 | ||
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c index 815a69ce821d..671281714099 100644 --- a/arch/arm/mach-omap1/board-voiceblue.c +++ b/arch/arm/mach-omap1/board-voiceblue.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/smc91x.h> | 26 | #include <linux/smc91x.h> |
27 | 27 | ||
28 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
29 | #include <mach/system.h> | ||
29 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
30 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
31 | #include <asm/mach/map.h> | 32 | #include <asm/mach/map.h> |
@@ -163,52 +164,6 @@ static void __init voiceblue_init_irq(void) | |||
163 | omap_init_irq(); | 164 | omap_init_irq(); |
164 | } | 165 | } |
165 | 166 | ||
166 | static void __init voiceblue_init(void) | ||
167 | { | ||
168 | /* mux pins for uarts */ | ||
169 | omap_cfg_reg(UART1_TX); | ||
170 | omap_cfg_reg(UART1_RTS); | ||
171 | omap_cfg_reg(UART2_TX); | ||
172 | omap_cfg_reg(UART2_RTS); | ||
173 | omap_cfg_reg(UART3_TX); | ||
174 | omap_cfg_reg(UART3_RX); | ||
175 | |||
176 | /* Watchdog */ | ||
177 | gpio_request(0, "Watchdog"); | ||
178 | /* smc91x reset */ | ||
179 | gpio_request(7, "SMC91x reset"); | ||
180 | gpio_direction_output(7, 1); | ||
181 | udelay(2); /* wait at least 100ns */ | ||
182 | gpio_set_value(7, 0); | ||
183 | mdelay(50); /* 50ms until PHY ready */ | ||
184 | /* smc91x interrupt pin */ | ||
185 | gpio_request(8, "SMC91x irq"); | ||
186 | /* 16C554 reset*/ | ||
187 | gpio_request(6, "16C554 reset"); | ||
188 | gpio_direction_output(6, 0); | ||
189 | /* 16C554 interrupt pins */ | ||
190 | gpio_request(12, "16C554 irq"); | ||
191 | gpio_request(13, "16C554 irq"); | ||
192 | gpio_request(14, "16C554 irq"); | ||
193 | gpio_request(15, "16C554 irq"); | ||
194 | set_irq_type(gpio_to_irq(12), IRQ_TYPE_EDGE_RISING); | ||
195 | set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING); | ||
196 | set_irq_type(gpio_to_irq(14), IRQ_TYPE_EDGE_RISING); | ||
197 | set_irq_type(gpio_to_irq(15), IRQ_TYPE_EDGE_RISING); | ||
198 | |||
199 | platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices)); | ||
200 | omap_board_config = voiceblue_config; | ||
201 | omap_board_config_size = ARRAY_SIZE(voiceblue_config); | ||
202 | omap_serial_init(); | ||
203 | omap1_usb_init(&voiceblue_usb_config); | ||
204 | omap_register_i2c_bus(1, 100, NULL, 0); | ||
205 | |||
206 | /* There is a good chance board is going up, so enable power LED | ||
207 | * (it is connected through invertor) */ | ||
208 | omap_writeb(0x00, OMAP_LPG1_LCR); | ||
209 | omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */ | ||
210 | } | ||
211 | |||
212 | static void __init voiceblue_map_io(void) | 167 | static void __init voiceblue_map_io(void) |
213 | { | 168 | { |
214 | omap1_map_common_io(); | 169 | omap1_map_common_io(); |
@@ -275,8 +230,17 @@ void voiceblue_wdt_ping(void) | |||
275 | gpio_set_value(0, wdt_gpio_state); | 230 | gpio_set_value(0, wdt_gpio_state); |
276 | } | 231 | } |
277 | 232 | ||
278 | void voiceblue_reset(void) | 233 | static void voiceblue_reset(char mode, const char *cmd) |
279 | { | 234 | { |
235 | /* | ||
236 | * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28 | ||
237 | * "Global Software Reset Affects Traffic Controller Frequency". | ||
238 | */ | ||
239 | if (cpu_is_omap5912()) { | ||
240 | omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4), DPLL_CTL); | ||
241 | omap_writew(0x8, ARM_RSTCT1); | ||
242 | } | ||
243 | |||
280 | set_bit(MACHINE_REBOOT, &machine_state); | 244 | set_bit(MACHINE_REBOOT, &machine_state); |
281 | voiceblue_wdt_enable(); | 245 | voiceblue_wdt_enable(); |
282 | while (1) ; | 246 | while (1) ; |
@@ -286,6 +250,54 @@ EXPORT_SYMBOL(voiceblue_wdt_enable); | |||
286 | EXPORT_SYMBOL(voiceblue_wdt_disable); | 250 | EXPORT_SYMBOL(voiceblue_wdt_disable); |
287 | EXPORT_SYMBOL(voiceblue_wdt_ping); | 251 | EXPORT_SYMBOL(voiceblue_wdt_ping); |
288 | 252 | ||
253 | static void __init voiceblue_init(void) | ||
254 | { | ||
255 | /* mux pins for uarts */ | ||
256 | omap_cfg_reg(UART1_TX); | ||
257 | omap_cfg_reg(UART1_RTS); | ||
258 | omap_cfg_reg(UART2_TX); | ||
259 | omap_cfg_reg(UART2_RTS); | ||
260 | omap_cfg_reg(UART3_TX); | ||
261 | omap_cfg_reg(UART3_RX); | ||
262 | |||
263 | /* Watchdog */ | ||
264 | gpio_request(0, "Watchdog"); | ||
265 | /* smc91x reset */ | ||
266 | gpio_request(7, "SMC91x reset"); | ||
267 | gpio_direction_output(7, 1); | ||
268 | udelay(2); /* wait at least 100ns */ | ||
269 | gpio_set_value(7, 0); | ||
270 | mdelay(50); /* 50ms until PHY ready */ | ||
271 | /* smc91x interrupt pin */ | ||
272 | gpio_request(8, "SMC91x irq"); | ||
273 | /* 16C554 reset*/ | ||
274 | gpio_request(6, "16C554 reset"); | ||
275 | gpio_direction_output(6, 0); | ||
276 | /* 16C554 interrupt pins */ | ||
277 | gpio_request(12, "16C554 irq"); | ||
278 | gpio_request(13, "16C554 irq"); | ||
279 | gpio_request(14, "16C554 irq"); | ||
280 | gpio_request(15, "16C554 irq"); | ||
281 | set_irq_type(gpio_to_irq(12), IRQ_TYPE_EDGE_RISING); | ||
282 | set_irq_type(gpio_to_irq(13), IRQ_TYPE_EDGE_RISING); | ||
283 | set_irq_type(gpio_to_irq(14), IRQ_TYPE_EDGE_RISING); | ||
284 | set_irq_type(gpio_to_irq(15), IRQ_TYPE_EDGE_RISING); | ||
285 | |||
286 | platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices)); | ||
287 | omap_board_config = voiceblue_config; | ||
288 | omap_board_config_size = ARRAY_SIZE(voiceblue_config); | ||
289 | omap_serial_init(); | ||
290 | omap1_usb_init(&voiceblue_usb_config); | ||
291 | omap_register_i2c_bus(1, 100, NULL, 0); | ||
292 | |||
293 | /* There is a good chance board is going up, so enable power LED | ||
294 | * (it is connected through invertor) */ | ||
295 | omap_writeb(0x00, OMAP_LPG1_LCR); | ||
296 | omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */ | ||
297 | |||
298 | arch_reset = voiceblue_reset; | ||
299 | } | ||
300 | |||
289 | MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910") | 301 | MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910") |
290 | /* Maintainer: Ladislav Michl <michl@2n.cz> */ | 302 | /* Maintainer: Ladislav Michl <michl@2n.cz> */ |
291 | .boot_params = 0x10000100, | 303 | .boot_params = 0x10000100, |
diff --git a/arch/arm/mach-omap1/reset.c b/arch/arm/mach-omap1/reset.c new file mode 100644 index 000000000000..ad951ee69205 --- /dev/null +++ b/arch/arm/mach-omap1/reset.c | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * OMAP1 reset support | ||
3 | */ | ||
4 | #include <linux/kernel.h> | ||
5 | #include <linux/io.h> | ||
6 | |||
7 | #include <mach/hardware.h> | ||
8 | #include <mach/system.h> | ||
9 | #include <plat/prcm.h> | ||
10 | |||
11 | void omap1_arch_reset(char mode, const char *cmd) | ||
12 | { | ||
13 | /* | ||
14 | * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28 | ||
15 | * "Global Software Reset Affects Traffic Controller Frequency". | ||
16 | */ | ||
17 | if (cpu_is_omap5912()) { | ||
18 | omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4), DPLL_CTL); | ||
19 | omap_writew(0x8, ARM_RSTCT1); | ||
20 | } | ||
21 | |||
22 | omap_writew(1, ARM_RSTCT1); | ||
23 | } | ||
24 | |||
25 | void (*arch_reset)(char, const char *) = omap1_arch_reset; | ||