blob: 26b70dab28ccaac4c93a804f60dfb6ebe444a52b [file] [log] [blame]
Lauri Leukkunenffe7f952009-03-23 18:38:17 -07001/*
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>
Lauri Leukkunenffe7f952009-03-23 18:38:17 -070018#include <linux/gpio.h>
Kevin Hilmana4b41d82009-10-02 08:17:56 -070019#include <linux/leds.h>
Lauri Leukkunenffe7f952009-03-23 18:38:17 -070020
21#include <mach/hardware.h>
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25
Tony Lindgrence491cf2009-10-20 09:40:47 -070026#include <plat/mcspi.h>
Tony Lindgrence491cf2009-10-20 09:40:47 -070027#include <plat/board.h>
28#include <plat/common.h>
Tony Lindgrence491cf2009-10-20 09:40:47 -070029#include <plat/dma.h>
30#include <plat/gpmc.h>
31#include <plat/usb.h>
Lauri Leukkunenffe7f952009-03-23 18:38:17 -070032
Tony Lindgrenca5742b2009-12-11 16:16:32 -080033#include "mux.h"
34
Kevin Hilmana4b41d82009-10-02 08:17:56 -070035#define RX51_GPIO_SLEEP_IND 162
36
Tero Kristo20006552009-11-22 10:11:36 -080037struct omap_sdrc_params *rx51_get_sdram_timings(void);
38
Kevin Hilmana4b41d82009-10-02 08:17:56 -070039static struct gpio_led gpio_leds[] = {
40 {
41 .name = "sleep_ind",
42 .gpio = RX51_GPIO_SLEEP_IND,
43 },
44};
45
46static struct gpio_led_platform_data gpio_led_info = {
47 .leds = gpio_leds,
48 .num_leds = ARRAY_SIZE(gpio_leds),
49};
50
51static struct platform_device leds_gpio = {
52 .name = "leds-gpio",
53 .id = -1,
54 .dev = {
55 .platform_data = &gpio_led_info,
56 },
57};
58
Lauri Leukkunenffe7f952009-03-23 18:38:17 -070059static struct omap_lcd_config rx51_lcd_config = {
60 .ctrl_name = "internal",
61};
62
63static struct omap_fbmem_config rx51_fbmem0_config = {
64 .size = 752 * 1024,
65};
66
67static struct omap_fbmem_config rx51_fbmem1_config = {
68 .size = 752 * 1024,
69};
70
71static struct omap_fbmem_config rx51_fbmem2_config = {
72 .size = 752 * 1024,
73};
74
75static struct omap_board_config_kernel rx51_config[] = {
Lauri Leukkunenffe7f952009-03-23 18:38:17 -070076 { 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
82static void __init rx51_init_irq(void)
83{
Tero Kristo20006552009-11-22 10:11:36 -080084 struct omap_sdrc_params *sdrc_params;
85
Paul Walmsleyb3c6df32009-09-03 20:14:02 +030086 omap_board_config = rx51_config;
87 omap_board_config_size = ARRAY_SIZE(rx51_config);
Tero Kristo20006552009-11-22 10:11:36 -080088 sdrc_params = rx51_get_sdram_timings();
89 omap2_init_common_hw(sdrc_params, sdrc_params);
Lauri Leukkunenffe7f952009-03-23 18:38:17 -070090 omap_init_irq();
91 omap_gpio_init();
92}
93
94extern void __init rx51_peripherals_init(void);
95
Tony Lindgrenca5742b2009-12-11 16:16:32 -080096#ifdef CONFIG_OMAP_MUX
97static struct omap_board_mux board_mux[] __initdata = {
98 { .reg_offset = OMAP_MUX_TERMINATOR },
99};
100#else
101#define board_mux NULL
102#endif
103
Lauri Leukkunenffe7f952009-03-23 18:38:17 -0700104static void __init rx51_init(void)
105{
Tony Lindgrenca5742b2009-12-11 16:16:32 -0800106 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
Lauri Leukkunenffe7f952009-03-23 18:38:17 -0700107 omap_serial_init();
108 usb_musb_init();
109 rx51_peripherals_init();
Jean Pihet9fb97412009-07-24 19:43:25 -0600110
111 /* Ensure SDRC pins are mux'd for self-refresh */
Tony Lindgren4896e392009-12-11 16:16:32 -0800112 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
113 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
Kevin Hilmana4b41d82009-10-02 08:17:56 -0700114
115 platform_device_register(&leds_gpio);
Lauri Leukkunenffe7f952009-03-23 18:38:17 -0700116}
117
118static void __init rx51_map_io(void)
119{
120 omap2_set_globals_343x();
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800121 omap34xx_map_common_io();
Lauri Leukkunenffe7f952009-03-23 18:38:17 -0700122}
123
124MACHINE_START(NOKIA_RX51, "Nokia RX-51 board")
125 /* Maintainer: Lauri Leukkunen <lauri.leukkunen@nokia.com> */
126 .phys_io = 0x48000000,
Santosh Shilimkarb4224b22009-10-19 17:25:55 -0700127 .io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
Lauri Leukkunenffe7f952009-03-23 18:38:17 -0700128 .boot_params = 0x80000100,
129 .map_io = rx51_map_io,
130 .init_irq = rx51_init_irq,
131 .init_machine = rx51_init,
132 .timer = &omap_timer,
133MACHINE_END