Commit 33183489 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'add-generic-pse-support'

Oleksij Rempel says:

====================
add generic PSE support

Add generic support for the Ethernet Power Sourcing Equipment.
====================

Link: https://lore.kernel.org/r/20221003065202.3889095-1-o.rempel@pengutronix.de


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 46a275a5 66741b4e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -144,6 +144,12 @@ properties:
      Mark the corresponding energy efficient ethernet mode as
      broken and request the ethernet to stop advertising it.

  pses:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    maxItems: 1
    description:
      Specifies a reference to a node representing a Power Sourcing Equipment.

  phy-is-integrated:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
+40 −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/pse-pd/podl-pse-regulator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Regulator based Power Sourcing Equipment

maintainers:
  - Oleksij Rempel <o.rempel@pengutronix.de>

description: Regulator based PoDL PSE controller. The device must be referenced
  by the PHY node to control power injection to the Ethernet cable.

allOf:
  - $ref: "pse-controller.yaml#"

properties:
  compatible:
    const: podl-pse-regulator

  '#pse-cells':
    const: 0

  pse-supply:
    description: Power supply for the PSE controller

additionalProperties: false

required:
  - compatible
  - pse-supply

examples:
  - |
    ethernet-pse {
      compatible = "podl-pse-regulator";
      pse-supply = <&reg_t1l1>;
      #pse-cells = <0>;
    };
+33 −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/pse-pd/pse-controller.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Power Sourcing Equipment (PSE).

description: Binding for the Power Sourcing Equipment (PSE) as defined in the
  IEEE 802.3 specification. It is designed for hardware which is delivering
  power over twisted pair/ethernet cable. The ethernet-pse nodes should be
  used to describe PSE controller and referenced by the ethernet-phy node.

maintainers:
  - Oleksij Rempel <o.rempel@pengutronix.de>

properties:
  $nodename:
    pattern: "^ethernet-pse(@.*)?$"

  "#pse-cells":
    description:
      Used to uniquely identify a PSE instance within an IC. Will be
      0 on PSE nodes with only a single output and at least 1 on nodes
      controlling several outputs.
    enum: [0, 1]

required:
  - "#pse-cells"

additionalProperties: true

...
+59 −0
Original line number Diff line number Diff line
@@ -220,6 +220,8 @@ Userspace to kernel:
  ``ETHTOOL_MSG_PHC_VCLOCKS_GET``       get PHC virtual clocks info
  ``ETHTOOL_MSG_MODULE_SET``            set transceiver module parameters
  ``ETHTOOL_MSG_MODULE_GET``            get transceiver module parameters
  ``ETHTOOL_MSG_PSE_SET``               set PSE parameters
  ``ETHTOOL_MSG_PSE_GET``               get PSE parameters
  ===================================== =================================

Kernel to userspace:
@@ -260,6 +262,7 @@ Kernel to userspace:
  ``ETHTOOL_MSG_STATS_GET_REPLY``          standard statistics
  ``ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY``    PHC virtual clocks info
  ``ETHTOOL_MSG_MODULE_GET_REPLY``         transceiver module parameters
  ``ETHTOOL_MSG_PSE_GET_REPLY``            PSE parameters
  ======================================== =================================

``GET`` requests are sent by userspace applications to retrieve device
@@ -1627,6 +1630,62 @@ For SFF-8636 modules, low power mode is forced by the host according to table
For CMIS modules, low power mode is forced by the host according to table 6-12
in revision 5.0 of the specification.

PSE_GET
=======

Gets PSE attributes.

Request contents:

  =====================================  ======  ==========================
  ``ETHTOOL_A_PSE_HEADER``               nested  request header
  =====================================  ======  ==========================

Kernel response contents:

  ======================================  ======  =============================
  ``ETHTOOL_A_PSE_HEADER``                nested  reply header
  ``ETHTOOL_A_PODL_PSE_ADMIN_STATE``         u32  Operational state of the PoDL
                                                  PSE functions
  ``ETHTOOL_A_PODL_PSE_PW_D_STATUS``         u32  power detection status of the
                                                  PoDL PSE.
  ======================================  ======  =============================

When set, the optional ``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` attribute identifies
the operational state of the PoDL PSE functions.  The operational state of the
PSE function can be changed using the ``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL``
action. This option is corresponding to ``IEEE 802.3-2018`` 30.15.1.1.2
aPoDLPSEAdminState. Possible values are:

.. kernel-doc:: include/uapi/linux/ethtool.h
    :identifiers: ethtool_podl_pse_admin_state

When set, the optional ``ETHTOOL_A_PODL_PSE_PW_D_STATUS`` attribute identifies
the power detection status of the PoDL PSE.  The status depend on internal PSE
state machine and automatic PD classification support. This option is
corresponding to ``IEEE 802.3-2018`` 30.15.1.1.3 aPoDLPSEPowerDetectionStatus.
Possible values are:

.. kernel-doc:: include/uapi/linux/ethtool.h
    :identifiers: ethtool_podl_pse_pw_d_status

PSE_SET
=======

Sets PSE parameters.

Request contents:

  ======================================  ======  =============================
  ``ETHTOOL_A_PSE_HEADER``                nested  request header
  ``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL``       u32  Control PoDL PSE Admin state
  ======================================  ======  =============================

When set, the optional ``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL`` attribute is used
to control PoDL PSE Admin functions. This option is implementing
``IEEE 802.3-2018`` 30.15.1.2.1 acPoDLPSEAdminControl. See
``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` for supported values.

Request translation
===================

+2 −0
Original line number Diff line number Diff line
@@ -500,6 +500,8 @@ config NET_SB1000

source "drivers/net/phy/Kconfig"

source "drivers/net/pse-pd/Kconfig"

source "drivers/net/can/Kconfig"

source "drivers/net/mctp/Kconfig"
Loading