# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/fsl,fman-port.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Freescale Frame Manager Port Device

maintainers:
  - Frank Li <Frank.Li@nxp.com>

description: |
  The Frame Manager (FMan) supports several types of hardware ports:
    Ethernet receiver (RX)
    Ethernet transmitter (TX)
    Offline/Host command (O/H)

properties:
  compatible:
    enum:
      - fsl,fman-v2-port-oh
      - fsl,fman-v2-port-rx
      - fsl,fman-v2-port-tx
      - fsl,fman-v3-port-oh
      - fsl,fman-v3-port-rx
      - fsl,fman-v3-port-tx

  cell-index:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      Specifies the hardware port id.
      Each hardware port on the FMan has its own hardware PortID.
      Super set of all hardware Port IDs available at FMan Reference
      Manual under "FMan Hardware Ports in Freescale Devices" table.

      Each hardware port is assigned a 4KB, port-specific page in
      the FMan hardware port memory region (which is part of the
      FMan memory map). The first 4 KB in the FMan hardware ports
      memory region is used for what are called common registers.
      The subsequent 63 4KB pages are allocated to the hardware
      ports.
      The page of a specific port is determined by the cell-index.

  reg:
    items:
      - description: There is one reg region describing the port
          configuration registers.

  fsl,fman-10g-port:
    $ref: /schemas/types.yaml#/definitions/flag
    description: The default port rate is 1G.
      If this property exists, the port is s 10G port.

  fsl,fman-best-effort-port:
    $ref: /schemas/types.yaml#/definitions/flag
    description: The default port rate is 1G.
      Can be defined only if 10G-support is set.
      This property marks a best-effort 10G port (10G port that
      may not be capable of line rate).

required:
  - compatible
  - reg
  - cell-index

additionalProperties: false

examples:
  - |
    port@a8000 {
        compatible = "fsl,fman-v2-port-tx";
        reg = <0xa8000 0x1000>;
        cell-index = <0x28>;
    };

