xref: /linux/arch/arm/mach-omap1/board-osk.c (revision d533c1289e87cc16b0590077a182f06e4d6ad8aa)
1dbdf9cedSTony Lindgren /*
2dbdf9cedSTony Lindgren  * linux/arch/arm/mach-omap1/board-osk.c
3dbdf9cedSTony Lindgren  *
4dbdf9cedSTony Lindgren  * Board specific init for OMAP5912 OSK
5dbdf9cedSTony Lindgren  *
6dbdf9cedSTony Lindgren  * Written by Dirk Behme <dirk.behme@de.bosch.com>
7dbdf9cedSTony Lindgren  *
8dbdf9cedSTony Lindgren  * This program is free software; you can redistribute it and/or modify it
9dbdf9cedSTony Lindgren  * under the terms of the GNU General Public License as published by the
10dbdf9cedSTony Lindgren  * Free Software Foundation; either version 2 of the License, or (at your
11dbdf9cedSTony Lindgren  * option) any later version.
12dbdf9cedSTony Lindgren  *
13dbdf9cedSTony Lindgren  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14dbdf9cedSTony Lindgren  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15dbdf9cedSTony Lindgren  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16dbdf9cedSTony Lindgren  * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17dbdf9cedSTony Lindgren  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18dbdf9cedSTony Lindgren  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19dbdf9cedSTony Lindgren  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20dbdf9cedSTony Lindgren  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21dbdf9cedSTony Lindgren  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22dbdf9cedSTony Lindgren  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23dbdf9cedSTony Lindgren  *
24dbdf9cedSTony Lindgren  * You should have received a copy of the  GNU General Public License along
25dbdf9cedSTony Lindgren  * with this program; if not, write  to the Free Software Foundation, Inc.,
26dbdf9cedSTony Lindgren  * 675 Mass Ave, Cambridge, MA 02139, USA.
27dbdf9cedSTony Lindgren  */
28dbdf9cedSTony Lindgren 
29dbdf9cedSTony Lindgren #include <linux/kernel.h>
30dbdf9cedSTony Lindgren #include <linux/init.h>
31d052d1beSRussell King #include <linux/platform_device.h>
32*d533c128SThomas Gleixner #include <linux/irq.h>
337c38cf02STony Lindgren 
347c38cf02STony Lindgren #include <linux/mtd/mtd.h>
357c38cf02STony Lindgren #include <linux/mtd/partitions.h>
369b6553cdSTony Lindgren #include <linux/input.h>
37dbdf9cedSTony Lindgren 
38dbdf9cedSTony Lindgren #include <asm/hardware.h>
39dbdf9cedSTony Lindgren #include <asm/mach-types.h>
40dbdf9cedSTony Lindgren #include <asm/mach/arch.h>
41dbdf9cedSTony Lindgren #include <asm/mach/map.h>
427c38cf02STony Lindgren #include <asm/mach/flash.h>
43dbdf9cedSTony Lindgren 
44dbdf9cedSTony Lindgren #include <asm/arch/gpio.h>
45dbdf9cedSTony Lindgren #include <asm/arch/usb.h>
46dbdf9cedSTony Lindgren #include <asm/arch/mux.h>
47dbdf9cedSTony Lindgren #include <asm/arch/tc.h>
489b6553cdSTony Lindgren #include <asm/arch/keypad.h>
49d48af15eSTony Lindgren #include <asm/arch/common.h>
509b6553cdSTony Lindgren #include <asm/arch/mcbsp.h>
519b6553cdSTony Lindgren #include <asm/arch/omap-alsa.h>
529b6553cdSTony Lindgren 
539b6553cdSTony Lindgren static int osk_keymap[] = {
549b6553cdSTony Lindgren 	KEY(0, 0, KEY_F1),
559b6553cdSTony Lindgren 	KEY(0, 3, KEY_UP),
569b6553cdSTony Lindgren 	KEY(1, 1, KEY_LEFTCTRL),
579b6553cdSTony Lindgren 	KEY(1, 2, KEY_LEFT),
589b6553cdSTony Lindgren 	KEY(2, 0, KEY_SPACE),
599b6553cdSTony Lindgren 	KEY(2, 1, KEY_ESC),
609b6553cdSTony Lindgren 	KEY(2, 2, KEY_DOWN),
619b6553cdSTony Lindgren 	KEY(3, 2, KEY_ENTER),
629b6553cdSTony Lindgren 	KEY(3, 3, KEY_RIGHT),
639b6553cdSTony Lindgren 	0
649b6553cdSTony Lindgren };
659b6553cdSTony Lindgren 
66dbdf9cedSTony Lindgren 
677c38cf02STony Lindgren static struct mtd_partition osk_partitions[] = {
687c38cf02STony Lindgren 	/* bootloader (U-Boot, etc) in first sector */
697c38cf02STony Lindgren 	{
707c38cf02STony Lindgren 	      .name		= "bootloader",
717c38cf02STony Lindgren 	      .offset		= 0,
727c38cf02STony Lindgren 	      .size		= SZ_128K,
737c38cf02STony Lindgren 	      .mask_flags	= MTD_WRITEABLE, /* force read-only */
747c38cf02STony Lindgren 	},
757c38cf02STony Lindgren 	/* bootloader params in the next sector */
767c38cf02STony Lindgren 	{
777c38cf02STony Lindgren 	      .name		= "params",
787c38cf02STony Lindgren 	      .offset		= MTDPART_OFS_APPEND,
797c38cf02STony Lindgren 	      .size		= SZ_128K,
807c38cf02STony Lindgren 	      .mask_flags	= 0,
817c38cf02STony Lindgren 	}, {
827c38cf02STony Lindgren 	      .name		= "kernel",
837c38cf02STony Lindgren 	      .offset		= MTDPART_OFS_APPEND,
847c38cf02STony Lindgren 	      .size		= SZ_2M,
857c38cf02STony Lindgren 	      .mask_flags	= 0
867c38cf02STony Lindgren 	}, {
877c38cf02STony Lindgren 	      .name		= "filesystem",
887c38cf02STony Lindgren 	      .offset		= MTDPART_OFS_APPEND,
897c38cf02STony Lindgren 	      .size		= MTDPART_SIZ_FULL,
907c38cf02STony Lindgren 	      .mask_flags	= 0
917c38cf02STony Lindgren 	}
92dbdf9cedSTony Lindgren };
93dbdf9cedSTony Lindgren 
947c38cf02STony Lindgren static struct flash_platform_data osk_flash_data = {
957c38cf02STony Lindgren 	.map_name	= "cfi_probe",
967c38cf02STony Lindgren 	.width		= 2,
977c38cf02STony Lindgren 	.parts		= osk_partitions,
987c38cf02STony Lindgren 	.nr_parts	= ARRAY_SIZE(osk_partitions),
997c38cf02STony Lindgren };
1007c38cf02STony Lindgren 
1017c38cf02STony Lindgren static struct resource osk_flash_resource = {
1027c38cf02STony Lindgren 	/* this is on CS3, wherever it's mapped */
1037c38cf02STony Lindgren 	.flags		= IORESOURCE_MEM,
1047c38cf02STony Lindgren };
1057c38cf02STony Lindgren 
1067c38cf02STony Lindgren static struct platform_device osk5912_flash_device = {
1077c38cf02STony Lindgren 	.name		= "omapflash",
1087c38cf02STony Lindgren 	.id		= 0,
1097c38cf02STony Lindgren 	.dev		= {
1107c38cf02STony Lindgren 		.platform_data	= &osk_flash_data,
1117c38cf02STony Lindgren 	},
1127c38cf02STony Lindgren 	.num_resources	= 1,
1137c38cf02STony Lindgren 	.resource	= &osk_flash_resource,
1147c38cf02STony Lindgren };
115dbdf9cedSTony Lindgren 
116dbdf9cedSTony Lindgren static struct resource osk5912_smc91x_resources[] = {
117dbdf9cedSTony Lindgren 	[0] = {
118dbdf9cedSTony Lindgren 		.start	= OMAP_OSK_ETHR_START,		/* Physical */
119dbdf9cedSTony Lindgren 		.end	= OMAP_OSK_ETHR_START + 0xf,
120dbdf9cedSTony Lindgren 		.flags	= IORESOURCE_MEM,
121dbdf9cedSTony Lindgren 	},
122dbdf9cedSTony Lindgren 	[1] = {
123dbdf9cedSTony Lindgren 		.start	= OMAP_GPIO_IRQ(0),
124dbdf9cedSTony Lindgren 		.end	= OMAP_GPIO_IRQ(0),
125dbdf9cedSTony Lindgren 		.flags	= IORESOURCE_IRQ,
126dbdf9cedSTony Lindgren 	},
127dbdf9cedSTony Lindgren };
128dbdf9cedSTony Lindgren 
129dbdf9cedSTony Lindgren static struct platform_device osk5912_smc91x_device = {
130dbdf9cedSTony Lindgren 	.name		= "smc91x",
131dbdf9cedSTony Lindgren 	.id		= -1,
132dbdf9cedSTony Lindgren 	.num_resources	= ARRAY_SIZE(osk5912_smc91x_resources),
133dbdf9cedSTony Lindgren 	.resource	= osk5912_smc91x_resources,
134dbdf9cedSTony Lindgren };
135dbdf9cedSTony Lindgren 
136dbdf9cedSTony Lindgren static struct resource osk5912_cf_resources[] = {
137dbdf9cedSTony Lindgren 	[0] = {
138dbdf9cedSTony Lindgren 		.start	= OMAP_GPIO_IRQ(62),
139dbdf9cedSTony Lindgren 		.end	= OMAP_GPIO_IRQ(62),
140dbdf9cedSTony Lindgren 		.flags	= IORESOURCE_IRQ,
141dbdf9cedSTony Lindgren 	},
142dbdf9cedSTony Lindgren };
143dbdf9cedSTony Lindgren 
144dbdf9cedSTony Lindgren static struct platform_device osk5912_cf_device = {
145dbdf9cedSTony Lindgren 	.name		= "omap_cf",
146dbdf9cedSTony Lindgren 	.id		= -1,
147dbdf9cedSTony Lindgren 	.dev = {
148dbdf9cedSTony Lindgren 		.platform_data	= (void *) 2 /* CS2 */,
149dbdf9cedSTony Lindgren 	},
150dbdf9cedSTony Lindgren 	.num_resources	= ARRAY_SIZE(osk5912_cf_resources),
151dbdf9cedSTony Lindgren 	.resource	= osk5912_cf_resources,
152dbdf9cedSTony Lindgren };
153dbdf9cedSTony Lindgren 
1549b6553cdSTony Lindgren #define DEFAULT_BITPERSAMPLE 16
1559b6553cdSTony Lindgren 
1569b6553cdSTony Lindgren static struct omap_mcbsp_reg_cfg mcbsp_regs = {
1579b6553cdSTony Lindgren 	.spcr2 = FREE | FRST | GRST | XRST | XINTM(3),
1589b6553cdSTony Lindgren 	.spcr1 = RINTM(3) | RRST,
1599b6553cdSTony Lindgren 	.rcr2 = RPHASE | RFRLEN2(OMAP_MCBSP_WORD_8) |
1609b6553cdSTony Lindgren 	    RWDLEN2(OMAP_MCBSP_WORD_16) | RDATDLY(0),
1619b6553cdSTony Lindgren 	.rcr1 = RFRLEN1(OMAP_MCBSP_WORD_8) | RWDLEN1(OMAP_MCBSP_WORD_16),
1629b6553cdSTony Lindgren 	.xcr2 = XPHASE | XFRLEN2(OMAP_MCBSP_WORD_8) |
1639b6553cdSTony Lindgren 	    XWDLEN2(OMAP_MCBSP_WORD_16) | XDATDLY(0) | XFIG,
1649b6553cdSTony Lindgren 	.xcr1 = XFRLEN1(OMAP_MCBSP_WORD_8) | XWDLEN1(OMAP_MCBSP_WORD_16),
1659b6553cdSTony Lindgren 	.srgr1 = FWID(DEFAULT_BITPERSAMPLE - 1),
1669b6553cdSTony Lindgren 	.srgr2 = GSYNC | CLKSP | FSGM | FPER(DEFAULT_BITPERSAMPLE * 2 - 1),
1679b6553cdSTony Lindgren 	/*.pcr0 = FSXM | FSRM | CLKXM | CLKRM | CLKXP | CLKRP,*/ /* mcbsp: master */
1689b6553cdSTony Lindgren 	.pcr0 = CLKXP | CLKRP,  /* mcbsp: slave */
1699b6553cdSTony Lindgren };
1709b6553cdSTony Lindgren 
1719b6553cdSTony Lindgren static struct omap_alsa_codec_config alsa_config = {
1729b6553cdSTony Lindgren 	.name			= "OSK AIC23",
1739b6553cdSTony Lindgren 	.mcbsp_regs_alsa	= &mcbsp_regs,
1749b6553cdSTony Lindgren 	.codec_configure_dev	= NULL, // aic23_configure,
1759b6553cdSTony Lindgren 	.codec_set_samplerate	= NULL, // aic23_set_samplerate,
1769b6553cdSTony Lindgren 	.codec_clock_setup	= NULL, // aic23_clock_setup,
1779b6553cdSTony Lindgren 	.codec_clock_on		= NULL, // aic23_clock_on,
1789b6553cdSTony Lindgren 	.codec_clock_off	= NULL, // aic23_clock_off,
1799b6553cdSTony Lindgren 	.get_default_samplerate	= NULL, // aic23_get_default_samplerate,
1809b6553cdSTony Lindgren };
1819b6553cdSTony Lindgren 
1827c38cf02STony Lindgren static struct platform_device osk5912_mcbsp1_device = {
1839b6553cdSTony Lindgren 	.name	= "omap_alsa_mcbsp",
1847c38cf02STony Lindgren  	.id	= 1,
1859b6553cdSTony Lindgren 	.dev = {
1869b6553cdSTony Lindgren 		.platform_data	= &alsa_config,
1879b6553cdSTony Lindgren 	},
1889b6553cdSTony Lindgren };
1899b6553cdSTony Lindgren 
1909b6553cdSTony Lindgren static struct resource osk5912_kp_resources[] = {
1919b6553cdSTony Lindgren 	[0] = {
1929b6553cdSTony Lindgren 		.start	= INT_KEYBOARD,
1939b6553cdSTony Lindgren 		.end	= INT_KEYBOARD,
1949b6553cdSTony Lindgren 		.flags	= IORESOURCE_IRQ,
1959b6553cdSTony Lindgren 	},
1969b6553cdSTony Lindgren };
1979b6553cdSTony Lindgren 
1989b6553cdSTony Lindgren static struct omap_kp_platform_data osk_kp_data = {
1999b6553cdSTony Lindgren 	.rows	= 8,
2009b6553cdSTony Lindgren 	.cols	= 8,
2019b6553cdSTony Lindgren 	.keymap = osk_keymap,
2029b6553cdSTony Lindgren };
2039b6553cdSTony Lindgren 
2049b6553cdSTony Lindgren static struct platform_device osk5912_kp_device = {
2059b6553cdSTony Lindgren 	.name		= "omap-keypad",
2069b6553cdSTony Lindgren 	.id		= -1,
2079b6553cdSTony Lindgren 	.dev		= {
2089b6553cdSTony Lindgren 		.platform_data = &osk_kp_data,
2099b6553cdSTony Lindgren 	},
2109b6553cdSTony Lindgren 	.num_resources	= ARRAY_SIZE(osk5912_kp_resources),
2119b6553cdSTony Lindgren 	.resource	= osk5912_kp_resources,
2129b6553cdSTony Lindgren };
2139b6553cdSTony Lindgren 
2149b6553cdSTony Lindgren static struct platform_device osk5912_lcd_device = {
2159b6553cdSTony Lindgren 	.name		= "lcd_osk",
2169b6553cdSTony Lindgren 	.id		= -1,
2177c38cf02STony Lindgren };
2187c38cf02STony Lindgren 
219dbdf9cedSTony Lindgren static struct platform_device *osk5912_devices[] __initdata = {
2207c38cf02STony Lindgren 	&osk5912_flash_device,
221dbdf9cedSTony Lindgren 	&osk5912_smc91x_device,
222dbdf9cedSTony Lindgren 	&osk5912_cf_device,
2237c38cf02STony Lindgren 	&osk5912_mcbsp1_device,
2249b6553cdSTony Lindgren 	&osk5912_kp_device,
2259b6553cdSTony Lindgren 	&osk5912_lcd_device,
226dbdf9cedSTony Lindgren };
227dbdf9cedSTony Lindgren 
228dbdf9cedSTony Lindgren static void __init osk_init_smc91x(void)
229dbdf9cedSTony Lindgren {
230dbdf9cedSTony Lindgren 	if ((omap_request_gpio(0)) < 0) {
231dbdf9cedSTony Lindgren 		printk("Error requesting gpio 0 for smc91x irq\n");
232dbdf9cedSTony Lindgren 		return;
233dbdf9cedSTony Lindgren 	}
234dbdf9cedSTony Lindgren 
235dbdf9cedSTony Lindgren 	/* Check EMIFS wait states to fix errors with SMC_GET_PKT_HDR */
2363179a019STony Lindgren 	EMIFS_CCS(1) |= 0x3;
237dbdf9cedSTony Lindgren }
238dbdf9cedSTony Lindgren 
239dbdf9cedSTony Lindgren static void __init osk_init_cf(void)
240dbdf9cedSTony Lindgren {
241dbdf9cedSTony Lindgren 	omap_cfg_reg(M7_1610_GPIO62);
242dbdf9cedSTony Lindgren 	if ((omap_request_gpio(62)) < 0) {
243dbdf9cedSTony Lindgren 		printk("Error requesting gpio 62 for CF irq\n");
244dbdf9cedSTony Lindgren 		return;
245dbdf9cedSTony Lindgren 	}
2467c38cf02STony Lindgren 	/* the CF I/O IRQ is really active-low */
2477c38cf02STony Lindgren 	set_irq_type(OMAP_GPIO_IRQ(62), IRQT_FALLING);
248dbdf9cedSTony Lindgren }
249dbdf9cedSTony Lindgren 
2507c38cf02STony Lindgren static void __init osk_init_irq(void)
251dbdf9cedSTony Lindgren {
25287bd63f6STony Lindgren 	omap1_init_common_hw();
253dbdf9cedSTony Lindgren 	omap_init_irq();
254dbdf9cedSTony Lindgren 	omap_gpio_init();
255dbdf9cedSTony Lindgren 	osk_init_smc91x();
256dbdf9cedSTony Lindgren 	osk_init_cf();
257dbdf9cedSTony Lindgren }
258dbdf9cedSTony Lindgren 
259dbdf9cedSTony Lindgren static struct omap_usb_config osk_usb_config __initdata = {
260dbdf9cedSTony Lindgren 	/* has usb host connector (A) ... for development it can also
261dbdf9cedSTony Lindgren 	 * be used, with a NONSTANDARD gender-bending cable/dongle, as
262dbdf9cedSTony Lindgren 	 * a peripheral.
263dbdf9cedSTony Lindgren 	 */
264dbdf9cedSTony Lindgren #ifdef	CONFIG_USB_GADGET_OMAP
265dbdf9cedSTony Lindgren 	.register_dev	= 1,
266dbdf9cedSTony Lindgren 	.hmc_mode	= 0,
267dbdf9cedSTony Lindgren #else
268dbdf9cedSTony Lindgren 	.register_host	= 1,
269dbdf9cedSTony Lindgren 	.hmc_mode	= 16,
270dbdf9cedSTony Lindgren 	.rwc		= 1,
271dbdf9cedSTony Lindgren #endif
272dbdf9cedSTony Lindgren 	.pins[0]	= 2,
273dbdf9cedSTony Lindgren };
274dbdf9cedSTony Lindgren 
2753179a019STony Lindgren static struct omap_uart_config osk_uart_config __initdata = {
2763179a019STony Lindgren 	.enabled_uarts = (1 << 0),
2773179a019STony Lindgren };
2783179a019STony Lindgren 
2793179a019STony Lindgren static struct omap_lcd_config osk_lcd_config __initdata = {
2803179a019STony Lindgren 	.ctrl_name	= "internal",
2813179a019STony Lindgren };
2823179a019STony Lindgren 
283dbdf9cedSTony Lindgren static struct omap_board_config_kernel osk_config[] = {
284dbdf9cedSTony Lindgren 	{ OMAP_TAG_USB,           &osk_usb_config },
2853179a019STony Lindgren 	{ OMAP_TAG_UART,		&osk_uart_config },
2863179a019STony Lindgren 	{ OMAP_TAG_LCD,			&osk_lcd_config },
287dbdf9cedSTony Lindgren };
288dbdf9cedSTony Lindgren 
2897c38cf02STony Lindgren #ifdef	CONFIG_OMAP_OSK_MISTRAL
2907c38cf02STony Lindgren 
2917c38cf02STony Lindgren #ifdef	CONFIG_PM
2927c38cf02STony Lindgren static irqreturn_t
2937c38cf02STony Lindgren osk_mistral_wake_interrupt(int irq, void *ignored, struct pt_regs *regs)
2947c38cf02STony Lindgren {
2957c38cf02STony Lindgren 	return IRQ_HANDLED;
2967c38cf02STony Lindgren }
2977c38cf02STony Lindgren #endif
2987c38cf02STony Lindgren 
2997c38cf02STony Lindgren static void __init osk_mistral_init(void)
3007c38cf02STony Lindgren {
3017c38cf02STony Lindgren 	/* FIXME here's where to feed in framebuffer, touchpad, and
3027c38cf02STony Lindgren 	 * keyboard setup ...  not in the drivers for those devices!
3037c38cf02STony Lindgren 	 *
3047c38cf02STony Lindgren 	 * NOTE:  we could actually tell if there's a Mistral board
3057c38cf02STony Lindgren 	 * attached, e.g. by trying to read something from the ads7846.
3067c38cf02STony Lindgren 	 * But this is too early for that...
3077c38cf02STony Lindgren 	 */
3087c38cf02STony Lindgren 
3097c38cf02STony Lindgren 	/* the sideways button (SW1) is for use as a "wakeup" button */
3107c38cf02STony Lindgren 	omap_cfg_reg(N15_1610_MPUIO2);
3117c38cf02STony Lindgren 	if (omap_request_gpio(OMAP_MPUIO(2)) == 0) {
3127c38cf02STony Lindgren 		int ret = 0;
3137c38cf02STony Lindgren 		omap_set_gpio_direction(OMAP_MPUIO(2), 1);
3147c38cf02STony Lindgren 		set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQT_RISING);
3157c38cf02STony Lindgren #ifdef	CONFIG_PM
3167c38cf02STony Lindgren 		/* share the IRQ in case someone wants to use the
3177c38cf02STony Lindgren 		 * button for more than wakeup from system sleep.
3187c38cf02STony Lindgren 		 */
3197c38cf02STony Lindgren 		ret = request_irq(OMAP_GPIO_IRQ(OMAP_MPUIO(2)),
3207c38cf02STony Lindgren 				&osk_mistral_wake_interrupt,
3217c38cf02STony Lindgren 				SA_SHIRQ, "mistral_wakeup",
3227c38cf02STony Lindgren 				&osk_mistral_wake_interrupt);
3237c38cf02STony Lindgren 		if (ret != 0) {
3247c38cf02STony Lindgren 			omap_free_gpio(OMAP_MPUIO(2));
3257c38cf02STony Lindgren 			printk(KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n",
3267c38cf02STony Lindgren 				ret);
3277c38cf02STony Lindgren 		} else
3287c38cf02STony Lindgren 			enable_irq_wake(OMAP_GPIO_IRQ(OMAP_MPUIO(2)));
3297c38cf02STony Lindgren #endif
3307c38cf02STony Lindgren 	} else
3317c38cf02STony Lindgren 		printk(KERN_ERR "OSK+Mistral: wakeup button is awol\n");
3327c38cf02STony Lindgren }
3337c38cf02STony Lindgren #else
3347c38cf02STony Lindgren static void __init osk_mistral_init(void) { }
3357c38cf02STony Lindgren #endif
3367c38cf02STony Lindgren 
3379b6553cdSTony Lindgren #define EMIFS_CS3_VAL	(0x88013141)
3389b6553cdSTony Lindgren 
339dbdf9cedSTony Lindgren static void __init osk_init(void)
340dbdf9cedSTony Lindgren {
3419b6553cdSTony Lindgren 	/* Workaround for wrong CS3 (NOR flash) timing
3429b6553cdSTony Lindgren 	 * There are some U-Boot versions out there which configure
3439b6553cdSTony Lindgren 	 * wrong CS3 memory timings. This mainly leads to CRC
3449b6553cdSTony Lindgren 	 * or similiar errors if you use NOR flash (e.g. with JFFS2)
3459b6553cdSTony Lindgren 	 */
3469b6553cdSTony Lindgren 	if (EMIFS_CCS(3) != EMIFS_CS3_VAL)
3479b6553cdSTony Lindgren 		EMIFS_CCS(3) = EMIFS_CS3_VAL;
3489b6553cdSTony Lindgren 
3497c38cf02STony Lindgren 	osk_flash_resource.end = osk_flash_resource.start = omap_cs3_phys();
3507c38cf02STony Lindgren 	osk_flash_resource.end += SZ_32M - 1;
351dbdf9cedSTony Lindgren 	platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices));
352dbdf9cedSTony Lindgren 	omap_board_config = osk_config;
353dbdf9cedSTony Lindgren 	omap_board_config_size = ARRAY_SIZE(osk_config);
354dbdf9cedSTony Lindgren 	USB_TRANSCEIVER_CTRL_REG |= (3 << 1);
3557c38cf02STony Lindgren 
3563179a019STony Lindgren 	omap_serial_init();
3577c38cf02STony Lindgren 	osk_mistral_init();
358dbdf9cedSTony Lindgren }
359dbdf9cedSTony Lindgren 
360dbdf9cedSTony Lindgren static void __init osk_map_io(void)
361dbdf9cedSTony Lindgren {
36287bd63f6STony Lindgren 	omap1_map_common_io();
363dbdf9cedSTony Lindgren }
364dbdf9cedSTony Lindgren 
365dbdf9cedSTony Lindgren MACHINE_START(OMAP_OSK, "TI-OSK")
366dbdf9cedSTony Lindgren 	/* Maintainer: Dirk Behme <dirk.behme@de.bosch.com> */
367dbdf9cedSTony Lindgren 	.phys_io	= 0xfff00000,
368dbdf9cedSTony Lindgren 	.io_pg_offst	= ((0xfef00000) >> 18) & 0xfffc,
369dbdf9cedSTony Lindgren 	.boot_params	= 0x10000100,
370dbdf9cedSTony Lindgren 	.map_io		= osk_map_io,
371dbdf9cedSTony Lindgren 	.init_irq	= osk_init_irq,
372dbdf9cedSTony Lindgren 	.init_machine	= osk_init,
373dbdf9cedSTony Lindgren 	.timer		= &omap_timer,
374dbdf9cedSTony Lindgren MACHINE_END
375