aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/board-dm646x-evm.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2009-05-07 09:19:40 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-05-26 10:18:16 -0400
commitac7b75b5bbbfd60b752869a22daa3be99b5b4f99 (patch)
treedac2408210f9e815f98f67c7c6e32216db99fa73 /arch/arm/mach-davinci/board-dm646x-evm.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/board-dm646x-evm.c')
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 94cb623b1ec9..aedde3cdb82f 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -45,6 +45,16 @@
45#include <mach/psc.h> 45#include <mach/psc.h>
46#include <mach/serial.h> 46#include <mach/serial.h>
47#include <mach/i2c.h> 47#include <mach/i2c.h>
48#include <mach/mmc.h>
49#include <mach/emac.h>
50
51#define DM646X_EVM_PHY_MASK (0x2)
52#define DM646X_EVM_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
53
54static struct emac_platform_data dm646x_evm_emac_pdata = {
55 .phy_mask = DM646X_EVM_PHY_MASK,
56 .mdio_max_freq = DM646X_EVM_MDIO_FREQUENCY,
57};
48 58
49static struct davinci_uart_config uart_config __initdata = { 59static struct davinci_uart_config uart_config __initdata = {
50 .enabled_uarts = (1 << 0), 60 .enabled_uarts = (1 << 0),
@@ -196,14 +206,16 @@ static struct memory_accessor *at24_mem_acc;
196 206
197static void at24_setup(struct memory_accessor *mem_acc, void *context) 207static void at24_setup(struct memory_accessor *mem_acc, void *context)
198{ 208{
199 char mac_addr[6]; 209 char mac_addr[ETH_ALEN];
200 210
201 at24_mem_acc = mem_acc; 211 at24_mem_acc = mem_acc;
202 212
203 /* Read MAC addr from EEPROM */ 213 /* Read MAC addr from EEPROM */
204 if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x7f00, ETH_ALEN) == 214 if (at24_mem_acc->read(at24_mem_acc, mac_addr, 0x7f00, ETH_ALEN) ==
205 ETH_ALEN) 215 ETH_ALEN) {
206 pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr); 216 pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr);
217 memcpy(dm646x_evm_emac_pdata.mac_addr, mac_addr, ETH_ALEN);
218 }
207} 219}
208 220
209static struct at24_platform_data eeprom_info = { 221static struct at24_platform_data eeprom_info = {
@@ -261,6 +273,7 @@ static __init void evm_init(void)
261{ 273{
262 evm_init_i2c(); 274 evm_init_i2c();
263 davinci_serial_init(&uart_config); 275 davinci_serial_init(&uart_config);
276 dm646x_init_emac(&dm646x_evm_emac_pdata);
264} 277}
265 278
266static __init void davinci_dm646x_evm_irq_init(void) 279static __init void davinci_dm646x_evm_irq_init(void)