summaryrefslogtreecommitdiff
path: root/arch/arm/mach-davinci/dm646x.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2009-05-07 06:19:40 -0700
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-26 07:18:16 -0700
commitac7b75b5bbbfd60b752869a22daa3be99b5b4f99 (patch)
treedac2408210f9e815f98f67c7c6e32216db99fa73 /arch/arm/mach-davinci/dm646x.c
parent2dbf56aeb7986b54651c93ed171877e8179289bc (diff)
davinci: EMAC platform support
Add SoC and platform-specific data and init for DaVinci EMAC network driver. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/dm646x.c')
-rw-r--r--arch/arm/mach-davinci/dm646x.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 93443a6637ea..975ed062ce24 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -279,6 +279,44 @@ struct davinci_clk dm646x_clks[] = {
CLK(NULL, NULL, NULL),
};
+#if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE)
+static struct resource dm646x_emac_resources[] = {
+ {
+ .start = DM646X_EMAC_BASE,
+ .end = DM646X_EMAC_BASE + 0x47ff,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = IRQ_DM646X_EMACRXTHINT,
+ .end = IRQ_DM646X_EMACRXTHINT,
+ .flags = IORESOURCE_IRQ,
+ },
+ {
+ .start = IRQ_DM646X_EMACRXINT,
+ .end = IRQ_DM646X_EMACRXINT,
+ .flags = IORESOURCE_IRQ,
+ },
+ {
+ .start = IRQ_DM646X_EMACTXINT,
+ .end = IRQ_DM646X_EMACTXINT,
+ .flags = IORESOURCE_IRQ,
+ },
+ {
+ .start = IRQ_DM646X_EMACMISCINT,
+ .end = IRQ_DM646X_EMACMISCINT,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device dm646x_emac_device = {
+ .name = "davinci_emac",
+ .id = 1,
+ .num_resources = ARRAY_SIZE(dm646x_emac_resources),
+ .resource = dm646x_emac_resources,
+};
+
+#endif
+
/*
* Device specific mux setup
*
@@ -385,6 +423,25 @@ static struct platform_device dm646x_edma_device = {
/*----------------------------------------------------------------------*/
+#if defined(CONFIG_TI_DAVINCI_EMAC) || defined(CONFIG_TI_DAVINCI_EMAC_MODULE)
+
+void dm646x_init_emac(struct emac_platform_data *pdata)
+{
+ pdata->ctrl_reg_offset = DM646X_EMAC_CNTRL_OFFSET;
+ pdata->ctrl_mod_reg_offset = DM646X_EMAC_CNTRL_MOD_OFFSET;
+ pdata->ctrl_ram_offset = DM646X_EMAC_CNTRL_RAM_OFFSET;
+ pdata->mdio_reg_offset = DM646X_EMAC_MDIO_OFFSET;
+ pdata->ctrl_ram_size = DM646X_EMAC_CNTRL_RAM_SIZE;
+ pdata->version = EMAC_VERSION_2;
+ dm646x_emac_device.dev.platform_data = pdata;
+ platform_device_register(&dm646x_emac_device);
+}
+#else
+
+void dm646x_init_emac(struct emac_platform_data *unused) {}
+
+#endif
+
void __init dm646x_init(void)
{
davinci_clk_init(dm646x_clks);