Skip to contentSkip to conversation

net: Add ag7xxx driver for Atheros MIPS

RFC PATCH New Marek Vasut 2 participants 3 messages Jan 27, 2016 – Jan 28, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 net: Add ag7xxx driver for Atheros MIPS

Add ethernet driver for the AR71xx and AR9xxx Atheros MIPS machines.

Cc Daniel Schwierzeck <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Wills Wang <[email protected]>
---
 arch/mips/dts/ap121.dts    |   8 +
 arch/mips/dts/ar933x.dtsi  |  16 +
 arch/mips/mach-ath79/cpu.c |  47 +++
 configs/ap121_defconfig    |   1 +
 drivers/net/Kconfig        |   9 +
 drivers/net/Makefile       |   1 +
 drivers/net/ag7xxx.c       | 794 +++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 876 insertions(+)
 create mode 100644 drivers/net/ag7xxx.c

NOTE: This is RFC patch, it is by no means a standard submission, but it should
give you some starting point for the ethernet driver.
NOTE: The driver works and I can transfer data via TFTP, but this patch needs
splitting and cleanup. Some FIXMEs need to be sorted out of course.
NOTE: This is only tested on ar9331.

arch/mips/dts/ap121.dts +8 -0
index 00bdd8b..337ae8f 100644
@@ -21,6 +21,14 @@
 	};
 };
 
+&gmac0 {
+	status = "okay";
+};
+
+&gmac1 {
+	status = "okay";
+};
+
 &xtal {
 	clock-frequency = <25000000>;
 };
arch/mips/dts/ar933x.dtsi +16 -0
index a75e173..f71a31f 100644
@@ -62,6 +62,22 @@
 
 				status = "disabled";
 			};
+
+			gmac0: eth at 0x19000000 {
+				compatible = "qca,ag7240-mac";
+				reg = <0x19000000 0x200>;
+				phy-mode = "rmii";
+
+				status = "disabled";
+			};
+
+			gmac1: eth at 0x1a000000 {
+				compatible = "qca,ag7240-mac";
+				reg = <0x1a000000 0x200>;
+				phy-mode = "rgmii";
+
+				status = "disabled";
+			};
 		};
 
 		spi0: spi at 1f000000 {
arch/mips/mach-ath79/cpu.c +47 -0

50 lines not on this page · raw message

configs/ap121_defconfig +1 -0
index 0e2c7e8..7b76429 100644
@@ -29,6 +29,7 @@ CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
 CONFIG_USB_STORAGE=y
+CONFIG_AG7XXX=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_WINBOND=y
drivers/net/Kconfig +9 -0
index de54ca8..5a5a954 100644
@@ -25,6 +25,15 @@ menuconfig NETDEVICES
 
 if NETDEVICES
 
+config AG7XXX
+	bool "Atheros AG7xxx Ethernet MAC support"
+	depends on DM_ETH
+	select PHYLIB
+	help
+	  This driver supports the Atheros AG7xxx Ethernet MAC. This MAC is
+	  present in the Atheros AR7xxx, AR9xxx and QCA9xxx MIPS chips.
+
+
 config ALTERA_TSE
 	bool "Altera Triple-Speed Ethernet MAC support"
 	depends on DM_ETH
drivers/net/Makefile +1 -0
index 150470c..384735a 100644
@@ -7,6 +7,7 @@
 
 obj-$(CONFIG_PPC4xx_EMAC) += 4xx_enet.o
 obj-$(CONFIG_ALTERA_TSE) += altera_tse.o
+obj-$(CONFIG_AG7XXX) += ag7xxx.o
 obj-$(CONFIG_ARMADA100_FEC) += armada100_fec.o
 obj-$(CONFIG_DRIVER_AT91EMAC) += at91_emac.o
 obj-$(CONFIG_DRIVER_AX88180) += ax88180.o
drivers/net/ag7xxx.c new file +794 -0

794 lines not on this page · raw message

Signature · 1 line
2.1.4
#1 lore raw

RFC PATCH 1/1 net: Add ag7xxx driver for Atheros MIPS

Hi Marek,

Quoted 17 lines · Marek Vasut

Add ethernet driver for the AR71xx and AR9xxx Atheros MIPS machines.

Cc Daniel Schwierzeck <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Wills Wang <[email protected]>
---
 arch/mips/dts/ap121.dts    |   8 +
 arch/mips/dts/ar933x.dtsi  |  16 +
 arch/mips/mach-ath79/cpu.c |  47 +++
 configs/ap121_defconfig    |   1 +
 drivers/net/Kconfig        |   9 +
 drivers/net/Makefile       |   1 +
 drivers/net/ag7xxx.c       | 794 +++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 876 insertions(+)
 create mode 100644 drivers/net/ag7xxx.c
Quoted 5 lines

NOTE: This is RFC patch, it is by no means a standard submission, but it should
give you some starting point for the ethernet driver.
NOTE: The driver works and I can transfer data via TFTP, but this patch needs
splitting and cleanup. Some FIXMEs need to be sorted out of course.
NOTE: This is only tested on ar9331.

What is your plan for this?

Are you wanting a review to continue improvements (sounds like you already know of some improvements needed)?

Are you transferring it to someone else to complete? If so, who?

Thanks,
-Joe

#2 lore raw

RFC PATCH 1/1 net: Add ag7xxx driver for Atheros MIPS

Quoted 30 lines · Joe Hershberger

Hi Marek,

Quoted 27 lines · Marek Vasut

Add ethernet driver for the AR71xx and AR9xxx Atheros MIPS machines.

Cc Daniel Schwierzeck <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Wills Wang <[email protected]>

---

 arch/mips/dts/ap121.dts    |   8 +
 arch/mips/dts/ar933x.dtsi  |  16 +
 arch/mips/mach-ath79/cpu.c |  47 +++
 configs/ap121_defconfig    |   1 +
 drivers/net/Kconfig        |   9 +
 drivers/net/Makefile       |   1 +
 drivers/net/ag7xxx.c       | 794
 +++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 876
 insertions(+)
 create mode 100644 drivers/net/ag7xxx.c

NOTE: This is RFC patch, it is by no means a standard submission, but it should

give you some starting point for the ethernet driver.

NOTE: The driver works and I can transfer data via TFTP, but this patch needs

Quoted 8 lines
Quoted 3 lines

splitting and cleanup. Some FIXMEs need to be sorted out of course.

NOTE: This is only tested on ar9331.

What is your plan for this?

Are you wanting a review to continue improvements (sounds like you already know of some improvements needed)?

A review (sans the few FIXME parts) would be nice. Also, the DT bindings and config bits should be split from the patch of course during the official submission.

Quoted 1 line

Are you transferring it to someone else to complete? If so, who?

Just wanted to get it out so others can have fun with it.

Best regards,
Marek Vasut