ARM: tegra: dalmore: creating board files
aghuge [Tue, 31 Jul 2012 05:18:37 +0000 (10:18 +0530)]
Change-Id: I5c3fe127403b1a01c82d88b821a4a28cad25d026
Signed-off-by: aghuge <aghuge@nvidia.com>
Reviewed-on: http://git-master/r/118305
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

arch/arm/configs/tegra3_android_defconfig
arch/arm/mach-tegra/Kconfig
arch/arm/mach-tegra/Makefile
arch/arm/mach-tegra/board-dalmore-memory.c [new file with mode: 0644]
arch/arm/mach-tegra/board-dalmore-pinmux.c [new file with mode: 0644]
arch/arm/mach-tegra/board-dalmore-power.c [new file with mode: 0644]
arch/arm/mach-tegra/board-dalmore-sdhci.c [new file with mode: 0644]
arch/arm/mach-tegra/board-dalmore.c [new file with mode: 0644]
arch/arm/mach-tegra/board-dalmore.h [new file with mode: 0644]
arch/arm/tools/mach-types

index 25c3ed3..944049a 100644 (file)
@@ -28,6 +28,7 @@ CONFIG_ARCH_TEGRA_3x_SOC=y
 CONFIG_MACH_CARDHU=y
 CONFIG_MACH_TEGRA_ENTERPRISE=y
 CONFIG_MACH_KAI=y
+CONFIG_MACH_DALMORE=y
 CONFIG_TEGRA_PWM=y
 CONFIG_TEGRA_EMC_SCALING_ENABLE=y
 CONFIG_TEGRA_CLOCK_DEBUG_WRITE=y
@@ -301,6 +302,7 @@ CONFIG_MFD_TPS80031=y
 CONFIG_GPADC_TPS80031=y
 CONFIG_MFD_RICOH583=y
 CONFIG_REGULATOR=y
+CONFIG_REGULATOR_DUMMY=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
 CONFIG_REGULATOR_VIRTUAL_CONSUMER=y
 CONFIG_REGULATOR_USERSPACE_CONSUMER=y
index 04e184d..ac8084a 100644 (file)
@@ -270,6 +270,14 @@ config MACH_KAI
        help
          Support for NVIDIA KAI development platform
 
+config MACH_DALMORE
+       bool "Dalmore board"
+       depends on ARCH_TEGRA_3x_SOC
+       select MACH_HAS_SND_SOC_TEGRA_RT5639 if SND_SOC
+       select MACH_HAS_SND_SOC_TEGRA_RT5640 if SND_SOC
+       help
+         Support for NVIDIA DALMORE development platform
+
 choice
        prompt "Tegra platform type"
        default TEGRA_SILICON_PLATFORM
index 96e1bad..0c6d3f8 100644 (file)
@@ -221,6 +221,12 @@ obj-${CONFIG_MACH_KAI}                  += board-kai-sdhci.o
 obj-${CONFIG_MACH_KAI}                  += board-kai-sensors.o
 obj-y                                   += eeprom-wifi-mac.o
 
+obj-${CONFIG_MACH_DALMORE}              += board-dalmore.o
+obj-${CONFIG_MACH_DALMORE}              += board-dalmore-memory.o
+obj-${CONFIG_MACH_DALMORE}              += board-dalmore-pinmux.o
+obj-${CONFIG_MACH_DALMORE}              += board-dalmore-power.o
+obj-${CONFIG_MACH_DALMORE}              += board-dalmore-sdhci.o
+
 obj-${CONFIG_TEGRA_BB_XMM_POWER}        += baseband-xmm-power.o
 obj-${CONFIG_TEGRA_BB_XMM_POWER2}       += baseband-xmm-power2.o
 
