ar71xx/sysmocom: move network configuration out of _common()

The sysmo boards differs to much - put it into board configuration
to improve readability.
This commit is contained in:
Alexander Couzens 2015-03-10 13:29:28 +01:00
parent c8cd9a10ce
commit ebeadd286c
1 changed files with 23 additions and 13 deletions

View File

@ -68,25 +68,21 @@ static struct gpio_led sysmocom_sob_jb02_leds_gpio[] __initdata = {
static void __init sysmocom_common_setup(void)
{
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
ath79_register_m25p80(NULL);
ath79_register_wmac(art + SYSMOCOM_CALDATA_OFFSET,
art + SYSMOCOM_WMAC_MAC_OFFSET);
ath79_setup_ar933x_phy4_switch(false, false);
ath79_init_mac(ath79_eth0_data.mac_addr, art + SYSMOCOM_MAC0_OFFSET, 0);
ath79_register_mdio(0, 0x0);
/* WAN port */
ath79_register_eth(0);
}
static void __init sysmocom_sob_ap1_setup(void)
{
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
sysmocom_common_setup();
ath79_register_wmac(art + SYSMOCOM_CALDATA_OFFSET,
art + SYSMOCOM_WMAC_MAC_OFFSET);
ath79_setup_ar933x_phy4_switch(false, false);
ath79_init_mac(ath79_eth0_data.mac_addr, art + SYSMOCOM_MAC0_OFFSET, 0);
ath79_register_mdio(0, 0x0);
ath79_register_eth(0);
ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
@ -104,10 +100,15 @@ static void __init sysmocom_sob_ap2_setup(void)
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
sysmocom_common_setup();
ath79_register_wmac(art + SYSMOCOM_CALDATA_OFFSET,
art + SYSMOCOM_WMAC_MAC_OFFSET);
/* RJ45 port is separate WAN port / MAC, not switched with other ports */
ath79_setup_ar933x_phy4_switch(true, true);
ath79_init_mac(ath79_eth0_data.mac_addr, art + SYSMOCOM_MAC0_OFFSET, 0);
ath79_init_mac(ath79_eth1_data.mac_addr, art + SYSMOCOM_MAC1_OFFSET, 1);
ath79_register_mdio(0, 0x0);
ath79_register_eth(0);
ath79_register_eth(1);
ath79_gpio_function_enable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
@ -129,7 +130,16 @@ static void __init sysmocom_sob_ap2_setup(void)
static void __init sysmocom_sob_jb02_setup(void)
{
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
sysmocom_common_setup();
ath79_register_wmac(art + SYSMOCOM_CALDATA_OFFSET,
art + SYSMOCOM_WMAC_MAC_OFFSET);
ath79_setup_ar933x_phy4_switch(false, false);
ath79_init_mac(ath79_eth0_data.mac_addr, art + SYSMOCOM_MAC0_OFFSET, 0);
ath79_register_mdio(0, 0x0);
ath79_register_eth(0);
ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |