diff options
author | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-10-17 18:27:47 +0000 |
---|---|---|
committer | juhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-10-17 18:27:47 +0000 |
commit | f2b2ff444e98f8099787347e98df7473576b3ef2 (patch) | |
tree | dd041a09f72acde344c11fb458af8deaa9ce751c /target/linux/ar71xx | |
parent | 83c1f2e1efbcb0472445ddeb759252a6b9feced4 (diff) |
ar71xx: use the ath79_set_ar934x_eth_cfg helper in machine setup routines
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33818 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx')
5 files changed, 7 insertions, 97 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c index 1855349a3..f6165273d 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c @@ -175,27 +175,6 @@ static void __init om2p_lc_setup(void) MIPS_MACHINE(ATH79_MACH_OM2P_LC, "OM2P-LC", "OpenMesh OM2P LC", om2p_lc_setup); - -static void __init om2p_hs_gmac_setup(void) -{ - void __iomem *base; - u32 t; - - base = ioremap(AR934X_GMAC_BASE, AR934X_GMAC_SIZE); - - t = __raw_readl(base + AR934X_GMAC_REG_ETH_CFG); - - t &= ~(AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0 | - AR934X_ETH_CFG_GMII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE | - AR934X_ETH_CFG_SW_PHY_SWAP); - - t |= AR934X_ETH_CFG_SW_PHY_SWAP; - __raw_writel(t, base + AR934X_GMAC_REG_ETH_CFG); - t = __raw_readl(base + AR934X_GMAC_REG_ETH_CFG); - - iounmap(base); -} - static void __init om2p_hs_setup(void) { u8 *mac1 = (u8 *)KSEG1ADDR(0x1ffc0000); @@ -222,7 +201,7 @@ static void __init om2p_hs_setup(void) ath79_register_wmac(art, NULL); - om2p_hs_gmac_setup(); + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP); ath79_register_mdio(1, 0x0); ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c index ecdd7ea2e..933a45130 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c @@ -123,23 +123,6 @@ static struct mdio_board_info rb2011_mdio0_info[] = { }, }; -static void __init rb2011_gmac_setup(void) -{ - void __iomem *base; - u32 t; - - base = ioremap(AR934X_GMAC_BASE, AR934X_GMAC_SIZE); - - t = __raw_readl(base + AR934X_GMAC_REG_ETH_CFG); - t &= ~(AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0 | - AR934X_ETH_CFG_GMII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE); - t |= AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE; - - __raw_writel(t, base + AR934X_GMAC_REG_ETH_CFG); - - iounmap(base); -} - static void __init rb2011_wlan_init(void) { u8 *hard_cfg = (u8 *) KSEG1ADDR(0x1f000000 + RB_HARD_CFG_OFFSET); @@ -232,7 +215,8 @@ static void __init rb2011_setup(void) ath79_register_m25p80(&rb2011_spi_flash_data); rb2011_nand_init(); - rb2011_gmac_setup(); + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 | + AR934X_ETH_CFG_SW_ONLY_MODE); ath79_register_mdio(1, 0x0); ath79_register_mdio(0, 0x0); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr4300.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr4300.c index 331de5680..483aa6e93 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr4300.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr4300.c @@ -139,23 +139,6 @@ static struct mdio_board_info wdr4300_mdio0_info[] = { }, }; -static void __init wdr4300_gmac_setup(void) -{ - void __iomem *base; - u32 t; - - base = ioremap(AR934X_GMAC_BASE, AR934X_GMAC_SIZE); - - t = __raw_readl(base + AR934X_GMAC_REG_ETH_CFG); - t &= ~(AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0 | - AR934X_ETH_CFG_GMII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE); - t |= AR934X_ETH_CFG_RGMII_GMAC0; - - __raw_writel(t, base + AR934X_GMAC_REG_ETH_CFG); - - iounmap(base); -} - static void __init wdr4300_setup(void) { u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); @@ -176,7 +159,7 @@ static void __init wdr4300_setup(void) ap9x_pci_setup_wmac_led_pin(0, 0); ap91_pci_init(art + WDR4300_PCIE_CALDATA_OFFSET, tmpmac); - wdr4300_gmac_setup(); + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0); mdiobus_register_board_info(wdr4300_mdio0_info, ARRAY_SIZE(wdr4300_mdio0_info)); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1041n-v2.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1041n-v2.c index ed5b2b0e6..163dc6fa6 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1041n-v2.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1041n-v2.c @@ -101,23 +101,6 @@ static struct mdio_board_info db120_mdio0_info[] = { }, }; -static void __init db120_gmac_setup(void) -{ - void __iomem *base; - u32 t; - - base = ioremap(AR934X_GMAC_BASE, AR934X_GMAC_SIZE); - - t = __raw_readl(base + AR934X_GMAC_REG_ETH_CFG); - t &= ~(AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0 | - AR934X_ETH_CFG_GMII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE); - t |= AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE; - - __raw_writel(t, base + AR934X_GMAC_REG_ETH_CFG); - - iounmap(base); -} - static void __init tl_wr1041nv2_setup(void) { u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); @@ -132,7 +115,8 @@ static void __init tl_wr1041nv2_setup(void) tl_wr1041nv2_gpio_keys); ath79_register_wmac(ee, mac); - db120_gmac_setup(); + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 | + AR934X_ETH_CFG_SW_ONLY_MODE); ath79_register_mdio(1, 0x0); ath79_register_mdio(0, 0x0); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c index db4d1052a..ffaf8d155 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v8.c @@ -99,26 +99,6 @@ static struct gpio_keys_button tl_wr841n_v8_gpio_keys[] __initdata = { } }; -static void __init tl_wr841n_v8_gmac_setup(void) -{ - void __iomem *base; - u32 t; - - base = ioremap(AR934X_GMAC_BASE, AR934X_GMAC_SIZE); - - t = __raw_readl(base + AR934X_GMAC_REG_ETH_CFG); - - t &= ~(AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0 | - AR934X_ETH_CFG_GMII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE | - AR934X_ETH_CFG_SW_PHY_SWAP); - - t |= AR934X_ETH_CFG_SW_PHY_SWAP; - __raw_writel(t, base + AR934X_GMAC_REG_ETH_CFG); - t = __raw_readl(base + AR934X_GMAC_REG_ETH_CFG); - - iounmap(base); -} - static void __init tl_wr841n_v8_setup(void) { u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); @@ -133,7 +113,7 @@ static void __init tl_wr841n_v8_setup(void) ath79_register_m25p80(&tl_wr841n_v8_flash_data); - tl_wr841n_v8_gmac_setup(); + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP); ath79_register_mdio(1, 0x0); |