From 35fe25977c3d18baa30f401e29a9aee1f8840e89 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 18 Sep 2018 13:11:51 +0800 Subject: [PATCH] switch ar71xx to kernel 4.14 --- target/linux/ar71xx/Makefile | 2 +- target/linux/ar71xx/config-4.14 | 1 - target/linux/ar71xx/config-4.9 | 4 -- .../patches-4.14/500-MIPS-fw-myloader.patch | 2 +- .../950-add-boardinfo-platform-data.patch | 67 +++++++++++++++++++ 5 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 target/linux/ar71xx/patches-4.14/950-add-boardinfo-platform-data.patch diff --git a/target/linux/ar71xx/Makefile b/target/linux/ar71xx/Makefile index 104961929..71fe02f32 100644 --- a/target/linux/ar71xx/Makefile +++ b/target/linux/ar71xx/Makefile @@ -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 diff --git a/target/linux/ar71xx/config-4.14 b/target/linux/ar71xx/config-4.14 index 61290b515..535b5195c 100644 --- a/target/linux/ar71xx/config-4.14 +++ b/target/linux/ar71xx/config-4.14 @@ -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 diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 28ca1a196..8d25692ec 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -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 @@ -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 @@ -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 diff --git a/target/linux/ar71xx/patches-4.14/500-MIPS-fw-myloader.patch b/target/linux/ar71xx/patches-4.14/500-MIPS-fw-myloader.patch index 1250a41b3..4ac1fd193 100644 --- a/target/linux/ar71xx/patches-4.14/500-MIPS-fw-myloader.patch +++ b/target/linux/ar71xx/patches-4.14/500-MIPS-fw-myloader.patch @@ -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/ diff --git a/target/linux/ar71xx/patches-4.14/950-add-boardinfo-platform-data.patch b/target/linux/ar71xx/patches-4.14/950-add-boardinfo-platform-data.patch new file mode 100644 index 000000000..edeac838d --- /dev/null +++ b/target/linux/ar71xx/patches-4.14/950-add-boardinfo-platform-data.patch @@ -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);