diff options
author | Sandeep Paulraj <s-paulraj@ti.com> | 2009-06-20 12:23:39 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-08-26 03:56:58 -0400 |
commit | 8ed0a9d4e7cfff439f95d08c882841f25a12bf54 (patch) | |
tree | c516207140f5d91b9e45863fd168622ed779dda9 /arch/arm/mach-davinci/board-dm365-evm.c | |
parent | 9f5131538368b299aabcc790f1cece0439e65a5e (diff) |
davinci: dm365: EMAC support for SoC and dm365 EVM
The patch adds Support for EMAC in the DM365 SOC and
the DM365 EVM board.
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/board-dm365-evm.c')
-rw-r--r-- | arch/arm/mach-davinci/board-dm365-evm.c | 66 |
1 files changed, 64 insertions, 2 deletions
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 08c2f12d03d1..9dda3999c8f3 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c | |||
@@ -19,12 +19,12 @@ | |||
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
22 | 22 | #include <linux/i2c/at24.h> | |
23 | #include <asm/setup.h> | 23 | #include <asm/setup.h> |
24 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
25 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
26 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
27 | 27 | #include <mach/mux.h> | |
28 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
29 | #include <mach/dm365.h> | 29 | #include <mach/dm365.h> |
30 | #include <mach/psc.h> | 30 | #include <mach/psc.h> |
@@ -34,14 +34,69 @@ | |||
34 | #include <mach/serial.h> | 34 | #include <mach/serial.h> |
35 | #include <mach/common.h> | 35 | #include <mach/common.h> |
36 | 36 | ||
37 | #define DM365_EVM_PHY_MASK (0x2) | ||
38 | #define DM365_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */ | ||
39 | |||
40 | static struct at24_platform_data eeprom_info = { | ||
41 | .byte_len = (256*1024) / 8, | ||
42 | .page_size = 64, | ||
43 | .flags = AT24_FLAG_ADDR16, | ||
44 | .setup = davinci_get_mac_addr, | ||
45 | .context = (void *)0x7f00, | ||
46 | }; | ||
47 | |||
48 | static struct i2c_board_info i2c_info[] = { | ||
49 | { | ||
50 | I2C_BOARD_INFO("24c256", 0x50), | ||
51 | .platform_data = &eeprom_info, | ||
52 | }, | ||
53 | }; | ||
54 | |||
37 | static struct davinci_i2c_platform_data i2c_pdata = { | 55 | static struct davinci_i2c_platform_data i2c_pdata = { |
38 | .bus_freq = 400 /* kHz */, | 56 | .bus_freq = 400 /* kHz */, |
39 | .bus_delay = 0 /* usec */, | 57 | .bus_delay = 0 /* usec */, |
40 | }; | 58 | }; |
41 | 59 | ||
60 | static void dm365evm_emac_configure(void) | ||
61 | { | ||
62 | /* | ||
63 | * EMAC pins are multiplexed with GPIO and UART | ||
64 | * Further details are available at the DM365 ARM | ||
65 | * Subsystem Users Guide(sprufg5.pdf) pages 125 - 127 | ||
66 | */ | ||
67 | davinci_cfg_reg(DM365_EMAC_TX_EN); | ||
68 | davinci_cfg_reg(DM365_EMAC_TX_CLK); | ||
69 | davinci_cfg_reg(DM365_EMAC_COL); | ||
70 | davinci_cfg_reg(DM365_EMAC_TXD3); | ||
71 | davinci_cfg_reg(DM365_EMAC_TXD2); | ||
72 | davinci_cfg_reg(DM365_EMAC_TXD1); | ||
73 | davinci_cfg_reg(DM365_EMAC_TXD0); | ||
74 | davinci_cfg_reg(DM365_EMAC_RXD3); | ||
75 | davinci_cfg_reg(DM365_EMAC_RXD2); | ||
76 | davinci_cfg_reg(DM365_EMAC_RXD1); | ||
77 | davinci_cfg_reg(DM365_EMAC_RXD0); | ||
78 | davinci_cfg_reg(DM365_EMAC_RX_CLK); | ||
79 | davinci_cfg_reg(DM365_EMAC_RX_DV); | ||
80 | davinci_cfg_reg(DM365_EMAC_RX_ER); | ||
81 | davinci_cfg_reg(DM365_EMAC_CRS); | ||
82 | davinci_cfg_reg(DM365_EMAC_MDIO); | ||
83 | davinci_cfg_reg(DM365_EMAC_MDCLK); | ||
84 | |||
85 | /* | ||
86 | * EMAC interrupts are multiplexed with GPIO interrupts | ||
87 | * Details are available at the DM365 ARM | ||
88 | * Subsystem Users Guide(sprufg5.pdf) pages 133 - 134 | ||
89 | */ | ||
90 | davinci_cfg_reg(DM365_INT_EMAC_RXTHRESH); | ||
91 | davinci_cfg_reg(DM365_INT_EMAC_RXPULSE); | ||
92 | davinci_cfg_reg(DM365_INT_EMAC_TXPULSE); | ||
93 | davinci_cfg_reg(DM365_INT_EMAC_MISCPULSE); | ||
94 | } | ||
95 | |||
42 | static void __init evm_init_i2c(void) | 96 | static void __init evm_init_i2c(void) |
43 | { | 97 | { |
44 | davinci_init_i2c(&i2c_pdata); | 98 | davinci_init_i2c(&i2c_pdata); |
99 | i2c_register_board_info(1, i2c_info, ARRAY_SIZE(i2c_info)); | ||
45 | } | 100 | } |
46 | 101 | ||
47 | static struct davinci_uart_config uart_config __initdata = { | 102 | static struct davinci_uart_config uart_config __initdata = { |
@@ -55,8 +110,15 @@ static void __init dm365_evm_map_io(void) | |||
55 | 110 | ||
56 | static __init void dm365_evm_init(void) | 111 | static __init void dm365_evm_init(void) |
57 | { | 112 | { |
113 | struct davinci_soc_info *soc_info = &davinci_soc_info; | ||
114 | |||
58 | evm_init_i2c(); | 115 | evm_init_i2c(); |
59 | davinci_serial_init(&uart_config); | 116 | davinci_serial_init(&uart_config); |
117 | |||
118 | dm365evm_emac_configure(); | ||
119 | |||
120 | soc_info->emac_pdata->phy_mask = DM365_EVM_PHY_MASK; | ||
121 | soc_info->emac_pdata->mdio_max_freq = DM365_EVM_MDIO_FREQUENCY; | ||
60 | } | 122 | } |
61 | 123 | ||
62 | static __init void dm365_evm_irq_init(void) | 124 | static __init void dm365_evm_irq_init(void) |