Skip to content
Merged
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
111 changes: 111 additions & 0 deletions Documentation/devicetree/bindings/net/corundum,mqnic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# SPDX-License-Identifier: BSD-2-Clause-Views
# Copyright (c) 2019-2024 The Regents of the University of California
%YAML 1.2
---
$id: "http://devicetree.org/schemas/net/corundum,mqnic.yaml#"
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Corundum mqnic Ethernet controller

maintainers:
- Alex Forencich <[email protected]>

description: |
The Corundum mqnic is an open-source multi-queue network interface controller
for FPGA platforms.

properties:
compatible:
enum:
- corundum,mqnic

reg:
description: >
Address and length of the "control" register set. Optionally a second and
third range, the "app" and "ram" register sets may be added.

reg-names:
description: >
Names for each register region in 'reg'.

interrupts:
minItems: 1
description: >
Should contain mqnic interrupt(s)

reset-gpios:
$ref: /schemas/gpio/gpio.yaml#
description: >
GPIO used to reset the device. This property is optional, but if present,
the RESET GPIO controller will be used to reset the device.

resets:
$ref: /schemas/types.yaml#/definitions/phandle
description: >
Phandle to a reset controller node. This property is optional, but if
present, the device will be reset using the reset controller.

nvmem-cells:
description: >
Phandle of nvmem cell containing the base MAC address

nvmem-cell-names:
const: mac-address
description: >
Should be "mac-address"

mac-address-increment-byte:
$ref: /schemas/types.yaml#/definitions/uint32
description: >
Index of base MAC address byte to increment (default: 0x5)

mac-address-increment:
$ref: /schemas/types.yaml#/definitions/uint32
description: >
Number to add to the chosen base MAC address byte (default: 0x0)

mac-address-local:
type: boolean
description: >
Boolean, mark derived MAC addresses as "locally administrated"
(default: false)

module-eeproms:
$ref: /schemas/types.yaml#/definitions/phandle
description: >
Array of phandles to SFP module EEPROM node(s)

required:
- compatible
- reg
- interrupts

additionalProperties: false

examples:
- |
mqnic0: ethernet@a0000000 {
compatible = "corundum,mqnic";
reg = <0x0 0xa0000000 0x0 0x1000000>,
<0x0 0xb0000000 0x0 0x1000000>;
reg-names = "csr", "app";
interrupt-parent = <&gic>;
interrupts = <0x0 0x59 0x1>;

nvmem-cells = <&macaddress>;
nvmem-cell-names = "mac-address";

mac-address-increment = <0x1>;
mac-address-local;

module-eeproms = <&module_eeprom_sfp0>;
};

