Commit 2382aedd authored by Rob Herring (Arm)'s avatar Rob Herring (Arm)
Browse files

dt-bindings: net: Convert Marvell Armada NETA and BM to DT schema

Convert Marvell Armada NETA Ethernet Controller and Buffer Manager
bindings to schema. It is a straight forward conversion.

Link: https://lore.kernel.org/r/20250702222626.2761199-1-robh@kernel.org


Signed-off-by: default avatarRob Herring (Arm) <robh@kernel.org>
parent 828e5018
Loading
Loading
Loading
Loading
+79 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/marvell,armada-370-neta.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Marvell Armada 370/XP/3700/AC5 Ethernet Controller (NETA)

maintainers:
  - Marcin Wojtas <marcin.s.wojtas@gmail.com>

allOf:
  - $ref: /schemas/net/ethernet-controller.yaml#

properties:
  compatible:
    enum:
      - marvell,armada-370-neta
      - marvell,armada-xp-neta
      - marvell,armada-3700-neta
      - marvell,armada-ac5-neta

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    minItems: 1
    maxItems: 2

  clock-names:
    minItems: 1
    items:
      - const: core
      - const: bus

  phys:
    maxItems: 1

  tx-csum-limit:
    description: Maximum MTU in bytes for Tx checksum offload; default is 1600 for
      armada-370-neta and 9800 for others.
    $ref: /schemas/types.yaml#/definitions/uint32

  buffer-manager:
    description: Phandle to hardware buffer manager.
    $ref: /schemas/types.yaml#/definitions/phandle

  bm,pool-long:
    description: Pool ID for packets larger than the short threshold.
    $ref: /schemas/types.yaml#/definitions/uint32

  bm,pool-short:
    description: Pool ID for packets smaller than the long threshold.
    $ref: /schemas/types.yaml#/definitions/uint32

required:
  - compatible
  - reg
  - clocks

unevaluatedProperties: false

examples:
  - |
    ethernet@70000 {
        compatible = "marvell,armada-370-neta";
        reg = <0x70000 0x2500>;
        interrupts = <8>;
        clocks = <&gate_clk 4>;
        tx-csum-limit = <9800>;
        phy = <&phy0>;
        phy-mode = "rgmii-id";
        buffer-manager = <&bm>;
        bm,pool-long = <0>;
        bm,pool-short = <1>;
    };
+60 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/marvell,armada-380-neta-bm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Marvell Armada 380/XP Buffer Manager (BM)

maintainers:
  - Marcin Wojtas <marcin.s.wojtas@gmail.com>

description:
  In order to see how to hook the BM to a given ethernet port, please refer to
  Documentation/devicetree/bindings/net/marvell,armada-370-neta.yaml.

properties:
  compatible:
    const: marvell,armada-380-neta-bm

  reg:
    maxItems: 1

  clocks:
    maxItems: 1

  internal-mem:
    description: Phandle to internal SRAM region
    $ref: /schemas/types.yaml#/definitions/phandle

patternProperties:
  "^pool[0-3],capacity$":
    description:
      size of external buffer pointers' ring maintained in DRAM for pool 0-3
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 128
    maximum: 16352

  "^pool[0-3],pkt-size$":
    description:
      maximum packet size for a short buffer pool entry (pool 0-3)
    $ref: /schemas/types.yaml#/definitions/uint32

required:
  - compatible
  - reg
  - clocks
  - internal-mem

additionalProperties: false

examples:
  - |
    bm@c8000 {
        compatible = "marvell,armada-380-neta-bm";
        reg = <0xc8000 0xac>;
        clocks = <&gateclk 13>;
        internal-mem = <&bm_bppi>;
        pool2,capacity = <4096>;
        pool1,pkt-size = <512>;
    };
+0 −50
Original line number Diff line number Diff line
* Marvell Armada 370 / Armada XP / Armada 3700 Ethernet Controller (NETA)

