diff options
author | Sudhakar Rajashekhara <sudhakar.raj@ti.com> | 2010-01-15 11:15:43 +0530 |
---|---|---|
committer | Sudhakar Rajashekhara <sudhakar.raj@ti.com> | 2010-01-15 14:57:06 +0530 |
commit | a3294b69bb1aa22a56839efdd57e38a5d9957b2c (patch) | |
tree | 35683eabba3049760fdb1a3186ac5f18c3f626c4 /board | |
parent | b43d9d5ab21b4155824a6a6dac5167608218e254 (diff) |
da830: Make i2c and emac work
Existing EMAC driver does not work for both the PHYs, hence
use the old EMAC driver. Also I2C was not working becasue
of wrong pinmux configuration. This patch corrects it.
Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/davinci/da830evm/da830evm.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/board/davinci/da830evm/da830evm.c b/board/davinci/da830evm/da830evm.c index bb8cc3c928..f8529b736d 100644 --- a/board/davinci/da830evm/da830evm.c +++ b/board/davinci/da830evm/da830evm.c @@ -59,10 +59,25 @@ const struct pinmux_config uart_pins[] = { { pinmux[9], 2, 0 } }; +#ifdef CONFIG_DRIVER_TI_EMAC +const struct pinmux_config emac_pins[] = { + { pinmux[9], 0, 5 }, + { pinmux[10], 2, 1 }, + { pinmux[10], 2, 2 }, + { pinmux[10], 2, 3 }, + { pinmux[10], 2, 4 }, + { pinmux[10], 2, 5 }, + { pinmux[10], 2, 6 }, + { pinmux[10], 2, 7 }, + { pinmux[11], 2, 0 }, + { pinmux[11], 2, 1 } +}; +#endif + /* I2C pin muxer settings */ const struct pinmux_config i2c_pins[] = { - { pinmux[9], 2, 3 }, - { pinmux[9], 2, 4 } + { pinmux[8], 2, 3 }, + { pinmux[8], 2, 4 } }; int board_init(void) @@ -118,6 +133,11 @@ int board_init(void) if (davinci_configure_pin_mux(i2c_pins, ARRAY_SIZE(i2c_pins)) != 0) return 1; +#ifdef CONFIG_DRIVER_TI_EMAC + if (davinci_configure_pin_mux(emac_pins, ARRAY_SIZE(emac_pins)) != 0) + return 1; +#endif + /* enable the console UART */ writel((DAVINCI_UART_PWREMU_MGMT_FREE | DAVINCI_UART_PWREMU_MGMT_URRST | DAVINCI_UART_PWREMU_MGMT_UTRST), @@ -125,3 +145,19 @@ int board_init(void) return(0); } + +int misc_init_r(void) +{ + uint8_t eeprom_enetaddr[6], tmp[2]; + + /* Read Ethernet MAC address from EEPROM if available. */ + if (dvevm_read_mac_address(eeprom_enetaddr)) + dv_configure_mac_address(eeprom_enetaddr); + + tmp[0] = 0x01; + tmp[1] = 0x23; + + if(i2c_write(0x5f, 0, 0, tmp, 2)) { + printf("Ethernet switch start failed!\n"); + } +} |