X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=target%2Flinux%2Far71xx%2Ffiles%2Farch%2Fmips%2Fath79%2Fmach-om2p.c;h=3b282a36ea3c8f4ed3e7795529c24af2e55fad98;hb=8010e8a37019a35b228f60603066b9465a7dbed1;hp=1855349a392d96024c88759316603720233f5c76;hpb=c5a32cfc9270d17f9b150ed2fb0aff44d56ee24d;p=openwrt%2Fopenwrt.git 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 1855349a39..3b282a36ea 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c @@ -31,7 +31,7 @@ #define OM2P_GPIO_LED_YELLOW 15 #define OM2P_GPIO_LED_LAN 16 #define OM2P_GPIO_LED_WAN 17 -#define OM2P_GPIO_BTN_RESET 11 +#define OM2P_GPIO_BTN_RESET 1 #define OM2P_KEYS_POLL_INTERVAL 20 /* msecs */ #define OM2P_KEYS_DEBOUNCE_INTERVAL (3 * OM2P_KEYS_POLL_INTERVAL) @@ -162,8 +162,8 @@ static void __init om2p_lc_setup(void) ARRAY_SIZE(om2p_gpio_keys), om2p_gpio_keys); - ath79_init_mac(ath79_eth1_data.mac_addr, mac1, 0); - ath79_init_mac(ath79_eth0_data.mac_addr, mac2, 0); + ath79_init_mac(ath79_eth0_data.mac_addr, mac1, 0); + ath79_init_mac(ath79_eth1_data.mac_addr, mac2, 0); ath79_register_mdio(0, 0x0); @@ -174,27 +174,7 @@ 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); -} +MIPS_MACHINE(ATH79_MACH_OM2Pv2, "OM2Pv2", "OpenMesh OM2Pv2", om2p_lc_setup); static void __init om2p_hs_setup(void) { @@ -208,7 +188,7 @@ static void __init om2p_hs_setup(void) /* enable reset button */ ath79_gpio_output_select(OM2P_GPIO_BTN_RESET, AR934X_GPIO_OUT_GPIO); - ath79_gpio_function_enable(AR933X_GPIO_FUNC_JTAG_DISABLE); + ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE); om2p_leds_gpio[4].gpio = OM2P_GPIO_LED_WAN; om2p_leds_gpio[5].gpio = OM2P_GPIO_LED_LAN; @@ -222,7 +202,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); @@ -242,3 +222,5 @@ static void __init om2p_hs_setup(void) } MIPS_MACHINE(ATH79_MACH_OM2P_HS, "OM2P-HS", "OpenMesh OM2P HS", om2p_hs_setup); +MIPS_MACHINE(ATH79_MACH_OM2P_HSv2, "OM2P-HSv2", "OpenMesh OM2P HSv2", om2p_hs_setup); +MIPS_MACHINE(ATH79_MACH_OM2P_HSv3, "OM2P-HSv3", "OpenMesh OM2P HSv3", om2p_hs_setup);