net: cortina_ni: Add eth support for Cortina Access CAxxxx SoCs
Subsystems (2)
PATCH v2 1/2 net: cortina_ni: Add 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.
Signed-off-by Aaron Tseng <[email protected]>
Signed-off-by Alex Nemirovsky <[email protected]>
CC Joe Hershberger <[email protected]>
CC Abbie Chang <[email protected]>
CC Tom Rini <[email protected]>
---
Changes in v2:
- Remove legacy mode support
- Add support for additional SoC variants
- Remove unused variables
MAINTAINERS | 4 + drivers/net/Kconfig | 7 + drivers/net/Makefile | 1 + drivers/net/cortina_ni.c | 1910 ++++++++++++++++++++++++++++++++++++++++++++++ drivers/net/cortina_ni.h | 592 ++++++++++++++ 5 files changed, 2514 insertions(+) create mode 100644 drivers/net/cortina_ni.c create mode 100644 drivers/net/cortina_ni.h
MAINTAINERS +4 -0
@@ -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]>
@@ -732,6 +734,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 MIPS MSCC M: Gregory CLEMENT <[email protected]>
drivers/net/Kconfig +7 -0
@@ -149,6 +149,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
@@ -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 +1910 -0
1,910 lines not on this page · raw message
drivers/net/cortina_ni.h new file +592 -0
592 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v2 2/2 board: presidio-asic: Add CAxxxx Ethernet support
Add CAxxxx Ethernet support for the Cortina Access Presidio Engineering Board
Signed-off-by Alex Nemirovsky <[email protected]>
---
Changes in v2: None
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
@@ -66,4 +66,11 @@ spi-max-frequency = <108000000>; }; }; + + eth: ethnet at 0xf4300000 { + compatible = "eth_cortina"; + reg = <0x0 0xf4320000 0x34>, + <0x0 0xf43290d8 0x04>, + <0x0 0xf4304000 0x04>; + }; };
board/cortina/presidio-asic/presidio.c +21 -0
@@ -105,6 +105,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
@@ -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