From 8f16df49ed93c18f5102570ebac5b7a9b1a125d8 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 28 Nov 2018 22:55:14 +0800 Subject: [PATCH] ar71xx: update kernel patch to upstream --- target/linux/ar71xx/config-4.14 | 8 +-- target/linux/ar71xx/config-4.9 | 9 --- ...mtd_fix_cfi_cmdset_0002_status_check.patch | 64 +++++++++++++++++++ ...mtd-cfi_cmdset_0002-force-word-write.patch | 6 +- ...MIPS-ath79-add-more-register-defines.patch | 4 +- .../408-mtd-redboot_partition_scan.patch | 6 +- ...mtd-cfi_cmdset_0002-force-word-write.patch | 6 +- ...MIPS-ath79-add-more-register-defines.patch | 4 +- ...MIPS-ath79-add-routerboard-detection.patch | 3 +- .../910-unaligned_access_hacks.patch | 10 +-- .../ar71xx/patches-4.9/999-mdio_hack.patch | 20 ------ 11 files changed, 82 insertions(+), 58 deletions(-) create mode 100644 target/linux/ar71xx/patches-4.14/403-mtd_fix_cfi_cmdset_0002_status_check.patch delete mode 100644 target/linux/ar71xx/patches-4.9/999-mdio_hack.patch diff --git a/target/linux/ar71xx/config-4.14 b/target/linux/ar71xx/config-4.14 index 3b37a8a03..9a524fae4 100644 --- a/target/linux/ar71xx/config-4.14 +++ b/target/linux/ar71xx/config-4.14 @@ -130,6 +130,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_GL_INET is not set # CONFIG_ATH79_MACH_GL_MIFI is not set # CONFIG_ATH79_MACH_GL_USB150 is not set +# CONFIG_ATH79_MACH_GS_MINIBOX_V32 is not set # CONFIG_ATH79_MACH_GS_OOLITE_V1 is not set # CONFIG_ATH79_MACH_GS_OOLITE_V5_2 is not set # CONFIG_ATH79_MACH_HIVEAP_121 is not set @@ -222,8 +223,6 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set # CONFIG_ATH79_MACH_TL_WR1043ND_V4 is not set # CONFIG_ATH79_MACH_TL_WR1043N_V5 is not set -# CONFIG_ATH79_MACH_TL_WR2041N_V1 is not set -# CONFIG_ATH79_MACH_TL_WR2041N_V2 is not set # CONFIG_ATH79_MACH_TL_WR2543N is not set # CONFIG_ATH79_MACH_TL_WR703N is not set # CONFIG_ATH79_MACH_TL_WR720N_V3 is not set @@ -237,13 +236,10 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_TL_WR841N_V1 is not set # CONFIG_ATH79_MACH_TL_WR841N_V8 is not set # CONFIG_ATH79_MACH_TL_WR841N_V9 is not set -# CONFIG_ATH79_MACH_TL_WR880N_V1 is not set -# CONFIG_ATH79_MACH_TL_WR881N_V1 is not set # CONFIG_ATH79_MACH_TL_WR902AC_V1 is not set # CONFIG_ATH79_MACH_TL_WR940N_V4 is not set # CONFIG_ATH79_MACH_TL_WR941ND is not set # CONFIG_ATH79_MACH_TL_WR941ND_V6 is not set -# CONFIG_ATH79_MACH_TL_WR941N_V7 is not set # CONFIG_ATH79_MACH_TL_WR942N_V1 is not set # CONFIG_ATH79_MACH_TS_D084 is not set # CONFIG_ATH79_MACH_TUBE2H is not set @@ -422,7 +418,6 @@ CONFIG_MTD_PHYSMAP=y CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-2 CONFIG_MTD_REDBOOT_PARTS=y CONFIG_MTD_SPI_NOR=y -# CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set CONFIG_MTD_SPLIT_EVA_FW=y CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_LZMA_FW=y @@ -489,4 +484,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 aaaef61e5..8aa0b41ae 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -52,7 +52,6 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set # CONFIG_ATH79_MACH_ARCHER_C58_V1 is not set # CONFIG_ATH79_MACH_ARCHER_C59_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C59_V2 is not set # CONFIG_ATH79_MACH_ARCHER_C60_V1 is not set # CONFIG_ATH79_MACH_ARCHER_C60_V2 is not set # CONFIG_ATH79_MACH_ARCHER_C7 is not set @@ -125,7 +124,6 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_GL_AR300 is not set # CONFIG_ATH79_MACH_GL_AR300M is not set # CONFIG_ATH79_MACH_GL_AR750 is not set -# CONFIG_ATH79_MACH_GL_AR750S is not set # CONFIG_ATH79_MACH_GL_DOMINO is not set # CONFIG_ATH79_MACH_GL_INET is not set # CONFIG_ATH79_MACH_GL_MIFI is not set @@ -222,8 +220,6 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set # CONFIG_ATH79_MACH_TL_WR1043ND_V4 is not set # CONFIG_ATH79_MACH_TL_WR1043N_V5 is not set -# CONFIG_ATH79_MACH_TL_WR2041N_V1 is not set -# CONFIG_ATH79_MACH_TL_WR2041N_V2 is not set # CONFIG_ATH79_MACH_TL_WR2543N is not set # CONFIG_ATH79_MACH_TL_WR703N is not set # CONFIG_ATH79_MACH_TL_WR720N_V3 is not set @@ -237,13 +233,10 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_TL_WR841N_V1 is not set # CONFIG_ATH79_MACH_TL_WR841N_V8 is not set # CONFIG_ATH79_MACH_TL_WR841N_V9 is not set -# CONFIG_ATH79_MACH_TL_WR880N_V1 is not set -# CONFIG_ATH79_MACH_TL_WR881N_V1 is not set # CONFIG_ATH79_MACH_TL_WR902AC_V1 is not set # CONFIG_ATH79_MACH_TL_WR940N_V4 is not set # CONFIG_ATH79_MACH_TL_WR941ND is not set # CONFIG_ATH79_MACH_TL_WR941ND_V6 is not set -# CONFIG_ATH79_MACH_TL_WR941N_V7 is not set # CONFIG_ATH79_MACH_TL_WR942N_V1 is not set # CONFIG_ATH79_MACH_TS_D084 is not set # CONFIG_ATH79_MACH_TUBE2H is not set @@ -421,7 +414,6 @@ CONFIG_MTD_PHYSMAP=y CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-2 CONFIG_MTD_REDBOOT_PARTS=y CONFIG_MTD_SPI_NOR=y -# CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set CONFIG_MTD_SPLIT_EVA_FW=y CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_LZMA_FW=y @@ -488,4 +480,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/patches-4.14/403-mtd_fix_cfi_cmdset_0002_status_check.patch b/target/linux/ar71xx/patches-4.14/403-mtd_fix_cfi_cmdset_0002_status_check.patch new file mode 100644 index 000000000..3c1f62fa0 --- /dev/null +++ b/target/linux/ar71xx/patches-4.14/403-mtd_fix_cfi_cmdset_0002_status_check.patch @@ -0,0 +1,64 @@ +--- a/drivers/mtd/chips/cfi_cmdset_0002.c ++++ b/drivers/mtd/chips/cfi_cmdset_0002.c +@@ -1635,8 +1635,8 @@ static int __xipram do_write_oneword(str + break; + } + +- if (chip_ready(map, adr)) +- break; ++ if (chip_good(map, adr, datum)) ++ goto enable_xip; + + /* Latency issues. Drop the lock, wait a while and retry */ + UDELAY(map, chip, adr, 1); +@@ -1652,6 +1652,8 @@ static int __xipram do_write_oneword(str + + ret = -EIO; + } ++ ++ enable_xip: + xip_enable(map, chip, adr); + op_done: + if (mode == FL_OTP_WRITE) +@@ -2230,7 +2232,6 @@ static int cfi_amdstd_panic_write(struct + return 0; + } + +- + /* + * Handle devices with one erase region, that only implement + * the chip erase command. +@@ -2298,7 +2299,7 @@ static int __xipram do_erase_chip(struct + } + + if (chip_good(map, adr, map_word_ff(map))) +- break; ++ goto op_done; + + if (time_after(jiffies, timeo)) { + printk(KERN_WARNING "MTD %s(): software timeout\n", +@@ -2322,6 +2323,7 @@ static int __xipram do_erase_chip(struct + } + } + ++ op_done: + chip->state = FL_READY; + xip_enable(map, chip, adr); + DISABLE_VPP(map); +@@ -2395,7 +2397,7 @@ static int __xipram do_erase_oneblock(st + + if (chip_good(map, adr, map_word_ff(map))) { + xip_enable(map, chip, adr); +- break; ++ goto op_done; + } + + if (time_after(jiffies, timeo)) { +@@ -2421,6 +2423,7 @@ static int __xipram do_erase_oneblock(st + } + } + ++ op_done: + chip->state = FL_READY; + DISABLE_VPP(map); + put_chip(map, chip, adr); diff --git a/target/linux/ar71xx/patches-4.14/411-mtd-cfi_cmdset_0002-force-word-write.patch b/target/linux/ar71xx/patches-4.14/411-mtd-cfi_cmdset_0002-force-word-write.patch index b28d6c1c2..3862dfd14 100644 --- a/target/linux/ar71xx/patches-4.14/411-mtd-cfi_cmdset_0002-force-word-write.patch +++ b/target/linux/ar71xx/patches-4.14/411-mtd-cfi_cmdset_0002-force-word-write.patch @@ -35,7 +35,7 @@ /* Atmel chips don't use the same PRI format as AMD chips */ static void fixup_convert_atmel_pri(struct mtd_info *mtd) -@@ -1792,6 +1796,7 @@ static int cfi_amdstd_write_words(struct +@@ -1794,6 +1798,7 @@ static int cfi_amdstd_write_words(struct /* * FIXME: interleaved mode not tested, and probably not supported! */ @@ -43,7 +43,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, unsigned long adr, const u_char *buf, int len) -@@ -1920,7 +1925,6 @@ static int __xipram do_write_buffer(stru +@@ -1922,7 +1927,6 @@ static int __xipram do_write_buffer(stru return ret; } @@ -51,7 +51,7 @@ static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) { -@@ -1995,6 +1999,7 @@ static int cfi_amdstd_write_buffers(stru +@@ -1997,6 +2001,7 @@ static int cfi_amdstd_write_buffers(stru return 0; } diff --git a/target/linux/ar71xx/patches-4.14/601-MIPS-ath79-add-more-register-defines.patch b/target/linux/ar71xx/patches-4.14/601-MIPS-ath79-add-more-register-defines.patch index 77a646378..d0f5b7890 100644 --- a/target/linux/ar71xx/patches-4.14/601-MIPS-ath79-add-more-register-defines.patch +++ b/target/linux/ar71xx/patches-4.14/601-MIPS-ath79-add-more-register-defines.patch @@ -217,7 +217,7 @@ #define AR71XX_GPIO_COUNT 16 #define AR7240_GPIO_COUNT 18 #define AR7241_GPIO_COUNT 20 -@@ -570,4 +681,237 @@ +@@ -570,4 +681,235 @@ #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13 #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7 @@ -433,8 +433,6 @@ +#define QCA955X_GMAC_REG_ETH_CFG 0x00 + +#define QCA955X_ETH_CFG_RGMII_EN BIT(0) -+#define QCA955X_ETH_CFG_GE0_MII_EN BIT(1) -+#define QCA955X_ETH_CFG_GE0_MII_SLAVE BIT(4) +#define QCA955X_ETH_CFG_MII_GE0 BIT(1) +#define QCA955X_ETH_CFG_GMII_GE0 BIT(2) +#define QCA955X_ETH_CFG_MII_GE0_MASTER BIT(3) diff --git a/target/linux/ar71xx/patches-4.9/408-mtd-redboot_partition_scan.patch b/target/linux/ar71xx/patches-4.9/408-mtd-redboot_partition_scan.patch index 18ff52aca..cd41e7ceb 100644 --- a/target/linux/ar71xx/patches-4.9/408-mtd-redboot_partition_scan.patch +++ b/target/linux/ar71xx/patches-4.9/408-mtd-redboot_partition_scan.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/redboot.c +++ b/drivers/mtd/redboot.c -@@ -77,12 +77,18 @@ static int parse_redboot_partitions(stru +@@ -76,12 +76,18 @@ static int parse_redboot_partitions(stru static char nullstring[] = "unallocated"; #endif @@ -19,7 +19,7 @@ return -EIO; } offset -= master->erasesize; -@@ -95,10 +101,6 @@ static int parse_redboot_partitions(stru +@@ -94,10 +100,6 @@ static int parse_redboot_partitions(stru goto nogood; } } @@ -30,7 +30,7 @@ printk(KERN_NOTICE "Searching for RedBoot partition table in %s at offset 0x%lx\n", master->name, offset); -@@ -171,6 +173,11 @@ static int parse_redboot_partitions(stru +@@ -170,6 +172,11 @@ static int parse_redboot_partitions(stru } if (i == numslots) { /* Didn't find it */ diff --git a/target/linux/ar71xx/patches-4.9/411-mtd-cfi_cmdset_0002-force-word-write.patch b/target/linux/ar71xx/patches-4.9/411-mtd-cfi_cmdset_0002-force-word-write.patch index ddd69f17e..aa708e01a 100644 --- a/target/linux/ar71xx/patches-4.9/411-mtd-cfi_cmdset_0002-force-word-write.patch +++ b/target/linux/ar71xx/patches-4.9/411-mtd-cfi_cmdset_0002-force-word-write.patch @@ -35,7 +35,7 @@ /* Atmel chips don't use the same PRI format as AMD chips */ static void fixup_convert_atmel_pri(struct mtd_info *mtd) -@@ -1788,6 +1792,7 @@ static int cfi_amdstd_write_words(struct +@@ -1790,6 +1794,7 @@ static int cfi_amdstd_write_words(struct /* * FIXME: interleaved mode not tested, and probably not supported! */ @@ -43,7 +43,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, unsigned long adr, const u_char *buf, int len) -@@ -1916,7 +1921,6 @@ static int __xipram do_write_buffer(stru +@@ -1918,7 +1923,6 @@ static int __xipram do_write_buffer(stru return ret; } @@ -51,7 +51,7 @@ static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) { -@@ -1991,6 +1995,7 @@ static int cfi_amdstd_write_buffers(stru +@@ -1993,6 +1997,7 @@ static int cfi_amdstd_write_buffers(stru return 0; } diff --git a/target/linux/ar71xx/patches-4.9/601-MIPS-ath79-add-more-register-defines.patch b/target/linux/ar71xx/patches-4.9/601-MIPS-ath79-add-more-register-defines.patch index 77a646378..d0f5b7890 100644 --- a/target/linux/ar71xx/patches-4.9/601-MIPS-ath79-add-more-register-defines.patch +++ b/target/linux/ar71xx/patches-4.9/601-MIPS-ath79-add-more-register-defines.patch @@ -217,7 +217,7 @@ #define AR71XX_GPIO_COUNT 16 #define AR7240_GPIO_COUNT 18 #define AR7241_GPIO_COUNT 20 -@@ -570,4 +681,237 @@ +@@ -570,4 +681,235 @@ #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13 #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7 @@ -433,8 +433,6 @@ +#define QCA955X_GMAC_REG_ETH_CFG 0x00 + +#define QCA955X_ETH_CFG_RGMII_EN BIT(0) -+#define QCA955X_ETH_CFG_GE0_MII_EN BIT(1) -+#define QCA955X_ETH_CFG_GE0_MII_SLAVE BIT(4) +#define QCA955X_ETH_CFG_MII_GE0 BIT(1) +#define QCA955X_ETH_CFG_GMII_GE0 BIT(2) +#define QCA955X_ETH_CFG_MII_GE0_MASTER BIT(3) diff --git a/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch b/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch index ae9e7772b..64c7e881a 100644 --- a/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch +++ b/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ath79/prom.c +++ b/arch/mips/ath79/prom.c -@@ -136,6 +136,32 @@ void __init prom_init(void) +@@ -136,6 +136,31 @@ void __init prom_init(void) initrd_end = initrd_start + fw_getenvl("initrd_size"); } #endif @@ -22,7 +22,6 @@ + strstr(arcs_cmdline, "board=map-hb") || + strstr(arcs_cmdline, "board=map2-hb") || + strstr(arcs_cmdline, "board=wap-hb") || -+ strstr(arcs_cmdline, "board=wap-lte") || + strstr(arcs_cmdline, "board=wapg-sc") || + strstr(arcs_cmdline, "board=2011L") || + strstr(arcs_cmdline, "board=2011r") || diff --git a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch index 049ee78d3..7fb38784f 100644 --- a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch @@ -621,7 +621,7 @@ #define IP6_MF 0x0001 #define IP6_OFFSET 0xFFF8 -@@ -443,8 +443,8 @@ static inline void __ipv6_addr_set_half( +@@ -436,8 +436,8 @@ static inline void __ipv6_addr_set_half( } #endif #endif @@ -632,7 +632,7 @@ } static inline void ipv6_addr_set(struct in6_addr *addr, -@@ -503,6 +503,8 @@ static inline bool ipv6_prefix_equal(con +@@ -496,6 +496,8 @@ static inline bool ipv6_prefix_equal(con const __be32 *a1 = addr1->s6_addr32; const __be32 *a2 = addr2->s6_addr32; unsigned int pdw, pbi; @@ -641,7 +641,7 @@ /* check complete u32 in prefix */ pdw = prefixlen >> 5; -@@ -511,7 +513,9 @@ static inline bool ipv6_prefix_equal(con +@@ -504,7 +506,9 @@ static inline bool ipv6_prefix_equal(con /* check incomplete u32 in prefix */ pbi = prefixlen & 0x1f; @@ -652,7 +652,7 @@ return false; return true; -@@ -655,13 +659,13 @@ static inline void ipv6_addr_set_v4mappe +@@ -633,13 +637,13 @@ static inline void ipv6_addr_set_v4mappe */ static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen) { @@ -668,7 +668,7 @@ if (xb) return i * 32 + 31 - __fls(ntohl(xb)); } -@@ -830,17 +834,18 @@ static inline int ip6_default_np_autolab +@@ -808,17 +812,18 @@ static inline int ip6_default_np_autolab static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass, __be32 flowlabel) { diff --git a/target/linux/ar71xx/patches-4.9/999-mdio_hack.patch b/target/linux/ar71xx/patches-4.9/999-mdio_hack.patch deleted file mode 100644 index 846c6a52a..000000000 --- a/target/linux/ar71xx/patches-4.9/999-mdio_hack.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/drivers/net/phy/mdio-boardinfo.c -+++ b/drivers/net/phy/mdio-boardinfo.c -@@ -49,6 +49,7 @@ mdiobus_register_board_info(struct mdio_ - - for (i = 0; i < n; i++, be++, info++) { - memcpy(&be->board_info, info, sizeof(*info)); -+ be->board_info.phy_addr = be->board_info.mdio_addr; - mutex_lock(&__mdio_board_lock); - list_add_tail(&be->list, &__mdio_board_list); - mutex_unlock(&__mdio_board_lock); ---- a/include/linux/phy.h -+++ b/include/linux/phy.h -@@ -872,6 +872,7 @@ extern struct bus_type mdio_bus_type; - - struct mdio_board_info { - const char *bus_id; -+ int mdio_addr; - int phy_addr; - - const void *platform_data;