Skip to content

Commit

Permalink
ar71xx: add mdio hack patch
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsnowwolf committed Nov 28, 2018
1 parent 8f16df4 commit 5c58234
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 84 deletions.
7 changes: 6 additions & 1 deletion target/linux/ar71xx/config-4.14
Expand Up @@ -130,7 +130,6 @@ 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
Expand Down Expand Up @@ -223,6 +222,8 @@ 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
Expand All @@ -236,10 +237,13 @@ 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
Expand Down Expand Up @@ -484,3 +488,4 @@ 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
8 changes: 8 additions & 0 deletions target/linux/ar71xx/config-4.9
Expand Up @@ -52,6 +52,7 @@ 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
Expand Down Expand Up @@ -124,6 +125,7 @@ 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
Expand Down Expand Up @@ -220,6 +222,8 @@ 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
Expand All @@ -233,10 +237,13 @@ 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
Expand Down Expand Up @@ -480,3 +487,4 @@ 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

This file was deleted.

Expand Up @@ -35,23 +35,23 @@

/* Atmel chips don't use the same PRI format as AMD chips */
static void fixup_convert_atmel_pri(struct mtd_info *mtd)
@@ -1794,6 +1798,7 @@ static int cfi_amdstd_write_words(struct
@@ -1792,6 +1796,7 @@ static int cfi_amdstd_write_words(struct
/*
* FIXME: interleaved mode not tested, and probably not supported!
*/
+#if !FORCE_WORD_WRITE
static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
unsigned long adr, const u_char *buf,
int len)
@@ -1922,7 +1927,6 @@ static int __xipram do_write_buffer(stru
@@ -1920,7 +1925,6 @@ static int __xipram do_write_buffer(stru
return ret;
}

-
static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
@@ -1997,6 +2001,7 @@ static int cfi_amdstd_write_buffers(stru
@@ -1995,6 +1999,7 @@ static int cfi_amdstd_write_buffers(stru

return 0;
}
Expand Down
Expand Up @@ -10,7 +10,7 @@

--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1152,6 +1152,9 @@ config MIPS_MSC
@@ -1151,6 +1151,9 @@ config MIPS_MSC
config MIPS_NILE4
bool

Expand Down
Expand Up @@ -217,7 +217,7 @@
#define AR71XX_GPIO_COUNT 16
#define AR7240_GPIO_COUNT 18
#define AR7241_GPIO_COUNT 20
@@ -570,4 +681,235 @@
@@ -570,4 +681,237 @@
#define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13
#define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7

Expand Down Expand Up @@ -433,6 +433,8 @@
+#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)
Expand Down
@@ -1,6 +1,6 @@
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -203,7 +203,6 @@ config ATH79
@@ -202,7 +202,6 @@ config ATH79
select SYS_SUPPORTS_BIG_ENDIAN
select SYS_SUPPORTS_MIPS16
select SYS_SUPPORTS_ZBOOT_UART_PROM
Expand Down
@@ -1,6 +1,6 @@
--- a/drivers/mtd/redboot.c
+++ b/drivers/mtd/redboot.c
@@ -76,12 +76,18 @@ static int parse_redboot_partitions(stru
@@ -77,12 +77,18 @@ static int parse_redboot_partitions(stru
static char nullstring[] = "unallocated";
#endif

Expand All @@ -19,7 +19,7 @@
return -EIO;
}
offset -= master->erasesize;
@@ -94,10 +100,6 @@ static int parse_redboot_partitions(stru
@@ -95,10 +101,6 @@ static int parse_redboot_partitions(stru
goto nogood;
}
}
Expand All @@ -30,7 +30,7 @@

printk(KERN_NOTICE "Searching for RedBoot partition table in %s at offset 0x%lx\n",
master->name, offset);
@@ -170,6 +172,11 @@ static int parse_redboot_partitions(stru
@@ -171,6 +173,11 @@ static int parse_redboot_partitions(stru
}
if (i == numslots) {
/* Didn't find it */
Expand Down
Expand Up @@ -35,23 +35,23 @@

/* Atmel chips don't use the same PRI format as AMD chips */
static void fixup_convert_atmel_pri(struct mtd_info *mtd)
@@ -1790,6 +1794,7 @@ static int cfi_amdstd_write_words(struct
@@ -1788,6 +1792,7 @@ static int cfi_amdstd_write_words(struct
/*
* FIXME: interleaved mode not tested, and probably not supported!
*/
+#if !FORCE_WORD_WRITE
static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
unsigned long adr, const u_char *buf,
int len)
@@ -1918,7 +1923,6 @@ static int __xipram do_write_buffer(stru
@@ -1916,7 +1921,6 @@ static int __xipram do_write_buffer(stru
return ret;
}

-
static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
@@ -1993,6 +1997,7 @@ static int cfi_amdstd_write_buffers(stru
@@ -1991,6 +1995,7 @@ static int cfi_amdstd_write_buffers(stru

return 0;
}
Expand Down
Expand Up @@ -217,7 +217,7 @@
#define AR71XX_GPIO_COUNT 16
#define AR7240_GPIO_COUNT 18
#define AR7241_GPIO_COUNT 20
@@ -570,4 +681,235 @@
@@ -570,4 +681,237 @@
#define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13
#define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7

Expand Down Expand Up @@ -433,6 +433,8 @@
+#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)
Expand Down
@@ -1,6 +1,6 @@
--- a/arch/mips/ath79/prom.c
+++ b/arch/mips/ath79/prom.c
@@ -136,6 +136,31 @@ void __init prom_init(void)
@@ -136,6 +136,32 @@ void __init prom_init(void)
initrd_end = initrd_start + fw_getenvl("initrd_size");
}
#endif
Expand All @@ -22,6 +22,7 @@
+ 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") ||
Expand Down
10 changes: 5 additions & 5 deletions target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch
Expand Up @@ -621,7 +621,7 @@

#define IP6_MF 0x0001
#define IP6_OFFSET 0xFFF8
@@ -436,8 +436,8 @@ static inline void __ipv6_addr_set_half(
@@ -443,8 +443,8 @@ static inline void __ipv6_addr_set_half(
}
#endif
#endif
Expand All @@ -632,7 +632,7 @@
}

static inline void ipv6_addr_set(struct in6_addr *addr,
@@ -496,6 +496,8 @@ static inline bool ipv6_prefix_equal(con
@@ -503,6 +503,8 @@ static inline bool ipv6_prefix_equal(con
const __be32 *a1 = addr1->s6_addr32;
const __be32 *a2 = addr2->s6_addr32;
unsigned int pdw, pbi;
Expand All @@ -641,7 +641,7 @@

/* check complete u32 in prefix */
pdw = prefixlen >> 5;
@@ -504,7 +506,9 @@ static inline bool ipv6_prefix_equal(con
@@ -511,7 +513,9 @@ static inline bool ipv6_prefix_equal(con

/* check incomplete u32 in prefix */
pbi = prefixlen & 0x1f;
Expand All @@ -652,7 +652,7 @@
return false;

return true;
@@ -633,13 +637,13 @@ static inline void ipv6_addr_set_v4mappe
@@ -655,13 +659,13 @@ static inline void ipv6_addr_set_v4mappe
*/
static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen)
{
Expand All @@ -668,7 +668,7 @@
if (xb)
return i * 32 + 31 - __fls(ntohl(xb));
}
@@ -808,17 +812,18 @@ static inline int ip6_default_np_autolab
@@ -830,17 +834,18 @@ static inline int ip6_default_np_autolab
static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass,
__be32 flowlabel)
{
Expand Down
20 changes: 20 additions & 0 deletions target/linux/ar71xx/patches-4.9/999-mdio_hack.patch
@@ -0,0 +1,20 @@
--- 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;

0 comments on commit 5c58234

Please sign in to comment.