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>
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 extern int omap_gpio_init(void);
39 static struct mtd_partition h4_partitions[] = {
40 /* bootloader (U-Boot, etc) in first sector */
45 .mask_flags = MTD_WRITEABLE, /* force read-only */
47 /* bootloader params in the next sector */
50 .offset = MTDPART_OFS_APPEND,
57 .offset = MTDPART_OFS_APPEND,
64 .offset = MTDPART_OFS_APPEND,
65 .size = MTDPART_SIZ_FULL,
70 static struct flash_platform_data h4_flash_data = {
71 .map_name = "cfi_probe",
73 .parts = h4_partitions,
74 .nr_parts = ARRAY_SIZE(h4_partitions),
77 static struct resource h4_flash_resource = {
79 .end = H4_CS0_BASE + SZ_64M - 1,
80 .flags = IORESOURCE_MEM,
83 static struct platform_device h4_flash_device = {
87 .platform_data = &h4_flash_data,
90 .resource = &h4_flash_resource,
93 static struct resource h4_smc91x_resources[] = {
95 .start = OMAP24XX_ETHR_START, /* Physical */
96 .end = OMAP24XX_ETHR_START + 0xf,
97 .flags = IORESOURCE_MEM,
100 .start = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
101 .end = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ),
102 .flags = IORESOURCE_IRQ,
106 static struct platform_device h4_smc91x_device = {
109 .num_resources = ARRAY_SIZE(h4_smc91x_resources),
110 .resource = h4_smc91x_resources,
113 static struct platform_device *h4_devices[] __initdata = {
118 static inline void __init h4_init_smc91x(void)
120 /* Make sure CS1 timings are correct */
121 GPMC_CONFIG1_1 = 0x00011200;
122 GPMC_CONFIG2_1 = 0x001f1f01;
123 GPMC_CONFIG3_1 = 0x00080803;
124 GPMC_CONFIG4_1 = 0x1c091c09;
125 GPMC_CONFIG5_1 = 0x041f1f1f;
126 GPMC_CONFIG6_1 = 0x000004c4;
127 GPMC_CONFIG7_1 = 0x00000f40 | (0x08000000 >> 24);
130 omap_cfg_reg(M15_24XX_GPIO92);
131 if (omap_request_gpio(OMAP24XX_ETHR_GPIO_IRQ) < 0) {
132 printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n",
133 OMAP24XX_ETHR_GPIO_IRQ);
136 omap_set_gpio_direction(OMAP24XX_ETHR_GPIO_IRQ, 1);
139 static void __init omap_h4_init_irq(void)
146 static struct omap_uart_config h4_uart_config __initdata = {
147 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
150 static struct omap_mmc_config h4_mmc_config __initdata = {
160 static struct omap_board_config_kernel h4_config[] = {
161 { OMAP_TAG_UART, &h4_uart_config },
162 { OMAP_TAG_MMC, &h4_mmc_config },
165 static void __init omap_h4_init(void)
168 * Make sure the serial ports are muxed on at this point.
169 * You have to mux them off in device drivers later on
172 platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
173 omap_board_config = h4_config;
174 omap_board_config_size = ARRAY_SIZE(h4_config);
178 static void __init omap_h4_map_io(void)
180 omap_map_common_io();
183 MACHINE_START(OMAP_H4, "OMAP2420 H4 board")
184 /* Maintainer: Paul Mundt <paul.mundt@nokia.com> */
185 .phys_ram = 0x80000000,
186 .phys_io = 0x48000000,
187 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
188 .boot_params = 0x80000100,
189 .map_io = omap_h4_map_io,
190 .init_irq = omap_h4_init_irq,
191 .init_machine = omap_h4_init,
192 .timer = &omap_timer,