Skip to content

Commit

Permalink
cgem: add 64-bit support
Browse files Browse the repository at this point in the history
Add 64-bit address support to Cadence CGEM Ethernet driver for use in
other SoCs such as the Zynq UltraScale+ and SiFive HighFive Unleashed.

Reviewed by:	philip, 0mp (manpages)
Differential Revision: https://reviews.freebsd.org/D24304
  • Loading branch information
Thomas Skibo authored and mhorne committed Jan 10, 2021
1 parent 5a181b8 commit facdd1c
Show file tree
Hide file tree
Showing 10 changed files with 323 additions and 126 deletions.
7 changes: 7 additions & 0 deletions share/man/man4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ MAN= aac.4 \
cdceem.4 \
cfi.4 \
cfumass.4 \
${_cgem.4} \
ch.4 \
chromebook_platform.4 \
${_chvgpio.4} \
Expand Down Expand Up @@ -903,6 +904,12 @@ _virtio_scsi.4= virtio_scsi.4
_vtnet.4= vtnet.4
.endif

.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64" || \
${MACHINE_CPUARCH} == "riscv"
_cgem.4= cgem.4
MLINKS+=cgem.4 if_cgem.4
.endif

.if empty(MAN_ARCH)
__arches= ${MACHINE} ${MACHINE_ARCH} ${MACHINE_CPUARCH}
.elif ${MAN_ARCH} == "all"
Expand Down
14 changes: 9 additions & 5 deletions share/man/man4/man4.arm/cgem.4 → share/man/man4/cgem.4
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd August 26, 2014
.Dd January 10, 2021
.Dt CGEM 4
.Os
.Sh NAME
Expand All @@ -44,7 +44,8 @@ The
.Nm
driver provides support for the Cadence GEM (Gigabit Ethernet MAC).
The Cadence GEM is used in some SoC (System on a Chip) devices such as
the Xilinx Zynq-7000 and the Atmel SAMA5D3.
the Xilinx Zynq-7000, the Xilinx Zynq UltraScale+, and the SiFive
HiFive Unleashed.
.Pp
The
.Nm
Expand Down Expand Up @@ -284,15 +285,18 @@ There are
variables that count
packets discarded by the hardware (see below).
.Pp
The GEM used in the Zynq-7000 has a bug such that the receiver can
The GEM used in the Zynq-7000 has a bug such that the receiver can
potentially freeze up under a high load.
The issue is described in sec. 16.7
"Known Issues" of the Zynq-7000 SoC Technical Reference Manual (Xilinx
UG585 v1.7).
The
.Nm
driver implements the work-around suggested in the manual.
If the bug does not exist in other versions of this device, the
work-around can be disabled by setting the dev.cgem.%d.rxhangwar
It is believed that the bug does not exist in the Zynq UltraScale+ and
SiFive SoCs so the work-around is disabled in those instances and enabled
in all others.
The work-around can be disabled by setting the
.Va dev.cgem.%d.rxhangwar
.Xr sysctl 8
variable to 0.
4 changes: 1 addition & 3 deletions share/man/man4/man4.arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ MAN= \
aw_spi.4 \
aw_syscon.4 \
bcm283x_pwm.4 \
cgem.4 \
devcfg.4 \
imx6_ahci.4 \
imx6_snvs.4 \
imx_wdog.4 \
mge.4 \
ti_adc.4

MLINKS= cgem.4 if_cgem.4
MLINKS+= imx_wdog.4 imxwdt.4
MLINKS= imx_wdog.4 imxwdt.4
MLINKS+= mge.4 if_mge.4

MANSUBDIR=/arm
Expand Down
2 changes: 1 addition & 1 deletion sys/arm/conf/GENERIC
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ device e6000sw
device miibus

device awg # 10/100/1000 integrated EMAC controller
device cgem # Cadence GEM Gigabit Ethernet device
device cpsw # TI Common Platform Ethernet Switch (CPSW)
device cgem # Zynq-7000 gig ethernet device
device dwc # 10/100/1000 integrated GMAC controller
device emac # 10/100 integrated EMAC controller
device ffec # Freescale Fast Ethernet Controller
Expand Down
2 changes: 1 addition & 1 deletion sys/arm/conf/ZEDBOARD
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ device mpcore_timer

device loop
device ether
device cgem # Zynq-7000 gig ethernet device
device cgem # Cadence GEM Gigabit Ethernet device
device mii
device e1000phy
device rgephy # Zybo uses Realtek RTL8211E
Expand Down
1 change: 1 addition & 0 deletions sys/arm64/conf/GENERIC
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ device miibus # MII bus support
device al_eth # Annapurna Alpine Ethernet NIC
device awg # Allwinner EMAC Gigabit Ethernet
device axa # AMD Opteron A1100 integrated NIC
device cgem # Cadence GEM Gigabit Ethernet device
device dwc_rk # Rockchip Designware
device dwc_socfpga # Altera SOCFPGA Ethernet MAC
device ffec # iMX FFEC
Expand Down
Loading

0 comments on commit facdd1c

Please sign in to comment.