Skip to content

Commit

Permalink
switch ar71xx to kernel 4.14
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsnowwolf committed Sep 18, 2018
1 parent 72e44c8 commit 35fe259
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 7 deletions.
2 changes: 1 addition & 1 deletion target/linux/ar71xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FEATURES:=usbgadget
CPU_TYPE:=24kc
SUBTARGETS:=generic tiny nand mikrotik

KERNEL_PATCHVER:=4.9
KERNEL_PATCHVER:=4.14

include $(INCLUDE_DIR)/target.mk

Expand Down
1 change: 0 additions & 1 deletion target/linux/ar71xx/config-4.14
Original file line number Diff line number Diff line change
Expand Up @@ -483,4 +483,3 @@ CONFIG_SYS_SUPPORTS_ZBOOT=y
CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_USB_SUPPORT=y
CONFIG_MIPS_FPU_EMULATOR=y
4 changes: 0 additions & 4 deletions target/linux/ar71xx/config-4.9
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,6 @@ CONFIG_ATH79=y
# CONFIG_ATH79_PCI_ATH9K_FIXUP is not set
# CONFIG_ATH79_ROUTERBOOT is not set
CONFIG_ATH79_WDT=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_CEVT_R4K=y
CONFIG_CLKDEV_LOOKUP=y
CONFIG_CLONE_BACKWARDS=y
Expand Down Expand Up @@ -399,7 +397,6 @@ CONFIG_MIPS_ASID_SHIFT=0
CONFIG_MIPS_CLOCK_VSYSCALL=y
# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
CONFIG_MIPS_FPU_EMULATOR=y
# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set
CONFIG_MIPS_L1_CACHE_SHIFT=5
CONFIG_MIPS_MACHINE=y
Expand Down Expand Up @@ -455,7 +452,6 @@ CONFIG_RTL8367_PHY=y
# CONFIG_SERIAL_8250_FSL is not set
CONFIG_SERIAL_8250_NR_UARTS=1
CONFIG_SERIAL_8250_RUNTIME_UARTS=1
# CONFIG_SHORTCUT_FE is not set
# CONFIG_SOC_AR71XX is not set
# CONFIG_SOC_AR724X is not set
# CONFIG_SOC_AR913X is not set
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -227,6 +227,7 @@ cflags-$(toolchain-virt) += -DTOOLCHAIN
@@ -223,6 +223,7 @@ cflags-$(toolchain-virt) += -DTOOLCHAIN
#
libs-$(CONFIG_FW_ARC) += arch/mips/fw/arc/
libs-$(CONFIG_FW_CFE) += arch/mips/fw/cfe/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
--- a/drivers/net/phy/mdio-boardinfo.c
+++ b/drivers/net/phy/mdio-boardinfo.c
@@ -15,8 +15,11 @@

#include "mdio-boardinfo.h"

-static LIST_HEAD(mdio_board_list);
-static DEFINE_MUTEX(mdio_board_lock);
+LIST_HEAD(mdio_board_list);
+EXPORT_SYMBOL_GPL(mdio_board_list);
+
+DEFINE_MUTEX(mdio_board_lock);
+EXPORT_SYMBOL_GPL(mdio_board_lock);

/**
* mdiobus_setup_mdiodev_from_board_info - create and setup MDIO devices
--- a/drivers/net/phy/mdio-boardinfo.h
+++ b/drivers/net/phy/mdio-boardinfo.h
@@ -20,4 +20,7 @@ void mdiobus_setup_mdiodev_from_board_in
(struct mii_bus *bus,
struct mdio_board_info *bi));

+extern struct mutex mdio_board_lock;
+extern struct list_head mdio_board_list;
+
#endif /* __MDIO_BOARD_INFO_H */
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -455,6 +455,17 @@ void mdiobus_free(struct mii_bus *bus)
}
EXPORT_SYMBOL(mdiobus_free);

+static void mdiobus_setup_phydev_from_boardinfo(struct mii_bus *bus,
+ struct phy_device *phydev,
+ struct mdio_board_info *bi)
+{
+ if (strcmp(bus->id, bi->bus_id) ||
+ bi->mdio_addr != phydev->mdio.addr)
+ return;
+
+ phydev->mdio.dev.platform_data = (void *) bi->platform_data;
+}
+
/**
* mdiobus_scan - scan a bus for MDIO devices.
* @bus: mii_bus to scan
@@ -470,6 +481,7 @@ EXPORT_SYMBOL(mdiobus_free);
struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr)
{
struct phy_device *phydev;
+ struct mdio_board_entry *be;
int err;

phydev = get_phy_device(bus, addr, false);
@@ -482,6 +494,12 @@ struct phy_device *mdiobus_scan(struct m
*/
of_mdiobus_link_mdiodev(bus, &phydev->mdio);

+ mutex_lock(&mdio_board_lock);
+ list_for_each_entry(be, &mdio_board_list, list)
+ mdiobus_setup_phydev_from_boardinfo(bus, phydev,
+ &be->board_info);
+ mutex_unlock(&mdio_board_lock);
+
err = phy_device_register(phydev);
if (err) {
phy_device_free(phydev);

0 comments on commit 35fe259

Please sign in to comment.