Skip to content

Commit

Permalink
dts: bindings: ethernet: Remove fixed link
Browse files Browse the repository at this point in the history
Remove ethernet-fixed-link binding as it is redundant with the
phy bindings. Clearly, ethernet does not work without the L1
layer, which is a phy device, or an integrated mac/phy device,
and all of these things should be described properly in DT.
The schema did not even come with a compatible, meaning nodelabels
were hardcoded into the drivers, which is unacceptable.

- Remove the binding file for ethernet-fixed-link.yaml.
- Remove fixed link functionality from the nxp s32 gmac driver.
  Since this functionality is already covered by the phy support,
  it is redundant.
- Remove fixed link include from the s32 gmac binding.
- Remove fixed link include from the nuvoton numaker binding.
  As far as I can tell the corresonding driver does not even
  use it anyways, and I did not find any board with this device
  that describes a "fixed link".
- Move the definition into the nxp,kinetis-ethernet binding
  as the eth_mcux driver, which is already being deprecated,
  does use this, contain the debt to the legacy driver.

(cherry picked from commit 353c6a6)

Original-Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
GitOrigin-RevId: 353c6a6
Change-Id: I59bd98001107f816c5033f65f62a0d01b6f96170
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5402704
Tested-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
  • Loading branch information
decsny authored and Chromeos LUCI committed Mar 29, 2024
1 parent 4227125 commit 520ab7c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 49 deletions.
32 changes: 4 additions & 28 deletions drivers/ethernet/eth_nxp_s32_gmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,29 +649,6 @@ BUILD_ASSERT((CONFIG_ETH_NXP_S32_RX_RING_BUF_SIZE % FEATURE_GMAC_DATA_BUS_WIDTH_
BUILD_ASSERT((CONFIG_ETH_NXP_S32_TX_RING_BUF_SIZE % FEATURE_GMAC_DATA_BUS_WIDTH_BYTES) == 0,
"CONFIG_ETH_NXP_S32_TX_RING_BUF_SIZE must be multiple of the data bus width");

#define ETH_NXP_S32_FIXED_LINK_NODE(n) \
DT_INST_CHILD(n, fixed_link)

#define ETH_NXP_S32_IS_FIXED_LINK(n) \
DT_NODE_EXISTS(ETH_NXP_S32_FIXED_LINK_NODE(n))

#define ETH_NXP_S32_FIXED_LINK_SPEED(n) \
DT_PROP(ETH_NXP_S32_FIXED_LINK_NODE(n), speed)

#define ETH_NXP_S32_FIXED_LINK_FULL_DUPLEX(n) \
DT_PROP(ETH_NXP_S32_FIXED_LINK_NODE(n), full_duplex)

#define ETH_NXP_S32_MAC_SPEED(n) \
COND_CODE_1(ETH_NXP_S32_IS_FIXED_LINK(n), \
(_CONCAT(_CONCAT(GMAC_SPEED_, ETH_NXP_S32_FIXED_LINK_SPEED(n)), M)), \
(GMAC_SPEED_100M))

#define ETH_NXP_S32_MAC_DUPLEX(n) \
COND_CODE_1(ETH_NXP_S32_IS_FIXED_LINK(n), \
(COND_CODE_1(ETH_NXP_S32_FIXED_LINK_FULL_DUPLEX(n), \
(GMAC_FULL_DUPLEX), (GMAC_HALF_DUPLEX))), \
(GMAC_FULL_DUPLEX))

#define ETH_NXP_S32_MAC_MII(n) \
_CONCAT(_CONCAT(GMAC_, DT_INST_STRING_UPPER_TOKEN(n, phy_connection_type)), _MODE)

Expand Down Expand Up @@ -803,8 +780,8 @@ BUILD_ASSERT((CONFIG_ETH_NXP_S32_TX_RING_BUF_SIZE % FEATURE_GMAC_DATA_BUS_WIDTH_
.Callback = NULL, \
.TxSchedAlgo = GMAC_SCHED_ALGO_SP, \
.MiiMode = ETH_NXP_S32_MAC_MII(n), \
.Speed = ETH_NXP_S32_MAC_SPEED(n), \
.Duplex = ETH_NXP_S32_MAC_DUPLEX(n), \
.Speed = GMAC_SPEED_100M, \
.Duplex = GMAC_FULL_DUPLEX, \
.MacConfig = ETH_NXP_S32_MAC_CONF(n), \
.MacPktFilterConfig = ETH_NXP_S32_MAC_PKT_FILTER(n), \
.EnableCtrl = false, \
Expand Down Expand Up @@ -837,9 +814,8 @@ BUILD_ASSERT((CONFIG_ETH_NXP_S32_TX_RING_BUF_SIZE % FEATURE_GMAC_DATA_BUS_WIDTH_
ETH_NXP_S32_HW_INSTANCE_CHECK, (|), n)

#define ETH_NXP_S32_PHY_DEV(n) \
COND_CODE_1(ETH_NXP_S32_IS_FIXED_LINK(n), NULL, \
(COND_CODE_1(DT_INST_NODE_HAS_PROP(n, phy_handle), \
(DEVICE_DT_GET(DT_INST_PHANDLE(n, phy_handle))), NULL)))
(COND_CODE_1(DT_INST_NODE_HAS_PROP(n, phy_handle), \
(DEVICE_DT_GET(DT_INST_PHANDLE(n, phy_handle))), NULL))

#define ETH_NXP_S32_DEVICE(n) \
ETH_NXP_S32_TX_CALLBACK(n) \
Expand Down
17 changes: 0 additions & 17 deletions dts/bindings/ethernet/ethernet,fixed-link.yaml

This file was deleted.

1 change: 0 additions & 1 deletion dts/bindings/ethernet/nuvoton,numaker-ethernet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ compatible: "nuvoton,numaker-ethernet"

include:
- ethernet-controller.yaml
- ethernet,fixed-link.yaml
- reset-device.yaml
- pinctrl-device.yaml

Expand Down
2 changes: 1 addition & 1 deletion dts/bindings/ethernet/nxp,enet-mac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: NXP ENET MAC/L2 Device

compatible: "nxp,enet-mac"

include: ["ethernet-controller.yaml", "ethernet,fixed-link.yaml", "pinctrl-device.yaml"]
include: ["ethernet-controller.yaml", "pinctrl-device.yaml"]

properties:
interrupts:
Expand Down
16 changes: 15 additions & 1 deletion dts/bindings/ethernet/nxp,kinetis-ethernet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: NXP Kinetis Ethernet

compatible: "nxp,kinetis-ethernet"

include: ["ethernet-controller.yaml", "ethernet,fixed-link.yaml", "pinctrl-device.yaml"]
include: ["ethernet-controller.yaml", "pinctrl-device.yaml"]

properties:
reg:
Expand All @@ -23,3 +23,17 @@ properties:
type: phandle-array
description:
interrupt GPIO for PHY. Will be pulled high before reset is asserted.

child-binding:
description: Fixed link ethernet node
properties:
speed:
type: int
required: true
description: The speed of fixed link
enum:
- 100
- 10
full-duplex:
type: boolean
description: The fixed link operates in full duplex mode
2 changes: 1 addition & 1 deletion dts/bindings/ethernet/nxp,s32-gmac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: NXP S32 GMAC/EMAC driver

compatible: "nxp,s32-gmac"

include: [ethernet-controller.yaml, "ethernet,fixed-link.yaml", pinctrl-device.yaml]
include: [ethernet-controller.yaml, pinctrl-device.yaml]

properties:
reg:
Expand Down

0 comments on commit 520ab7c

Please sign in to comment.