diff options
author | Johnny Qiu <joqiu@nvidia.com> | 2012-01-10 12:40:05 -0800 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2012-01-30 11:46:19 -0800 |
commit | 00ce1168fe25fa398a758c1b05dc3fc40d4fb497 (patch) | |
tree | 3e3d34c276d5e177016956bef18c1e0af7e16b16 /arch/arm/mach-tegra/board-kai-sdhci.c | |
parent | e818b6ec2c0ab3bf142291983eb0f2840f62570c (diff) |
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 <joqiu@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/77296
Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'arch/arm/mach-tegra/board-kai-sdhci.c')
-rw-r--r-- | arch/arm/mach-tegra/board-kai-sdhci.c | 163 |
1 files changed, 163 insertions, 0 deletions
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 <linux/resource.h> +#include <linux/platform_device.h> +#include <linux/delay.h> +#include <linux/gpio.h> +#include <linux/clk.h> +#include <linux/err.h> +#include <linux/mmc/host.h> + +#include <asm/mach-types.h> +#include <mach/irqs.h> +#include <mach/iomap.h> +#include <mach/sdhci.h> + +#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; +} |