165b935aaSMarc Dietrich /* 265b935aaSMarc Dietrich * arch/arm/mach-tegra/board-paz00.c 365b935aaSMarc Dietrich * 465b935aaSMarc Dietrich * Copyright (C) 2011 Marc Dietrich <marvin24@gmx.de> 565b935aaSMarc Dietrich * 665b935aaSMarc Dietrich * Based on board-harmony.c 765b935aaSMarc Dietrich * Copyright (C) 2010 Google, Inc. 865b935aaSMarc Dietrich * 965b935aaSMarc Dietrich * This software is licensed under the terms of the GNU General Public 1065b935aaSMarc Dietrich * License version 2, as published by the Free Software Foundation, and 1165b935aaSMarc Dietrich * may be copied, distributed, and modified under those terms. 1265b935aaSMarc Dietrich * 1365b935aaSMarc Dietrich * This program is distributed in the hope that it will be useful, 1465b935aaSMarc Dietrich * but WITHOUT ANY WARRANTY; without even the implied warranty of 1565b935aaSMarc Dietrich * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1665b935aaSMarc Dietrich * GNU General Public License for more details. 1765b935aaSMarc Dietrich * 1865b935aaSMarc Dietrich */ 1965b935aaSMarc Dietrich 2065b935aaSMarc Dietrich #include <linux/kernel.h> 2165b935aaSMarc Dietrich #include <linux/init.h> 2265b935aaSMarc Dietrich #include <linux/platform_device.h> 2365b935aaSMarc Dietrich #include <linux/serial_8250.h> 2465b935aaSMarc Dietrich #include <linux/clk.h> 2565b935aaSMarc Dietrich #include <linux/dma-mapping.h> 2665b935aaSMarc Dietrich #include <linux/pda_power.h> 2765b935aaSMarc Dietrich #include <linux/io.h> 28dda9cd28SMarc Dietrich #include <linux/i2c.h> 29dda9cd28SMarc Dietrich #include <linux/i2c-tegra.h> 3013db7a7fSMarc Dietrich #include <linux/platform_data/tegra_usb.h> 3165b935aaSMarc Dietrich 3265b935aaSMarc Dietrich #include <asm/mach-types.h> 3365b935aaSMarc Dietrich #include <asm/mach/arch.h> 3465b935aaSMarc Dietrich #include <asm/mach/time.h> 3565b935aaSMarc Dietrich #include <asm/setup.h> 3665b935aaSMarc Dietrich 3765b935aaSMarc Dietrich #include <mach/iomap.h> 3865b935aaSMarc Dietrich #include <mach/irqs.h> 3965b935aaSMarc Dietrich #include <mach/sdhci.h> 4013db7a7fSMarc Dietrich #include <mach/usb_phy.h> 4113db7a7fSMarc Dietrich #include <mach/gpio.h> 4265b935aaSMarc Dietrich 4365b935aaSMarc Dietrich #include "board.h" 4465b935aaSMarc Dietrich #include "board-paz00.h" 4565b935aaSMarc Dietrich #include "clock.h" 4665b935aaSMarc Dietrich #include "devices.h" 4765b935aaSMarc Dietrich #include "gpio-names.h" 4865b935aaSMarc Dietrich 4965b935aaSMarc Dietrich static struct plat_serial8250_port debug_uart_platform_data[] = { 5065b935aaSMarc Dietrich { 5165b935aaSMarc Dietrich .membase = IO_ADDRESS(TEGRA_UARTD_BASE), 5265b935aaSMarc Dietrich .mapbase = TEGRA_UARTD_BASE, 5365b935aaSMarc Dietrich .irq = INT_UARTD, 5465b935aaSMarc Dietrich .flags = UPF_BOOT_AUTOCONF, 5565b935aaSMarc Dietrich .iotype = UPIO_MEM, 5665b935aaSMarc Dietrich .regshift = 2, 5765b935aaSMarc Dietrich .uartclk = 216000000, 5865b935aaSMarc Dietrich }, { 5965b935aaSMarc Dietrich .flags = 0 6065b935aaSMarc Dietrich } 6165b935aaSMarc Dietrich }; 6265b935aaSMarc Dietrich 6365b935aaSMarc Dietrich static struct platform_device debug_uart = { 6465b935aaSMarc Dietrich .name = "serial8250", 6565b935aaSMarc Dietrich .id = PLAT8250_DEV_PLATFORM, 6665b935aaSMarc Dietrich .dev = { 6765b935aaSMarc Dietrich .platform_data = debug_uart_platform_data, 6865b935aaSMarc Dietrich }, 6965b935aaSMarc Dietrich }; 7065b935aaSMarc Dietrich 7165b935aaSMarc Dietrich static struct platform_device *paz00_devices[] __initdata = { 7265b935aaSMarc Dietrich &debug_uart, 7365b935aaSMarc Dietrich &tegra_sdhci_device1, 7465b935aaSMarc Dietrich &tegra_sdhci_device4, 7565b935aaSMarc Dietrich }; 7665b935aaSMarc Dietrich 77dda9cd28SMarc Dietrich static struct tegra_i2c_platform_data paz00_i2c1_platform_data = { 78dda9cd28SMarc Dietrich .bus_clk_rate = 400000, 79dda9cd28SMarc Dietrich }; 80dda9cd28SMarc Dietrich 81dda9cd28SMarc Dietrich static struct tegra_i2c_platform_data paz00_i2c2_platform_data = { 82dda9cd28SMarc Dietrich .bus_clk_rate = 400000, 83dda9cd28SMarc Dietrich }; 84dda9cd28SMarc Dietrich 85dda9cd28SMarc Dietrich static struct tegra_i2c_platform_data paz00_dvc_platform_data = { 86dda9cd28SMarc Dietrich .bus_clk_rate = 400000, 87dda9cd28SMarc Dietrich }; 88dda9cd28SMarc Dietrich 89dda9cd28SMarc Dietrich static void paz00_i2c_init(void) 90dda9cd28SMarc Dietrich { 91dda9cd28SMarc Dietrich tegra_i2c_device1.dev.platform_data = &paz00_i2c1_platform_data; 92dda9cd28SMarc Dietrich tegra_i2c_device2.dev.platform_data = &paz00_i2c2_platform_data; 93dda9cd28SMarc Dietrich tegra_i2c_device4.dev.platform_data = &paz00_dvc_platform_data; 94dda9cd28SMarc Dietrich 95dda9cd28SMarc Dietrich platform_device_register(&tegra_i2c_device1); 96dda9cd28SMarc Dietrich platform_device_register(&tegra_i2c_device2); 97dda9cd28SMarc Dietrich platform_device_register(&tegra_i2c_device4); 98dda9cd28SMarc Dietrich } 99dda9cd28SMarc Dietrich 10013db7a7fSMarc Dietrich static struct tegra_ulpi_config ulpi_phy_config = { 10113db7a7fSMarc Dietrich .reset_gpio = TEGRA_ULPI_RST, 10213db7a7fSMarc Dietrich .clk = "cdev2", 10313db7a7fSMarc Dietrich }; 10413db7a7fSMarc Dietrich 10513db7a7fSMarc Dietrich static struct tegra_ehci_platform_data tegra_ehci_pdata[] = { 10613db7a7fSMarc Dietrich [0] = { 10713db7a7fSMarc Dietrich .operating_mode = TEGRA_USB_OTG, 10813db7a7fSMarc Dietrich .power_down_on_bus_suspend = 1, 10913db7a7fSMarc Dietrich }, 11013db7a7fSMarc Dietrich [1] = { 11113db7a7fSMarc Dietrich .phy_config = &ulpi_phy_config, 11213db7a7fSMarc Dietrich .operating_mode = TEGRA_USB_HOST, 11313db7a7fSMarc Dietrich .power_down_on_bus_suspend = 1, 11413db7a7fSMarc Dietrich }, 11513db7a7fSMarc Dietrich [2] = { 11613db7a7fSMarc Dietrich .operating_mode = TEGRA_USB_HOST, 11713db7a7fSMarc Dietrich .power_down_on_bus_suspend = 1, 11813db7a7fSMarc Dietrich }, 11913db7a7fSMarc Dietrich }; 12013db7a7fSMarc Dietrich 12113db7a7fSMarc Dietrich static void paz00_usb_init(void) 12213db7a7fSMarc Dietrich { 12313db7a7fSMarc Dietrich tegra_ehci2_device.dev.platform_data = &tegra_ehci_pdata[1]; 12413db7a7fSMarc Dietrich tegra_ehci3_device.dev.platform_data = &tegra_ehci_pdata[2]; 12513db7a7fSMarc Dietrich 12613db7a7fSMarc Dietrich platform_device_register(&tegra_ehci2_device); 12713db7a7fSMarc Dietrich platform_device_register(&tegra_ehci3_device); 12813db7a7fSMarc Dietrich } 12913db7a7fSMarc Dietrich 13065b935aaSMarc Dietrich static void __init tegra_paz00_fixup(struct machine_desc *desc, 13165b935aaSMarc Dietrich struct tag *tags, char **cmdline, struct meminfo *mi) 13265b935aaSMarc Dietrich { 13365b935aaSMarc Dietrich mi->nr_banks = 1; 13465b935aaSMarc Dietrich mi->bank[0].start = PHYS_OFFSET; 13565b935aaSMarc Dietrich mi->bank[0].size = 448 * SZ_1M; 13665b935aaSMarc Dietrich } 13765b935aaSMarc Dietrich 13865b935aaSMarc Dietrich static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = { 13965b935aaSMarc Dietrich /* name parent rate enabled */ 14065b935aaSMarc Dietrich { "uartd", "pll_p", 216000000, true }, 14165b935aaSMarc Dietrich { NULL, NULL, 0, 0}, 14265b935aaSMarc Dietrich }; 14365b935aaSMarc Dietrich 14465b935aaSMarc Dietrich static struct tegra_sdhci_platform_data sdhci_pdata1 = { 14565b935aaSMarc Dietrich .cd_gpio = TEGRA_GPIO_SD1_CD, 14665b935aaSMarc Dietrich .wp_gpio = TEGRA_GPIO_SD1_WP, 14765b935aaSMarc Dietrich .power_gpio = TEGRA_GPIO_SD1_POWER, 14865b935aaSMarc Dietrich }; 14965b935aaSMarc Dietrich 15041cdc62eSMarc Dietrich static struct tegra_sdhci_platform_data sdhci_pdata4 = { 15165b935aaSMarc Dietrich .cd_gpio = -1, 15265b935aaSMarc Dietrich .wp_gpio = -1, 15365b935aaSMarc Dietrich .power_gpio = -1, 15465b935aaSMarc Dietrich .is_8bit = 1, 15565b935aaSMarc Dietrich }; 15665b935aaSMarc Dietrich 15765b935aaSMarc Dietrich static void __init tegra_paz00_init(void) 15865b935aaSMarc Dietrich { 15965b935aaSMarc Dietrich tegra_clk_init_from_table(paz00_clk_init_table); 16065b935aaSMarc Dietrich 16165b935aaSMarc Dietrich paz00_pinmux_init(); 16265b935aaSMarc Dietrich 16365b935aaSMarc Dietrich tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1; 16465b935aaSMarc Dietrich tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4; 16565b935aaSMarc Dietrich 16665b935aaSMarc Dietrich platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices)); 167dda9cd28SMarc Dietrich 168dda9cd28SMarc Dietrich paz00_i2c_init(); 16913db7a7fSMarc Dietrich paz00_usb_init(); 17065b935aaSMarc Dietrich } 17165b935aaSMarc Dietrich 17265b935aaSMarc Dietrich MACHINE_START(PAZ00, "paz00") 17365b935aaSMarc Dietrich .boot_params = 0x00000100, 17465b935aaSMarc Dietrich .fixup = tegra_paz00_fixup, 17565b935aaSMarc Dietrich .map_io = tegra_map_common_io, 17665b935aaSMarc Dietrich .init_early = tegra_init_early, 17765b935aaSMarc Dietrich .init_irq = tegra_init_irq, 17865b935aaSMarc Dietrich .timer = &tegra_timer, 17965b935aaSMarc Dietrich .init_machine = tegra_paz00_init, 18065b935aaSMarc Dietrich MACHINE_END 181