diff options
author | Scott Williams <scwilliams@nvidia.com> | 2010-12-07 11:20:05 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:45:24 -0800 |
commit | e8c4914e040999d075b562ea671d99ab64cf45a4 (patch) | |
tree | 153a5500a8a1639f7ae6b95bc04d43a20145209c | |
parent | 5a5ed447904971aa146e15966b2d9c982fa157b0 (diff) |
[ARM/tegra] Add Aruba board definition files
Bug 764354
Original-Change-Id: I23d0ddc5107c02195ef58cab0e0c49ea65c72a87
Reviewed-on: http://git-master/r/12229
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Tested-by: Scott Williams <scwilliams@nvidia.com>
Original-Change-Id: Ibaa7f1e4cd5a3e3475d56601b420e40985194197
Rebase-Id: Rbdcbee634d19419502574f356a35370797db473a
-rw-r--r-- | arch/arm/mach-tegra/board-aruba-panel.c | 252 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-aruba-pinmux.c | 299 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-aruba-power.c | 279 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-aruba-sdhci.c | 251 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-aruba-sensors.c | 98 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-aruba.c | 434 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-aruba.h | 26 |
7 files changed, 1639 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-aruba-panel.c b/arch/arm/mach-tegra/board-aruba-panel.c new file mode 100644 index 000000000000..d98cb7f65db9 --- /dev/null +++ b/arch/arm/mach-tegra/board-aruba-panel.c @@ -0,0 +1,252 @@ +/* + * arch/arm/mach-tegra/board-aruba-panel.c + * + * Copyright (c) 2010, NVIDIA Corporation. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include <linux/delay.h> +#include <linux/gpio.h> +#include <linux/regulator/consumer.h> +#include <linux/resource.h> +#include <asm/mach-types.h> +#include <linux/platform_device.h> +#include <linux/pwm_backlight.h> +#include <mach/nvhost.h> +#include <mach/nvmap.h> +#include <mach/irqs.h> +#include <mach/iomap.h> +#include <mach/dc.h> +#include <mach/fb.h> + +#include "devices.h" +#include "gpio-names.h" + +#define PMC_SCRATCH20 0xa0 + +#define aruba_lvds_shutdown TEGRA_GPIO_PB2 + +static int aruba_panel_enable(void) +{ + static struct regulator *reg = NULL; + + if (reg == NULL) { + reg = regulator_get(NULL, "avdd_lvds"); + if (WARN_ON(IS_ERR(reg))) + pr_err("%s: couldn't get regulator avdd_lvds: %ld\n", + __func__, PTR_ERR(reg)); + else + regulator_enable(reg); + } + + gpio_set_value(aruba_lvds_shutdown, 1); + return 0; +} + +static int aruba_panel_disable(void) +{ + gpio_set_value(aruba_lvds_shutdown, 0); + return 0; +} + +static struct resource aruba_disp1_resources[] = { + { + .name = "irq", + .start = INT_DISPLAY_GENERAL, + .end = INT_DISPLAY_GENERAL, + .flags = IORESOURCE_IRQ, + }, + { + .name = "regs", + .start = TEGRA_DISPLAY_BASE, + .end = TEGRA_DISPLAY_BASE + TEGRA_DISPLAY_SIZE-1, + .flags = IORESOURCE_MEM, + }, + { + .name = "fbmem", + .start = 0, /* Filled in by fbmem_set() */ + .end = 0, /* Filled in by fbmem_set() */ + .flags = IORESOURCE_MEM, + }, +}; + +static struct tegra_dc_mode aruba_panel_modes[] = { + { + .pclk = 18000000, + .h_ref_to_sync = 8, + .v_ref_to_sync = 2, + .h_sync_width = 4, + .v_sync_width = 1, + .h_back_porch = 20, + .v_back_porch = 7, + .h_active = 480, + .v_active = 640, + .h_front_porch = 8, + .v_front_porch = 8, + }, +}; + +static struct tegra_fb_data aruba_fb_data = { + .win = 0, + .xres = 1366, + .yres = 768, + .bits_per_pixel = 16, +}; + +static struct tegra_dc_out aruba_disp1_out = { + .type = TEGRA_DC_OUT_RGB, + + .align = TEGRA_DC_ALIGN_MSB, + .order = TEGRA_DC_ORDER_RED_BLUE, + + .modes = aruba_panel_modes, + .n_modes = ARRAY_SIZE(aruba_panel_modes), + + .enable = aruba_panel_enable, + .disable = aruba_panel_disable, +}; + +static struct tegra_dc_platform_data aruba_disp1_pdata = { + .flags = TEGRA_DC_FLAG_ENABLED, + .default_out = &aruba_disp1_out, + .fb = &aruba_fb_data, +}; + +static struct nvhost_device aruba_disp1_device = { + .name = "tegradc", + .id = 0, + .resource = aruba_disp1_resources, + .num_resources = ARRAY_SIZE(aruba_disp1_resources), + .dev = { + .platform_data = &aruba_disp1_pdata, + }, +}; + +static struct nvmap_platform_carveout aruba_carveouts[] = { + [0] = { + .name = "iram", + .usage_mask = NVMAP_HEAP_CARVEOUT_IRAM, + .base = TEGRA_IRAM_BASE, + .size = TEGRA_IRAM_SIZE, + .buddy_size = 0, /* no buddy allocation for IRAM */ + }, + [1] = { + .name = "generic-0", + .usage_mask = NVMAP_HEAP_CARVEOUT_GENERIC, + .base = 0, /* Filled in by carveout_set() */ + .size = 0, /* Filled in by carveout_set() */ + .buddy_size = SZ_32K, + }, +}; + +static struct nvmap_platform_data aruba_nvmap_data = { + .carveouts = aruba_carveouts, + .nr_carveouts = ARRAY_SIZE(aruba_carveouts), +}; + +static struct platform_device aruba_nvmap_device = { + .name = "tegra-nvmap", + .id = -1, + .dev = { + .platform_data = &aruba_nvmap_data, + }, +}; + +static struct platform_device *aruba_gfx_devices[] __initdata = { + &aruba_nvmap_device, + &tegra_grhost_device, +}; + + +static inline u32 pmc_readl(unsigned long offset) +{ + return readl(IO_TO_VIRT(TEGRA_PMC_BASE + offset)); +} + +static void fbmem_set(struct resource *res, int num_res, + u32 start, resource_size_t size) +{ + int i; + for (i = 0; i < num_res ; i++) { + if (!strcmp(res[i].name, "fbmem")) { + res[i].start = start; + res[i].end = start + size - 1; + return; + } + } + /* Didn't find a framebuffer memory resource */ + BUG(); +} + +static void carveout_set(struct nvmap_platform_carveout *res, int num_res, + u32 base, resource_size_t size) +{ + int i; + for (i = 0; i < num_res ; i++) { + if (!strcmp(res[i].name, "generic-0")) { + res[i].base = base; + res[i].size = size; + return; + } + } + /* Didn't find a carveout memory resource */ + BUG(); +} + +int __init aruba_panel_init(void) +{ + int err; + u32 odm_data = pmc_readl(PMC_SCRATCH20); + + /* !!!FIXME!!! HAVE TO USE HARD-CODED FRAME BUFFER AND CARVEOUT + ADDRESSES FOR NOW -- BUG 769986 */ + switch (odm_data & 0x70000000) { + case 0x10000000: + /* 256MB LPDDR2 */ + fbmem_set(aruba_disp1_resources, + ARRAY_SIZE(aruba_disp1_resources), + 0x8E010000, + 0x0012C3C0); + carveout_set(aruba_carveouts, + ARRAY_SIZE(aruba_carveouts), + 0x8EC00000, /* 256MB mem - 32MB carveout + 0xC00000 ?*/ + SZ_32M - 0xC00000); + break; + case 0x40000000: + /* 1GB DDR3 -- NOTE: The bootloader cannot map more than 512MB + of physical memory. Therefore, the frame buffer and carveout + must be completely below the 512MB boundary. */ + fbmem_set(aruba_disp1_resources, + ARRAY_SIZE(aruba_disp1_resources), + 0x9E010000, + 0x0012C3C0); + carveout_set(aruba_carveouts, + ARRAY_SIZE(aruba_carveouts), + 0x9EC00000, /* 512MB mem - 32MB carveout + 0xC00000 ?*/ + SZ_32M - 0xC00000); + break; + default: + BUG(); + } + + err = platform_add_devices(aruba_gfx_devices, + ARRAY_SIZE(aruba_gfx_devices)); + + if (!err) + err = nvhost_device_register(&aruba_disp1_device); + + return err; +} diff --git a/arch/arm/mach-tegra/board-aruba-pinmux.c b/arch/arm/mach-tegra/board-aruba-pinmux.c new file mode 100644 index 000000000000..069468b3ae00 --- /dev/null +++ b/arch/arm/mach-tegra/board-aruba-pinmux.c @@ -0,0 +1,299 @@ +/* + * arch/arm/mach-tegra/board-aruba-pinmux.c + * + * Copyright (C) 2010 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/kernel.h> +#include <linux/init.h> +#include <mach/pinmux.h> + +#define DEFAULT_DRIVE(_name) \ + { \ + .pingroup = TEGRA_DRIVE_PINGROUP_##_name, \ + .hsm = TEGRA_HSM_DISABLE, \ + .schmitt = TEGRA_SCHMITT_ENABLE, \ + .drive = TEGRA_DRIVE_DIV_1, \ + .pull_down = TEGRA_PULL_31, \ + .pull_up = TEGRA_PULL_31, \ + .slew_rising = TEGRA_SLEW_SLOWEST, \ + .slew_falling = TEGRA_SLEW_SLOWEST, \ + } + + +// !!!FIXME!!!! POPULATE THIS TABLE +static __initdata struct tegra_drive_pingroup_config aruba_drive_pinmux[] = { + /* DEFAULT_DRIVE(<pin_group>), */ +}; + +#define DEFAULT_PINMUX(_pingroup, _mux, _pupd, _tri, _io) \ + { \ + .pingroup = TEGRA_PINGROUP_##_pingroup, \ + .func = TEGRA_MUX_##_mux, \ + .pupd = TEGRA_PUPD_##_pupd, \ + .tristate = TEGRA_TRI_##_tri, \ + .io = TEGRA_PIN_##_io, \ + } + +// !!!FIXME!!!! POPULATE THIS TABLE +static __initdata struct tegra_pingroup_config aruba_pinmux[] = { + DEFAULT_PINMUX(ULPI_DATA0, UARTA, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(ULPI_DATA1, UARTA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(ULPI_DATA2, UARTA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(ULPI_DATA3, UARTA, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(ULPI_DATA4, UARTA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(ULPI_DATA5, UARTA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(ULPI_DATA6, UARTA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(ULPI_DATA7, UARTA, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(ULPI_CLK, UARTD, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(ULPI_DIR, UARTD, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(ULPI_NXT, UARTD, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(ULPI_STP, UARTD, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(DAP3_FS, I2S2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP3_DIN, I2S2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP3_DOUT, I2S2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP3_SCLK, I2S2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC1_CLK, SDMMC1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC1_CMD, SDMMC1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC1_DAT3, SDMMC1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC1_DAT2, SDMMC1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC1_DAT1, SDMMC1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC1_DAT0, SDMMC1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GPIO_PV2, OWR, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GPIO_PV3, CLK12, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(CLK2_OUT, EXTPERIPH2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(CLK2_REQ, DAP, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_PWR1, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_PWR2, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_SDIN, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_SDOUT, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_WR_N, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_CS0_N, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_DC0, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_SCK, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_PWR0, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_PCLK, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_DE, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_HSYNC, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_VSYNC, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D0, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D1, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D2, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D3, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D4, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D5, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D6, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D7, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D8, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D9, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D10, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D11, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D12, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D13, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D14, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D15, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D16, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D17, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D18, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D19, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D20, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D21, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D22, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_D23, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_CS1_N, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_M1, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(LCD_DC1, DISPLAYA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DDC_SCL, I2C4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DDC_SDA, I2C4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(CRT_HSYNC, CRT, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(CRT_VSYNC, CRT, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(VI_D0, RSVD1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_D1, SDMMC2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_D2, SDMMC2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_D3, SDMMC2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_D4, SDMMC2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_D5, SDMMC2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_D6, SDMMC2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_D7, SDMMC2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_D8, SDMMC2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_D9, SDMMC2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_D10, RSVD1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_D11, RSVD1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_PCLK, SDMMC2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_MCLK, VI, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_VSYNC, RSVD1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(VI_HSYNC, RSVD1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(UART2_RXD, IRDA, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(UART2_TXD, IRDA, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(UART2_RTS_N, GMI, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(UART2_CTS_N, GMI, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(UART3_TXD, UARTC, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(UART3_RXD, UARTC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(UART3_CTS_N, UARTC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(UART3_RTS_N, UARTC, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GPIO_PU0, RSVD1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GPIO_PU1, RSVD1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GPIO_PU2, RSVD1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GPIO_PU3, PWM0, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GPIO_PU4, PWM1, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GPIO_PU5, PWM2, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GPIO_PU6, PWM3, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GEN1_I2C_SDA, I2C1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GEN1_I2C_SCL, I2C1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP4_FS, I2S3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP4_DIN, I2S3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP4_DOUT, I2S3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP4_SCLK, I2S3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(CLK3_OUT, EXTPERIPH3, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(CLK3_REQ, DEV3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_WP_N, RSVD1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_IORDY, NAND, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_WAIT, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_ADV_N, NAND, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_CLK, NAND, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_CS0_N, NAND, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_CS1_N, NAND, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_CS2_N, NAND, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_CS3_N, NAND, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_CS4_N, NAND, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_CS6_N, NAND_ALT, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_CS7_N, NAND_ALT, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_AD0, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD1, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD2, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD3, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD4, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD5, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD6, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD7, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD8, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD9, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD10, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD11, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD12, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD13, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD14, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_AD15, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_A16, UARTD, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_A17, UARTD, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_A18, UARTD, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_A19, UARTD, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_WR_N, NAND, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_OE_N, NAND, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(GMI_DQS, NAND, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GMI_RST_N, RSVD3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GEN2_I2C_SCL, I2C2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GEN2_I2C_SDA, I2C2, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC4_CLK, SDMMC4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC4_CMD, SDMMC4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC4_DAT0, SDMMC4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC4_DAT1, SDMMC4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC4_DAT2, SDMMC4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC4_DAT3, SDMMC4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC4_DAT4, SDMMC4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC4_DAT5, SDMMC4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC4_DAT6, SDMMC4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC4_DAT7, SDMMC4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC4_RST_N, RSVD1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(CAM_MCLK, VI, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GPIO_PCC1, RSVD1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GPIO_PBB0, RSVD1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(CAM_I2C_SCL, I2C3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(CAM_I2C_SDA, I2C3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GPIO_PBB3, VGP3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GPIO_PBB4, VGP4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GPIO_PBB5, VGP5, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GPIO_PBB6, VGP6, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GPIO_PBB7, I2S4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(GPIO_PCC2, I2S4, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(JTAG_RTCK, RTCK, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(PWR_I2C_SCL, I2CPWR, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(PWR_I2C_SDA, I2CPWR, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW0, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW1, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW2, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW3, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW4, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW5, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW6, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW7, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW8, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW9, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW10, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW11, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW12, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW13, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW14, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_ROW15, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_COL0, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_COL1, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_COL2, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_COL3, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_COL4, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_COL5, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_COL6, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(KB_COL7, KBC, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(CLK_32K_OUT, BLINK, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(SYS_CLK_REQ, SYSCLK, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(OWR, OWR, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP1_FS, I2S0, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP1_DIN, I2S0, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP1_DOUT, I2S0, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP1_SCLK, I2S0, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(CLK1_REQ, DAP, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(CLK1_OUT, EXTPERIPH1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SPDIF_IN, SPDIF, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SPDIF_OUT, SPDIF, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(DAP2_FS, I2S1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP2_DIN, I2S1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP2_DOUT, I2S1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(DAP2_SCLK, I2S1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SPI2_MOSI, SPI6, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SPI2_MISO, SPI6, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SPI2_CS0_N, SPI6, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SPI2_SCK, SPI6, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SPI1_MOSI, SPI1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SPI1_SCK, SPI1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SPI1_CS0_N, SPI1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SPI1_MISO, SPI1, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SPI2_CS1_N, SPI3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SPI2_CS2_N, SPI3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC3_CLK, SDMMC3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC3_CMD, SDMMC3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC3_DAT0, SDMMC3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC3_DAT1, SDMMC3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC3_DAT2, SDMMC3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC3_DAT3, SDMMC3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC3_DAT4, SDMMC3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC3_DAT5, SDMMC3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC3_DAT6, SDMMC3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(SDMMC3_DAT7, SDMMC3, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(PEX_L0_PRSNT_N, PCIE, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(PEX_L0_RST_N, PCIE, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(PEX_L0_CLKREQ_N, PCIE, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(PEX_WAKE_N, PCIE, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(PEX_L1_PRSNT_N, PCIE, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(PEX_L1_RST_N, PCIE, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(PEX_L1_CLKREQ_N, PCIE, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(PEX_L2_PRSNT_N, PCIE, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(PEX_L2_RST_N, PCIE, NORMAL, NORMAL, OUTPUT), + DEFAULT_PINMUX(PEX_L2_CLKREQ_N, PCIE, NORMAL, NORMAL, INPUT), + DEFAULT_PINMUX(HDMI_CEC, CEC, NORMAL, NORMAL, INPUT), +}; + +void __init aruba_pinmux_init(void) +{ + tegra_pinmux_config_table(aruba_pinmux, ARRAY_SIZE(aruba_pinmux)); + tegra_drive_pinmux_config_table(aruba_drive_pinmux, + ARRAY_SIZE(aruba_drive_pinmux)); +} diff --git a/arch/arm/mach-tegra/board-aruba-power.c b/arch/arm/mach-tegra/board-aruba-power.c new file mode 100644 index 000000000000..ce8d9b571504 --- /dev/null +++ b/arch/arm/mach-tegra/board-aruba-power.c @@ -0,0 +1,279 @@ +/* + * Copyright (C) 2010 NVIDIA, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307, USA + */ +#include <linux/i2c.h> +#include <linux/pda_power.h> +#include <linux/platform_device.h> +#include <linux/resource.h> +#include <linux/regulator/machine.h> +#include <linux/mfd/tps6586x.h> +#include <linux/gpio.h> +#include <mach/suspend.h> +#include <linux/io.h> + +#include <mach/iomap.h> +#include <mach/irqs.h> + +#if 0 // !!!FIXME!!! IMPLEMENT ME + +#include "gpio-names.h" +#include "power.h" +/* !!!FIXME!!! #include "wakeups-t3.h" NEED TO CREATE THIS ................................. */ +#include "board.h" + +#define PMC_CTRL 0x0 +#define PMC_CTRL_INTR_LOW (1 << 17) + +static int ac_ok = TEGRA_GPIO_PV3; +static int charge_disable = TEGRA_GPIO_PR6; + +static int charge_init(struct device *dev) +{ + int ret = gpio_request(charge_disable, "chg_disable"); + if (ret < 0) + return ret; + + ret = gpio_request(ac_ok, "ac_ok"); + if (ret < 0) { + gpio_free(charge_disable); + return ret; + } + + ret = gpio_direction_output(charge_disable, 0); + if (ret < 0) + goto cleanup; + + ret = gpio_direction_input(ac_ok); + if (ret < 0) + goto cleanup; + + tegra_gpio_enable(ac_ok); + tegra_gpio_enable(charge_disable); + + return 0; + +cleanup: + gpio_free(ac_ok); + gpio_free(charge_disable); + return ret; +} + +static void charge_exit(struct device *dev) +{ + gpio_free(charge_disable); +} + +static int ac_online(void) +{ + return !gpio_get_value(ac_ok); +} + +static void set_charge(int flags) +{ + if (flags == PDA_POWER_CHARGE_AC) + gpio_set_value(charge_disable, 0); + else if (!flags) + gpio_set_value(charge_disable, 1); + /* USB charging not supported on Aruba */ +} + +static struct resource aruba_pda_resources[] = { + [0] = { + .name = "ac", + .start = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PV3), + .end = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PV3), + .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | + IORESOURCE_IRQ_LOWEDGE), + }, +}; + +static struct pda_power_pdata aruba_pda_data = { + .is_ac_online = ac_online, + .exit = charge_exit, + .init = charge_init, + .set_charge = set_charge, +}; + +static struct platform_device aruba_pda_power_device = { + .name = "pda-power", + .id = -1, + .resource = aruba_pda_resources, + .num_resources = ARRAY_SIZE(aruba_pda_resources), + .dev = { + .platform_data = &aruba_pda_data, + }, +}; + + +static struct regulator_consumer_supply tps658621_sm0_supply[] = { + REGULATOR_SUPPLY("vdd_core", NULL), +}; +static struct regulator_consumer_supply tps658621_sm1_supply[] = { + REGULATOR_SUPPLY("vdd_cpu", NULL), +}; +static struct regulator_consumer_supply tps658621_sm2_supply[] = { + REGULATOR_SUPPLY("vdd_sm2", NULL), +}; +static struct regulator_consumer_supply tps658621_ldo0_supply[] = { + REGULATOR_SUPPLY("p_cam_avdd", NULL), +}; +static struct regulator_consumer_supply tps658621_ldo1_supply[] = { + REGULATOR_SUPPLY("avdd_pll", NULL), +}; +static struct regulator_consumer_supply tps658621_ldo2_supply[] = { + REGULATOR_SUPPLY("vdd_rtc", NULL), +}; +static struct regulator_consumer_supply tps658621_ldo3_supply[] = { + REGULATOR_SUPPLY("avdd_usb", NULL), + REGULATOR_SUPPLY("avdd_usb_pll", NULL), + REGULATOR_SUPPLY("avdd_lvds", NULL), +}; +static struct regulator_consumer_supply tps658621_ldo4_supply[] = { + REGULATOR_SUPPLY("avdd_osc", NULL), + REGULATOR_SUPPLY("vddio_sys", "panjit_touch"), +}; +static struct regulator_consumer_supply tps658621_ldo5_supply[] = { + REGULATOR_SUPPLY("vcore_mmc", "sdhci-tegra.1"), + REGULATOR_SUPPLY("vcore_mmc", "sdhci-tegra.3"), +}; +static struct regulator_consumer_supply tps658621_ldo6_supply[] = { + REGULATOR_SUPPLY("vddio_vi", NULL), +}; +static struct regulator_consumer_supply tps658621_ldo7_supply[] = { + REGULATOR_SUPPLY("avdd_hdmi", NULL), + REGULATOR_SUPPLY("vdd_fuse", NULL), +}; +static struct regulator_consumer_supply tps658621_ldo8_supply[] = { + REGULATOR_SUPPLY("avdd_hdmi_pll", NULL), +}; +static struct regulator_consumer_supply tps658621_ldo9_supply[] = { + REGULATOR_SUPPLY("avdd_2v85", NULL), + REGULATOR_SUPPLY("vdd_ddr_rx", NULL), + REGULATOR_SUPPLY("avdd_amp", NULL), +}; + +#define REGULATOR_INIT(_id, _minmv, _maxmv) \ + { \ + .constraints = { \ + .min_uV = (_minmv)*1000, \ + .max_uV = (_maxmv)*1000, \ + .valid_modes_mask = (REGULATOR_MODE_NORMAL | \ + REGULATOR_MODE_STANDBY), \ + .valid_ops_mask = (REGULATOR_CHANGE_MODE | \ + REGULATOR_CHANGE_STATUS | \ + REGULATOR_CHANGE_VOLTAGE), \ + }, \ + .num_consumer_supplies = ARRAY_SIZE(tps658621_##_id##_supply),\ + .consumer_supplies = tps658621_##_id##_supply, \ + } + +static struct regulator_init_data sm0_data = REGULATOR_INIT(sm0, 725, 1500); +static struct regulator_init_data sm1_data = REGULATOR_INIT(sm1, 725, 1500); +static struct regulator_init_data sm2_data = REGULATOR_INIT(sm2, 3000, 4550); +static struct regulator_init_data ldo0_data = REGULATOR_INIT(ldo0, 1250, 3300); +static struct regulator_init_data ldo1_data = REGULATOR_INIT(ldo1, 725, 1500); +static struct regulator_init_data ldo2_data = REGULATOR_INIT(ldo2, 725, 1500); +static struct regulator_init_data ldo3_data = REGULATOR_INIT(ldo3, 1250, 3300); +static struct regulator_init_data ldo4_data = REGULATOR_INIT(ldo4, 1700, 2475); +static struct regulator_init_data ldo5_data = REGULATOR_INIT(ldo5, 1250, 3300); +static struct regulator_init_data ldo6_data = REGULATOR_INIT(ldo6, 1250, 3300); +static struct regulator_init_data ldo7_data = REGULATOR_INIT(ldo7, 1250, 3300); +static struct regulator_init_data ldo8_data = REGULATOR_INIT(ldo8, 1250, 3300); +static struct regulator_init_data ldo9_data = REGULATOR_INIT(ldo9, 1250, 3300); + +static struct tps6586x_rtc_platform_data rtc_data = { + .irq = TEGRA_NR_IRQS + TPS6586X_INT_RTC_ALM1, +}; + +#define TPS_REG(_id, _data) \ + { \ + .id = TPS6586X_ID_##_id, \ + .name = "tps6586x-regulator", \ + .platform_data = _data, \ + } + +static struct tps6586x_subdev_info tps_devs[] = { + TPS_REG(SM_0, &sm0_data), + TPS_REG(SM_1, &sm1_data), + TPS_REG(SM_2, &sm2_data), + TPS_REG(LDO_0, &ldo0_data), + TPS_REG(LDO_1, &ldo1_data), + TPS_REG(LDO_2, &ldo2_data), + TPS_REG(LDO_3, &ldo3_data), + TPS_REG(LDO_4, &ldo4_data), + TPS_REG(LDO_5, &ldo5_data), + TPS_REG(LDO_6, &ldo6_data), + TPS_REG(LDO_7, &ldo7_data), + TPS_REG(LDO_8, &ldo8_data), + TPS_REG(LDO_9, &ldo9_data), + { + .id = 0, + .name = "tps6586x-rtc", + .platform_data = &rtc_data, + }, +}; + +static struct tps6586x_platform_data tps_platform = { + .irq_base = TEGRA_NR_IRQS, + .num_subdevs = ARRAY_SIZE(tps_devs), + .subdevs = tps_devs, + .gpio_base = TEGRA_NR_GPIOS, +}; + +static struct i2c_board_info __initdata aruba_regulators[] = { + { + I2C_BOARD_INFO("tps6586x", 0x34), + .irq = INT_EXTERNAL_PMU, + .platform_data = &tps_platform, + }, +}; + +static struct tegra_suspend_platform_data aruba_suspend_data = { + .cpu_timer = 2000, + .cpu_off_timer = 0, + .suspend_mode = TEGRA_SUSPEND_NONE, + .core_timer = 0x7e7e, + .core_off_timer = 0, + .separate_req = true, + .corereq_high = false, + .sysclkreq_high = true, + .wake_enb = 0, /* !!!FIXME!!! THIS IS A VENTANA PIN ASSIGNMENT TEGRA_WAKE_GPIO_PV2, */ + .wake_high = 0, + .wake_low = 0, /* !!!FIXME!!! THIS IS A VENTANA PIN ASSIGNMENT TEGRA_WAKE_GPIO_PV2, */ + .wake_any = 0, +}; + +int __init aruba_regulator_init(void) +{ + void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE); + u32 pmc_ctrl; + + /* configure the power management controller to trigger PMU + * interrupts when low */ + pmc_ctrl = readl(pmc + PMC_CTRL); + writel(pmc_ctrl | PMC_CTRL_INTR_LOW, pmc + PMC_CTRL); + platform_device_register(&aruba_pda_power_device); + i2c_register_board_info(4, aruba_regulators, 1); + tegra_init_suspend(&aruba_suspend_data); + return 0; +} +#else +int __init aruba_regulator_init(void) +{ + return 0; +} +#endif diff --git a/arch/arm/mach-tegra/board-aruba-sdhci.c b/arch/arm/mach-tegra/board-aruba-sdhci.c new file mode 100644 index 000000000000..fc801c080fa7 --- /dev/null +++ b/arch/arm/mach-tegra/board-aruba-sdhci.c @@ -0,0 +1,251 @@ +/* + * arch/arm/mach-tegra/board-harmony-sdhci.c + * + * Copyright (C) 2010 Google, Inc. + * + * 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/wlan_plat.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" + +#define ARUBA_WIFI 0 /* !!!FIXME!!! NOT SUPPORTED YET */ + +#if ARUBA_WIFI + +#define ARUBA_WLAN_PWR TEGRA_GPIO_PK5 +#define ARUBA_WLAN_RST TEGRA_GPIO_PK6 + +static void (*wifi_status_cb)(int card_present, void *dev_id); +static void *wifi_status_cb_devid; +static int aruba_wifi_status_register(void (*callback)(int , void *), void *); +static struct clk *wifi_32k_clk; + +static int aruba_wifi_reset(int on); +static int aruba_wifi_power(int on); +static int aruba_wifi_set_carddetect(int val); + +static struct wifi_platform_data aruba_wifi_control = { + .set_power = aruba_wifi_power, + .set_reset = aruba_wifi_reset, + .set_carddetect = aruba_wifi_set_carddetect, +}; + +static struct platform_device aruba_wifi_device = { + .name = "bcm4329_wlan", + .id = 1, + .dev = { + .platform_data = &aruba_wifi_control, + }, +}; +#endif + +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_data0 = { + .clk_id = NULL, + .force_hs = 0, +#if ARUBA_WIFI /* !!!FIXME!!! NOT SUPPORTED YET */ + .register_status_notify = aruba_wifi_status_register, + .cccr = { + .sdio_vsn = 2, + .multi_block = 1, + .low_speed = 0, + .wide_bus = 0, + .high_power = 1, + .high_speed = 1, + }, + .cis = { + .vendor = 0x02d0, + .device = 0x4329, + }, +#endif + .cd_gpio = -1, + .wp_gpio = -1, + .power_gpio = -1, +}; + +static struct tegra_sdhci_platform_data tegra_sdhci_platform_data2 = { + .clk_id = NULL, + .force_hs = 1, + .cd_gpio = -1, + .wp_gpio = -1, + .power_gpio = -1, +}; + +static struct tegra_sdhci_platform_data tegra_sdhci_platform_data3 = { + .clk_id = NULL, + .force_hs = 0, + .cd_gpio = -1, + .wp_gpio = -1, + .power_gpio = -1, +}; + +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, + }, +}; + +#if ARUBA_WIFI /* !!!FIXME!!! NOT SUPPORTED YET */ +static int aruba_wifi_status_register( + void (*callback)(int card_present, void *dev_id), + void *dev_id) +{ + if (wifi_status_cb) + return -EAGAIN; + wifi_status_cb = callback; + wifi_status_cb_devid = dev_id; + return 0; +} + +static int aruba_wifi_set_carddetect(int val) +{ + pr_debug("%s: %d\n", __func__, val); + if (wifi_status_cb) + wifi_status_cb(val, wifi_status_cb_devid); + else + pr_warning("%s: Nobody to notify\n", __func__); + return 0; +} + +static int aruba_wifi_power(int on) +{ + pr_debug("%s: %d\n", __func__, on); + + gpio_set_value(ARUBA_WLAN_PWR, on); + mdelay(100); + gpio_set_value(ARUBA_WLAN_RST, on); + mdelay(200); + + if (on) + clk_enable(wifi_32k_clk); + else + clk_disable(wifi_32k_clk); + + return 0; +} + +static int aruba_wifi_reset(int on) +{ + pr_debug("%s: do nothing\n", __func__); + return 0; +} + +static int __init aruba_wifi_init(void) +{ + wifi_32k_clk = clk_get_sys(NULL, "blink"); + if (IS_ERR(wifi_32k_clk)) { + pr_err("%s: unable to get blink clock\n", __func__); + return PTR_ERR(wifi_32k_clk); + } + + gpio_request(ARUBA_WLAN_PWR, "wlan_power"); + gpio_request(ARUBA_WLAN_RST, "wlan_rst"); + + tegra_gpio_enable(ARUBA_WLAN_PWR); + tegra_gpio_enable(ARUBA_WLAN_RST); + + gpio_direction_output(ARUBA_WLAN_PWR, 0); + gpio_direction_output(ARUBA_WLAN_RST, 0); + + platform_device_register(&aruba_wifi_device); + return 0; +} +#else +#define aruba_wifi_init() do {} while (0) +#endif + +int __init aruba_sdhci_init(void) +{ + platform_device_register(&tegra_sdhci_device3); + platform_device_register(&tegra_sdhci_device2); + platform_device_register(&tegra_sdhci_device0); + + aruba_wifi_init(); + return 0; +} diff --git a/arch/arm/mach-tegra/board-aruba-sensors.c b/arch/arm/mach-tegra/board-aruba-sensors.c new file mode 100644 index 000000000000..c50467976621 --- /dev/null +++ b/arch/arm/mach-tegra/board-aruba-sensors.c @@ -0,0 +1,98 @@ +/* + * arch/arm/mach-tegra/board-aruba-sensors.c + * + * Copyright (c) 2010, NVIDIA, All Rights Reserved. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#include <linux/i2c.h> +#include <mach/gpio.h> +#include <linux/i2c/nct1008.h> +#include <linux/akm8975.h> + +#include "gpio-names.h" + +#if 0 // !!!FIXME!!! IMPLEMENT ME + +#define ISL29018_IRQ_GPIO TEGRA_GPIO_PZ2 +#define AKM8975_IRQ_GPIO TEGRA_GPIO_PN5 + +static void aruba_isl29018_init(void) +{ + tegra_gpio_enable(ISL29018_IRQ_GPIO); + gpio_request(ISL29018_IRQ_GPIO, "isl29018"); + gpio_direction_input(ISL29018_IRQ_GPIO); +} + +static void aruba_akm8975_init(void) +{ + tegra_gpio_enable(AKM8975_IRQ_GPIO); + gpio_request(AKM8975_IRQ_GPIO, "akm8975"); + gpio_direction_input(AKM8975_IRQ_GPIO); +} + +struct nct1008_platform_data aruba_nct1008_pdata = { + .conv_rate = 5, + .config = NCT1008_CONFIG_ALERT_DISABLE, + .thermal_threshold = 110, +}; + +static const struct i2c_board_info aruba_i2c0_board_info[] = { + { + I2C_BOARD_INFO("isl29018", 0x44), + .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PZ2), + }, +}; + +static const struct i2c_board_info aruba_i2c2_board_info[] = { + { + I2C_BOARD_INFO("bq20z75-battery", 0x0B), + }, +}; + +static struct i2c_board_info aruba_i2c4_board_info[] = { + { + I2C_BOARD_INFO("nct1008", 0x4C), + .platform_data = &aruba_nct1008_pdata, + }, + { + I2C_BOARD_INFO("akm8975", 0x0C), + .irq = TEGRA_GPIO_TO_IRQ(AKM8975_IRQ_GPIO), + } +}; + +int __init aruba_sensors_init(void) +{ + aruba_isl29018_init(); + aruba_akm8975_init(); + + i2c_register_board_info(0, aruba_i2c0_board_info, + ARRAY_SIZE(aruba_i2c0_board_info)); + + i2c_register_board_info(2, aruba_i2c2_board_info, + ARRAY_SIZE(aruba_i2c2_board_info)); + + i2c_register_board_info(4, aruba_i2c4_board_info, + ARRAY_SIZE(aruba_i2c4_board_info)); + + return 0; +} +#else +int __init aruba_sensors_init(void) +{ + return 0; +} +#endif diff --git a/arch/arm/mach-tegra/board-aruba.c b/arch/arm/mach-tegra/board-aruba.c new file mode 100644 index 000000000000..ea1f90fecd1d --- /dev/null +++ b/arch/arm/mach-tegra/board-aruba.c @@ -0,0 +1,434 @@ +/* + * arch/arm/mach-tegra/board-aruba.c + * + * Copyright (c) 2010, NVIDIA Corporation. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/slab.h> +#include <linux/ctype.h> +#include <linux/platform_device.h> +#include <linux/clk.h> +#include <linux/serial_8250.h> +#include <linux/i2c.h> +#include <linux/i2c/panjit_ts.h> +#include <linux/dma-mapping.h> +#include <linux/delay.h> +#include <linux/i2c-tegra.h> +#include <linux/gpio.h> +#include <linux/gpio_keys.h> +#include <linux/input.h> +#include <linux/tegra_usb.h> +#include <mach/clk.h> +#include <mach/iomap.h> +#include <mach/irqs.h> +#include <mach/pinmux.h> +#include <mach/iomap.h> +#include <mach/io.h> +#include <mach/i2s.h> +#include <mach/audio.h> +#include <asm/mach-types.h> +#include <asm/mach/arch.h> +#include <mach/usb_phy.h> + +#include "board.h" +#include "clock.h" +#include "board-aruba.h" +#include "devices.h" +#include "gpio-names.h" +#include "fuse.h" + +static struct plat_serial8250_port debug_uart_platform_data[] = { + { + .membase = IO_ADDRESS(TEGRA_UARTA_BASE), + .mapbase = TEGRA_UARTA_BASE, + .irq = INT_UARTA, + .flags = UPF_BOOT_AUTOCONF | UPF_FIXED_TYPE, + .type = PORT_TEGRA, + .iotype = UPIO_MEM, + .regshift = 2, + .uartclk = 13000000, + }, { + .flags = 0, + } +}; + +static struct platform_device debug_uart = { + .name = "serial8250", + .id = PLAT8250_DEV_PLATFORM, + .dev = { + .platform_data = debug_uart_platform_data, + }, +}; + +/* !!!FIXME!!! THESE ARE VENTANA SETTINGS */ +static struct tegra_utmip_config utmi_phy_config[] = { + [0] = { + .hssync_start_delay = 0, + .idle_wait_delay = 17, + .elastic_limit = 16, + .term_range_adj = 6, + .xcvr_setup = 15, + .xcvr_lsfslew = 2, + .xcvr_lsrslew = 2, + }, + [1] = { + .hssync_start_delay = 0, + .idle_wait_delay = 17, + .elastic_limit = 16, + .term_range_adj = 6, + .xcvr_setup = 8, + .xcvr_lsfslew = 2, + .xcvr_lsrslew = 2, + }, +}; + +/* !!!FIXME!!! THESE ARE VENTANA SETTINGS */ +static struct tegra_ulpi_config ulpi_phy_config = { + .reset_gpio = TEGRA_GPIO_PG2, // !!!FIXME!!! CABLE DETECT? if so GPIO_PC7 on aruba + .clk = "clk_dev2", +}; + +#ifdef CONFIG_BCM4329_RFKILL + +static struct resource aruba_bcm4329_rfkill_resources[] = { + { + .name = "bcm4329_nreset_gpio", + .start = TEGRA_GPIO_PU0, + .end = TEGRA_GPIO_PU0, + .flags = IORESOURCE_IO, + }, + { + .name = "bcm4329_nshutdown_gpio", + .start = TEGRA_GPIO_PK2, + .end = TEGRA_GPIO_PK2, + .flags = IORESOURCE_IO, + }, +}; + +static struct platform_device aruba_bcm4329_rfkill_device = { + .name = "bcm4329_rfkill", + .id = -1, + .num_resources = ARRAY_SIZE(aruba_bcm4329_rfkill_resources), + .resource = aruba_bcm4329_rfkill_resources, +}; + +static noinline void __init aruba_bt_rfkill(void) +{ + /*Add Clock Resource*/ + clk_add_alias("bcm4329_32k_clk", aruba_bcm4329_rfkill_device.name, \ + "blink", NULL); + + platform_device_register(&aruba_bcm4329_rfkill_device); + + return; +} +#else +static inline void aruba_bt_rfkill(void) { } +#endif + +static __initdata struct tegra_clk_init_table aruba_clk_init_table[] = { + /* name parent rate enabled */ + { "uarta", "pll_p", 216000000, true}, + { "uartb", "pll_p", 216000000, true}, + { "uartc", "pll_p", 216000000, true}, + { "uartd", "pll_p", 216000000, true}, + { "uarte", "pll_p", 216000000, true}, + { "pll_m", NULL, 600000000, true}, + { "uartc", "pll_m", 600000000, false}, + { "blink", "clk_32k", 32768, false}, + { "pll_p_out4", "pll_p", 24000000, true }, + { "pwm", "clk_32k", 32768, false}, + { "blink", "clk_32k", 32768, false}, + { "pll_a", NULL, 11289600, true}, + { "pll_a_out0", NULL, 11289600, true}, + { "i2s1", "pll_a_out0", 11289600, true}, + { "i2s2", "pll_a_out0", 11289600, true}, + { "audio", "pll_a_out0", 11289600, true}, + { "audio_2x", "audio", 22579200, true}, + { NULL, NULL, 0, 0}, +}; + +#if 0 // !!!CHECKME !!! +static struct i2c_board_info __initdata aruba_i2c_bus1_board_info[] = { + { + I2C_BOARD_INFO("wm8903", 0x1a), + }, +}; +#endif + +static struct tegra_ulpi_config aruba_ehci2_ulpi_phy_config = { + .reset_gpio = TEGRA_GPIO_PV1, + .clk = "clk_dev2", +}; + +static struct tegra_ehci_platform_data aruba_ehci2_ulpi_platform_data = { + .operating_mode = TEGRA_USB_HOST, + .power_down_on_bus_suspend = 0, + .phy_config = &aruba_ehci2_ulpi_phy_config, +}; + +static struct tegra_i2c_platform_data aruba_i2c1_platform_data = { + .adapter_nr = 0, + .bus_count = 1, + .bus_clk_rate = { 400000, 0 }, +}; + +#if 0 /* !!!FIXME!!! THESE ARE VENTANA SETTINGS */ +static const struct tegra_pingroup_config i2c2_ddc = { + .pingroup = TEGRA_PINGROUP_DDC, + .func = TEGRA_MUX_I2C2, +}; + +static const struct tegra_pingroup_config i2c2_gen2 = { + .pingroup = TEGRA_PINGROUP_PTA, + .func = TEGRA_MUX_I2C2, +}; +#endif + +static struct tegra_i2c_platform_data aruba_i2c2_platform_data = { + .adapter_nr = 1, + .bus_count = 2, + .bus_clk_rate = { 400000, 100000 }, +#if 0 /* !!!FIXME!!!! TESE ARE VENTANA SETTINGS */ + .bus_mux = { &i2c2_ddc, &i2c2_gen2 }, + .bus_mux_len = { 1, 1 }, +#endif +}; + +static struct tegra_i2c_platform_data aruba_i2c3_platform_data = { + .adapter_nr = 3, + .bus_count = 1, + .bus_clk_rate = { 400000, 0 }, +}; + +static struct tegra_i2c_platform_data aruba_i2c4_platform_data = { + .adapter_nr = 4, + .bus_count = 1, + .bus_clk_rate = { 400000, 0 }, + .is_dvc = true, +}; + +static struct tegra_i2c_platform_data aruba_i2c5_platform_data = { + .adapter_nr = 5, + .bus_count = 1, + .bus_clk_rate = { 400000, 0 }, +}; + + +static void aruba_i2c_init(void) +{ + tegra_i2c_device1.dev.platform_data = &aruba_i2c1_platform_data; + tegra_i2c_device2.dev.platform_data = &aruba_i2c2_platform_data; + tegra_i2c_device3.dev.platform_data = &aruba_i2c3_platform_data; + tegra_i2c_device4.dev.platform_data = &aruba_i2c4_platform_data; + tegra_i2c_device5.dev.platform_data = &aruba_i2c5_platform_data; + + platform_device_register(&tegra_i2c_device5); + platform_device_register(&tegra_i2c_device4); + platform_device_register(&tegra_i2c_device3); + platform_device_register(&tegra_i2c_device2); + platform_device_register(&tegra_i2c_device1); +} + +#define GPIO_KEY(_id, _gpio, _iswake) \ + { \ + .code = _id, \ + .gpio = TEGRA_GPIO_##_gpio, \ + .active_low = 1, \ + .desc = #_id, \ + .type = EV_KEY, \ + .wakeup = _iswake, \ + .debounce_interval = 10, \ + } + +// !!!FIXME!!! THESE ARE VENTANA DEFINITIONS +static struct gpio_keys_button aruba_keys[] = { + [0] = GPIO_KEY(KEY_MENU, PQ0, 0), + [1] = GPIO_KEY(KEY_HOME, PQ1, 0), + [2] = GPIO_KEY(KEY_BACK, PQ2, 0), + [3] = GPIO_KEY(KEY_VOLUMEUP, PQ3, 0), + [4] = GPIO_KEY(KEY_VOLUMEDOWN, PQ4, 0), + [5] = GPIO_KEY(KEY_POWER, PV2, 1), +}; + +static struct gpio_keys_platform_data aruba_keys_platform_data = { + .buttons = aruba_keys, + .nbuttons = ARRAY_SIZE(aruba_keys), +}; + +static struct platform_device aruba_keys_device = { + .name = "gpio-keys", + .id = 0, + .dev = { + .platform_data = &aruba_keys_platform_data, + }, +}; + +static struct resource tegra_rtc_resources[] = { + [0] = { + .start = TEGRA_RTC_BASE, + .end = TEGRA_RTC_BASE + TEGRA_RTC_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = INT_RTC, + .end = INT_RTC, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device tegra_rtc_device = { + .name = "tegra_rtc", + .id = -1, + .resource = tegra_rtc_resources, + .num_resources = ARRAY_SIZE(tegra_rtc_resources), +}; + +static struct platform_device *aruba_devices[] __initdata = { + &tegra_otg_device, + &debug_uart, + &tegra_uart1_device, + &tegra_uart2_device, + &tegra_uart3_device, + &tegra_uart4_device, + &pmu_device, + &tegra_rtc_device, + &tegra_udc_device, + &tegra_ehci2_device, +#if defined(CONFIG_TEGRA_IOVMM_SMMU) + &tegra_smmu_device, +#endif + &aruba_keys_device, + &tegra_wdt_device, + &tegra_avp_device, +}; + +static void aruba_keys_init(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(aruba_keys); i++) + tegra_gpio_enable(aruba_keys[i].gpio); +} + +static int __init aruba_touch_init(void) +{ + return 0; +} + + +static struct tegra_ehci_platform_data tegra_ehci_pdata[] = { + [0] = { + .phy_config = &utmi_phy_config[0], + .operating_mode = TEGRA_USB_HOST, + .power_down_on_bus_suspend = 0, + }, + [1] = { + .phy_config = &ulpi_phy_config, + .operating_mode = TEGRA_USB_HOST, + .power_down_on_bus_suspend = 1, + }, + [2] = { + .phy_config = &utmi_phy_config[1], + .operating_mode = TEGRA_USB_HOST, + .power_down_on_bus_suspend = 0, + }, +}; + +static void aruba_usb_init(void) +{ + tegra_ehci3_device.dev.platform_data=&tegra_ehci_pdata[2]; + platform_device_register(&tegra_ehci3_device); +} + +struct platform_device *tegra_usb_otg_host_register(void) +{ + struct platform_device *pdev; + void *platform_data; + int val; + + pdev = platform_device_alloc(tegra_ehci1_device.name, tegra_ehci1_device.id); + if (!pdev) + return NULL; + + val = platform_device_add_resources(pdev, tegra_ehci1_device.resource, + tegra_ehci1_device.num_resources); + if (val) + goto error; + + pdev->dev.dma_mask = tegra_ehci1_device.dev.dma_mask; + pdev->dev.coherent_dma_mask = tegra_ehci1_device.dev.coherent_dma_mask; + + platform_data = kmalloc(sizeof(struct tegra_ehci_platform_data), GFP_KERNEL); + if (!platform_data) + goto error; + + memcpy(platform_data, &tegra_ehci_pdata[0], + sizeof(struct tegra_ehci_platform_data)); + pdev->dev.platform_data = platform_data; + + val = platform_device_add(pdev); + if (val) + goto error_add; + + return pdev; + +error_add: + kfree(platform_data); +error: + pr_err("%s: failed to add the host contoller device\n", __func__); + platform_device_put(pdev); + return NULL; +} + +void tegra_usb_otg_host_unregister(struct platform_device *pdev) +{ + platform_device_unregister(pdev); +} + +static void __init tegra_aruba_init(void) +{ + tegra_common_init(); + tegra_clk_init_from_table(aruba_clk_init_table); + aruba_pinmux_init(); + + tegra_ehci2_device.dev.platform_data + = &aruba_ehci2_ulpi_platform_data; + platform_add_devices(aruba_devices, ARRAY_SIZE(aruba_devices)); + + aruba_sdhci_init(); + aruba_i2c_init(); + aruba_regulator_init(); + aruba_touch_init(); + aruba_keys_init(); + aruba_usb_init(); + aruba_panel_init(); + aruba_sensors_init(); + aruba_bt_rfkill(); +} + +MACHINE_START(ARUBA, "aruba") + .boot_params = 0x80000100, + .phys_io = IO_APB_PHYS, + .io_pg_offst = ((IO_APB_VIRT) >> 18) & 0xfffc, + .init_irq = tegra_init_irq, + .init_machine = tegra_aruba_init, + .map_io = tegra_map_common_io, + .timer = &tegra_timer, +MACHINE_END diff --git a/arch/arm/mach-tegra/board-aruba.h b/arch/arm/mach-tegra/board-aruba.h new file mode 100644 index 000000000000..e00e0b071ffb --- /dev/null +++ b/arch/arm/mach-tegra/board-aruba.h @@ -0,0 +1,26 @@ +/* + * arch/arm/mach-tegra/board-aruba.h + * + * Copyright (C) 2010 Google, Inc. + * + * 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. + * + */ + +#ifndef _MACH_TEGRA_BOARD_ARUBA_H +#define _MACH_TEGRA_BOARD_ARUBA_H + +int aruba_regulator_init(void); +int aruba_sdhci_init(void); +int aruba_pinmux_init(void); +int aruba_panel_init(void); +int aruba_sensors_init(void); + +#endif |