PRCM: OMAP3: Fix to wrongly modified omap2_clk_wait_ready
[linux-ginger.git] / arch / arm / mach-omap2 / board-2430osk.c
blob146dba3ce776a7b514e46151c56b104f6e0cb975
1 /*
2 * linux/arch/arm/mach-omap2/board-2430osk.c
4 * Copyright (C) 2007 Mistral Software Pvt Ltd
6 * Modified from mach-omap2/board-generic.c
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/platform_device.h>
16 #include <linux/delay.h>
17 #include <linux/err.h>
18 #include <linux/clk.h>
20 #include <asm/hardware.h>
21 #include <asm/mach-types.h>
22 #include <asm/mach/arch.h>
23 #include <asm/mach/map.h>
25 #include <asm/arch/gpio.h>
26 #include <asm/arch/board.h>
27 #include <asm/arch/common.h>
29 #include <asm/io.h>
31 static void __init omap_2430osk_init_irq(void)
33 omap2_init_common_hw();
34 omap_init_irq();
35 omap_gpio_init();
38 static struct omap_uart_config osk2430_uart_config __initdata = {
39 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
42 static struct omap_board_config_kernel osk2430_config[] __initdata = {
44 {OMAP_TAG_UART, &osk2430_uart_config},
47 #if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
49 #define OMAP2_I2C_BASE1 0x48070000
50 #define OMAP2_I2C_BASE2 0x48072000
51 #define OMAP2_I2C_INT1 56
52 #define OMAP2_I2C_INT2 57
54 static u32 omap2_i2c1_clkrate = 400;
55 static u32 omap2_i2c2_clkrate = 2600;
57 static struct resource i2c_resources1[] = {
59 .start = OMAP2_I2C_BASE1,
60 .end = OMAP2_I2C_BASE1 + 0x3f,
61 .flags = IORESOURCE_MEM,
64 .start = OMAP2_I2C_INT1,
65 .flags = IORESOURCE_IRQ,
69 static struct resource i2c_resources2[] = {
71 .start = OMAP2_I2C_BASE2,
72 .end = OMAP2_I2C_BASE2 + 0x3f,
73 .flags = IORESOURCE_MEM,
76 .start = OMAP2_I2C_INT2,
77 .flags = IORESOURCE_IRQ,
81 static struct platform_device omap_i2c_device1 = {
82 .name = "i2c_omap",
83 .id = 1,
84 .num_resources = ARRAY_SIZE(i2c_resources1),
85 .resource = i2c_resources1,
86 .dev = {
87 .platform_data = &omap2_i2c1_clkrate,
91 static struct platform_device omap_i2c_device2 = {
92 .name = "i2c_omap",
93 .id = 2,
94 .num_resources = ARRAY_SIZE(i2c_resources2),
95 .resource = i2c_resources2,
96 .dev = {
97 .platform_data = &omap2_i2c2_clkrate,
101 static void omap_init_i2c(void)
103 (void) platform_device_register(&omap_i2c_device2);
104 (void) platform_device_register(&omap_i2c_device1);
107 #else
109 static void omap_init_i2c(void) {}
111 #endif
113 static int __init omap2430_i2c_init(void)
115 omap_init_i2c();
116 return 0;
119 static void __init omap_2430osk_init(void)
121 omap_board_config = osk2430_config;
122 omap_board_config_size = ARRAY_SIZE(osk2430_config);
123 omap_serial_init();
126 static void __init omap_2430osk_map_io(void)
128 omap2_set_globals_243x();
129 omap2_map_common_io();
132 arch_initcall(omap2430_i2c_init);
134 MACHINE_START(OMAP_2430OSK, "OMAP2430 2430OSK board")
135 /* Maintainer: Syed Khasim */
136 .phys_io = 0x48000000,
137 .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
138 .boot_params = 0x80000100,
139 .map_io = omap_2430osk_map_io,
140 .init_irq = omap_2430osk_init_irq,
141 .init_machine = omap_2430osk_init,
142 .timer = &omap_timer,
143 MACHINE_END