[ARM] tegra: harmony/ventana: register additional devices
authorGary King <gking@nvidia.com>
Wed, 14 Jul 2010 01:30:59 +0000 (18:30 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:27:14 +0000 (16:27 -0700)
register GART, pda_power, and OTG devices

Change-Id: I6dec5f765494cdc96f3395cf32fd962c87bf70b7
Signed-off-by: Gary King <gking@nvidia.com>
arch/arm/mach-tegra/board-harmony.c
arch/arm/mach-tegra/board-ventana.c

index a5521983ef89821d77110993ad8e8de4e4afe406..ebf8362fd3a54f9ae3fbf8a6380f5800fb10af82 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/fsl_devices.h>
 #include <linux/pda_power.h>
 #include <linux/io.h>
+#include <linux/delay.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -34,7 +35,9 @@
 #include <mach/iomap.h>
 #include <mach/irqs.h>
 #include <mach/nand.h>
+#include <mach/clk.h>
 
+#include "clock.h"
 #include "board.h"
 #include "board-harmony.h"
 #include "clock.h"
@@ -172,7 +175,7 @@ static struct fsl_usb2_platform_data tegra_otg_pdata = {
        .phy_mode       = FSL_USB2_PHY_UTMI,
 };
 
-struct platform_device tegra_otg = {
+static struct platform_device tegra_otg = {
        .name = "fsl-tegra-udc",
        .id   = -1,
        .dev  = {
@@ -196,6 +199,28 @@ static struct platform_device pda_power_device = {
        },
 };
 
+static struct resource tegra_gart_resources[] = {
+    {
+       .name = "mc",
+       .flags = IORESOURCE_MEM,
+       .start = TEGRA_MC_BASE,
+       .end = TEGRA_MC_BASE + TEGRA_MC_SIZE - 1,
+    },
+    {
+       .name = "gart",
+       .flags = IORESOURCE_MEM,
+       .start = 0x58000000,
+       .end = 0x58000000 - 1 + 32 * 1024 * 1024,
+    }
+};
+
+static struct platform_device tegra_gart_dev = {
+    .name = "tegra_gart",
+    .id = -1,
+    .num_resources = ARRAY_SIZE(tegra_gart_resources),
+    .resource = tegra_gart_resources
+};
+
 static struct platform_device *harmony_devices[] __initdata = {
        &debug_uart,
        &tegra_nand_device,
@@ -209,6 +234,7 @@ static struct platform_device *harmony_devices[] __initdata = {
        &tegra_spi_device2,
        &tegra_spi_device3,
        &tegra_spi_device4,
+       &tegra_gart_dev,
 };
 
 static void __init tegra_harmony_fixup(struct machine_desc *desc,
index a42868a9f4f8508cd353ccd32c51a05a347b471c..eef18980947dd393bd8b0a51cc2a0d104533d0fe 100644 (file)
 #include <linux/clk.h>
 #include <linux/serial_8250.h>
 #include <linux/i2c.h>
+#include <linux/pda_power.h>
+#include <linux/dma-mapping.h>
+#include <linux/fsl_devices.h>
+#include <linux/delay.h>
 
 #include <mach/iomap.h>
 #include <mach/irqs.h>
@@ -64,11 +68,84 @@ static struct platform_device debug_uart = {
 static __initdata struct tegra_clk_init_table ventana_clk_init_table[] = {
        /* name         parent          rate            enabled */
        { "uartd",      "pll_p",        216000000,      true},
+       { "pll_m",      "clk_m",        600000000,      true},
+       { "emc",        "pll_m",        600000000,      true},
        { NULL,         NULL,           0,              0},
 };
 
+/* OTG gadget device */
+static u64 tegra_otg_dmamask = DMA_BIT_MASK(32);
+
+
+static struct resource tegra_otg_resources[] = {
+       [0] = {
+               .start  = TEGRA_USB_BASE,
+               .end    = TEGRA_USB_BASE + TEGRA_USB_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = INT_USB,
+               .end    = INT_USB,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct fsl_usb2_platform_data tegra_otg_pdata = {
+       .operating_mode = FSL_USB2_DR_DEVICE,
+       .phy_mode       = FSL_USB2_PHY_UTMI,
+};
+
+static struct platform_device tegra_otg = {
+       .name = "fsl-tegra-udc",
+       .id   = -1,
+       .dev  = {
+               .dma_mask               = &tegra_otg_dmamask,
+               .coherent_dma_mask      = 0xffffffff,
+               .platform_data = &tegra_otg_pdata,
+       },
+       .resource = tegra_otg_resources,
+       .num_resources = ARRAY_SIZE(tegra_otg_resources),
+};
+
+/* PDA power */
+static struct pda_power_pdata pda_power_pdata = {
+};
+
+static struct platform_device pda_power_device = {
+       .name   = "pda_power",
+       .id     = -1,
+       .dev    = {
+               .platform_data  = &pda_power_pdata,
+       },
+};
+
+static struct resource tegra_gart_resources[] = {
+    {
+       .name = "mc",
+       .flags = IORESOURCE_MEM,
+       .start = TEGRA_MC_BASE,
+       .end = TEGRA_MC_BASE + TEGRA_MC_SIZE - 1,
+    },
+    {
+       .name = "gart",
+       .flags = IORESOURCE_MEM,
+       .start = 0x58000000,
+       .end = 0x58000000 - 1 + 32 * 1024 * 1024,
+    }
+};
+
+static struct platform_device tegra_gart_dev = {
+    .name = "tegra_gart",
+    .id = -1,
+    .num_resources = ARRAY_SIZE(tegra_gart_resources),
+    .resource = tegra_gart_resources
+};
+
 static struct platform_device *ventana_devices[] __initdata = {
        &debug_uart,
+       &tegra_otg,
+       &pda_power_device,
+       &tegra_gart_dev,
 };
 
 extern int __init ventana_sdhci_init(void);