Required properties:
- compatible: could be one of the following:
	"marvell,armada-370-neta"
	"marvell,armada-xp-neta"
	"marvell,armada-3700-neta"
	"marvell,armada-ac5-neta"
- reg: address and length of the register set for the device.
- interrupts: interrupt for the device
- phy: See ethernet.txt file in the same directory.
- phy-mode: See ethernet.txt file in the same directory
- clocks: List of clocks for this device. At least one clock is
  mandatory for the core clock. If several clocks are given, then the
  clock-names property must be used to identify them.

Optional properties:
- tx-csum-limit: maximum mtu supported by port that allow TX checksum.
  Value is presented in bytes. If not used, by default 1600B is set for
  "marvell,armada-370-neta" and 9800B for others.
- clock-names: List of names corresponding to clocks property; shall be
  "core" for core clock and "bus" for the optional bus clock.
- phys: comphy for the ethernet port, see ../phy/phy-bindings.txt

Optional properties (valid only for Armada XP/38x):

- buffer-manager: a phandle to a buffer manager node. Please refer to
  Documentation/devicetree/bindings/net/marvell-neta-bm.txt
- bm,pool-long: ID of a pool, that will accept all packets of a size
  higher than 'short' pool's threshold (if set) and up to MTU value.
  Obligatory, when the port is supposed to use hardware
  buffer management.
- bm,pool-short: ID of a pool, that will be used for accepting
  packets of a size lower than given threshold. If not set, the port
  will use a single 'long' pool for all packets, as defined above.

Example:

ethernet@70000 {
	compatible = "marvell,armada-370-neta";
	reg = <0x70000 0x2500>;
	interrupts = <8>;
	clocks = <&gate_clk 4>;
	tx-csum-limit = <9800>
	phy = <&phy0>;
	phy-mode = "rgmii-id";
	buffer-manager = <&bm>;
	bm,pool-long = <0>;
	bm,pool-short = <1>;
};
+0 −47
Original line number Diff line number Diff line
* Marvell Armada 380/XP Buffer Manager driver (BM)

Required properties:

- compatible: should be "marvell,armada-380-neta-bm".
- reg: address and length of the register set for the device.
- clocks: a pointer to the reference clock for this device.
- internal-mem: a phandle to BM internal SRAM definition.

Optional properties (port):

- pool<0 : 3>,capacity: size of external buffer pointers' ring maintained
  in DRAM. Can be set for each pool (id 0 : 3) separately. The value has
  to be chosen between 128 and 16352 and it also has to be aligned to 32.
  Otherwise the driver would adjust a given number or choose default if
  not set.
- pool<0 : 3>,pkt-size: maximum size of a packet accepted by a given buffer
  pointers' pool (id 0 : 3). It will be taken into consideration only when pool
  type is 'short'. For 'long' ones it would be overridden by port's MTU.
  If not set a driver will choose a default value.

In order to see how to hook the BM to a given ethernet port, please
refer to Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt.

Example:

- main node:

bm: bm@c8000 {
	compatible = "marvell,armada-380-neta-bm";
	reg = <0xc8000 0xac>;
	clocks = <&gateclk 13>;
	internal-mem = <&bm_bppi>;
	pool2,capacity = <4096>;
	pool1,pkt-size = <512>;
};

- internal SRAM node:

bm_bppi: bm-bppi {
	compatible = "mmio-sram";
	reg = <MBUS_ID(0x0c, 0x04) 0 0x100000>;
	ranges = <0 MBUS_ID(0x0c, 0x04) 0 0x100000>;
	#address-cells = <1>;
	#size-cells = <1>;
	clocks = <&gateclk 13>;
};
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ patternProperties:
  "^(pciclass|pinctrl-single|#pinctrl-single|PowerPC),.*": true
  "^(pl022|pxa-mmc|rcar_sound|rotary-encoder|s5m8767|sdhci),.*": true
  "^(simple-audio-card|st-plgpio|st-spics|ts),.*": true
  "^pool[0-3],.*": true

  # Keep list in alphabetical order.
  "^100ask,.*":