[OpenWrt-Devel] [RFC v2 2/6] ar71xx: Save GMAC id in ag71xx_platform_data

Sven Eckelmann sven.eckelmann at open-mesh.com
Tue Apr 5 09:32:09 EDT 2016


From: Sven Eckelmann <sven.eckelmann at open-mesh.com>

The ag71xx driver must know which GMAC is is currently handling to enable
some special workarounds for this GMAC. GMAC0 has some registers on
QCA9558 which GMAC1 doesn't have.

Signed-off-by: Sven Eckelmann <sven.eckelmann at open-mesh.com>
---
v2:
 - Split into multiple patches and adjust slightly to look more like an
   OpenWrt patch

 target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c                     | 1 +
 .../ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h     | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
index 09201c9..bfcc82f 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
@@ -871,6 +871,7 @@ void __init ath79_register_eth(unsigned int id)
 
 	pdata->max_frame_len = 1540;
 	pdata->desc_pktlen_mask = 0xfff;
+	pdata->gmac_num = id;
 
 	err = ath79_setup_phy_if_mode(id, pdata);
 	if (err) {
diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
index 4db2c65..5e4edae 100644
--- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
+++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
@@ -38,6 +38,8 @@ struct ag71xx_platform_data {
 	u8		has_ar8216:1;
 	u8		is_qca955x:1;
 
+	unsigned int	gmac_num;
+
 	struct ag71xx_switch_platform_data *switch_data;
 
 	void		(*ddr_flush)(void);
-- 
2.8.0.rc3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list