OMAP4: SPI: Fix Driver Kconfig
[deliverable/linux.git] / arch / arm / mach-omap2 / board-4430sdp.c
CommitLineData
46ba0abf
SS
1/*
2 * Board support file for OMAP4430 SDP.
3 *
4 * Copyright (C) 2009 Texas Instruments
5 *
6 * Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
7 *
8 * Based on mach-omap2/board-3430sdp.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <linux/platform_device.h>
18#include <linux/io.h>
19#include <linux/gpio.h>
bce06683 20#include <linux/usb/otg.h>
46ba0abf
SS
21
22#include <mach/hardware.h>
23#include <asm/mach-types.h>
24#include <asm/mach/arch.h>
25#include <asm/mach/map.h>
26
ce491cf8
TL
27#include <plat/board.h>
28#include <plat/common.h>
29#include <plat/control.h>
30#include <plat/timer-gp.h>
bce06683 31#include <plat/usb.h>
46ba0abf 32#include <asm/hardware/gic.h>
d309427e 33#include <asm/hardware/cache-l2x0.h>
46ba0abf
SS
34
35static struct platform_device sdp4430_lcd_device = {
36 .name = "sdp4430_lcd",
37 .id = -1,
38};
39
40static struct platform_device *sdp4430_devices[] __initdata = {
41 &sdp4430_lcd_device,
42};
43
46ba0abf
SS
44static struct omap_lcd_config sdp4430_lcd_config __initdata = {
45 .ctrl_name = "internal",
46};
47
48static struct omap_board_config_kernel sdp4430_config[] __initdata = {
46ba0abf
SS
49 { OMAP_TAG_LCD, &sdp4430_lcd_config },
50};
51
d309427e 52#ifdef CONFIG_CACHE_L2X0
d309427e
SS
53static int __init omap_l2_cache_init(void)
54{
d660f9a2 55 extern void omap_smc1(u32 fn, u32 arg);
d309427e
SS
56 void __iomem *l2cache_base;
57
58 /* To avoid code running on other OMAPs in
59 * multi-omap builds
60 */
61 if (!cpu_is_omap44xx())
62 return -ENODEV;
63
64 /* Static mapping, never released */
65 l2cache_base = ioremap(OMAP44XX_L2CACHE_BASE, SZ_4K);
66 BUG_ON(!l2cache_base);
67
68 /* Enable PL310 L2 Cache controller */
69 omap_smc1(0x102, 0x1);
70
71 /* 32KB way size, 16-way associativity,
72 * parity disabled
73 */
74 l2x0_init(l2cache_base, 0x0e050000, 0xc0000fff);
75
76 return 0;
77}
78early_initcall(omap_l2_cache_init);
79#endif
80
46ba0abf
SS
81static void __init gic_init_irq(void)
82{
e4e7a13a
TL
83 void __iomem *base;
84
85 /* Static mapping, never released */
86 base = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K);
87 BUG_ON(!base);
88 gic_dist_init(0, base, 29);
89
90 /* Static mapping, never released */
91 gic_cpu_base_addr = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512);
92 BUG_ON(!gic_cpu_base_addr);
93 gic_cpu_init(0, gic_cpu_base_addr);
46ba0abf
SS
94}
95
96static void __init omap_4430sdp_init_irq(void)
97{
5b7815b5
SS
98 omap_board_config = sdp4430_config;
99 omap_board_config_size = ARRAY_SIZE(sdp4430_config);
58cda884 100 omap2_init_common_hw(NULL, NULL);
46ba0abf
SS
101#ifdef CONFIG_OMAP_32K_TIMER
102 omap2_gp_clockevent_set_gptimer(1);
103#endif
104 gic_init_irq();
105 omap_gpio_init();
106}
107
bce06683
MM
108static struct omap_musb_board_data musb_board_data = {
109 .interface_type = MUSB_INTERFACE_UTMI,
110 .mode = MUSB_PERIPHERAL,
111 .power = 100,
112};
46ba0abf
SS
113
114static void __init omap_4430sdp_init(void)
115{
116 platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices));
46ba0abf 117 omap_serial_init();
bce06683
MM
118 /* OMAP4 SDP uses internal transceiver so register nop transceiver */
119 usb_nop_xceiv_register();
ae46ec77
SS
120 /* FIXME: allow multi-omap to boot until musb is updated for omap4 */
121 if (!cpu_is_omap44xx())
122 usb_musb_init(&musb_board_data);
46ba0abf
SS
123}
124
125static void __init omap_4430sdp_map_io(void)
126{
127 omap2_set_globals_443x();
6fbd55d0 128 omap44xx_map_common_io();
46ba0abf
SS
129}
130
131MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board")
132 /* Maintainer: Santosh Shilimkar - Texas Instruments Inc */
133 .phys_io = 0x48000000,
b4224b23 134 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
46ba0abf
SS
135 .boot_params = 0x80000100,
136 .map_io = omap_4430sdp_map_io,
137 .init_irq = omap_4430sdp_init_irq,
138 .init_machine = omap_4430sdp_init,
139 .timer = &omap_timer,
140MACHINE_END
This page took 0.083105 seconds and 5 git commands to generate.