diff --git a/arch/arm/mach-tegra/board-dalmore-memory.c b/arch/arm/mach-tegra/board-dalmore-memory.c
new file mode 100644 (file)
index 0000000..fe4e8fd
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2012 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/kernel.h>
+#include <linux/init.h>
+
+#include "board.h"
+#include "board-dalmore.h"
+#include "tegra3_emc.h"
+#include "fuse.h"
+
+
+int dalmore_emc_init(void)
+{
+       tegra_init_emc(NULL, 0);
+
+       return 0;
+}
diff --git a/arch/arm/mach-tegra/board-dalmore-pinmux.c b/arch/arm/mach-tegra/board-dalmore-pinmux.c
new file mode 100644 (file)
index 0000000..6f68004
--- /dev/null
@@ -0,0 +1,511 @@
+/*
+ * arch/arm/mach-tegra/board-dalmore-pinmux.c
+ *
+ * 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/kernel.h>
+#include <linux/init.h>
+#include <linux/gpio.h>
+#include <mach/pinmux.h>
+#include <mach/pinmux-tegra30.h>
+#include <mach/gpio-tegra.h>
+#include "board.h"
+#include "board-dalmore.h"
+#include "devices.h"
+#include "gpio-names.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,             \
+       }
+/* Setting the drive strength of pins
+ * hsm: Enable High speed mode (ENABLE/DISABLE)
+ * Schimit: Enable/disable schimit (ENABLE/DISABLE)
+ * drive: low power mode (DIV_1, DIV_2, DIV_4, DIV_8)
+ * pulldn_drive - drive down (falling edge) - Driver Output Pull-Down drive
+ *                strength code. Value from 0 to 31.
+ * pullup_drive - drive up (rising edge)  - Driver Output Pull-Up drive
+ *                strength code. Value from 0 to 31.
+ * pulldn_slew -  Driver Output Pull-Up slew control code  - 2bit code
+ *                code 11 is least slewing of signal. code 00 is highest
+ *                slewing of the signal.
+ *                Value - FASTEST, FAST, SLOW, SLOWEST
+ * pullup_slew -  Driver Output Pull-Down slew control code -
+ *                code 11 is least slewing of signal. code 00 is highest
+ *                slewing of the signal.
+ *                Value - FASTEST, FAST, SLOW, SLOWEST
+ */
+#define SET_DRIVE(_name, _hsm, _schmitt, _drive, _pulldn_drive, _pullup_drive, _pulldn_slew, _pullup_slew) \
+       {                                               \
+               .pingroup = TEGRA_DRIVE_PINGROUP_##_name,   \
+               .hsm = TEGRA_HSM_##_hsm,                    \
+               .schmitt = TEGRA_SCHMITT_##_schmitt,        \
+               .drive = TEGRA_DRIVE_##_drive,              \
+               .pull_down = TEGRA_PULL_##_pulldn_drive,    \
+               .pull_up = TEGRA_PULL_##_pullup_drive,          \
+               .slew_rising = TEGRA_SLEW_##_pulldn_slew,   \
+               .slew_falling = TEGRA_SLEW_##_pullup_slew,      \
+       }
+
+/* !!!FIXME!!!! POPULATE THIS TABLE */
+static __initdata struct tegra_drive_pingroup_config dalmore_drive_pinmux[] = {
+       /* DEFAULT_DRIVE(<pin_group>), */
+       /* SET_DRIVE(ATA, DISABLE, DISABLE, DIV_1, 31, 31, FAST, FAST) */
+       SET_DRIVE(DAP2,         DISABLE, ENABLE, DIV_1, 31, 31, FASTEST, FASTEST),
+
+       /* All I2C pins are driven to maximum drive strength */
+       /* GEN1 I2C */
+       SET_DRIVE(DBG,          DISABLE, ENABLE, DIV_1, 31, 31, FASTEST, FASTEST),
+
+       /* GEN2 I2C */
+       SET_DRIVE(AT5,          DISABLE, ENABLE, DIV_1, 31, 31, FASTEST, FASTEST),
+
+       /* CAM I2C */
+       SET_DRIVE(GME,          DISABLE, ENABLE, DIV_1, 31, 31, FASTEST, FASTEST),
+
+       /* DDC I2C */
+       SET_DRIVE(DDC,          DISABLE, ENABLE, DIV_1, 31, 31, FASTEST, FASTEST),
+
+       /* PWR_I2C */
+       SET_DRIVE(AO1,          DISABLE, ENABLE, DIV_1, 31, 31, FASTEST, FASTEST),
+
+       /* UART3 */
+       SET_DRIVE(UART3,        DISABLE, ENABLE, DIV_1, 31, 31, FASTEST, FASTEST),
+
+       /* SDMMC1 */
+       SET_DRIVE(SDIO1,        DISABLE, DISABLE, DIV_1, 46, 42, FAST, FAST),
+
+       /* SDMMC3 */
+       SET_DRIVE(SDIO3,        DISABLE, DISABLE, DIV_1, 46, 42, FAST, FAST),
+
+       /* SDMMC4 */
+       SET_DRIVE(GMA,          DISABLE, DISABLE, DIV_1, 9, 9, SLOWEST, SLOWEST),
+       SET_DRIVE(GMB,          DISABLE, DISABLE, DIV_1, 9, 9, SLOWEST, SLOWEST),
+       SET_DRIVE(GMC,          DISABLE, DISABLE, DIV_1, 9, 9, SLOWEST, SLOWEST),
+       SET_DRIVE(GMD,          DISABLE, DISABLE, DIV_1, 9, 9, SLOWEST, SLOWEST),
+
+};
+
+#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,              \
+               .lock           = TEGRA_PIN_LOCK_DEFAULT,       \
+               .od             = TEGRA_PIN_OD_DEFAULT,         \
+               .ioreset        = TEGRA_PIN_IO_RESET_DEFAULT,   \
+       }
+
+#define I2C_PINMUX(_pingroup, _mux, _pupd, _tri, _io, _lock, _od) \
+       {                                                       \
+               .pingroup       = TEGRA_PINGROUP_##_pingroup,   \
+               .func           = TEGRA_MUX_##_mux,             \
+               .pupd           = TEGRA_PUPD_##_pupd,           \
+               .tristate       = TEGRA_TRI_##_tri,             \
+               .io             = TEGRA_PIN_##_io,              \
+               .lock           = TEGRA_PIN_LOCK_##_lock,       \
+               .od             = TEGRA_PIN_OD_##_od,           \
+               .ioreset        = TEGRA_PIN_IO_RESET_DEFAULT,   \
+       }
+
+#define VI_PINMUX(_pingroup, _mux, _pupd, _tri, _io, _lock, _ioreset) \
+       {                                                       \
+               .pingroup       = TEGRA_PINGROUP_##_pingroup,   \
+               .func           = TEGRA_MUX_##_mux,             \
+               .pupd           = TEGRA_PUPD_##_pupd,           \
+               .tristate       = TEGRA_TRI_##_tri,             \
+               .io             = TEGRA_PIN_##_io,              \
+               .lock           = TEGRA_PIN_LOCK_##_lock,       \
+               .od             = TEGRA_PIN_OD_DEFAULT,         \
+               .ioreset        = TEGRA_PIN_IO_RESET_##_ioreset \
+       }
+
+static __initdata struct tegra_pingroup_config dalmore_pinmux_common[] = {
+       /* SDMMC1 pinmux */
+       DEFAULT_PINMUX(SDMMC1_CLK,      SDMMC1,          NORMAL,     NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC1_CMD,      SDMMC1,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC1_DAT3,     SDMMC1,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC1_DAT2,     SDMMC1,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC1_DAT1,     SDMMC1,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC1_DAT0,     SDMMC1,          PULL_UP,    NORMAL,     INPUT),
+
+       /* SDMMC3 pinmux */
+       DEFAULT_PINMUX(SDMMC3_CLK,      SDMMC3,          NORMAL,     NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC3_CMD,      SDMMC3,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC3_DAT0,     SDMMC3,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC3_DAT1,     SDMMC3,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC3_DAT2,     SDMMC3,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC3_DAT3,     SDMMC3,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC3_DAT6,     SDMMC3,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC3_DAT7,     SDMMC3,          PULL_UP,    NORMAL,     INPUT),
+
+       /* SDMMC4 pinmux */
+       DEFAULT_PINMUX(SDMMC4_CLK,      SDMMC4,          NORMAL,     NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC4_CMD,      SDMMC4,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC4_DAT0,     SDMMC4,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC4_DAT1,     SDMMC4,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC4_DAT2,     SDMMC4,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC4_DAT3,     SDMMC4,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC4_DAT4,     SDMMC4,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC4_DAT5,     SDMMC4,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC4_DAT6,     SDMMC4,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC4_DAT7,     SDMMC4,          PULL_UP,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SDMMC4_RST_N,    RSVD1,           PULL_DOWN,  NORMAL,     INPUT),
+
+       /* I2C1 pinmux */
+       I2C_PINMUX(GEN1_I2C_SCL,        I2C1,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+       I2C_PINMUX(GEN1_I2C_SDA,        I2C1,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+
+       /* I2C2 pinmux */
+       I2C_PINMUX(GEN2_I2C_SCL,        I2C2,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+       I2C_PINMUX(GEN2_I2C_SDA,        I2C2,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+
+       /* I2C3 pinmux */
+       I2C_PINMUX(CAM_I2C_SCL,         I2C3,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+       I2C_PINMUX(CAM_I2C_SDA,         I2C3,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+
+       /* I2C4 pinmux */
+       I2C_PINMUX(DDC_SCL,             I2C4,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+       I2C_PINMUX(DDC_SDA,             I2C4,           NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+
+       /* Power I2C pinmux */
+       I2C_PINMUX(PWR_I2C_SCL,         I2CPWR,         NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+       I2C_PINMUX(PWR_I2C_SDA,         I2CPWR,         NORMAL, NORMAL, INPUT,  DISABLE,        ENABLE),
+
+       /* LCD */
+       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),
+
+       /* UART B : GPS */
+       DEFAULT_PINMUX(UART2_RXD,       IRDA,            NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(UART2_TXD,       IRDA,            NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(UART2_RTS_N,     UARTB,           NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(UART2_CTS_N,     UARTB,           NORMAL,    NORMAL,     INPUT),
+
+       /*UART C : BT */
+       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),
+
+       /* UART D : DEBUG */
+       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),
+
+       /*  KBC keys */
+       DEFAULT_PINMUX(KB_COL0,         KBC,             PULL_UP,   NORMAL,     INPUT),
+       DEFAULT_PINMUX(KB_COL1,         KBC,             PULL_UP,   NORMAL,     INPUT),
+       DEFAULT_PINMUX(KB_COL2,         KBC,             PULL_UP,   NORMAL,     INPUT),
+       DEFAULT_PINMUX(KB_COL3,         KBC,             PULL_UP,   NORMAL,     INPUT),
+       DEFAULT_PINMUX(KB_ROW0,         KBC,             PULL_UP,   NORMAL,     INPUT),
+       DEFAULT_PINMUX(KB_ROW1,         KBC,             PULL_UP,   NORMAL,     INPUT),
+       DEFAULT_PINMUX(KB_ROW2,         KBC,             PULL_UP,   NORMAL,     INPUT),
+
+       /* I2S0 : for MODEM */
+       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),
+
+       /* I2S1 : for CODEC */
+       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),
+
+       /* I2S3 : for BT */
+       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),
+
+       /* SPI1 : touch */
+       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),
+
+       /* SPIDIF */
+       DEFAULT_PINMUX(SPDIF_IN,        SPDIF,           NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SPDIF_OUT,       SPDIF,           NORMAL,    NORMAL,     OUTPUT),
+
+       /* FIXED FUNCTION AND CONFIGURATION */
+       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(GMI_AD4,         RSVD1,           NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(CLK1_OUT,        EXTPERIPH1,      NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(CLK2_OUT,        EXTPERIPH2,      NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(CLK3_OUT,        EXTPERIPH3,      NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(CLK2_REQ,        DAP,             NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(HDMI_INT,        RSVD0,           NORMAL,    TRISTATE,   INPUT),
+
+       /* GPIO */
+       /* POWER RAIL GPIO */
+       DEFAULT_PINMUX(DAP3_FS,         I2S2,            NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_AD14,        RSVD1,           PULL_DOWN, NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(SDMMC3_DAT5,     SDMMC3,          NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(KB_ROW6,         KBC,             NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(KB_ROW7,         KBC,             NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(LCD_M1,          DISPLAYA,        NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(LCD_PWR0,        DISPLAYA,        NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(LCD_PWR1,        DISPLAYA,        NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(LCD_PWR2,        DISPLAYA,        NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(KB_ROW8,         KBC,             NORMAL,    NORMAL,     OUTPUT),
+
+       /* CAMERA */
+       DEFAULT_PINMUX(CAM_MCLK,        VI_ALT2,         PULL_UP,   NORMAL,     INPUT),
+       DEFAULT_PINMUX(GPIO_PCC1,       RSVD1,           NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(GPIO_PBB0,       RSVD1,           NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(GPIO_PBB3,       VGP3,            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(KB_ROW4,         KBC,             NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(KB_ROW5,         KBC,             NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(KB_ROW9,         KBC,             NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(KB_ROW10,        KBC,             NORMAL,    NORMAL,     OUTPUT),
+
+       /* MODEM */
+       DEFAULT_PINMUX(GPIO_PV0,        RSVD,            NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(GPIO_PV1,        RSVD,            NORMAL,    NORMAL,     INPUT),
+
+       /* GPS and BT */
+       DEFAULT_PINMUX(GPIO_PU0,        RSVD1,           NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(GPIO_PU1,        RSVD1,           NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GPIO_PU2,        RSVD1,           NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(GPIO_PU3,        RSVD1,           NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(GPIO_PU4,        PWM1,            NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GPIO_PU5,        PWM2,            NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(GPIO_PU6,        RSVD1,           NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(KB_ROW14,        KBC,             NORMAL,    TRISTATE,   OUTPUT),
+
+       /* LCD GPIO */
+       DEFAULT_PINMUX(GMI_AD0,         RSVD1,           NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_AD1,         RSVD1,           NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_AD2,         RSVD1,           PULL_DOWN, NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_AD3,         RSVD1,           PULL_DOWN, NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_AD5,         RSVD1,           PULL_DOWN, NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_AD6,         RSVD1,           PULL_DOWN, NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_AD7,         RSVD1,           PULL_DOWN, NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_AD8,         PWM0,            NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_AD9,         RSVD2,           PULL_DOWN, NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_AD11,        PWM3,            NORMAL,    NORMAL,     OUTPUT),
+
+       /* TOUCH */
+       DEFAULT_PINMUX(GMI_WAIT,        RSVD1,           PULL_UP,   NORMAL,     INPUT),
+       DEFAULT_PINMUX(GMI_WP_N,        RSVD1,           PULL_UP,   NORMAL,     INPUT),
+       DEFAULT_PINMUX(LCD_SDOUT,       DISPLAYA,        NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(LCD_DC1,         DISPLAYA,        NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(LCD_WR_N,        DISPLAYA,        PULL_UP,   NORMAL,     INPUT),
+
+       /* SDMMC */
+       DEFAULT_PINMUX(GMI_IORDY,       RSVD1,           PULL_UP,   NORMAL,     INPUT),
+
+       /* CODEC */
+       DEFAULT_PINMUX(SPI2_SCK,        SPI2,            NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(SPI2_CS1_N,      SPI2,            NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(GMI_CS2_N,       RSVD1,           NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(GMI_CS3_N,       RSVD1,           NORMAL,    NORMAL,     INPUT),
+
+       /* OTHERS */
+       DEFAULT_PINMUX(KB_ROW3,         KBC,             NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_DQS,         RSVD1,           NORMAL,    NORMAL,     INPUT),
+
+       DEFAULT_PINMUX(GMI_AD15,        RSVD1,           PULL_UP,   NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(GMI_CLK,         RSVD1,           PULL_UP,   NORMAL,     INPUT),
+
+       DEFAULT_PINMUX(GMI_RST_N,       NAND,            PULL_UP,   NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(LCD_DC0,         DISPLAYA,        NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(LCD_CS0_N,       DISPLAYA,        NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(LCD_CS1_N,       DISPLAYA,        NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(LCD_SCK,         DISPLAYA,        NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(LCD_SDIN,        DISPLAYA,        NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(CRT_HSYNC,       CRT,             NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(CRT_VSYNC,       CRT,             NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(PEX_WAKE_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,     OUTPUT),
+       DEFAULT_PINMUX(HDMI_CEC,        CEC,             NORMAL,    NORMAL,     INPUT),
+
+       DEFAULT_PINMUX(KB_ROW15,        KBC,             NORMAL,    NORMAL,     OUTPUT),
+       DEFAULT_PINMUX(SPI2_CS2_N,      SPI2,            NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SPI2_MISO,       SPI2,            NORMAL,    NORMAL,     INPUT),
+       DEFAULT_PINMUX(SPI2_MOSI,       SPI2,            NORMAL,    NORMAL,     INPUT),
+
+       DEFAULT_PINMUX(KB_ROW11,        KBC,             PULL_UP,   TRISTATE,   INPUT),
+       DEFAULT_PINMUX(KB_ROW12,        KBC,             NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(KB_ROW13,        KBC,             NORMAL,    TRISTATE,   OUTPUT),
+};
+
+/*Do not use for now*/
+static __initdata struct tegra_pingroup_config unused_pins_lowpower[] = {
+       DEFAULT_PINMUX(ULPI_CLK,        ULPI,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(ULPI_DATA0,      ULPI,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(ULPI_DATA1,      ULPI,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(ULPI_DATA2,      ULPI,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(ULPI_DATA3,      ULPI,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(ULPI_DATA4,      ULPI,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(ULPI_DATA5,      ULPI,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(ULPI_DATA6,      ULPI,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(ULPI_DATA7,      ULPI,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(ULPI_DIR,        ULPI,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(ULPI_NXT,        ULPI,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(ULPI_STP,        ULPI,          NORMAL,    TRISTATE,   OUTPUT),
+
+       DEFAULT_PINMUX(GMI_AD10,        PWM2,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(GMI_AD12,        RSVD1,         NORMAL,    TRISTATE,   INPUT),
+       DEFAULT_PINMUX(GMI_AD13,        RSVD1,         NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(CLK1_REQ,        DAP,           NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(GMI_ADV_N,       RSVD1,         NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(GMI_CS0_N,       RSVD1,         NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(GMI_CS1_N,       RSVD1,         NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(GMI_CS4_N,       RSVD1,         NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(GMI_CS6_N,       NAND,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(GMI_CS7_N,       NAND,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(GMI_OE_N,        RSVD1,         NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(GMI_WR_N,        RSVD1,         NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(PEX_L0_CLKREQ_N, PCIE,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(PEX_L0_PRSNT_N,  PCIE,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(PEX_L0_RST_N,    PCIE,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(PEX_L1_CLKREQ_N, PCIE,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(PEX_L1_PRSNT_N,  PCIE,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(PEX_L1_RST_N,    PCIE,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(GPIO_PV2,        OWR,           NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(GPIO_PV3,        RSVD1,         NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(HDMI_CEC,        CEC,           NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(KB_COL4,         KBC,           NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(KB_COL5,         KBC,           NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(KB_COL6,         KBC,           NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(KB_COL7,         KBC,           NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(CLK3_REQ,        DEV3,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_D0,           VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_D1,           VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_D10,          VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_D11,          VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_D2,           VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_D3,           VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_D4,           VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_D5,           VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_D6,           VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_D7,           VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_D8,           VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_D9,           VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_HSYNC,        VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_MCLK,         VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_PCLK,         VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(VI_VSYNC,        VI,            NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(DAP3_DIN,        I2S2,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(DAP3_DOUT,       I2S2,          NORMAL,    TRISTATE,   OUTPUT),
+       DEFAULT_PINMUX(DAP3_SCLK,       I2S2,          NORMAL,    TRISTATE,   OUTPUT),
+
+};
+
+static void __init dalmore_pinmux_audio_init(void)
+{
+       gpio_request(TEGRA_GPIO_CDC_IRQ, "rt5640");
+       gpio_direction_input(TEGRA_GPIO_CDC_IRQ);
+
+}
+
+/* We are disabling this code for now. */
+#define GPIO_INIT_PIN_MODE(_gpio, _is_input, _value)   \
+       {                                       \
+               .gpio_nr        = _gpio,        \
+               .is_input       = _is_input,    \
+               .value          = _value,       \
+       }
+
+static struct gpio_init_pin_info init_gpio_mode_dalmore_common[] = {
+       GPIO_INIT_PIN_MODE(TEGRA_GPIO_PDD7, false, 0),
+       GPIO_INIT_PIN_MODE(TEGRA_GPIO_PCC6, false, 0),
+       GPIO_INIT_PIN_MODE(TEGRA_GPIO_PCC7, false, 1),
+};
+
+static void __init dalmore_gpio_init_configure(void)
+{
+       int len;
+       int i;
+       struct gpio_init_pin_info *pins_info;
+
+       len = ARRAY_SIZE(init_gpio_mode_dalmore_common);
+       pins_info = init_gpio_mode_dalmore_common;
+
+       for (i = 0; i < len; ++i) {
+               tegra_gpio_init_configure(pins_info->gpio_nr,
+                       pins_info->is_input, pins_info->value);
+               pins_info++;
+       }
+}
+
+int __init dalmore_pinmux_init(void)
+{
+       struct board_info board_info;
+       tegra_get_board_info(&board_info);
+       /*BUG_ON(board_info.board_id != BOARD_E1565);*/
+
+       tegra30_default_pinmux();
+
+       dalmore_gpio_init_configure();
+
+       tegra_pinmux_config_table(dalmore_pinmux_common, ARRAY_SIZE(dalmore_pinmux_common));
+       tegra_drive_pinmux_config_table(dalmore_drive_pinmux,
+                                       ARRAY_SIZE(dalmore_drive_pinmux));
+
+       tegra_pinmux_config_table(unused_pins_lowpower,
+               ARRAY_SIZE(unused_pins_lowpower));
+       dalmore_pinmux_audio_init();
+
+
+       return 0;
+}
diff --git a/arch/arm/mach-tegra/board-dalmore-power.c b/arch/arm/mach-tegra/board-dalmore-power.c
new file mode 100644 (file)
index 0000000..fd205c3
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * arch/arm/mach-tegra/board-dalmore-power.c
+ *
+ * Copyright (C) 2012 NVIDIA Corporation.
+ *
+ * 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.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#include <linux/i2c.h>
+#include <linux/pda_power.h>
+#include <linux/platform_device.h>
+#include <linux/resource.h>
+#include <linux/io.h>
+
+#include <mach/iomap.h>
+#include <mach/irqs.h>
+
+#include "pm.h"
+#include "board.h"
+#include "board-dalmore.h"
+
+
+static int ac_online(void)
+{
+       return 1;
+}
+
+static struct resource dalmore_pda_resources[] = {
+       [0] = {
+               .name   = "ac",
+       },
+};
+
+static struct pda_power_pdata dalmore_pda_data = {
+       .is_ac_online   = ac_online,
+};
+
+static struct platform_device dalmore_pda_power_device = {
+       .name           = "pda-power",
+       .id             = -1,
+       .resource       = dalmore_pda_resources,
+       .num_resources  = ARRAY_SIZE(dalmore_pda_resources),
+       .dev    = {
+               .platform_data  = &dalmore_pda_data,
+       },
+};
+
+static struct tegra_suspend_platform_data dalmore_suspend_data = {
+       .cpu_timer      = 2000,
+       .cpu_off_timer  = 0,
+       .suspend_mode   = TEGRA_SUSPEND_NONE,
+       .core_timer     = 0x7e7e,
+       .core_off_timer = 0,
+       .corereq_high   = false,
+       .sysclkreq_high = true,
+};
+
+int __init dalmore_regulator_init(void)
+{
+
+       platform_device_register(&dalmore_pda_power_device);
+       return 0;
+
+}
+
+int __init dalmore_suspend_init(void)
+{
+       tegra_init_suspend(&dalmore_suspend_data);
+       return 0;
+}
+
diff --git a/arch/arm/mach-tegra/board-dalmore-sdhci.c b/arch/arm/mach-tegra/board-dalmore-sdhci.c
new file mode 100644 (file)
index 0000000..8dc3d96
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * arch/arm/mach-tegra/board-dalmore-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 <linux/wl12xx.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-dalmore.h"
+
+#define DALMORE_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_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 = {
+       .cd_gpio = DALMORE_SD_CD,
+       .wp_gpio = -1,
+       .power_gpio = -1,
+       .tap_delay = 0x0F,
+       .ddr_clk_limit = 41000000,
+/*     .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,
+       .ddr_clk_limit = 41000000,
+       .mmc_data = {
+               .built_in = 1,
+       }
+/*     .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_device3 = {
+       .name           = "sdhci-tegra",
+       .id             = 3,
+       .resource       = sdhci_resource3,
+       .num_resources  = ARRAY_SIZE(sdhci_resource3),
+       .dev = {
+               .platform_data = &tegra_sdhci_platform_data3,
+       },
+};
+
+
+int __init dalmore_sdhci_init(void)
+{
+       platform_device_register(&tegra_sdhci_device3);
+       platform_device_register(&tegra_sdhci_device0);
+
+       return 0;
+}
diff --git a/arch/arm/mach-tegra/board-dalmore.c b/arch/arm/mach-tegra/board-dalmore.c
new file mode 100644 (file)
index 0000000..7111994
--- /dev/null
@@ -0,0 +1,551 @@
+/*
+ * arch/arm/mach-tegra/board-dalmore.c
+ *
+ * Copyright (c) 2012, NVIDIA CORPORATION.  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 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.,
+ * 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/dma-mapping.h>
+#include <linux/delay.h>
+#include <linux/i2c-tegra.h>
+#include <linux/gpio.h>
+#include <linux/input.h>
+#include <linux/platform_data/tegra_usb.h>
+#include <linux/spi/spi.h>
+#include <linux/tegra_uart.h>
+#include <linux/memblock.h>
+#include <linux/spi-tegra.h>
+#include <linux/nfc/pn544.h>
+#include <linux/skbuff.h>
+#include <linux/ti_wilink_st.h>
+#include <linux/regulator/consumer.h>
+#include <linux/smb349-charger.h>
+#include <linux/max17048_battery.h>
+#include <linux/leds.h>
+#include <linux/i2c/at24.h>
+
+#include <asm/hardware/gic.h>
+
+#include <mach/clk.h>
+#include <mach/iomap.h>
+#include <mach/irqs.h>
+#include <mach/pinmux.h>
+#include <mach/pinmux-tegra30.h>
+#include <mach/iomap.h>
+#include <mach/io.h>
+#include <mach/io_dpd.h>
+#include <mach/i2s.h>
+#include <mach/tegra_rt5640_pdata.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/usb_phy.h>
+#include <mach/gpio-tegra.h>
+#include <mach/tegra_fiq_debugger.h>
+
+#include "board.h"
+#include "clock.h"
+#include "board-dalmore.h"
+#include "devices.h"
+#include "gpio-names.h"
+#include "fuse.h"
+#include "pm.h"
+#include "common.h"
+
+static __initdata struct tegra_clk_init_table dalmore_clk_init_table[] = {
+       /* name         parent          rate            enabled */
+       { "pll_m",      NULL,           0,              false},
+       { "hda",        "pll_p",        108000000,      false},
+       { "hda2codec_2x", "pll_p",      48000000,       false},
+       { "pwm",        "pll_p",        3187500,        false},
+       { "blink",      "clk_32k",      32768,          true},
+       { "i2s1",       "pll_a_out0",   0,              false},
+       { "i2s3",       "pll_a_out0",   0,              false},
+       { "i2s4",       "pll_a_out0",   0,              false},
+       { "spdif_out",  "pll_a_out0",   0,              false},
+       { "d_audio",    "clk_m",        12000000,       false},
+       { "dam0",       "clk_m",        12000000,       false},
+       { "dam1",       "clk_m",        12000000,       false},
+       { "dam2",       "clk_m",        12000000,       false},
+       { "audio1",     "i2s1_sync",    0,              false},
+       { "audio3",     "i2s3_sync",    0,              false},
+       { "vi_sensor",  "pll_p",        150000000,      false},
+       { "i2c1",       "pll_p",        3200000,        false},
+       { "i2c2",       "pll_p",        3200000,        false},
+       { "i2c3",       "pll_p",        3200000,        false},
+       { "i2c4",       "pll_p",        3200000,        false},
+       { "i2c5",       "pll_p",        3200000,        false},
+       { NULL,         NULL,           0,              0},
+};
+
+static struct tegra_i2c_platform_data dalmore_i2c1_platform_data = {
+       .adapter_nr     = 0,
+       .bus_count      = 1,
+       .bus_clk_rate   = { 100000, 0 },
+       .scl_gpio               = {TEGRA_GPIO_I2C1_SCL, 0},
+       .sda_gpio               = {TEGRA_GPIO_I2C1_SDA, 0},
+       .arb_recovery = arb_lost_recovery,
+};
+
+static struct tegra_i2c_platform_data dalmore_i2c2_platform_data = {
+       .adapter_nr     = 1,
+       .bus_count      = 1,
+       .bus_clk_rate   = { 100000, 0 },
+       .is_clkon_always = true,
+       .scl_gpio               = {TEGRA_GPIO_I2C2_SCL, 0},
+       .sda_gpio               = {TEGRA_GPIO_I2C2_SDA, 0},
+       .arb_recovery = arb_lost_recovery,
+};
+
+static struct tegra_i2c_platform_data dalmore_i2c3_platform_data = {
+       .adapter_nr     = 2,
+       .bus_count      = 1,
+       .bus_clk_rate   = { 100000, 0 },
+       .scl_gpio               = {TEGRA_GPIO_I2C3_SCL, 0},
+       .sda_gpio               = {TEGRA_GPIO_I2C3_SDA, 0},
+       .arb_recovery = arb_lost_recovery,
+};
+
+static struct tegra_i2c_platform_data dalmore_i2c4_platform_data = {
+       .adapter_nr     = 3,
+       .bus_count      = 1,
+       .bus_clk_rate   = { 10000, 0 },
+       .scl_gpio               = {TEGRA_GPIO_I2C4_SCL, 0},
+       .sda_gpio               = {TEGRA_GPIO_I2C4_SDA, 0},
+       .arb_recovery = arb_lost_recovery,
+};
+
+static struct tegra_i2c_platform_data dalmore_i2c5_platform_data = {
+       .adapter_nr     = 4,
+       .bus_count      = 1,
+       .bus_clk_rate   = { 400000, 0 },
+       .scl_gpio               = {TEGRA_GPIO_I2C5_SCL, 0},
+       .sda_gpio               = {TEGRA_GPIO_I2C5_SDA, 0},
+       .arb_recovery = arb_lost_recovery,
+};
+
+
+
+static void dalmore_i2c_init(void)
+{
+       struct board_info board_info;
+
+       tegra_get_board_info(&board_info);
+
+       tegra_i2c_device1.dev.platform_data = &dalmore_i2c1_platform_data;
+       tegra_i2c_device2.dev.platform_data = &dalmore_i2c2_platform_data;
+       tegra_i2c_device3.dev.platform_data = &dalmore_i2c3_platform_data;
+       tegra_i2c_device4.dev.platform_data = &dalmore_i2c4_platform_data;
+       tegra_i2c_device5.dev.platform_data = &dalmore_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);
+}
+
+static struct platform_device *dalmore_uart_devices[] __initdata = {
+       &tegra_uarta_device,
+       &tegra_uartb_device,
+       &tegra_uartc_device,
+       &tegra_uartd_device,
+       &tegra_uarte_device,
+};
+static struct uart_clk_parent uart_parent_clk[] = {
+       [0] = {.name = "clk_m"},
+       [1] = {.name = "pll_p"},
+#ifndef CONFIG_TEGRA_PLLM_RESTRICTED
+       [2] = {.name = "pll_m"},
+#endif
+};
+
+static struct tegra_uart_platform_data dalmore_uart_pdata;
+static struct tegra_uart_platform_data dalmore_loopback_uart_pdata;
+
+static void __init uart_debug_init(void)
+{
+       int debug_port_id;
+
+       debug_port_id = get_tegra_uart_debug_port_id();
+       if (debug_port_id < 0)
+               debug_port_id = 3;
+
+       switch (debug_port_id) {
+       case 0:
+               /* UARTA is the debug port. */
+               pr_info("Selecting UARTA as the debug console\n");
+               dalmore_uart_devices[0] = &debug_uarta_device;
+               debug_uart_clk = clk_get_sys("serial8250.0", "uarta");
+               debug_uart_port_base = ((struct plat_serial8250_port *)(
+                       debug_uarta_device.dev.platform_data))->mapbase;
+               break;
+
+       case 1:
+               /* UARTB is the debug port. */
+               pr_info("Selecting UARTB as the debug console\n");
+               dalmore_uart_devices[1] = &debug_uartb_device;
+               debug_uart_clk = clk_get_sys("serial8250.0", "uartb");
+               debug_uart_port_base = ((struct plat_serial8250_port *)(
+                       debug_uartb_device.dev.platform_data))->mapbase;
+               break;
+
+       case 2:
+               /* UARTC is the debug port. */
+               pr_info("Selecting UARTC as the debug console\n");
+               dalmore_uart_devices[2] = &debug_uartc_device;
+               debug_uart_clk = clk_get_sys("serial8250.0", "uartc");
+               debug_uart_port_base = ((struct plat_serial8250_port *)(
+                       debug_uartc_device.dev.platform_data))->mapbase;
+               break;
+
+       case 3:
+               /* UARTD is the debug port. */
+               pr_info("Selecting UARTD as the debug console\n");
+               dalmore_uart_devices[3] = &debug_uartd_device;
+               debug_uart_clk = clk_get_sys("serial8250.0", "uartd");
+               debug_uart_port_base = ((struct plat_serial8250_port *)(
+                       debug_uartd_device.dev.platform_data))->mapbase;
+               break;
+
+       case 4:
+               /* UARTE is the debug port. */
+               pr_info("Selecting UARTE as the debug console\n");
+               dalmore_uart_devices[4] = &debug_uarte_device;
+               debug_uart_clk = clk_get_sys("serial8250.0", "uarte");
+               debug_uart_port_base = ((struct plat_serial8250_port *)(
+                       debug_uarte_device.dev.platform_data))->mapbase;
+               break;
+
+       default:
+               pr_info("The debug console id %d is invalid, Assuming UARTA",
+                       debug_port_id);
+               dalmore_uart_devices[0] = &debug_uarta_device;
+               debug_uart_clk = clk_get_sys("serial8250.0", "uarta");
+               debug_uart_port_base = ((struct plat_serial8250_port *)(
+                       debug_uarta_device.dev.platform_data))->mapbase;
+               break;
+       }
+}
+
+static void __init dalmore_uart_init(void)
+{
+       struct clk *c;
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(uart_parent_clk); ++i) {
+               c = tegra_get_clock_by_name(uart_parent_clk[i].name);
+               if (IS_ERR_OR_NULL(c)) {
+                       pr_err("Not able to get the clock for %s\n",
+                                               uart_parent_clk[i].name);
+                       continue;
+               }
+               uart_parent_clk[i].parent_clk = c;
+               uart_parent_clk[i].fixed_clk_rate = clk_get_rate(c);
+       }
+       dalmore_uart_pdata.parent_clk_list = uart_parent_clk;
+       dalmore_uart_pdata.parent_clk_count = ARRAY_SIZE(uart_parent_clk);
+       dalmore_loopback_uart_pdata.parent_clk_list = uart_parent_clk;
+       dalmore_loopback_uart_pdata.parent_clk_count =
+                                               ARRAY_SIZE(uart_parent_clk);
+       dalmore_loopback_uart_pdata.is_loopback = true;
+       tegra_uarta_device.dev.platform_data = &dalmore_uart_pdata;
+       tegra_uartb_device.dev.platform_data = &dalmore_uart_pdata;
+       tegra_uartc_device.dev.platform_data = &dalmore_uart_pdata;
+       tegra_uartd_device.dev.platform_data = &dalmore_uart_pdata;
+       /* UARTE is used for loopback test purpose */
+       tegra_uarte_device.dev.platform_data = &dalmore_loopback_uart_pdata;
+
+       /* Register low speed only if it is selected */
+       if (!is_tegra_debug_uartport_hs()) {
+               uart_debug_init();
+               /* Clock enable for the debug channel */
+               if (!IS_ERR_OR_NULL(debug_uart_clk)) {
+                       pr_info("The debug console clock name is %s\n",
+                                               debug_uart_clk->name);
+                       c = tegra_get_clock_by_name("pll_p");
+                       if (IS_ERR_OR_NULL(c))
+                               pr_err("Not getting the parent clock pll_p\n");
+                       else
+                               clk_set_parent(debug_uart_clk, c);
+
+                       clk_enable(debug_uart_clk);
+                       clk_set_rate(debug_uart_clk, clk_get_rate(c));
+               } else {
+                       pr_err("Not getting the clock %s for debug console\n",
+                                       debug_uart_clk->name);
+               }
+       }
+
+       platform_add_devices(dalmore_uart_devices,
+                               ARRAY_SIZE(dalmore_uart_devices));
+}
+
+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 tegra_rt5640_platform_data dalmore_audio_pdata = {
+       .gpio_spkr_en           = TEGRA_GPIO_SPKR_EN,
+       .gpio_hp_det            = TEGRA_GPIO_HP_DET,
+       .gpio_hp_mute           = -1,
+       .gpio_int_mic_en        = TEGRA_GPIO_INT_MIC_EN,
+       .gpio_ext_mic_en        = TEGRA_GPIO_EXT_MIC_EN,
+};
+
+static struct platform_device dalmore_audio_device = {
+       .name   = "tegra-snd-rt5640",
+       .id     = 0,
+       .dev    = {
+               .platform_data = &dalmore_audio_pdata,
+       },
+};
+
+
+static struct platform_device *dalmore_devices[] __initdata = {
+       &tegra_pmu_device,
+       &tegra_rtc_device,
+       &tegra_udc_device,
+#if defined(CONFIG_TEGRA_IOVMM_SMMU) || defined(CONFIG_TEGRA_IOMMU_SMMU)
+       &tegra_smmu_device,
+#endif
+#if defined(CONFIG_TEGRA_AVP)
+       &tegra_avp_device,
+#endif
+#if defined(CONFIG_CRYPTO_DEV_TEGRA_SE)
+       &tegra_se_device,
+#endif
+       &tegra_ahub_device,
+       &tegra_pcm_device,
+       &dalmore_audio_device,
+       &tegra_hda_device,
+#if defined(CONFIG_CRYPTO_DEV_TEGRA_AES)
+       &tegra_aes_device,
+#endif
+};
+
+static struct tegra_usb_platform_data tegra_udc_pdata = {
+       .port_otg = true,
+       .has_hostpc = true,
+       .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
+       .op_mode = TEGRA_USB_OPMODE_DEVICE,
+       .u_data.dev = {
+               .vbus_pmu_irq = 0,
+               .vbus_gpio = -1,
+               .charging_supported = false,
+               .remote_wakeup_supported = false,
+       },
+       .u_cfg.utmi = {
+               .hssync_start_delay = 0,
+               .elastic_limit = 16,
+               .idle_wait_delay = 17,
+               .term_range_adj = 6,
+               .xcvr_setup = 8,
+               .xcvr_lsfslew = 2,
+               .xcvr_lsrslew = 2,
+               .xcvr_setup_offset = 0,
+               .xcvr_use_fuses = 1,
+       },
+};
+
+static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = {
+       .port_otg = true,
+       .has_hostpc = true,
+       .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
+       .op_mode = TEGRA_USB_OPMODE_HOST,
+       .u_data.host = {
+               .vbus_gpio = -1,
+               .vbus_reg = "usb_vbus_otg",
+               .hot_plug = true,
+               .remote_wakeup_supported = true,
+               .power_off_on_suspend = true,
+       },
+       .u_cfg.utmi = {
+               .hssync_start_delay = 0,
+               .elastic_limit = 16,
+               .idle_wait_delay = 17,
+               .term_range_adj = 6,
+               .xcvr_setup = 15,
+               .xcvr_lsfslew = 2,
+               .xcvr_lsrslew = 2,
+               .xcvr_setup_offset = 0,
+               .xcvr_use_fuses = 1,
+       },
+};
+
+
+static struct tegra_usb_platform_data tegra_ehci2_utmi_pdata = {
+       .port_otg = false,
+       .has_hostpc = true,
+       .phy_intf = TEGRA_USB_PHY_INTF_UTMI,
+       .op_mode        = TEGRA_USB_OPMODE_HOST,
+       .u_data.host = {
+               .vbus_gpio = -1,
+               .vbus_reg = NULL,
+               .hot_plug = false,
+               .remote_wakeup_supported = true,
+               .power_off_on_suspend = true,
+
+       },
+       .u_cfg.utmi = {
+               .hssync_start_delay = 0,
+               .elastic_limit = 16,
+               .idle_wait_delay = 17,
+               .term_range_adj = 6,
+               .xcvr_setup = 8,
+               .xcvr_lsfslew = 2,
+               .xcvr_lsrslew = 2,
+               .xcvr_setup_offset = 0,
+               .xcvr_use_fuses = 1,
+       },
+};
+
+static struct tegra_usb_otg_data tegra_otg_pdata = {
+       .ehci_device = &tegra_ehci1_device,
+       .ehci_pdata = &tegra_ehci1_utmi_pdata,
+};
+
+#if CONFIG_USB_SUPPORT
+static void dalmore_usb_init(void)
+{
+       tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
+       platform_device_register(&tegra_otg_device);
+
+       /* Setup the udc platform data */
+       tegra_udc_device.dev.platform_data = &tegra_udc_pdata;
+
+       tegra_ehci2_device.dev.platform_data = &tegra_ehci2_utmi_pdata;
+       platform_device_register(&tegra_ehci2_device);
+}
+
+static void dalmore_modem_init(void)
+{
+       int ret;
+
+       ret = gpio_request(TEGRA_GPIO_W_DISABLE, "w_disable_gpio");
+       if (ret < 0)
+               pr_err("%s: gpio_request failed for gpio %d\n",
+                       __func__, TEGRA_GPIO_W_DISABLE);
+       else
+               gpio_direction_output(TEGRA_GPIO_W_DISABLE, 1);
+
+
+       ret = gpio_request(TEGRA_GPIO_MODEM_RSVD1, "Port_V_PIN_0");
+       if (ret < 0)
+               pr_err("%s: gpio_request failed for gpio %d\n",
+                       __func__, TEGRA_GPIO_MODEM_RSVD1);
+       else
+               gpio_direction_input(TEGRA_GPIO_MODEM_RSVD1);
+
+
+       ret = gpio_request(TEGRA_GPIO_MODEM_RSVD2, "Port_H_PIN_7");
+       if (ret < 0)
+               pr_err("%s: gpio_request failed for gpio %d\n",
+                       __func__, TEGRA_GPIO_MODEM_RSVD2);
+       else
+               gpio_direction_output(TEGRA_GPIO_MODEM_RSVD2, 1);
+
+}
+
+#else
+static void dalmore_usb_init(void) { }
+static void dalmore_modem_init(void) { }
+#endif
+
+static void dalmore_audio_init(void)
+{
+       struct board_info board_info;
+
+       tegra_get_board_info(&board_info);
+
+       dalmore_audio_pdata.codec_name = "rt5640.4-001c";
+       dalmore_audio_pdata.codec_dai_name = "rt5640-aif1";
+}
+
+static void __init tegra_dalmore_init(void)
+{
+       tegra_clk_init_from_table(dalmore_clk_init_table);
+       tegra_enable_pinmux();
+       dalmore_pinmux_init();
+       dalmore_i2c_init();
+       dalmore_usb_init();
+       dalmore_uart_init();
+       dalmore_audio_init();
+       platform_add_devices(dalmore_devices, ARRAY_SIZE(dalmore_devices));
+       tegra_ram_console_debug_init();
+       tegra_io_dpd_init();
+       dalmore_sdhci_init();
+       dalmore_regulator_init();
+       dalmore_suspend_init();
+       dalmore_emc_init();
+       tegra_release_bootloader_fb();
+       dalmore_modem_init();
+#ifdef CONFIG_TEGRA_WDT_RECOVERY
+       tegra_wdt_recovery_init();
+#endif
+       tegra_serial_debug_init(TEGRA_UARTD_BASE, INT_WDT_CPU, NULL, -1, -1);
+}
+
+static void __init dalmore_ramconsole_reserve(unsigned long size)
+{
+       tegra_ram_console_debug_reserve(SZ_1M);
+}
+
+static void __init tegra_dalmore_reserve(void)
+{
+#if defined(CONFIG_NVMAP_CONVERT_CARVEOUT_TO_IOVMM)
+       /* support 1920X1200 with 24bpp */
+       tegra_reserve(0, SZ_8M + SZ_1M, SZ_8M + SZ_1M);
+#else
+       tegra_reserve(SZ_128M, SZ_8M, SZ_8M);
+#endif
+       dalmore_ramconsole_reserve(SZ_1M);
+}
+
+MACHINE_START(DALMORE, "dalmore")
+       .atag_offset    = 0x100,
+       .soc            = &tegra_soc_desc,
+       .map_io         = tegra_map_common_io,
+       .reserve        = tegra_dalmore_reserve,
+       .init_early     = tegra30_init_early,
+       .init_irq       = tegra_init_irq,
+       .handle_irq     = gic_handle_irq,
+       .timer          = &tegra_timer,
+       .init_machine   = tegra_dalmore_init,
+       .restart        = tegra_assert_system_reset,
+MACHINE_END
diff --git a/arch/arm/mach-tegra/board-dalmore.h b/arch/arm/mach-tegra/board-dalmore.h
new file mode 100644 (file)
index 0000000..adb3540
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * arch/arm/mach-tegra/board-dalmore.h
+ *
+ * Copyright (c) 2012, NVIDIA Corporation.
+ *
+ * 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.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#ifndef _MACH_TEGRA_BOARD_DALMORE_H
+#define _MACH_TEGRA_BOARD_DALMORE_H
+
+#include <mach/gpio.h>
+#include <mach/irqs.h>
+#include <linux/mfd/max77663-core.h>
+#include "gpio-names.h"
+
+/* External peripheral act as gpio */
+/* MAX77663 GPIO */
+#define MAX77663_GPIO_BASE      TEGRA_NR_GPIOS
+#define MAX77663_GPIO_END       (MAX77663_GPIO_BASE + MAX77663_GPIO_NR)
+
+/* Audio-related GPIOs */
+#define TEGRA_GPIO_CDC_IRQ             TEGRA_GPIO_PW3
+#define TEGRA_GPIO_SPKR_EN             -1
+#define TEGRA_GPIO_HP_DET              TEGRA_GPIO_PW2
+#define TEGRA_GPIO_INT_MIC_EN          TEGRA_GPIO_PK3
+#define TEGRA_GPIO_EXT_MIC_EN          TEGRA_GPIO_PK4
+
+#define TEGRA_GPIO_W_DISABLE           TEGRA_GPIO_PDD7
+#define TEGRA_GPIO_MODEM_RSVD1         TEGRA_GPIO_PV0
+#define TEGRA_GPIO_MODEM_RSVD2         TEGRA_GPIO_PH7
+
+/* External peripheral act as interrupt controller */
+/* MAX77663 IRQs */
+#define MAX77663_IRQ_BASE      TEGRA_NR_IRQS
+#define MAX77663_IRQ_END       (MAX77663_IRQ_BASE + MAX77663_IRQ_NR)
+#define MAX77663_IRQ_ACOK_RISING MAX77663_IRQ_ONOFF_ACOK_RISING
+
+/* I2C related GPIOs */
+#define TEGRA_GPIO_I2C1_SCL            TEGRA_GPIO_PC4
+#define TEGRA_GPIO_I2C1_SDA             TEGRA_GPIO_PC5
+#define TEGRA_GPIO_I2C2_SCL             TEGRA_GPIO_PT5
+#define TEGRA_GPIO_I2C2_SDA             TEGRA_GPIO_PT6
+#define TEGRA_GPIO_I2C3_SCL             TEGRA_GPIO_PBB1
+#define TEGRA_GPIO_I2C3_SDA             TEGRA_GPIO_PBB2
+#define TEGRA_GPIO_I2C4_SCL             TEGRA_GPIO_PV4
+#define TEGRA_GPIO_I2C4_SDA             TEGRA_GPIO_PV5
+#define TEGRA_GPIO_I2C5_SCL             TEGRA_GPIO_PZ6
+#define TEGRA_GPIO_I2C5_SDA             TEGRA_GPIO_PZ7
+
+int dalmore_regulator_init(void);
+int dalmore_suspend_init(void);
+int dalmore_sdhci_init(void);
+int dalmore_pinmux_init(void);
+int dalmore_sensors_init(void);
+int dalmore_emc_init(void);
+
+#endif
index 4c0e977..5f82238 100644 (file)
@@ -1171,3 +1171,4 @@ pov2                      MACH_POV2               POV2                    3889
 ipod_touch_2g          MACH_IPOD_TOUCH_2G      IPOD_TOUCH_2G           3890
 da850_pqab             MACH_DA850_PQAB         DA850_PQAB              3891
 kai                    MACH_KAI                KAI                     3897
+dalmore                        MACH_DALMORE            DALMORE                 4282