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/platform_device.h>
17 #include <linux/mtd/mtd.h>
18 #include <linux/mtd/partitions.h>
19 #include <linux/delay.h>
21 #include <asm/hardware.h>
22 #include <asm/mach-types.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/map.h>
25 #include <asm/mach/flash.h>
27 #include <asm/arch/gpio.h>
28 #include <asm/arch/mux.h>
29 #include <asm/arch/usb.h>
30 #include <asm/arch/board.h>
31 #include <asm/arch/common.h>
32 #include <asm/arch/prcm.h>
35 #include <asm/delay.h>
37 static struct mtd_partition h4_partitions[] = {
38 /* bootloader (U-Boot, etc) in first sector */
43 .mask_flags = MTD_WRITEABLE, /* force read-only */
45 /* bootloader params in the next sector */
48 .offset = MTDPART_OFS_APPEND,
55 .offset = MTDPART_OFS_APPEND,
62 .offset = MTDPART_OFS_APPEND,
63 .size = MTDPART_SIZ_FULL,
68 static struct flash_platform_data h4_flash_data = {
69 .map_name = "cfi_probe",
71 .parts = h4_partitions,
72 .nr_parts = ARRAY_SIZE(h4_partitions),
75 static struct resource h4_flash_resource = {
77 .end = H4_CS0_BASE + SZ_64M - 1,
78 .flags = IORESOURCE_MEM,
81 static struct platform_device h4_flash_device = {
85 .platform_data = &h4_flash_data,
88 .resource = &h4_flash_resource,
91 static struct resource h4_smc91x_resources[] = {
93 .start = OMAP24XX_ETHR_START, /* Physical */
94 .end = OMAP24XX_ETHR_START + 0xf,
95 .flags = IORESOURCE_MEM,
98 .start = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
99 .end = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
100 .flags = IORESOURCE_IRQ,
104 static struct platform_device h4_smc91x_device = {
107 .num_resources = ARRAY_SIZE(h4_smc91x_resources),
108 .resource = h4_smc91x_resources,
111 static struct platform_device *h4_devices[] __initdata = {
116 static inline void __init h4_init_smc91x(void)
118 /* Make sure CS1 timings are correct */
119 GPMC_CONFIG1_1 = 0x00011200;
120 GPMC_CONFIG2_1 = 0x001f1f01;
121 GPMC_CONFIG3_1 = 0x00080803;
122 GPMC_CONFIG4_1 = 0x1c091c09;
123 GPMC_CONFIG5_1 = 0x041f1f1f;
124 GPMC_CONFIG6_1 = 0x000004c4;
125 GPMC_CONFIG7_1 = 0x00000f40 | (0x08000000 >> 24);
128 omap_cfg_reg(M15_24XX_GPIO92);
129 if (omap_request_gpio(OMAP24XX_ETHR_GPIO_IRQ) < 0) {
130 printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
131 OMAP24XX_ETHR_GPIO_IRQ);
134 omap_set_gpio_direction(OMAP24XX_ETHR_GPIO_IRQ, 1);
137 static void __init omap_h4_init_irq(void)
144 static struct omap_uart_config h4_uart_config __initdata = {
145 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
148 static struct omap_mmc_config h4_mmc_config __initdata = {
158 static struct omap_lcd_config h4_lcd_config __initdata = {
160 .ctrl_name = "internal",
163 static struct omap_board_config_kernel h4_config[] = {
164 { OMAP_TAG_UART, &h4_uart_config },
165 { OMAP_TAG_MMC, &h4_mmc_config },
166 { OMAP_TAG_LCD, &h4_lcd_config },
169 static void __init omap_h4_init(void)
172 * Make sure the serial ports are muxed on at this point.
173 * You have to mux them off in device drivers later on
176 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
177 omap_board_config = h4_config;
178 omap_board_config_size = ARRAY_SIZE(h4_config);
182 static void __init omap_h4_map_io(void)
184 omap_map_common_io();
187 MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
188 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
189 .phys_ram = 0x80000000,
190 .phys_io = 0x48000000,
191 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
192 .boot_params = 0x80000100,
193 .map_io = omap_h4_map_io,
194 .init_irq = omap_h4_init_irq,
195 .init_machine = omap_h4_init,
196 .timer = &omap_timer,