aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci
diff options
context:
space:
mode:
authorSudhakar Rajashekhara <sudhakar.raj@ti.com>2009-07-17 04:47:10 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-08-26 04:55:45 -0400
commit5a4b131508236c0a59b8680f486c49e31881fe4e (patch)
tree418d8946d58c159718d0c195e7d0c92a476da3ab /arch/arm/mach-davinci
parent0fbc5592158db4e1ca2037178e1ea6733ccc6f61 (diff)
davinci: Add EMAC support for da850/omap-l138
Ethernet Media Access Controller (EMAC) on da850/omap-l138 supports 10/100 Mbps operation. It also supports Media Independent Interface (MII) and Reduced Media Independent Interface (RMII) to physical layer (PHY). Phy which supports MII is present on the DA850/OMAP-L138 base board and Phy supporting RMII is present on the UI card. This patch adds support only for the MII Phy. Support for RMII Phy will be added later. Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c18
-rw-r--r--arch/arm/mach-davinci/da850.c31
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h1
-rw-r--r--arch/arm/mach-davinci/include/mach/mux.h17
4 files changed, 67 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index eaa1fc1bc5f5..d98934629604 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -26,6 +26,9 @@
26#include <mach/cp_intc.h> 26#include <mach/cp_intc.h>
27#include <mach/da8xx.h> 27#include <mach/da8xx.h>
28 28
29#define DA850_EVM_PHY_MASK 0x1
30#define DA850_EVM_MDIO_FREQUENCY 2200000 /* PHY bus frequency */
31
29static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { 32static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
30 .bus_freq = 100, /* kHz */ 33 .bus_freq = 100, /* kHz */
31 .bus_delay = 0, /* usec */ 34 .bus_delay = 0, /* usec */
@@ -37,6 +40,7 @@ static struct davinci_uart_config da850_evm_uart_config __initdata = {
37 40
38static __init void da850_evm_init(void) 41static __init void da850_evm_init(void)
39{ 42{
43 struct davinci_soc_info *soc_info = &davinci_soc_info;
40 int ret; 44 int ret;
41 45
42 ret = da8xx_register_edma(); 46 ret = da8xx_register_edma();
@@ -54,6 +58,20 @@ static __init void da850_evm_init(void)
54 pr_warning("da850_evm_init: i2c0 registration failed: %d\n", 58 pr_warning("da850_evm_init: i2c0 registration failed: %d\n",
55 ret); 59 ret);
56 60
61 soc_info->emac_pdata->phy_mask = DA850_EVM_PHY_MASK;
62 soc_info->emac_pdata->mdio_max_freq = DA850_EVM_MDIO_FREQUENCY;
63 soc_info->emac_pdata->rmii_en = 0;
64
65 ret = da8xx_pinmux_setup(da850_cpgmac_pins);
66 if (ret)
67 pr_warning("da850_evm_init: cpgmac mux setup failed: %d\n",
68 ret);
69
70 ret = da8xx_register_emac();
71 if (ret)
72 pr_warning("da850_evm_init: emac registration failed: %d\n",
73 ret);
74
57 ret = da8xx_register_watchdog(); 75 ret = da8xx_register_watchdog();
58 if (ret) 76 if (ret)
59 pr_warning("da830_evm_init: watchdog registration failed: %d\n", 77 pr_warning("da830_evm_init: watchdog registration failed: %d\n",
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 332cf7fadb1f..4a43ae2bec09 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -283,6 +283,12 @@ static struct clk rmii_clk = {
283 .parent = &pll0_sysclk7, 283 .parent = &pll0_sysclk7,
284}; 284};
285 285
286static struct clk emac_clk = {
287 .name = "emac",
288 .parent = &pll0_sysclk4,
289 .lpsc = DA8XX_LPSC1_CPGMAC,
290};
291
286static struct davinci_clk da850_clks[] = { 292static struct davinci_clk da850_clks[] = {
287 CLK(NULL, "ref", &ref_clk), 293 CLK(NULL, "ref", &ref_clk),
288 CLK(NULL, "pll0", &pll0_clk), 294 CLK(NULL, "pll0", &pll0_clk),
@@ -319,6 +325,7 @@ static struct davinci_clk da850_clks[] = {
319 CLK(NULL, "emif3", &emif3_clk), 325 CLK(NULL, "emif3", &emif3_clk),
320 CLK(NULL, "arm", &arm_clk), 326 CLK(NULL, "arm", &arm_clk),
321 CLK(NULL, "rmii", &rmii_clk), 327 CLK(NULL, "rmii", &rmii_clk),
328 CLK("davinci_emac.1", NULL, &emac_clk),
322 CLK(NULL, NULL, NULL), 329 CLK(NULL, NULL, NULL),
323}; 330};
324 331
@@ -347,6 +354,22 @@ static const struct mux_config da850_pins[] = {
347 /* I2C0 function */ 354 /* I2C0 function */
348 MUX_CFG(DA850, I2C0_SDA, 4, 12, 15, 2, false) 355 MUX_CFG(DA850, I2C0_SDA, 4, 12, 15, 2, false)
349 MUX_CFG(DA850, I2C0_SCL, 4, 8, 15, 2, false) 356 MUX_CFG(DA850, I2C0_SCL, 4, 8, 15, 2, false)
357 /* EMAC function */
358 MUX_CFG(DA850, MII_TXEN, 2, 4, 15, 8, false)
359 MUX_CFG(DA850, MII_TXCLK, 2, 8, 15, 8, false)
360 MUX_CFG(DA850, MII_COL, 2, 12, 15, 8, false)
361 MUX_CFG(DA850, MII_TXD_3, 2, 16, 15, 8, false)
362 MUX_CFG(DA850, MII_TXD_2, 2, 20, 15, 8, false)
363 MUX_CFG(DA850, MII_TXD_1, 2, 24, 15, 8, false)
364 MUX_CFG(DA850, MII_TXD_0, 2, 28, 15, 8, false)
365 MUX_CFG(DA850, MII_RXCLK, 3, 0, 15, 8, false)
366 MUX_CFG(DA850, MII_RXDV, 3, 4, 15, 8, false)
367 MUX_CFG(DA850, MII_RXER, 3, 8, 15, 8, false)
368 MUX_CFG(DA850, MII_CRS, 3, 12, 15, 8, false)
369 MUX_CFG(DA850, MII_RXD_3, 3, 16, 15, 8, false)
370 MUX_CFG(DA850, MII_RXD_2, 3, 20, 15, 8, false)
371 MUX_CFG(DA850, MII_RXD_1, 3, 24, 15, 8, false)
372 MUX_CFG(DA850, MII_RXD_0, 3, 28, 15, 8, false)
350#endif 373#endif
351}; 374};
352 375
@@ -375,6 +398,14 @@ const short da850_i2c1_pins[] __initdata = {
375 -1 398 -1
376}; 399};
377 400
401const short da850_cpgmac_pins[] __initdata = {
402 DA850_MII_TXEN, DA850_MII_TXCLK, DA850_MII_COL, DA850_MII_TXD_3,
403 DA850_MII_TXD_2, DA850_MII_TXD_1, DA850_MII_TXD_0, DA850_MII_RXER,
404 DA850_MII_CRS, DA850_MII_RXCLK, DA850_MII_RXDV, DA850_MII_RXD_3,
405 DA850_MII_RXD_2, DA850_MII_RXD_1, DA850_MII_RXD_0,
406 -1
407};
408
378/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */ 409/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
379static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = { 410static u8 da850_default_priorities[DA850_N_CP_INTC_IRQ] = {
380 [IRQ_DA8XX_COMMTX] = 7, 411 [IRQ_DA8XX_COMMTX] = 7,
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index 594f9882e422..a8cb5709848d 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -99,6 +99,7 @@ extern const short da850_uart1_pins[];
99extern const short da850_uart2_pins[]; 99extern const short da850_uart2_pins[];
100extern const short da850_i2c0_pins[]; 100extern const short da850_i2c0_pins[];
101extern const short da850_i2c1_pins[]; 101extern const short da850_i2c1_pins[];
102extern const short da850_cpgmac_pins[];
102 103
103int da8xx_pinmux_setup(const short pins[]); 104int da8xx_pinmux_setup(const short pins[]);
104 105
diff --git a/arch/arm/mach-davinci/include/mach/mux.h b/arch/arm/mach-davinci/include/mach/mux.h
index 3349fa5f82e1..368fca69197d 100644
--- a/arch/arm/mach-davinci/include/mach/mux.h
+++ b/arch/arm/mach-davinci/include/mach/mux.h
@@ -730,6 +730,23 @@ enum davinci_da850_index {
730 /* I2C0 function */ 730 /* I2C0 function */
731 DA850_I2C0_SDA, 731 DA850_I2C0_SDA,
732 DA850_I2C0_SCL, 732 DA850_I2C0_SCL,
733
734 /* EMAC function */
735 DA850_MII_TXEN,
736 DA850_MII_TXCLK,
737 DA850_MII_COL,
738 DA850_MII_TXD_3,
739 DA850_MII_TXD_2,
740 DA850_MII_TXD_1,
741 DA850_MII_TXD_0,
742 DA850_MII_RXER,
743 DA850_MII_CRS,
744 DA850_MII_RXCLK,
745 DA850_MII_RXDV,
746 DA850_MII_RXD_3,
747 DA850_MII_RXD_2,
748 DA850_MII_RXD_1,
749 DA850_MII_RXD_0,
733}; 750};
734 751
735#ifdef CONFIG_DAVINCI_MUX 752#ifdef CONFIG_DAVINCI_MUX