2 * arch/arm/mach-tegra/board-harmony.c
4 * Copyright (C) 2010 Google, Inc.
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
17 #include <linux/kernel.h>
18 #include <linux/init.h>
19 #include <linux/platform_device.h>
20 #include <linux/serial_8250.h>
21 #include <linux/clk.h>
22 #include <linux/mtd/mtd.h>
23 #include <linux/mtd/partitions.h>
24 #include <linux/dma-mapping.h>
25 #include <linux/pda_power.h>
27 #include <linux/delay.h>
29 #include <asm/mach-types.h>
30 #include <asm/mach/arch.h>
31 #include <asm/mach/time.h>
32 #include <asm/setup.h>
34 #include <mach/iomap.h>
35 #include <mach/irqs.h>
36 #include <mach/nand.h>
41 #include "board-harmony.h"
45 /* NVidia bootloader tags */
46 #define ATAG_NVIDIA 0x41000801
48 #define ATAG_NVIDIA_RM 0x1
49 #define ATAG_NVIDIA_DISPLAY 0x2
50 #define ATAG_NVIDIA_FRAMEBUFFER 0x3
51 #define ATAG_NVIDIA_CHIPSHMOO 0x4
52 #define ATAG_NVIDIA_CHIPSHMOOPHYS 0x5
53 #define ATAG_NVIDIA_PRESERVED_MEM_0 0x10000
54 #define ATAG_NVIDIA_PRESERVED_MEM_N 2
55 #define ATAG_NVIDIA_FORCE_32 0x7fffffff
63 static int __init parse_tag_nvidia(const struct tag *tag)
68 __tagtable(ATAG_NVIDIA, parse_tag_nvidia);
70 static struct tegra_nand_chip_parms nand_chip_parms[] = {
71 /* Samsung K5E2G1GACM */
89 /* Hynix H5PS1GB3EFR */
109 struct tegra_nand_platform harmony_nand_data = {
111 .chip_parms = nand_chip_parms,
112 .nr_chip_parms = ARRAY_SIZE(nand_chip_parms),
115 static struct resource resources_nand[] = {
117 .start = INT_NANDFLASH,
118 .end = INT_NANDFLASH,
119 .flags = IORESOURCE_IRQ,
123 struct platform_device tegra_nand_device = {
124 .name = "tegra_nand",
126 .num_resources = ARRAY_SIZE(resources_nand),
127 .resource = resources_nand,
129 .platform_data = &harmony_nand_data,
133 static struct plat_serial8250_port debug_uart_platform_data[] = {
135 .membase = IO_ADDRESS(TEGRA_UARTD_BASE),
136 .mapbase = TEGRA_UARTD_BASE,
138 .flags = UPF_BOOT_AUTOCONF,
141 .uartclk = 216000000,
147 static struct platform_device debug_uart = {
148 .name = "serial8250",
149 .id = PLAT8250_DEV_PLATFORM,
151 .platform_data = debug_uart_platform_data,
156 static struct pda_power_pdata pda_power_pdata = {
159 static struct platform_device pda_power_device = {
163 .platform_data = &pda_power_pdata,
167 static struct platform_device *harmony_devices[] __initdata = {
184 static void __init tegra_harmony_fixup(struct machine_desc *desc,
185 struct tag *tags, char **cmdline, struct meminfo *mi)
188 mi->bank[0].start = PHYS_OFFSET;
189 mi->bank[0].size = 448 * SZ_1M;
190 mi->bank[1].start = SZ_512M;
191 mi->bank[1].size = SZ_512M;
194 static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = {
195 /* name parent rate enabled */
196 { "uartd", "pll_p", 216000000, true },
200 static void __init tegra_harmony_init(void)
204 tegra_clk_init_from_table(harmony_clk_init_table);
206 harmony_pinmux_init();
208 platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
210 harmony_panel_init();
211 harmony_sdhci_init();
214 MACHINE_START(HARMONY, "harmony")
215 .boot_params = 0x00000100,
216 .phys_io = IO_APB_PHYS,
217 .io_pg_offst = ((IO_APB_VIRT) >> 18) & 0xfffc,
218 .fixup = tegra_harmony_fixup,
219 .init_irq = tegra_init_irq,
220 .init_machine = tegra_harmony_init,
221 .map_io = tegra_map_common_io,
222 .timer = &tegra_timer,