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 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/device.h>
17 #include <linux/mtd/mtd.h>
18 #include <linux/mtd/partitions.h>
20 #include <asm/hardware.h>
21 #include <asm/mach-types.h>
22 #include <asm/mach/arch.h>
23 #include <asm/mach/map.h>
24 #include <asm/mach/flash.h>
26 #include <asm/arch/gpio.h>
27 #include <asm/arch/mux.h>
28 #include <asm/arch/usb.h>
29 #include <asm/arch/board.h>
30 #include <asm/arch/common.h>
33 #include <asm/delay.h>
35 static struct mtd_partition h4_partitions[] = {
36 /* bootloader (U-Boot, etc) in first sector */
41 .mask_flags = MTD_WRITEABLE, /* force read-only */
43 /* bootloader params in the next sector */
46 .offset = MTDPART_OFS_APPEND,
53 .offset = MTDPART_OFS_APPEND,
60 .offset = MTDPART_OFS_APPEND,
61 .size = MTDPART_SIZ_FULL,
66 static struct flash_platform_data h4_flash_data = {
67 .map_name = "cfi_probe",
69 .parts = h4_partitions,
70 .nr_parts = ARRAY_SIZE(h4_partitions),
73 static struct resource h4_flash_resource = {
75 .end = H4_CS0_BASE + SZ_64M - 1,
76 .flags = IORESOURCE_MEM,
79 static struct platform_device h4_flash_device = {
83 .platform_data = &h4_flash_data,
86 .resource = &h4_flash_resource,
89 static struct resource h4_smc91x_resources[] = {
91 .start = OMAP24XX_ETHR_START, /* Physical */
92 .end = OMAP24XX_ETHR_START + 0xf,
93 .flags = IORESOURCE_MEM,
96 .start = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
97 .end = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
98 .flags = IORESOURCE_IRQ,
102 static struct platform_device h4_smc91x_device = {
105 .num_resources = ARRAY_SIZE(h4_smc91x_resources),
106 .resource = h4_smc91x_resources,
109 static struct platform_device *h4_devices[] __initdata = {
114 static inline void __init h4_init_smc91x(void)
118 if (omap_request_gpio(OMAP24XX_ETHR_GPIO_IRQ) < 0) {
119 printk(KERN_ERR "Failed to request GPIO#%d for smc91x IRQ\n",
120 OMAP24XX_ETHR_GPIO_IRQ);
123 set_irq_type(OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
125 /* Set pin M15 to mux mode 3 -> GPIO#92, disable PU/PD */
126 /* FIXME: change this using omap2 mux api when it's ready */
127 l = __raw_readl(0xd8000000 + 0x108);
128 l &= ~(((1 << 5) - 1) << 16);
130 __raw_writel(l, 0xd8000000 + 0x108);
133 static void __init omap_h4_init_irq(void)
140 static struct omap_uart_config h4_uart_config __initdata = {
141 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
144 static struct omap_mmc_config h4_mmc_config __initdata = {
154 static struct omap_board_config_kernel h4_config[] = {
155 { OMAP_TAG_UART, &h4_uart_config },
156 { OMAP_TAG_MMC, &h4_mmc_config },
159 static void __init omap_h4_init(void)
162 * Make sure the serial ports are muxed on at this point.
163 * You have to mux them off in device drivers later on
166 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
167 omap_board_config = h4_config;
168 omap_board_config_size = ARRAY_SIZE(h4_config);
172 static void __init omap_h4_map_io(void)
174 omap_map_common_io();
177 MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
178 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
179 .phys_ram = 0x80000000,
180 .phys_io = 0x48000000,
181 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
182 .boot_params = 0x80000100,
183 .map_io = omap_h4_map_io,
184 .init_irq = omap_h4_init_irq,
185 .init_machine = omap_h4_init,
186 .timer = &omap_timer,