2 * arch/arm/mach-tegra/board-paz00.c
4 * Copyright (C) 2011 Marc Dietrich <marvin24@gmx.de>
6 * Based on board-harmony.c
7 * Copyright (C) 2010 Google, Inc.
9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and
11 * may be copied, distributed, and modified under those terms.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
20 #include <linux/kernel.h>
21 #include <linux/init.h>
22 #include <linux/platform_device.h>
23 #include <linux/serial_8250.h>
24 #include <linux/clk.h>
25 #include <linux/dma-mapping.h>
26 #include <linux/gpio_keys.h>
27 #include <linux/pda_power.h>
29 #include <linux/input.h>
30 #include <linux/i2c.h>
31 #include <linux/gpio.h>
32 #include <linux/rfkill-gpio.h>
34 #include <asm/hardware/gic.h>
35 #include <asm/mach-types.h>
36 #include <asm/mach/arch.h>
37 #include <asm/mach/time.h>
38 #include <asm/setup.h>
40 #include <mach/iomap.h>
41 #include <mach/irqs.h>
42 #include <mach/sdhci.h>
45 #include "board-paz00.h"
48 #include "gpio-names.h"
50 static struct plat_serial8250_port debug_uart_platform_data
[] = {
52 /* serial port on JP1 */
53 .membase
= IO_ADDRESS(TEGRA_UARTA_BASE
),
54 .mapbase
= TEGRA_UARTA_BASE
,
56 .flags
= UPF_BOOT_AUTOCONF
| UPF_FIXED_TYPE
,
62 /* serial port on mini-pcie */
63 .membase
= IO_ADDRESS(TEGRA_UARTC_BASE
),
64 .mapbase
= TEGRA_UARTC_BASE
,
66 .flags
= UPF_BOOT_AUTOCONF
| UPF_FIXED_TYPE
,
76 static struct platform_device debug_uart
= {
78 .id
= PLAT8250_DEV_PLATFORM
,
80 .platform_data
= debug_uart_platform_data
,
84 static struct rfkill_gpio_platform_data wifi_rfkill_platform_data
= {
85 .name
= "wifi_rfkill",
86 .reset_gpio
= TEGRA_WIFI_RST
,
87 .shutdown_gpio
= TEGRA_WIFI_PWRN
,
88 .type
= RFKILL_TYPE_WLAN
,
91 static struct platform_device wifi_rfkill_device
= {
92 .name
= "rfkill_gpio",
95 .platform_data
= &wifi_rfkill_platform_data
,
99 static struct gpio_led gpio_leds
[] = {
102 .default_trigger
= "rfkill0",
103 .gpio
= TEGRA_WIFI_LED
,
107 static struct gpio_led_platform_data gpio_led_info
= {
109 .num_leds
= ARRAY_SIZE(gpio_leds
),
112 static struct platform_device leds_gpio
= {
116 .platform_data
= &gpio_led_info
,
120 static struct gpio_keys_button paz00_gpio_keys_buttons
[] = {
123 .gpio
= TEGRA_GPIO_POWERKEY
,
131 static struct gpio_keys_platform_data paz00_gpio_keys
= {
132 .buttons
= paz00_gpio_keys_buttons
,
133 .nbuttons
= ARRAY_SIZE(paz00_gpio_keys_buttons
),
136 static struct platform_device gpio_keys_device
= {
140 .platform_data
= &paz00_gpio_keys
,
144 static struct platform_device
*paz00_devices
[] __initdata
= {
146 &tegra_sdhci_device4
,
147 &tegra_sdhci_device1
,
153 static void paz00_i2c_init(void)
155 platform_device_register(&tegra_i2c_device1
);
156 platform_device_register(&tegra_i2c_device2
);
157 platform_device_register(&tegra_i2c_device4
);
160 static void paz00_usb_init(void)
162 platform_device_register(&tegra_ehci2_device
);
163 platform_device_register(&tegra_ehci3_device
);
166 static void __init
tegra_paz00_fixup(struct tag
*tags
, char **cmdline
,
170 mi
->bank
[0].start
= PHYS_OFFSET
;
171 mi
->bank
[0].size
= 448 * SZ_1M
;
174 static __initdata
struct tegra_clk_init_table paz00_clk_init_table
[] = {
175 /* name parent rate enabled */
176 { "uarta", "pll_p", 216000000, true },
177 { "uartc", "pll_p", 216000000, true },
179 { "pll_p_out4", "pll_p", 24000000, true },
180 { "usbd", "clk_m", 12000000, false },
181 { "usb2", "clk_m", 12000000, false },
182 { "usb3", "clk_m", 12000000, false },
187 static struct tegra_sdhci_platform_data sdhci_pdata1
= {
188 .cd_gpio
= TEGRA_GPIO_SD1_CD
,
189 .wp_gpio
= TEGRA_GPIO_SD1_WP
,
190 .power_gpio
= TEGRA_GPIO_SD1_POWER
,
193 static struct tegra_sdhci_platform_data sdhci_pdata4
= {
200 static void __init
tegra_paz00_init(void)
202 tegra_clk_init_from_table(paz00_clk_init_table
);
206 tegra_sdhci_device1
.dev
.platform_data
= &sdhci_pdata1
;
207 tegra_sdhci_device4
.dev
.platform_data
= &sdhci_pdata4
;
209 platform_add_devices(paz00_devices
, ARRAY_SIZE(paz00_devices
));
215 MACHINE_START(PAZ00
, "Toshiba AC100 / Dynabook AZ")
216 .atag_offset
= 0x100,
217 .fixup
= tegra_paz00_fixup
,
218 .map_io
= tegra_map_common_io
,
219 .init_early
= tegra20_init_early
,
220 .init_irq
= tegra_init_irq
,
221 .handle_irq
= gic_handle_irq
,
222 .timer
= &tegra_timer
,
223 .init_machine
= tegra_paz00_init
,
224 .restart
= tegra_assert_system_reset
,