0007-ar71xx-refactor-ubnt-xw-board-setup.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Wed, 26 Nov 2014 23:20:33 +0100
  3. Subject: ar71xx: refactor ubnt xw board setup
  4. Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
  5. diff --git a/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch b/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch
  6. index ed2fd24..9413bd8 100644
  7. --- a/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch
  8. +++ b/target/linux/ar71xx/patches-3.10/616-MIPS-ath79-ubnt-xw.patch
  9. @@ -1,6 +1,8 @@
  10. ---- a/arch/mips/ath79/mach-ubnt-xm.c
  11. -+++ b/arch/mips/ath79/mach-ubnt-xm.c
  12. -@@ -332,3 +332,60 @@ static void __init ubnt_uap_pro_setup(vo
  13. +Index: linux-3.10.49/arch/mips/ath79/mach-ubnt-xm.c
  14. +===================================================================
  15. +--- linux-3.10.49.orig/arch/mips/ath79/mach-ubnt-xm.c 2014-08-15 22:55:37.890080659 +0200
  16. ++++ linux-3.10.49/arch/mips/ath79/mach-ubnt-xm.c 2014-08-15 22:58:31.061570912 +0200
  17. +@@ -332,3 +332,67 @@
  18. MIPS_MACHINE(ATH79_MACH_UBNT_UAP_PRO, "UAP-PRO", "Ubiquiti UniFi AP Pro",
  19. ubnt_uap_pro_setup);
  20. @@ -29,7 +31,7 @@
  21. + },
  22. +};
  23. +
  24. -+static void __init ubnt_nano_m_xw_setup(void)
  25. ++static void __init ubnt_xw_init(void)
  26. +{
  27. + u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff0000);
  28. +
  29. @@ -44,26 +46,36 @@
  30. + ath79_register_wmac(eeprom + UAP_PRO_WMAC_CALDATA_OFFSET, NULL);
  31. + ap91_pci_init(eeprom + UAP_PRO_PCI_CALDATA_OFFSET, NULL);
  32. +
  33. -+ ath79_register_mdio(0, ~(BIT(0) | BIT(1) | BIT(5)));
  34. +
  35. + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_MII_GMAC0 | AR934X_ETH_CFG_MII_GMAC0_SLAVE);
  36. + ath79_init_mac(ath79_eth0_data.mac_addr,
  37. + eeprom + UAP_PRO_MAC0_OFFSET, 0);
  38. +
  39. -+ /* GMAC0 is connected to an AR8326 switch */
  40. + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
  41. ++ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
  42. ++}
  43. ++
  44. ++static void __init ubnt_nano_m_xw_setup(void)
  45. ++{
  46. ++ ubnt_xw_init();
  47. ++
  48. ++ /* GMAC0 is connected to an AR8326 switch */
  49. ++ ath79_register_mdio(0, ~(BIT(0) | BIT(1) | BIT(5)));
  50. + ath79_eth0_data.phy_mask = (BIT(0) | BIT(1) | BIT(5));
  51. + ath79_eth0_data.speed = SPEED_100;
  52. + ath79_eth0_data.duplex = DUPLEX_FULL;
  53. -+ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
  54. + ath79_register_eth(0);
  55. +}
  56. +
  57. +MIPS_MACHINE(ATH79_MACH_UBNT_NANO_M_XW, "UBNT-NM-XW", "Ubiquiti Nanostation M XW",
  58. + ubnt_nano_m_xw_setup);
  59. ++
  60. --- a/arch/mips/ath79/machtypes.h
  61. +++ b/arch/mips/ath79/machtypes.h
  62. -@@ -124,6 +124,7 @@ enum ath79_mach_type {
  63. +@@ -121,9 +121,10 @@ enum ath79_mach_type {
  64. + ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */
  65. + ATH79_MACH_UBNT_AIRROUTER, /* Ubiquiti AirRouter */
  66. + ATH79_MACH_UBNT_BULLET_M, /* Ubiquiti Bullet M */
  67. ATH79_MACH_UBNT_LSSR71, /* Ubiquiti LS-SR71 */
  68. ATH79_MACH_UBNT_LSX, /* Ubiquiti LSX */
  69. ATH79_MACH_UBNT_NANO_M, /* Ubiquiti NanoStation M */