blob: ea2f79c9879bbbbba6c1f868f531d880fae1262d [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 {
48 .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
49 .mapbase = TEGRA_UARTD_BASE,
50 .irq = INT_UARTD,
51 .flags = UPF_BOOT_AUTOCONF,
52 .iotype = UPIO_MEM,
53 .regshift = 2,
54 .uartclk = 216000000,
55 }, {
56 .flags = 0
57 }
58};
59
60static struct platform_device debug_uart = {
61 .name = "serial8250",
62 .id = PLAT8250_DEV_PLATFORM,
63 .dev = {
64 .platform_data = debug_uart_platform_data,
65 },
66};
67
68static struct platform_device *paz00_devices[] __initdata = {
69 &debug_uart,
70 &tegra_sdhci_device1,
Marc Dietrich65b935a2011-03-07 21:01:31 +010071 &tegra_sdhci_device4,
72};
73
Marc Dietrichdda9cd22011-05-19 14:08:26 +020074static void paz00_i2c_init(void)
75{
Marc Dietrichdda9cd22011-05-19 14:08:26 +020076 platform_device_register(&tegra_i2c_device1);
77 platform_device_register(&tegra_i2c_device2);
78 platform_device_register(&tegra_i2c_device4);
79}
80
Marc Dietrich13db7a72011-05-19 14:08:27 +020081static void paz00_usb_init(void)
82{
Marc Dietrich13db7a72011-05-19 14:08:27 +020083 platform_device_register(&tegra_ehci2_device);
84 platform_device_register(&tegra_ehci3_device);
85}
86
Marc Dietrich65b935a2011-03-07 21:01:31 +010087static void __init tegra_paz00_fixup(struct machine_desc *desc,
88 struct tag *tags, char **cmdline, struct meminfo *mi)
89{
90 mi->nr_banks = 1;
91 mi->bank[0].start = PHYS_OFFSET;
92 mi->bank[0].size = 448 * SZ_1M;
93}
94
95static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
96 /* name parent rate enabled */
97 { "uartd", "pll_p", 216000000, true },
98 { NULL, NULL, 0, 0},
99};
100
Marc Dietrich65b935a2011-03-07 21:01:31 +0100101static struct tegra_sdhci_platform_data sdhci_pdata1 = {
102 .cd_gpio = TEGRA_GPIO_SD1_CD,
103 .wp_gpio = TEGRA_GPIO_SD1_WP,
104 .power_gpio = TEGRA_GPIO_SD1_POWER,
105};
106
Marc Dietrich41cdc622011-05-19 14:08:28 +0200107static struct tegra_sdhci_platform_data sdhci_pdata4 = {
Marc Dietrich65b935a2011-03-07 21:01:31 +0100108 .cd_gpio = -1,
109 .wp_gpio = -1,
110 .power_gpio = -1,
Marc Dietrich65b935a2011-03-07 21:01:31 +0100111 .is_8bit = 1,
112};
113
114static void __init tegra_paz00_init(void)
115{
116 tegra_clk_init_from_table(paz00_clk_init_table);
117
118 paz00_pinmux_init();
119
120 tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
Marc Dietrich65b935a2011-03-07 21:01:31 +0100121 tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
122
123 platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices));
Marc Dietrichdda9cd22011-05-19 14:08:26 +0200124
125 paz00_i2c_init();
Marc Dietrich13db7a72011-05-19 14:08:27 +0200126 paz00_usb_init();
Marc Dietrich65b935a2011-03-07 21:01:31 +0100127}
128
Marc Dietrichd1890d4d2011-05-19 14:08:29 +0200129MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
Marc Dietrich65b935a2011-03-07 21:01:31 +0100130 .boot_params = 0x00000100,
131 .fixup = tegra_paz00_fixup,
132 .map_io = tegra_map_common_io,
133 .init_early = tegra_init_early,
134 .init_irq = tegra_init_irq,
135 .timer = &tegra_timer,
136 .init_machine = tegra_paz00_init,
137MACHINE_END