aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-voiceblue.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2005-09-08 18:07:38 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-09-08 18:07:38 -0400
commit7c38cf021b42a4297bc8f860ab627734bdd6c8d1 (patch)
tree89c3b807ca90f5c7e5692ddbcd388511dc289530 /arch/arm/mach-omap1/board-voiceblue.c
parentd7b6b3589471c3856f1e6dc9c77abc4af962ffdb (diff)
[ARM] 2890/1: OMAP 1/4: Update omap1 specific files, take 2
Patch from Tony Lindgren This patch syncs the mainline kernel with linux-omap tree. The highlights of the patch are: - Convert more drivers to register resources in board-*.c to take advantage of the driver model by David Brownell and Ladislav Michl - Use set_irq_type() for GPIO interrupts instead of omap_set_gpio_edge_ctrl() by David Brownell - Add minimal support for handling optional add-on boards, such as OSK Mistral board with LCD and keypad, by David Brownell - Minimal support for loading functions to SRAM by Tony Lindgren - Wake up from serial port by muxing RX lines temporarily into GPIO interrupts by Tony Lindgren - 32KHz sched_clock by Tony Lindgren and Juha Yrjola Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-omap1/board-voiceblue.c')
-rw-r--r--arch/arm/mach-omap1/board-voiceblue.c62
1 files changed, 47 insertions, 15 deletions
diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
index e4228198899..209d79ef1d5 100644
--- a/arch/arm/mach-omap1/board-voiceblue.c
+++ b/arch/arm/mach-omap1/board-voiceblue.c
@@ -25,13 +25,14 @@
25#include <asm/hardware.h> 25#include <asm/hardware.h>
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <asm/mach/flash.h>
28#include <asm/mach/map.h> 29#include <asm/mach/map.h>
29 30
31#include <asm/arch/common.h>
30#include <asm/arch/gpio.h> 32#include <asm/arch/gpio.h>
31#include <asm/arch/tc.h>
32#include <asm/arch/mux.h> 33#include <asm/arch/mux.h>
34#include <asm/arch/tc.h>
33#include <asm/arch/usb.h> 35#include <asm/arch/usb.h>
34#include <asm/arch/common.h>
35 36
36extern void omap_init_time(void); 37extern void omap_init_time(void);
37extern int omap_gpio_init(void); 38extern int omap_gpio_init(void);
@@ -86,6 +87,27 @@ static int __init ext_uart_init(void)
86} 87}
87arch_initcall(ext_uart_init); 88arch_initcall(ext_uart_init);
88 89
90static struct flash_platform_data voiceblue_flash_data = {
91 .map_name = "cfi_probe",
92 .width = 2,
93};
94
95static struct resource voiceblue_flash_resource = {
96 .start = OMAP_CS0_PHYS,
97 .end = OMAP_CS0_PHYS + SZ_32M - 1,
98 .flags = IORESOURCE_MEM,
99};
100
101static struct platform_device voiceblue_flash_device = {
102 .name = "omapflash",
103 .id = 0,
104 .dev = {
105 .platform_data = &voiceblue_flash_data,
106 },
107 .num_resources = 1,
108 .resource = &voiceblue_flash_resource,
109};
110
89static struct resource voiceblue_smc91x_resources[] = { 111static struct resource voiceblue_smc91x_resources[] = {
90 [0] = { 112 [0] = {
91 .start = OMAP_CS2_PHYS + 0x300, 113 .start = OMAP_CS2_PHYS + 0x300,
@@ -107,6 +129,7 @@ static struct platform_device voiceblue_smc91x_device = {
107}; 129};
108 130
109static struct platform_device *voiceblue_devices[] __initdata = { 131static struct platform_device *voiceblue_devices[] __initdata = {
132 &voiceblue_flash_device,
110 &voiceblue_smc91x_device, 133 &voiceblue_smc91x_device,
111}; 134};
112 135
@@ -119,8 +142,17 @@ static struct omap_usb_config voiceblue_usb_config __initdata = {
119 .pins[2] = 6, 142 .pins[2] = 6,
120}; 143};
121 144
145static struct omap_mmc_config voiceblue_mmc_config __initdata = {
146 .mmc[0] = {
147 .enabled = 1,
148 .power_pin = 2,
149 .switch_pin = -1,
150 },
151};
152
122static struct omap_board_config_kernel voiceblue_config[] = { 153static struct omap_board_config_kernel voiceblue_config[] = {
123 { OMAP_TAG_USB, &voiceblue_usb_config }, 154 { OMAP_TAG_USB, &voiceblue_usb_config },
155 { OMAP_TAG_MMC, &voiceblue_mmc_config },
124}; 156};
125 157
126static void __init voiceblue_init_irq(void) 158static void __init voiceblue_init_irq(void)
@@ -131,9 +163,6 @@ static void __init voiceblue_init_irq(void)
131 163
132static void __init voiceblue_init(void) 164static void __init voiceblue_init(void)
133{ 165{
134 /* There is a good chance board is going up, so enable Power LED
135 * (it is connected through invertor) */
136 omap_writeb(0x00, OMAP_LPG1_LCR);
137 /* Watchdog */ 166 /* Watchdog */
138 omap_request_gpio(0); 167 omap_request_gpio(0);
139 /* smc91x reset */ 168 /* smc91x reset */
@@ -145,7 +174,6 @@ static void __init voiceblue_init(void)
145 mdelay(50); /* 50ms until PHY ready */ 174 mdelay(50); /* 50ms until PHY ready */
146 /* smc91x interrupt pin */ 175 /* smc91x interrupt pin */
147 omap_request_gpio(8); 176 omap_request_gpio(8);
148 omap_set_gpio_edge_ctrl(8, OMAP_GPIO_RISING_EDGE);
149 /* 16C554 reset*/ 177 /* 16C554 reset*/
150 omap_request_gpio(6); 178 omap_request_gpio(6);
151 omap_set_gpio_direction(6, 0); 179 omap_set_gpio_direction(6, 0);
@@ -155,14 +183,19 @@ static void __init voiceblue_init(void)
155 omap_request_gpio(13); 183 omap_request_gpio(13);
156 omap_request_gpio(14); 184 omap_request_gpio(14);
157 omap_request_gpio(15); 185 omap_request_gpio(15);
158 omap_set_gpio_edge_ctrl(12, OMAP_GPIO_RISING_EDGE); 186 set_irq_type(OMAP_GPIO_IRQ(12), IRQT_RISING);
159 omap_set_gpio_edge_ctrl(13, OMAP_GPIO_RISING_EDGE); 187 set_irq_type(OMAP_GPIO_IRQ(13), IRQT_RISING);
160 omap_set_gpio_edge_ctrl(14, OMAP_GPIO_RISING_EDGE); 188 set_irq_type(OMAP_GPIO_IRQ(14), IRQT_RISING);
161 omap_set_gpio_edge_ctrl(15, OMAP_GPIO_RISING_EDGE); 189 set_irq_type(OMAP_GPIO_IRQ(15), IRQT_RISING);
162 190
163 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices)); 191 platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
164 omap_board_config = voiceblue_config; 192 omap_board_config = voiceblue_config;
165 omap_board_config_size = ARRAY_SIZE(voiceblue_config); 193 omap_board_config_size = ARRAY_SIZE(voiceblue_config);
194
195 /* There is a good chance board is going up, so enable power LED
196 * (it is connected through invertor) */
197 omap_writeb(0x00, OMAP_LPG1_LCR);
198 omap_writeb(0x00, OMAP_LPG1_PMR); /* Disable clock */
166} 199}
167 200
168static int __initdata omap_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1}; 201static int __initdata omap_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1};
@@ -184,9 +217,9 @@ static int panic_event(struct notifier_block *this, unsigned long event,
184 if (test_and_set_bit(MACHINE_PANICED, &machine_state)) 217 if (test_and_set_bit(MACHINE_PANICED, &machine_state))
185 return NOTIFY_DONE; 218 return NOTIFY_DONE;
186 219
187 /* Flash Power LED 220 /* Flash power LED */
188 * (TODO: Enable clock right way (enabled in bootloader already)) */
189 omap_writeb(0x78, OMAP_LPG1_LCR); 221 omap_writeb(0x78, OMAP_LPG1_LCR);
222 omap_writeb(0x01, OMAP_LPG1_PMR); /* Enable clock */
190 223
191 return NOTIFY_DONE; 224 return NOTIFY_DONE;
192} 225}
@@ -195,15 +228,14 @@ static struct notifier_block panic_block = {
195 .notifier_call = panic_event, 228 .notifier_call = panic_event,
196}; 229};
197 230
198static int __init setup_notifier(void) 231static int __init voiceblue_setup(void)
199{ 232{
200 /* Setup panic notifier */ 233 /* Setup panic notifier */
201 notifier_chain_register(&panic_notifier_list, &panic_block); 234 notifier_chain_register(&panic_notifier_list, &panic_block);
202 235
203 return 0; 236 return 0;
204} 237}
205 238postcore_initcall(voiceblue_setup);
206postcore_initcall(setup_notifier);
207 239
208static int wdt_gpio_state; 240static int wdt_gpio_state;
209 241