2 * Copyright (c) 2010, 2011 NVIDIA Corporation.
3 * Copyright (C) 2010, 2011 Google, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 #include <linux/kernel.h>
18 #include <linux/init.h>
19 #include <linux/platform_device.h>
20 #include <linux/serial_8250.h>
21 #include <linux/delay.h>
22 #include <linux/input.h>
24 #include <linux/gpio_keys.h>
26 #include <mach/iomap.h>
27 #include <mach/irqs.h>
28 #include <mach/sdhci.h>
30 #include <asm/mach-types.h>
31 #include <asm/mach/arch.h>
34 #include "board-seaboard.h"
37 #include "gpio-names.h"
39 static struct plat_serial8250_port debug_uart_platform_data[] = {
41 /* Memory and IRQ filled in before registration */
42 .flags = UPF_BOOT_AUTOCONF,
51 static struct platform_device debug_uart = {
53 .id = PLAT8250_DEV_PLATFORM,
55 .platform_data = debug_uart_platform_data,
59 static __initdata struct tegra_clk_init_table seaboard_clk_init_table[] = {
60 /* name parent rate enabled */
61 { "uartb", "pll_p", 216000000, true},
62 { "uartd", "pll_p", 216000000, true},
66 static struct gpio_keys_button seaboard_gpio_keys_buttons[] = {
69 .gpio = TEGRA_GPIO_LIDSWITCH,
74 .debounce_interval = 1,
78 .gpio = TEGRA_GPIO_POWERKEY,
86 static struct gpio_keys_platform_data seaboard_gpio_keys = {
87 .buttons = seaboard_gpio_keys_buttons,
88 .nbuttons = ARRAY_SIZE(seaboard_gpio_keys_buttons),
91 static struct platform_device seaboard_gpio_keys_device = {
95 .platform_data = &seaboard_gpio_keys,
99 static struct tegra_sdhci_platform_data sdhci_pdata1 = {
105 static struct tegra_sdhci_platform_data sdhci_pdata3 = {
106 .cd_gpio = TEGRA_GPIO_PI5,
107 .wp_gpio = TEGRA_GPIO_PH1,
108 .power_gpio = TEGRA_GPIO_PI6,
111 static struct tegra_sdhci_platform_data sdhci_pdata4 = {
118 static struct platform_device *seaboard_devices[] __initdata = {
121 &tegra_sdhci_device1,
122 &tegra_sdhci_device3,
123 &tegra_sdhci_device4,
124 &seaboard_gpio_keys_device,
127 static void __init __tegra_seaboard_init(void)
129 seaboard_pinmux_init();
131 tegra_clk_init_from_table(seaboard_clk_init_table);
133 tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
134 tegra_sdhci_device3.dev.platform_data = &sdhci_pdata3;
135 tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
137 platform_add_devices(seaboard_devices, ARRAY_SIZE(seaboard_devices));
140 static void __init tegra_seaboard_init(void)
142 /* Seaboard uses UARTD for the debug port. */
143 debug_uart_platform_data[0].membase = IO_ADDRESS(TEGRA_UARTD_BASE);
144 debug_uart_platform_data[0].mapbase = TEGRA_UARTD_BASE;
145 debug_uart_platform_data[0].irq = INT_UARTD;
147 __tegra_seaboard_init();
150 static void __init tegra_kaen_init(void)
152 /* Kaen uses UARTB for the debug port. */
153 debug_uart_platform_data[0].membase = IO_ADDRESS(TEGRA_UARTB_BASE);
154 debug_uart_platform_data[0].mapbase = TEGRA_UARTB_BASE;
155 debug_uart_platform_data[0].irq = INT_UARTB;
157 __tegra_seaboard_init();
160 static void __init tegra_wario_init(void)
162 /* Wario uses UARTB for the debug port. */
163 debug_uart_platform_data[0].membase = IO_ADDRESS(TEGRA_UARTB_BASE);
164 debug_uart_platform_data[0].mapbase = TEGRA_UARTB_BASE;
165 debug_uart_platform_data[0].irq = INT_UARTB;
167 __tegra_seaboard_init();
171 MACHINE_START(SEABOARD, "seaboard")
172 .boot_params = 0x00000100,
173 .map_io = tegra_map_common_io,
174 .init_early = tegra_init_early,
175 .init_irq = tegra_init_irq,
176 .timer = &tegra_timer,
177 .init_machine = tegra_seaboard_init,
180 MACHINE_START(KAEN, "kaen")
181 .boot_params = 0x00000100,
182 .map_io = tegra_map_common_io,
183 .init_early = tegra_init_early,
184 .init_irq = tegra_init_irq,
185 .timer = &tegra_timer,
186 .init_machine = tegra_kaen_init,
189 MACHINE_START(WARIO, "wario")
190 .boot_params = 0x00000100,
191 .map_io = tegra_map_common_io,
192 .init_early = tegra_init_early,
193 .init_irq = tegra_init_irq,
194 .timer = &tegra_timer,
195 .init_machine = tegra_wario_init,