blob: 6b798e7609314f17644f0cb90c228c991e684567 [file] [log] [blame]
Marc Dietrich65b935a2011-03-07 21:01:31 +01001/*
2 * arch/arm/mach-tegra/board-paz00.c
3 *
4 * Copyright (C) 2011 Marc Dietrich <marvin24@gmx.de>
5 *
6 * Based on board-harmony.c
7 * Copyright (C) 2010 Google, Inc.
8 *
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.
12 *
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.
17 *
18 */
19
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/pda_power.h>
27#include <linux/io.h>
Marc Dietrichdda9cd22011-05-19 14:08:26 +020028#include <linux/i2c.h>
Marc Dietrich9aaa15a2011-08-07 21:00:52 +020029#include <linux/rfkill-gpio.h>
Marc Dietrich65b935a2011-03-07 21:01:31 +010030
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33#include <asm/mach/time.h>
34#include <asm/setup.h>
35
36#include <mach/iomap.h>
37#include <mach/irqs.h>
38#include <mach/sdhci.h>
Marc Dietrich13db7a72011-05-19 14:08:27 +020039#include <mach/gpio.h>
Marc Dietrich65b935a2011-03-07 21:01:31 +010040
41#include "board.h"
42#include "board-paz00.h"
43#include "clock.h"
44#include "devices.h"
45#include "gpio-names.h"
46
47static struct plat_serial8250_port debug_uart_platform_data[] = {
48 {
Marc Dietrichde7164d2011-08-07 21:00:51 +020049 /* serial port on JP1 */
50 .membase = IO_ADDRESS(TEGRA_UARTA_BASE),
51 .mapbase = TEGRA_UARTA_BASE,
52 .irq = INT_UARTA,
53 .flags = UPF_BOOT_AUTOCONF,
54 .iotype = UPIO_MEM,
55 .regshift = 2,
56 .uartclk = 216000000,
57 }, {
58 /* serial port on mini-pcie */
Marc Dietrich65b935a2011-03-07 21:01:31 +010059 .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
60 .mapbase = TEGRA_UARTD_BASE,
61 .irq = INT_UARTD,
62 .flags = UPF_BOOT_AUTOCONF,
63 .iotype = UPIO_MEM,
64 .regshift = 2,
65 .uartclk = 216000000,
66 }, {
67 .flags = 0
68 }
69};
70
71static struct platform_device debug_uart = {
72 .name = "serial8250",
73 .id = PLAT8250_DEV_PLATFORM,
74 .dev = {
75 .platform_data = debug_uart_platform_data,
76 },
77};
78
Marc Dietrich9aaa15a2011-08-07 21:00:52 +020079static struct rfkill_gpio_platform_data wifi_rfkill_platform_data = {
80 .name = "wifi_rfkill",
81 .reset_gpio = TEGRA_WIFI_RST,
82 .shutdown_gpio = TEGRA_WIFI_PWRN,
83 .type = RFKILL_TYPE_WLAN,
84};
85
86static struct platform_device wifi_rfkill_device = {
87 .name = "rfkill_gpio",
88 .id = -1,
89 .dev = {
90 .platform_data = &wifi_rfkill_platform_data,
91 },
92};
93
Marc Dietrich65b935a2011-03-07 21:01:31 +010094static struct platform_device *paz00_devices[] __initdata = {
95 &debug_uart,
96 &tegra_sdhci_device1,
Marc Dietrich65b935a2011-03-07 21:01:31 +010097 &tegra_sdhci_device4,
Marc Dietrich9aaa15a2011-08-07 21:00:52 +020098 &wifi_rfkill_device,
Marc Dietrich65b935a2011-03-07 21:01:31 +010099};
100
Marc Dietrichdda9cd22011-05-19 14:08:26 +0200101static void paz00_i2c_init(void)
102{
Marc Dietrichdda9cd22011-05-19 14:08:26 +0200103 platform_device_register(&tegra_i2c_device1);
104 platform_device_register(&tegra_i2c_device2);
105 platform_device_register(&tegra_i2c_device4);
106}
107
Marc Dietrich13db7a72011-05-19 14:08:27 +0200108static void paz00_usb_init(void)
109{
Marc Dietrich13db7a72011-05-19 14:08:27 +0200110 platform_device_register(&tegra_ehci2_device);
111 platform_device_register(&tegra_ehci3_device);
112}
113
Marc Dietrich65b935a2011-03-07 21:01:31 +0100114static void __init tegra_paz00_fixup(struct machine_desc *desc,
115 struct tag *tags, char **cmdline, struct meminfo *mi)
116{
117 mi->nr_banks = 1;
118 mi->bank[0].start = PHYS_OFFSET;
119 mi->bank[0].size = 448 * SZ_1M;
120}
121
122static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
123 /* name parent rate enabled */
Marc Dietrichde7164d2011-08-07 21:00:51 +0200124 { "uarta", "pll_p", 216000000, true },
Marc Dietrich65b935a2011-03-07 21:01:31 +0100125 { "uartd", "pll_p", 216000000, true },
126 { NULL, NULL, 0, 0},
127};
128
Marc Dietrich65b935a2011-03-07 21:01:31 +0100129static struct tegra_sdhci_platform_data sdhci_pdata1 = {
130 .cd_gpio = TEGRA_GPIO_SD1_CD,
131 .wp_gpio = TEGRA_GPIO_SD1_WP,
132 .power_gpio = TEGRA_GPIO_SD1_POWER,
133};
134
Marc Dietrich41cdc622011-05-19 14:08:28 +0200135static struct tegra_sdhci_platform_data sdhci_pdata4 = {
Marc Dietrich65b935a2011-03-07 21:01:31 +0100136 .cd_gpio = -1,
137 .wp_gpio = -1,
138 .power_gpio = -1,
Marc Dietrich65b935a2011-03-07 21:01:31 +0100139 .is_8bit = 1,
140};
141
142static void __init tegra_paz00_init(void)
143{
144 tegra_clk_init_from_table(paz00_clk_init_table);
145
146 paz00_pinmux_init();
147
148 tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
Marc Dietrich65b935a2011-03-07 21:01:31 +0100149 tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
150
151 platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices));
Marc Dietrichdda9cd22011-05-19 14:08:26 +0200152
153 paz00_i2c_init();
Marc Dietrich13db7a72011-05-19 14:08:27 +0200154 paz00_usb_init();
Marc Dietrich65b935a2011-03-07 21:01:31 +0100155}
156
Marc Dietrichd1890d42011-05-19 14:08:29 +0200157MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
Marc Dietrich65b935a2011-03-07 21:01:31 +0100158 .boot_params = 0x00000100,
159 .fixup = tegra_paz00_fixup,
160 .map_io = tegra_map_common_io,
161 .init_early = tegra_init_early,
162 .init_irq = tegra_init_irq,
163 .timer = &tegra_timer,
164 .init_machine = tegra_paz00_init,
165MACHINE_END