2 * linux/arch/arm/mach-omap/omap2/board-h4.c
4 * Copyright (C) 2005 Nokia Corporation
5 * Author: Paul Mundt <paul.mundt@nokia.com>
7 * Modified from mach-omap/omap1/board-generic.c
9 * Code for generic OMAP2 board. Should work on many OMAP2 systems where
10 * the bootloader passes the board-specific data to the kernel.
11 * Do not put any board specific code to this file; create a new machine
12 * type if you need custom low-level initializations.
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
19 #include <linux/kernel.h>
20 #include <linux/init.h>
21 #include <linux/device.h>
23 #include <asm/hardware.h>
24 #include <asm/mach-types.h>
25 #include <asm/mach/arch.h>
26 #include <asm/mach/map.h>
28 #include <asm/arch/gpio.h>
29 #include <asm/arch/mux.h>
30 #include <asm/arch/usb.h>
31 #include <asm/arch/board.h>
32 #include <asm/arch/common.h>
35 #include <asm/delay.h>
37 static struct resource h4_smc91x_resources[] = {
39 .start = OMAP24XX_ETHR_START, /* Physical */
40 .end = OMAP24XX_ETHR_START + 0xf,
41 .flags = IORESOURCE_MEM,
44 .start = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
45 .end = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
46 .flags = IORESOURCE_IRQ,
50 static struct platform_device h4_smc91x_device = {
53 .num_resources = ARRAY_SIZE(h4_smc91x_resources),
54 .resource = h4_smc91x_resources,
57 static struct platform_device *h4_devices[] __initdata = {
61 static inline void __init h4_init_smc91x(void)
65 if (omap_request_gpio(OMAP24XX_ETHR_GPIO_IRQ) < 0) {
66 printk(KERN_ERR "Failed to request GPIO#%d for smc91x IRQ\n",
67 OMAP24XX_ETHR_GPIO_IRQ);
70 set_irq_type(OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
72 /* Set pin M15 to mux mode 3 -> GPIO#92, disable PU/PD */
73 /* FIXME: change this using omap2 mux api when it's ready */
74 l = __raw_readl(0xd8000000 + 0x108);
75 l &= ~(((1 << 5) - 1) << 16);
77 __raw_writel(l, 0xd8000000 + 0x108);
80 static void __init omap_h4_init_irq(void)
87 static struct omap_uart_config h4_uart_config __initdata = {
88 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
91 static struct omap_board_config_kernel h4_config[] = {
92 { OMAP_TAG_UART, &h4_uart_config },
95 static void __init omap_h4_init(void)
98 * Make sure the serial ports are muxed on at this point.
99 * You have to mux them off in device drivers later on
102 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
103 omap_board_config = h4_config;
104 omap_board_config_size = ARRAY_SIZE(h4_config);
108 static void __init omap_h4_map_io(void)
110 omap_map_common_io();
113 MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
114 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
115 .phys_ram = 0x80000000,
116 .phys_io = 0x48000000,
117 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
118 .boot_params = 0x80000100,
119 .map_io = omap_h4_map_io,
120 .init_irq = omap_h4_init_irq,
121 .init_machine = omap_h4_init,
122 .timer = &omap_timer,