Commit | Line | Data |
---|---|---|
65b935aa MD |
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> | |
dda9cd28 | 28 | #include <linux/i2c.h> |
65b935aa MD |
29 | |
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> | |
13db7a7f | 38 | #include <mach/gpio.h> |
65b935aa MD |
39 | |
40 | #include "board.h" | |
41 | #include "board-paz00.h" | |
42 | #include "clock.h" | |
43 | #include "devices.h" | |
44 | #include "gpio-names.h" | |
45 | ||
46 | static struct plat_serial8250_port debug_uart_platform_data[] = { | |
47 | { | |
de7164db MD |
48 | /* 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 */ | |
65b935aa MD |
58 | .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 | ||
70 | static 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 | ||
78 | static struct platform_device *paz00_devices[] __initdata = { | |
79 | &debug_uart, | |
80 | &tegra_sdhci_device1, | |
65b935aa MD |
81 | &tegra_sdhci_device4, |
82 | }; | |
83 | ||
dda9cd28 MD |
84 | static void paz00_i2c_init(void) |
85 | { | |
dda9cd28 MD |
86 | platform_device_register(&tegra_i2c_device1); |
87 | platform_device_register(&tegra_i2c_device2); | |
88 | platform_device_register(&tegra_i2c_device4); | |
89 | } | |
90 | ||
13db7a7f MD |
91 | static void paz00_usb_init(void) |
92 | { | |
13db7a7f MD |
93 | platform_device_register(&tegra_ehci2_device); |
94 | platform_device_register(&tegra_ehci3_device); | |
95 | } | |
96 | ||
65b935aa MD |
97 | static 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 | ||
105 | static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = { | |
106 | /* name parent rate enabled */ | |
de7164db | 107 | { "uarta", "pll_p", 216000000, true }, |
65b935aa MD |
108 | { "uartd", "pll_p", 216000000, true }, |
109 | { NULL, NULL, 0, 0}, | |
110 | }; | |
111 | ||
65b935aa MD |
112 | static 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 | ||
41cdc62e | 118 | static struct tegra_sdhci_platform_data sdhci_pdata4 = { |
65b935aa MD |
119 | .cd_gpio = -1, |
120 | .wp_gpio = -1, | |
121 | .power_gpio = -1, | |
65b935aa MD |
122 | .is_8bit = 1, |
123 | }; | |
124 | ||
125 | static 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; | |
65b935aa MD |
132 | tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4; |
133 | ||
134 | platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices)); | |
dda9cd28 MD |
135 | |
136 | paz00_i2c_init(); | |
13db7a7f | 137 | paz00_usb_init(); |
65b935aa MD |
138 | } |
139 | ||
d1890d4d | 140 | MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ") |
65b935aa MD |
141 | .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, | |
148 | MACHINE_END |