Merge commit 'v2.6.39-rc6' into x86/cleanups
[pandora-kernel.git] / arch / arm / mach-tegra / board-paz00.c
1 /*
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>
28
29 #include <asm/mach-types.h>
30 #include <asm/mach/arch.h>
31 #include <asm/mach/time.h>
32 #include <asm/setup.h>
33
34 #include <mach/iomap.h>
35 #include <mach/irqs.h>
36 #include <mach/sdhci.h>
37
38 #include "board.h"
39 #include "board-paz00.h"
40 #include "clock.h"
41 #include "devices.h"
42 #include "gpio-names.h"
43
44 static struct plat_serial8250_port debug_uart_platform_data[] = {
45         {
46                 .membase        = IO_ADDRESS(TEGRA_UARTD_BASE),
47                 .mapbase        = TEGRA_UARTD_BASE,
48                 .irq            = INT_UARTD,
49                 .flags          = UPF_BOOT_AUTOCONF,
50                 .iotype         = UPIO_MEM,
51                 .regshift       = 2,
52                 .uartclk        = 216000000,
53         }, {
54                 .flags          = 0
55         }
56 };
57
58 static struct platform_device debug_uart = {
59         .name = "serial8250",
60         .id = PLAT8250_DEV_PLATFORM,
61         .dev = {
62                 .platform_data = debug_uart_platform_data,
63         },
64 };
65
66 static struct platform_device *paz00_devices[] __initdata = {
67         &debug_uart,
68         &tegra_sdhci_device1,
69         &tegra_sdhci_device2,
70         &tegra_sdhci_device4,
71 };
72
73 static void __init tegra_paz00_fixup(struct machine_desc *desc,
74         struct tag *tags, char **cmdline, struct meminfo *mi)
75 {
76         mi->nr_banks = 1;
77         mi->bank[0].start = PHYS_OFFSET;
78         mi->bank[0].size = 448 * SZ_1M;
79 }
80
81 static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
82         /* name         parent          rate            enabled */
83         { "uartd",      "pll_p",        216000000,      true },
84         { NULL,         NULL,           0,              0},
85 };
86
87
88 static struct tegra_sdhci_platform_data sdhci_pdata1 = {
89         .cd_gpio        = TEGRA_GPIO_SD1_CD,
90         .wp_gpio        = TEGRA_GPIO_SD1_WP,
91         .power_gpio     = TEGRA_GPIO_SD1_POWER,
92 };
93
94 static struct tegra_sdhci_platform_data sdhci_pdata2 = {
95         .cd_gpio        = -1,
96         .wp_gpio        = -1,
97         .power_gpio     = -1,
98 };
99
100 static struct tegra_sdhci_platform_data sdhci_pdata4 = {
101         .cd_gpio        = TEGRA_GPIO_SD4_CD,
102         .wp_gpio        = TEGRA_GPIO_SD4_WP,
103         .power_gpio     = TEGRA_GPIO_SD4_POWER,
104         .is_8bit        = 1,
105 };
106
107 static void __init tegra_paz00_init(void)
108 {
109         tegra_clk_init_from_table(paz00_clk_init_table);
110
111         paz00_pinmux_init();
112
113         tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
114         tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2;
115         tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
116
117         platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices));
118 }
119
120 MACHINE_START(PAZ00, "paz00")
121         .boot_params    = 0x00000100,
122         .fixup          = tegra_paz00_fixup,
123         .map_io         = tegra_map_common_io,
124         .init_early     = tegra_init_early,
125         .init_irq       = tegra_init_irq,
126         .timer          = &tegra_timer,
127         .init_machine   = tegra_paz00_init,
128 MACHINE_END