2 * arch/arm/mach-tegra/board-harmony.c
4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (C) 2011 NVIDIA, Inc.
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
18 #include <linux/kernel.h>
19 #include <linux/init.h>
20 #include <linux/platform_device.h>
21 #include <linux/serial_8250.h>
22 #include <linux/clk.h>
23 #include <linux/dma-mapping.h>
24 #include <linux/pda_power.h>
26 #include <linux/gpio.h>
28 #include <asm/mach-types.h>
29 #include <asm/mach/arch.h>
30 #include <asm/mach/time.h>
31 #include <asm/setup.h>
33 #include <mach/harmony_audio.h>
34 #include <mach/iomap.h>
35 #include <mach/irqs.h>
36 #include <mach/sdhci.h>
39 #include "board-harmony.h"
42 #include "gpio-names.h"
44 static struct plat_serial8250_port debug_uart_platform_data[] = {
46 .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
47 .mapbase = TEGRA_UARTD_BASE,
49 .flags = UPF_BOOT_AUTOCONF,
58 static struct platform_device debug_uart = {
60 .id = PLAT8250_DEV_PLATFORM,
62 .platform_data = debug_uart_platform_data,
66 static struct harmony_audio_platform_data harmony_audio_pdata = {
67 .gpio_spkr_en = TEGRA_GPIO_SPKR_EN,
68 .gpio_hp_det = TEGRA_GPIO_HP_DET,
69 .gpio_int_mic_en = TEGRA_GPIO_INT_MIC_EN,
70 .gpio_ext_mic_en = TEGRA_GPIO_EXT_MIC_EN,
73 static struct platform_device harmony_audio_device = {
74 .name = "tegra-snd-harmony",
77 .platform_data = &harmony_audio_pdata,
81 static struct platform_device *harmony_devices[] __initdata = {
89 &harmony_audio_device,
92 static void __init tegra_harmony_fixup(struct machine_desc *desc,
93 struct tag *tags, char **cmdline, struct meminfo *mi)
96 mi->bank[0].start = PHYS_OFFSET;
97 mi->bank[0].size = 448 * SZ_1M;
98 mi->bank[1].start = SZ_512M;
99 mi->bank[1].size = SZ_512M;
102 static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = {
103 /* name parent rate enabled */
104 { "uartd", "pll_p", 216000000, true },
105 { "pll_a", "pll_p_out1", 56448000, true },
106 { "pll_a_out0", "pll_a", 11289600, true },
107 { "cdev1", NULL, 0, true },
108 { "i2s1", "pll_a_out0", 11289600, false},
113 static struct tegra_sdhci_platform_data sdhci_pdata1 = {
119 static struct tegra_sdhci_platform_data sdhci_pdata2 = {
120 .cd_gpio = TEGRA_GPIO_SD2_CD,
121 .wp_gpio = TEGRA_GPIO_SD2_WP,
122 .power_gpio = TEGRA_GPIO_SD2_POWER,
125 static 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,
132 static void __init tegra_harmony_init(void)
134 tegra_clk_init_from_table(harmony_clk_init_table);
136 harmony_pinmux_init();
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;
142 platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
145 MACHINE_START(HARMONY, "harmony")
146 .boot_params = 0x00000100,
147 .fixup = tegra_harmony_fixup,
148 .map_io = tegra_map_common_io,
149 .init_early = tegra_init_early,
150 .init_irq = tegra_init_irq,
151 .timer = &tegra_timer,
152 .init_machine = tegra_harmony_init,