Commit | Line | Data |
---|---|---|
ffe7f95b LL |
1 | /* |
2 | * linux/arch/arm/mach-omap2/board-rx51.c | |
3 | * | |
4 | * Copyright (C) 2007, 2008 Nokia | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License version 2 as | |
8 | * published by the Free Software Foundation. | |
9 | */ | |
10 | ||
11 | #include <linux/kernel.h> | |
12 | #include <linux/init.h> | |
13 | #include <linux/platform_device.h> | |
14 | #include <linux/delay.h> | |
15 | #include <linux/err.h> | |
16 | #include <linux/clk.h> | |
17 | #include <linux/io.h> | |
ffe7f95b | 18 | #include <linux/gpio.h> |
a4b41d8e | 19 | #include <linux/leds.h> |
ffe7f95b LL |
20 | |
21 | #include <mach/hardware.h> | |
22 | #include <asm/mach-types.h> | |
23 | #include <asm/mach/arch.h> | |
24 | #include <asm/mach/map.h> | |
25 | ||
ce491cf8 | 26 | #include <plat/mcspi.h> |
ce491cf8 TL |
27 | #include <plat/board.h> |
28 | #include <plat/common.h> | |
ce491cf8 TL |
29 | #include <plat/dma.h> |
30 | #include <plat/gpmc.h> | |
31 | #include <plat/usb.h> | |
ffe7f95b | 32 | |
ca5742bd TL |
33 | #include "mux.h" |
34 | ||
a4b41d8e KH |
35 | #define RX51_GPIO_SLEEP_IND 162 |
36 | ||
2000655e TK |
37 | struct omap_sdrc_params *rx51_get_sdram_timings(void); |
38 | ||
a4b41d8e KH |
39 | static struct gpio_led gpio_leds[] = { |
40 | { | |
41 | .name = "sleep_ind", | |
42 | .gpio = RX51_GPIO_SLEEP_IND, | |
43 | }, | |
44 | }; | |
45 | ||
46 | static struct gpio_led_platform_data gpio_led_info = { | |
47 | .leds = gpio_leds, | |
48 | .num_leds = ARRAY_SIZE(gpio_leds), | |
49 | }; | |
50 | ||
51 | static struct platform_device leds_gpio = { | |
52 | .name = "leds-gpio", | |
53 | .id = -1, | |
54 | .dev = { | |
55 | .platform_data = &gpio_led_info, | |
56 | }, | |
57 | }; | |
58 | ||
ffe7f95b LL |
59 | static struct omap_lcd_config rx51_lcd_config = { |
60 | .ctrl_name = "internal", | |
61 | }; | |
62 | ||
63 | static struct omap_fbmem_config rx51_fbmem0_config = { | |
64 | .size = 752 * 1024, | |
65 | }; | |
66 | ||
67 | static struct omap_fbmem_config rx51_fbmem1_config = { | |
68 | .size = 752 * 1024, | |
69 | }; | |
70 | ||
71 | static struct omap_fbmem_config rx51_fbmem2_config = { | |
72 | .size = 752 * 1024, | |
73 | }; | |
74 | ||
75 | static struct omap_board_config_kernel rx51_config[] = { | |
ffe7f95b LL |
76 | { OMAP_TAG_FBMEM, &rx51_fbmem0_config }, |
77 | { OMAP_TAG_FBMEM, &rx51_fbmem1_config }, | |
78 | { OMAP_TAG_FBMEM, &rx51_fbmem2_config }, | |
79 | { OMAP_TAG_LCD, &rx51_lcd_config }, | |
80 | }; | |
81 | ||
82 | static void __init rx51_init_irq(void) | |
83 | { | |
2000655e TK |
84 | struct omap_sdrc_params *sdrc_params; |
85 | ||
b3c6df3a PW |
86 | omap_board_config = rx51_config; |
87 | omap_board_config_size = ARRAY_SIZE(rx51_config); | |
2000655e TK |
88 | sdrc_params = rx51_get_sdram_timings(); |
89 | omap2_init_common_hw(sdrc_params, sdrc_params); | |
ffe7f95b LL |
90 | omap_init_irq(); |
91 | omap_gpio_init(); | |
92 | } | |
93 | ||
94 | extern void __init rx51_peripherals_init(void); | |
95 | ||
ca5742bd TL |
96 | #ifdef CONFIG_OMAP_MUX |
97 | static struct omap_board_mux board_mux[] __initdata = { | |
98 | { .reg_offset = OMAP_MUX_TERMINATOR }, | |
99 | }; | |
100 | #else | |
101 | #define board_mux NULL | |
102 | #endif | |
103 | ||
ffe7f95b LL |
104 | static void __init rx51_init(void) |
105 | { | |
ca5742bd | 106 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
ffe7f95b LL |
107 | omap_serial_init(); |
108 | usb_musb_init(); | |
109 | rx51_peripherals_init(); | |
9fb97412 JP |
110 | |
111 | /* Ensure SDRC pins are mux'd for self-refresh */ | |
4896e394 TL |
112 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
113 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | |
a4b41d8e KH |
114 | |
115 | platform_device_register(&leds_gpio); | |
ffe7f95b LL |
116 | } |
117 | ||
118 | static void __init rx51_map_io(void) | |
119 | { | |
120 | omap2_set_globals_343x(); | |
6fbd55d0 | 121 | omap34xx_map_common_io(); |
ffe7f95b LL |
122 | } |
123 | ||
124 | MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") | |
125 | /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */ | |
126 | .phys_io = 0x48000000, | |
b4224b23 | 127 | .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc, |
ffe7f95b LL |
128 | .boot_params = 0x80000100, |
129 | .map_io = rx51_map_io, | |
130 | .init_irq = rx51_init_irq, | |
131 | .init_machine = rx51_init, | |
132 | .timer = &omap_timer, | |
133 | MACHINE_END |