From 00ce1168fe25fa398a758c1b05dc3fc40d4fb497 Mon Sep 17 00:00:00 2001 From: Johnny Qiu Date: Tue, 10 Jan 2012 12:40:05 -0800 Subject: arm: tegra: kai: create board files Create initial board files and config files for Kai. Reviewed-on: http://git-master/r/74441 Change-Id: I4b07607da85fe4bcb00e5fce2ddbc2a83471b1de Signed-off-by: Johnny Qiu Signed-off-by: Varun Wadekar Reviewed-on: http://git-master/r/77296 Reviewed-by: Automatic_Commit_Validation_User --- arch/arm/mach-tegra/board-kai-sdhci.c | 163 ++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 arch/arm/mach-tegra/board-kai-sdhci.c (limited to 'arch/arm/mach-tegra/board-kai-sdhci.c') diff --git a/arch/arm/mach-tegra/board-kai-sdhci.c b/arch/arm/mach-tegra/board-kai-sdhci.c new file mode 100644 index 000000000000..99f7736b14e7 --- /dev/null +++ b/arch/arm/mach-tegra/board-kai-sdhci.c @@ -0,0 +1,163 @@ +/* + * arch/arm/mach-tegra/board-kai-sdhci.c + * + * Copyright (C) 2010 Google, Inc. + * Copyright (C) 2012 NVIDIA Corporation. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "gpio-names.h" +#include "board.h" +#include "board-kai.h" + +#define KAI_SD_CD TEGRA_GPIO_PI5 + +static struct resource sdhci_resource0[] = { + [0] = { + .start = INT_SDMMC1, + .end = INT_SDMMC1, + .flags = IORESOURCE_IRQ, + }, + [1] = { + .start = TEGRA_SDMMC1_BASE, + .end = TEGRA_SDMMC1_BASE + TEGRA_SDMMC1_SIZE-1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct resource sdhci_resource2[] = { + [0] = { + .start = INT_SDMMC3, + .end = INT_SDMMC3, + .flags = IORESOURCE_IRQ, + }, + [1] = { + .start = TEGRA_SDMMC3_BASE, + .end = TEGRA_SDMMC3_BASE + TEGRA_SDMMC3_SIZE-1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct resource sdhci_resource3[] = { + [0] = { + .start = INT_SDMMC4, + .end = INT_SDMMC4, + .flags = IORESOURCE_IRQ, + }, + [1] = { + .start = TEGRA_SDMMC4_BASE, + .end = TEGRA_SDMMC4_BASE + TEGRA_SDMMC4_SIZE-1, + .flags = IORESOURCE_MEM, + }, +}; + +static struct tegra_sdhci_platform_data tegra_sdhci_platform_data2 = { + .mmc_data = { + .built_in = 1, + }, + .cd_gpio = -1, + .wp_gpio = -1, + .power_gpio = -1, +/* .tap_delay = 6, + .is_voltage_switch_supported = false, + .vdd_rail_name = NULL, + .slot_rail_name = NULL, + .vdd_max_uv = -1, + .vdd_min_uv = -1, + .max_clk = 0, + .is_8bit_supported = false, */ +}; + +static struct tegra_sdhci_platform_data tegra_sdhci_platform_data0 = { + .cd_gpio = KAI_SD_CD, + .wp_gpio = -1, + .power_gpio = -1, +/* .tap_delay = 6, + .is_voltage_switch_supported = true, + .vdd_rail_name = "vddio_sdmmc1", + .slot_rail_name = "vddio_sd_slot", + .vdd_max_uv = 3320000, + .vdd_min_uv = 3280000, + .max_clk = 208000000, + .is_8bit_supported = false, */ +}; + +static struct tegra_sdhci_platform_data tegra_sdhci_platform_data3 = { + .cd_gpio = -1, + .wp_gpio = -1, + .power_gpio = -1, + .is_8bit = 1, + .tap_delay = 0x0F, + .mmc_data = { + .built_in = 1, + } +/* .tap_delay = 6, + .is_voltage_switch_supported = false, + .vdd_rail_name = NULL, + .slot_rail_name = NULL, + .vdd_max_uv = -1, + .vdd_min_uv = -1, + .max_clk = 48000000, + .is_8bit_supported = true, */ +}; + +static struct platform_device tegra_sdhci_device0 = { + .name = "sdhci-tegra", + .id = 0, + .resource = sdhci_resource0, + .num_resources = ARRAY_SIZE(sdhci_resource0), + .dev = { + .platform_data = &tegra_sdhci_platform_data0, + }, +}; + +static struct platform_device tegra_sdhci_device2 = { + .name = "sdhci-tegra", + .id = 2, + .resource = sdhci_resource2, + .num_resources = ARRAY_SIZE(sdhci_resource2), + .dev = { + .platform_data = &tegra_sdhci_platform_data2, + }, +}; + +static struct platform_device tegra_sdhci_device3 = { + .name = "sdhci-tegra", + .id = 3, + .resource = sdhci_resource3, + .num_resources = ARRAY_SIZE(sdhci_resource3), + .dev = { + .platform_data = &tegra_sdhci_platform_data3, + }, +}; + +int __init kai_sdhci_init(void) +{ + platform_device_register(&tegra_sdhci_device3); + platform_device_register(&tegra_sdhci_device2); + platform_device_register(&tegra_sdhci_device0); + + return 0; +} -- cgit v1.2.3