Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Files:
drivers/blk/virtio/config.json
drivers/i2c/meson/config.json
drivers/i2c/opentitan/config.json
drivers/network/genet/config.json
drivers/network/imx/config.json
drivers/network/meson/config.json
drivers/network/virtio/mmio/config.json
Expand Down
1 change: 1 addition & 0 deletions ci/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def listify(s: str | Sequence[str]) -> Sequence[str]:
"qemu_virt_aarch64",
"qemu_virt_riscv64",
"rock3b",
"rpi4b_1gb",
"star64",
"x86_64_generic",
],
Expand Down
32 changes: 32 additions & 0 deletions drivers/network/genet/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"compatible": [
"brcm,bcm2711-genet-v5"
],
"resources": {
"regions": [
{
"name": "regs",
"perms": "rw",
"size": 65536,
"dt_index": 0
},
{
"name": "device_rx_ring",
"size": 32768
},
{
"name": "device_tx_ring",
"size": 32768
},
{
"name": "mbox_message",
"size": 32768
}
],
"irqs": [
{
"dt_index": 0
}
]
}
}
27 changes: 27 additions & 0 deletions drivers/network/genet/eth_driver.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Copyright 2024, UNSW
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Include this snippet in your project Makefile to build
# the GENET NIC driver
#
# NOTES
# Generates eth_driver.elf (alternative unique name eth_driver_genet.elf)
# Expects libsddf_util_debug.a to be in LIBS

ETHERNET_DRIVER_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
CHECK_NETDRV_GENET_FLAGS_MD5:=.netdrv_genet_cflags-$(shell echo -- ${CFLAGS} ${CFLAGS_network} | shasum | sed 's/ *-//')

${CHECK_NETDRV_GENET_FLAGS_MD5}:
-rm -f .netdrv_genet_cflags-*
touch $@

eth_driver_genet.elf: network/genet/ethernet.o libsddf_util.a
$(LD) $(LDFLAGS) $^ $(LIBS) -o $@

network/genet/ethernet.o: ${ETHERNET_DRIVER_DIR}/ethernet.c ${CHECK_NETDRV_FLAGS_MD5} | $(SDDF_LIBC_INCLUDE)
mkdir -p network/genet
${CC} -c ${CFLAGS} ${CFLAGS_network} -I ${ETHERNET_DRIVER_DIR} -o $@ $<

-include genet/ethernet.d
Loading
Loading