blob: f3b737637306eb9587d11e7403c1aff347591539 [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 Dietrich65b935a2011-03-07 21:01:31 +010029
30#include <asm/mach-types.h>
31#include <asm/mach/arch.h>
32#include <asm/mach/time.h>
33#include <asm/setup.h>
34
35#include <mach/iomap.h>
36#include <mach/irqs.h>
37#include <mach/sdhci.h>
Marc Dietrich13db7a72011-05-19 14:08:27 +020038#include <mach/gpio.h>
Marc Dietrich65b935a2011-03-07 21:01:31 +010039
40#include "board.h"
41#include "board-paz00.h"
42#include "clock.h"
43#include "devices.h"
44#include "gpio-names.h"
45
46static struct plat_serial8250_port debug_uart_platform_data[] = {
47 {
Marc Dietrichde7164d2011-08-07 21:00:51 +020048 /* serial port on JP1 */
49 .membase = IO_ADDRESS(TEGRA_UARTA_BASE),
50 .mapbase = TEGRA_UARTA_BASE,
51 .irq = INT_UARTA,
52 .flags = UPF_BOOT_AUTOCONF,
53 .iotype = UPIO_MEM,
54 .regshift = 2,
55 .uartclk = 216000000,
56 }, {
57 /* serial port on mini-pcie */
Marc Dietrich65b935a2011-03-07 21:01:31 +010058 .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
59 .mapbase = TEGRA_UARTD_BASE,
60 .irq = INT_UARTD,
61 .flags = UPF_BOOT_AUTOCONF,
62 .iotype = UPIO_MEM,
63 .regshift = 2,
64 .uartclk = 216000000,
65 }, {
66 .flags = 0
67 }
68};
69
70static struct platform_device debug_uart = {
71 .name = "serial8250",
72 .id = PLAT8250_DEV_PLATFORM,
73 .dev = {
74 .platform_data = debug_uart_platform_data,
75 },
76};
77
78static struct platform_device *paz00_devices[] __initdata = {
79 &debug_uart,
80 &tegra_sdhci_device1,
Marc Dietrich65b935a2011-03-07 21:01:31 +010081 &tegra_sdhci_device4,
82};
83
Marc Dietrichdda9cd22011-05-19 14:08:26 +020084static void paz00_i2c_init(void)
85{
Marc Dietrichdda9cd22011-05-19 14:08:26 +020086 platform_device_register(&tegra_i2c_device1);
87 platform_device_register(&tegra_i2c_device2);
88 platform_device_register(&tegra_i2c_device4);
89}
90
Marc Dietrich13db7a72011-05-19 14:08:27 +020091static void paz00_usb_init(void)
92{
Marc Dietrich13db7a72011-05-19 14:08:27 +020093 platform_device_register(&tegra_ehci2_device);
94 platform_device_register(&tegra_ehci3_device);
95}
96
Marc Dietrich65b935a2011-03-07 21:01:31 +010097static void __init tegra_paz00_fixup(struct machine_desc *desc,
98 struct tag *tags, char **cmdline, struct meminfo *mi)
99{
100 mi->nr_banks = 1;
101 mi->bank[0].start = PHYS_OFFSET;
102 mi->bank[0].size = 448 * SZ_1M;
103}
104
105static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
106 /* name parent rate enabled */
Marc Dietrichde7164d2011-08-07 21:00:51 +0200107 { "uarta", "pll_p", 216000000, true },
Marc Dietrich65b935a2011-03-07 21:01:31 +0100108 { "uartd", "pll_p", 216000000, true },
109 { NULL, NULL, 0, 0},
110};
111
Marc Dietrich65b935a2011-03-07 21:01:31 +0100112static struct tegra_sdhci_platform_data sdhci_pdata1 = {
113 .cd_gpio = TEGRA_GPIO_SD1_CD,
114 .wp_gpio = TEGRA_GPIO_SD1_WP,
115 .power_gpio = TEGRA_GPIO_SD1_POWER,
116};
117
Marc Dietrich41cdc622011-05-19 14:08:28 +0200118static struct tegra_sdhci_platform_data sdhci_pdata4 = {
Marc Dietrich65b935a2011-03-07 21:01:31 +0100119 .cd_gpio = -1,
120 .wp_gpio = -1,
121 .power_gpio = -1,
Marc Dietrich65b935a2011-03-07 21:01:31 +0100122 .is_8bit = 1,
123};
124
125static void __init tegra_paz00_init(void)
126{
127 tegra_clk_init_from_table(paz00_clk_init_table);
128
129 paz00_pinmux_init();
130
131 tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
Marc Dietrich65b935a2011-03-07 21:01:31 +0100132 tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
133
134 platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices));
Marc Dietrichdda9cd22011-05-19 14:08:26 +0200135
136 paz00_i2c_init();
Marc Dietrich13db7a72011-05-19 14:08:27 +0200137 paz00_usb_init();
Marc Dietrich65b935a2011-03-07 21:01:31 +0100138}
139
Marc Dietrichd1890d42011-05-19 14:08:29 +0200140MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
Marc Dietrich65b935a2011-03-07 21:01:31 +0100141 .boot_params = 0x00000100,
142 .fixup = tegra_paz00_fixup,
143 .map_io = tegra_map_common_io,
144 .init_early = tegra_init_early,
145 .init_irq = tegra_init_irq,
146 .timer = &tegra_timer,
147 .init_machine = tegra_paz00_init,
148MACHINE_END