blob: 5f1c110c508be4a12a459c2926dcc48ba392813e [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>
29#include <linux/i2c-tegra.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>
39
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,
71 &tegra_sdhci_device2,
72 &tegra_sdhci_device4,
73};
74
Marc Dietrichdda9cd22011-05-19 14:08:26 +020075static struct tegra_i2c_platform_data paz00_i2c1_platform_data = {
76 .bus_clk_rate = 400000,
77};
78
79static struct tegra_i2c_platform_data paz00_i2c2_platform_data = {
80 .bus_clk_rate = 400000,
81};
82
83static struct tegra_i2c_platform_data paz00_dvc_platform_data = {
84 .bus_clk_rate = 400000,
85};
86
87static void paz00_i2c_init(void)
88{
89 tegra_i2c_device1.dev.platform_data = &paz00_i2c1_platform_data;
90 tegra_i2c_device2.dev.platform_data = &paz00_i2c2_platform_data;
91 tegra_i2c_device4.dev.platform_data = &paz00_dvc_platform_data;
92
93 platform_device_register(&tegra_i2c_device1);
94 platform_device_register(&tegra_i2c_device2);
95 platform_device_register(&tegra_i2c_device4);
96}
97
Marc Dietrich65b935a2011-03-07 21:01:31 +010098static void __init tegra_paz00_fixup(struct machine_desc *desc,
99 struct tag *tags, char **cmdline, struct meminfo *mi)
100{
101 mi->nr_banks = 1;
102 mi->bank[0].start = PHYS_OFFSET;
103 mi->bank[0].size = 448 * SZ_1M;
104}
105
106static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
107 /* name parent rate enabled */
108 { "uartd", "pll_p", 216000000, true },
109 { NULL, NULL, 0, 0},
110};
111
112
113static struct tegra_sdhci_platform_data sdhci_pdata1 = {
114 .cd_gpio = TEGRA_GPIO_SD1_CD,
115 .wp_gpio = TEGRA_GPIO_SD1_WP,
116 .power_gpio = TEGRA_GPIO_SD1_POWER,
117};
118
119static struct tegra_sdhci_platform_data sdhci_pdata2 = {
120 .cd_gpio = -1,
121 .wp_gpio = -1,
122 .power_gpio = -1,
123};
124
125static struct tegra_sdhci_platform_data sdhci_pdata4 = {
126 .cd_gpio = TEGRA_GPIO_SD4_CD,
127 .wp_gpio = TEGRA_GPIO_SD4_WP,
128 .power_gpio = TEGRA_GPIO_SD4_POWER,
129 .is_8bit = 1,
130};
131
132static void __init tegra_paz00_init(void)
133{
134 tegra_clk_init_from_table(paz00_clk_init_table);
135
136 paz00_pinmux_init();
137
138 tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
139 tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2;
140 tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
141
142 platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices));
Marc Dietrichdda9cd22011-05-19 14:08:26 +0200143
144 paz00_i2c_init();
Marc Dietrich65b935a2011-03-07 21:01:31 +0100145}
146
147MACHINE_START(PAZ00, "paz00")
148 .boot_params = 0x00000100,
149 .fixup = tegra_paz00_fixup,
150 .map_io = tegra_map_common_io,
151 .init_early = tegra_init_early,
152 .init_irq = tegra_init_irq,
153 .timer = &tegra_timer,
154 .init_machine = tegra_paz00_init,
155MACHINE_END