eeprom {
#address-cells = <1>;
#size-cells = <1>;

macaddress: macaddress@20 {
reg = <0x20 0x06>;
};
};
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/vendor-prefixes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ patternProperties:
description: Chengdu Corpro Technology Co., Ltd.
"^cortina,.*":
description: Cortina Systems, Inc.
"^corundum,.*":
description: Corundum Project (https://github.com/ucsdsysnet/corundum)
"^cosmic,.*":
description: Cosmic Circuits
"^crane,.*":
Expand Down
51 changes: 51 additions & 0 deletions arch/microblaze/boot/dts/vcu118_ad9081_m8_l4_corundum.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Analog Devices AD9081-FMC-EBZ
* https://wiki.analog.com/resources/tools-software/linux-drivers/iio-mxfe/ad9081
* https://wiki.analog.com/resources/eval/user-guides/ad9081_fmca_ebz/ad9081_fmca_ebz_hdl
*
* hdl_project: <ad9081_fmca_ebz/vcu118>
* board_revision: <>
*
* Copyright (C) 2019-2025 Analog Devices Inc.
*/

#include "vcu118_ad9081_m8_l4.dts"

/ {
model = "Analog Devices AD9081-FMCA-EBZ @Xilinx/vcu118 Corundum support";
};

&amba_pl {
corundum_reset: gpio@52000000 {
#gpio-cells = <2>;
clock-frequency = <100000000>;
clock-names = "s_axi_aclk";
clocks = <&clk_bus_0>;
compatible = "xlnx,axi-gpio-2.0", "xlnx,xps-gpio-1.00.a";
gpio-controller ;
reg = <0x52000000 0x1000>;
xlnx,all-inputs = <0x0>;
xlnx,all-inputs-2 = <0x0>;
xlnx,all-outputs = <0x1>;
xlnx,all-outputs-2 = <0x0>;
xlnx,dout-default = <0x00000000>;
xlnx,dout-default-2 = <0x00000000>;
xlnx,gpio-width = <0x1>;
xlnx,gpio2-width = <0x20>;
xlnx,interrupt-present = <0x0>;
xlnx,is-dual = <0x0>;
xlnx,tri-default = <0xFFFFFFFF>;
xlnx,tri-default-2 = <0xFFFFFFFF>;
};
corundum: corundum_eth100g@50000000 {
compatible = "corundum,mqnic";
reg = <0x50000000 0x1000000>;
reg-names = "csr";
local-mac-address = [00 0a 35 00 01 02];
interrupt-names = "irq";
interrupt-parent = <&axi_intc>;
interrupts = <5 2>;
reset-gpios = <&corundum_reset 0 GPIO_ACTIVE_HIGH>;
};
};
5 changes: 5 additions & 0 deletions arch/microblaze/configs/adi_mb_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ CONFIG_XILINX_LL_TEMAC=y
CONFIG_MARVELL_PHY=y
CONFIG_DP83867_PHY=y
CONFIG_XILINX_PHY=y
CONFIG_CORUNDUM_MQNIC=y
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
Expand All @@ -127,6 +128,7 @@ CONFIG_I2C=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MUX=y
CONFIG_I2C_MUX_PCA954x=y
CONFIG_I2C_ALGOBIT=y
# CONFIG_I2C_HELPER_AUTO is not set
CONFIG_I2C_XILINX=y
CONFIG_SPI=y
Expand All @@ -139,12 +141,15 @@ CONFIG_GPIO_PCA953X=y
CONFIG_GPIO_PCA953X_IRQ=y
CONFIG_POWER_RESET=y
CONFIG_POWER_RESET_GPIO_RESTART=y
CONFIG_RESET_CONTROLLER=y
CONFIG_RESET_GPIO=y
# CONFIG_HWMON is not set
CONFIG_WATCHDOG=y
CONFIG_XILINX_WATCHDOG=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
# CONFIG_USB_SUPPORT is not set
CONFIG_RTC_CLASS=y
CONFIG_DMADEVICES=y
CONFIG_AXI_DMAC=y
CONFIG_XILINX_DMA=y
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,8 @@ source "drivers/net/mctp/Kconfig"

source "drivers/net/mdio/Kconfig"

source "drivers/net/mqnic/Kconfig"

source "drivers/net/pcs/Kconfig"

source "drivers/net/plip/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ obj-$(CONFIG_WLAN) += wireless/
obj-$(CONFIG_IEEE802154) += ieee802154/
obj-$(CONFIG_WWAN) += wwan/
obj-$(CONFIG_MCTP) += mctp/
obj-$(CONFIG_CORUNDUM_MQNIC) += mqnic/

obj-$(CONFIG_VMXNET3) += vmxnet3/
obj-$(CONFIG_XEN_NETDEV_FRONTEND) += xen-netfront.o
Expand Down
28 changes: 28 additions & 0 deletions drivers/net/mqnic/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SPDX-License-Identifier: BSD-2-Clause-Views

Check warning on line 1 in drivers/net/mqnic/Kconfig

View workflow job for this annotation

GitHub Actions / checks / checks

checkpatch: 'SPDX-License-Identifier: BSD-2-Clause-Views' is not supported in LICENSES/... +# SPDX-License-Identifier: BSD-2-Clause-Views
# Copyright (c) 2019-2023 The Regents of the University of California

menuconfig CORUNDUM_MQNIC
tristate "Corundum MQNIC support"
select NET_DEVLINK
select I2C_ALGOBIT
depends on RTC_CLASS
help
Corundum is an open-source, FPGA-based Network Interface Card (NIC)
and platform designed for high-performance networking and in-network
compute applications.

Say yes here to build support for Corundum network interface card.

if CORUNDUM_MQNIC

config CORUNDUM_MQNIC_PCI
bool "Enable PCI support for Corundum MQNIC"
depends on CORUNDUM_MQNIC && PCI
help
Enable support for Corundum MQNIC devices connected via the PCI bus.
Corundum supports both PCI and AXI interfaces, so enabling this
option allows the driver to work with PCIe-based hardware. If you are
targeting FPGA boards or systems that use PCIe for host communication,
select this option.

endif # CORUNDUM_MQNIC
52 changes: 52 additions & 0 deletions drivers/net/mqnic/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# SPDX-License-Identifier: BSD-2-Clause-Views

Check warning on line 1 in drivers/net/mqnic/Makefile

View workflow job for this annotation

GitHub Actions / checks / checks

checkpatch: 'SPDX-License-Identifier: BSD-2-Clause-Views' is not supported in LICENSES/... +# SPDX-License-Identifier: BSD-2-Clause-Views
# Copyright (c) 2019-2023 The Regents of the University of California

ifneq ($(KERNELRELEASE),)

# object files to build
obj-$(CONFIG_CORUNDUM_MQNIC) += mqnic.o
mqnic-y += mqnic_main.o
mqnic-y += mqnic_devlink.o
mqnic-y += mqnic_res.o
mqnic-y += mqnic_reg_block.o
mqnic-y += mqnic_irq.o
mqnic-y += mqnic_dev.o
mqnic-y += mqnic_if.o
mqnic-y += mqnic_port.o
mqnic-y += mqnic_netdev.o
mqnic-y += mqnic_sched_block.o
mqnic-y += mqnic_sched_port.o
mqnic-y += mqnic_scheduler.o
mqnic-y += mqnic_ptp.o
mqnic-y += mqnic_i2c.o
mqnic-y += mqnic_board.o
mqnic-y += mqnic_clk_info.o
mqnic-y += mqnic_stats.o
mqnic-y += mqnic_tx.o
mqnic-y += mqnic_rx.o
mqnic-y += mqnic_cq.o
mqnic-y += mqnic_eq.o
mqnic-y += mqnic_ethtool.o

ifneq ($(DEBUG),)
ccflags-y += -DDEBUG
endif

else

ifneq ($(KERNEL_SRC),)
# alternatively to variable KDIR accept variable KERNEL_SRC as used in
# PetaLinux/Yocto for example
KDIR ?= $(KERNEL_SRC)
endif

KDIR ?= /lib/modules/$(shell uname -r)/build

all: modules

help modules modules_install clean:
$(MAKE) -C $(KDIR) M=$(shell pwd) $@

install: modules_install

endif
Loading
Loading