Skip to contentSkip to conversation

net: cortina_ni: Addd eth support for Cortina Access CAxxxx SoCs

PATCH New Alex Nemirovsky 2 participants 3 messages Apr 30, 2020 – May 6, 2020

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

PATCH v2 1/2 net: cortina_ni: Addd eth support for Cortina Access CAxxxx SoCs

From: Aaron Tseng <[email protected]>

Add Cortina Access Ethernet device driver for CAxxxx SoCs. This driver supports both legacy and DM_ETH network models.

Series changes: 2
- cleanup MAINTAINERS

---

 MAINTAINERS              |    2 +
 drivers/net/Kconfig      |    7 +
 drivers/net/Makefile     |    1 +
 drivers/net/cortina_ni.c | 2096 ++++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/cortina_ni.h |  626 ++++++++++++++
 5 files changed, 2732 insertions(+)
 create mode 100644 drivers/net/cortina_ni.c
 create mode 100644 drivers/net/cortina_ni.h
MAINTAINERS +2 -0
index dd92af5..789b897 100644
@@ -181,6 +181,8 @@ F:	drivers/gpio/cortina_gpio.c
 F:	drivers/watchdog/cortina_wdt.c
 F:	drivers/serial/serial_cortina.c
 F:	drivers/mmc/ca_dw_mmc.c
+F:	drivers/net/cortina_ni.c
+F:	drivers/net/cortina_ni.h
 
 ARM/CZ.NIC TURRIS MOX SUPPORT
 M:	Marek Behun <[email protected]>
drivers/net/Kconfig +7 -0
index 4d1013c..edeb132 100644
@@ -143,6 +143,13 @@ config BCMGENET
 	help
 	  This driver supports the BCMGENET Ethernet MAC.
 
+config CORTINA_NI_ENET
+    	bool "Cortina-Access Ethernet driver"
+    	depends on DM_ETH && CORTINA_PLATFORM
+    	help
+      	  The driver supports the Cortina-Access Ethernet MAC for
+	  all supported CAxxxx SoCs
+
 config DWC_ETH_QOS
 	bool "Synopsys DWC Ethernet QOS device support"
 	depends on DM_ETH
drivers/net/Makefile +1 -0
index 6e0a688..85e60f3 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_DRIVER_AX88180) += ax88180.o
 obj-$(CONFIG_BCM_SF2_ETH) += bcm-sf2-eth.o
 obj-$(CONFIG_BCM_SF2_ETH_GMAC) += bcm-sf2-eth-gmac.o
 obj-$(CONFIG_CALXEDA_XGMAC) += calxedaxgmac.o
+obj-$(CONFIG_CORTINA_NI_ENET) += cortina_ni.o
 obj-$(CONFIG_CS8900) += cs8900.o
 obj-$(CONFIG_TULIP) += dc2114x.o
 obj-$(CONFIG_ETH_DESIGNWARE) += designware.o
drivers/net/cortina_ni.c new file +2096 -0

2,096 lines not on this page · raw message

drivers/net/cortina_ni.h new file +626 -0

626 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 2/2 board: presidio-asic: Add CAxxxx Ethernet support

Add CAxxxx Ethernet support for the Cortina Access Presidio Engineering Board

Cc Joe Hershberger <[email protected]>
Cc Tom Rini <[email protected]>

---

 arch/arm/dts/ca-presidio-engboard.dts        |  7 +++++++
 board/cortina/presidio-asic/presidio.c       | 21 +++++++++++++++++++++
 configs/cortina_presidio-asic-emmc_defconfig |  4 +++-
 3 files changed, 31 insertions(+), 1 deletion(-)
arch/arm/dts/ca-presidio-engboard.dts +7 -0
index c03dacc..78eb542 100644
@@ -19,6 +19,13 @@
 		io_drv_ctrl = <0xf432004c>;
 	};
 
+	eth: ethnet at 0xf4300000 {
+		compatible = "eth_cortina";
+		reg = <0x0 0xf4320000 0x34>,
+		      <0x0 0xf43290d8 0x04>,
+		      <0x0 0xf4304000 0x04>;
+	};
+
 	gpio0: gpio-controller at 0xf4329280  {
 		compatible = "cortina,ca-gpio";
 		reg = <0x0 0xf4329280 0x24>;
board/cortina/presidio-asic/presidio.c +21 -0
index b4fa01f..881845d 100644
@@ -103,6 +103,27 @@ int board_init(void)
 	return 0;
 }
 
+#ifndef CONFIG_DM_ETH
+/*
+ * Board specific ethernet initialization routine.
+ */
+int ca77xx_eth_initialize(bd_t *bis);
+int board_eth_init(bd_t *bis)
+{
+	int rc = 0;
+	unsigned int reg_data;
+
+	ca77xx_eth_initialize(bis);
+
+	// Power down GMAC4 TX/RX clock for EMI issue
+	reg_data = readl(0xf4304684);
+	reg_data |= (3 << 11);
+	writel(reg_data, 0xf4304684);
+
+	return rc;
+}
+#endif
+
 int dram_init(void)
 {
 	unsigned int ddr_size;
configs/cortina_presidio-asic-emmc_defconfig +3 -1
index e10008a..360ebeb 100644
@@ -21,12 +21,14 @@ CONFIG_CMD_EXT4=y
 CONFIG_OF_CONTROL=y
 CONFIG_OF_LIVE=y
 CONFIG_DEFAULT_DEVICE_TREE="ca-presidio-engboard"
-# CONFIG_NET is not set
 CONFIG_DM=y
 CONFIG_CORTINA_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_DW_CORTINA=y
+CONFIG_PHYLIB=y
+CONFIG_DM_ETH=y
+CONFIG_CORTINA_NI_ENET=y
 CONFIG_DM_SERIAL=y
 CONFIG_CORTINA_UART=y
 CONFIG_WDT=y
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 1/2 net: cortina_ni: Addd eth support for Cortina Access CAxxxx SoCs

In reply to Alex Nemirovsky

On Wed, Apr 29, 2020 at 05:07:29PM -0700, Alex Nemirovsky wrote:
Now,

Quoted 5 lines

From: Aaron Tseng <[email protected]>

Add Cortina Access Ethernet device driver for CAxxxx SoCs. This driver supports both legacy and DM_ETH network models.

Quoted 7 lines

Series changes: 2
- cleanup MAINTAINERS

Sorry for the late review, checkpatch reports a number of issues, please address those (and check the other I/O patches, etc, for checkpatch problems as well). Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200506/45c76d30/attachment.sig>