1d5b0e70fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2d5b0e70fSEmmanuel Vadot# Copyright (C) Sunplus Co., Ltd. 2021 3d5b0e70fSEmmanuel Vadot%YAML 1.2 4d5b0e70fSEmmanuel Vadot--- 5d5b0e70fSEmmanuel Vadot$id: http://devicetree.org/schemas/net/sunplus,sp7021-emac.yaml# 6d5b0e70fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 7d5b0e70fSEmmanuel Vadot 8*7ef62cebSEmmanuel Vadottitle: Sunplus SP7021 Dual Ethernet MAC 9d5b0e70fSEmmanuel Vadot 10d5b0e70fSEmmanuel Vadotmaintainers: 11d5b0e70fSEmmanuel Vadot - Wells Lu <wellslutw@gmail.com> 12d5b0e70fSEmmanuel Vadot 13d5b0e70fSEmmanuel Vadotdescription: | 14d5b0e70fSEmmanuel Vadot Sunplus SP7021 dual 10M/100M Ethernet MAC controller. 15d5b0e70fSEmmanuel Vadot Device node of the controller has following properties. 16d5b0e70fSEmmanuel Vadot 17d5b0e70fSEmmanuel Vadotproperties: 18d5b0e70fSEmmanuel Vadot compatible: 19d5b0e70fSEmmanuel Vadot const: sunplus,sp7021-emac 20d5b0e70fSEmmanuel Vadot 21d5b0e70fSEmmanuel Vadot reg: 22d5b0e70fSEmmanuel Vadot maxItems: 1 23d5b0e70fSEmmanuel Vadot 24d5b0e70fSEmmanuel Vadot interrupts: 25d5b0e70fSEmmanuel Vadot maxItems: 1 26d5b0e70fSEmmanuel Vadot 27d5b0e70fSEmmanuel Vadot clocks: 28d5b0e70fSEmmanuel Vadot maxItems: 1 29d5b0e70fSEmmanuel Vadot 30d5b0e70fSEmmanuel Vadot resets: 31d5b0e70fSEmmanuel Vadot maxItems: 1 32d5b0e70fSEmmanuel Vadot 33d5b0e70fSEmmanuel Vadot ethernet-ports: 34d5b0e70fSEmmanuel Vadot type: object 35*7ef62cebSEmmanuel Vadot additionalProperties: false 36d5b0e70fSEmmanuel Vadot description: Ethernet ports to PHY 37d5b0e70fSEmmanuel Vadot 38d5b0e70fSEmmanuel Vadot properties: 39d5b0e70fSEmmanuel Vadot "#address-cells": 40d5b0e70fSEmmanuel Vadot const: 1 41d5b0e70fSEmmanuel Vadot 42d5b0e70fSEmmanuel Vadot "#size-cells": 43d5b0e70fSEmmanuel Vadot const: 0 44d5b0e70fSEmmanuel Vadot 45d5b0e70fSEmmanuel Vadot patternProperties: 46d5b0e70fSEmmanuel Vadot "^port@[0-1]$": 47d5b0e70fSEmmanuel Vadot type: object 48*7ef62cebSEmmanuel Vadot additionalProperties: false 49d5b0e70fSEmmanuel Vadot description: Port to PHY 50d5b0e70fSEmmanuel Vadot 51d5b0e70fSEmmanuel Vadot properties: 52d5b0e70fSEmmanuel Vadot reg: 53d5b0e70fSEmmanuel Vadot minimum: 0 54d5b0e70fSEmmanuel Vadot maximum: 1 55d5b0e70fSEmmanuel Vadot 56d5b0e70fSEmmanuel Vadot phy-handle: 57d5b0e70fSEmmanuel Vadot maxItems: 1 58d5b0e70fSEmmanuel Vadot 59d5b0e70fSEmmanuel Vadot phy-mode: 60d5b0e70fSEmmanuel Vadot maxItems: 1 61d5b0e70fSEmmanuel Vadot 62d5b0e70fSEmmanuel Vadot nvmem-cells: 63d5b0e70fSEmmanuel Vadot items: 64d5b0e70fSEmmanuel Vadot - description: nvmem cell address of MAC address 65d5b0e70fSEmmanuel Vadot 66d5b0e70fSEmmanuel Vadot nvmem-cell-names: 67d5b0e70fSEmmanuel Vadot description: names corresponding to the nvmem cells 68d5b0e70fSEmmanuel Vadot items: 69d5b0e70fSEmmanuel Vadot - const: mac-address 70d5b0e70fSEmmanuel Vadot 71d5b0e70fSEmmanuel Vadot required: 72d5b0e70fSEmmanuel Vadot - reg 73d5b0e70fSEmmanuel Vadot - phy-handle 74d5b0e70fSEmmanuel Vadot - phy-mode 75d5b0e70fSEmmanuel Vadot - nvmem-cells 76d5b0e70fSEmmanuel Vadot - nvmem-cell-names 77d5b0e70fSEmmanuel Vadot 78d5b0e70fSEmmanuel Vadot mdio: 79d5b0e70fSEmmanuel Vadot $ref: mdio.yaml# 80d5b0e70fSEmmanuel Vadot unevaluatedProperties: false 81d5b0e70fSEmmanuel Vadot 82d5b0e70fSEmmanuel VadotadditionalProperties: false 83d5b0e70fSEmmanuel Vadot 84d5b0e70fSEmmanuel Vadotrequired: 85d5b0e70fSEmmanuel Vadot - compatible 86d5b0e70fSEmmanuel Vadot - reg 87d5b0e70fSEmmanuel Vadot - interrupts 88d5b0e70fSEmmanuel Vadot - clocks 89d5b0e70fSEmmanuel Vadot - resets 90d5b0e70fSEmmanuel Vadot - pinctrl-0 91d5b0e70fSEmmanuel Vadot - pinctrl-names 92d5b0e70fSEmmanuel Vadot - ethernet-ports 93d5b0e70fSEmmanuel Vadot - mdio 94d5b0e70fSEmmanuel Vadot 95d5b0e70fSEmmanuel Vadotexamples: 96d5b0e70fSEmmanuel Vadot - | 97d5b0e70fSEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 98d5b0e70fSEmmanuel Vadot 99d5b0e70fSEmmanuel Vadot ethernet@9c108000 { 100d5b0e70fSEmmanuel Vadot compatible = "sunplus,sp7021-emac"; 101d5b0e70fSEmmanuel Vadot reg = <0x9c108000 0x400>; 102d5b0e70fSEmmanuel Vadot interrupt-parent = <&intc>; 103d5b0e70fSEmmanuel Vadot interrupts = <66 IRQ_TYPE_LEVEL_HIGH>; 104d5b0e70fSEmmanuel Vadot clocks = <&clkc 0xa7>; 105d5b0e70fSEmmanuel Vadot resets = <&rstc 0x97>; 106d5b0e70fSEmmanuel Vadot pinctrl-0 = <&emac_demo_board_v3_pins>; 107d5b0e70fSEmmanuel Vadot pinctrl-names = "default"; 108d5b0e70fSEmmanuel Vadot 109d5b0e70fSEmmanuel Vadot ethernet-ports { 110d5b0e70fSEmmanuel Vadot #address-cells = <1>; 111d5b0e70fSEmmanuel Vadot #size-cells = <0>; 112d5b0e70fSEmmanuel Vadot 113d5b0e70fSEmmanuel Vadot port@0 { 114d5b0e70fSEmmanuel Vadot reg = <0>; 115d5b0e70fSEmmanuel Vadot phy-handle = <ð_phy0>; 116d5b0e70fSEmmanuel Vadot phy-mode = "rmii"; 117d5b0e70fSEmmanuel Vadot nvmem-cells = <&mac_addr0>; 118d5b0e70fSEmmanuel Vadot nvmem-cell-names = "mac-address"; 119d5b0e70fSEmmanuel Vadot }; 120d5b0e70fSEmmanuel Vadot 121d5b0e70fSEmmanuel Vadot port@1 { 122d5b0e70fSEmmanuel Vadot reg = <1>; 123d5b0e70fSEmmanuel Vadot phy-handle = <ð_phy1>; 124d5b0e70fSEmmanuel Vadot phy-mode = "rmii"; 125d5b0e70fSEmmanuel Vadot nvmem-cells = <&mac_addr1>; 126d5b0e70fSEmmanuel Vadot nvmem-cell-names = "mac-address"; 127d5b0e70fSEmmanuel Vadot }; 128d5b0e70fSEmmanuel Vadot }; 129d5b0e70fSEmmanuel Vadot 130d5b0e70fSEmmanuel Vadot mdio { 131d5b0e70fSEmmanuel Vadot #address-cells = <1>; 132d5b0e70fSEmmanuel Vadot #size-cells = <0>; 133d5b0e70fSEmmanuel Vadot 134d5b0e70fSEmmanuel Vadot eth_phy0: ethernet-phy@0 { 135d5b0e70fSEmmanuel Vadot reg = <0>; 136d5b0e70fSEmmanuel Vadot }; 137d5b0e70fSEmmanuel Vadot 138d5b0e70fSEmmanuel Vadot eth_phy1: ethernet-phy@1 { 139d5b0e70fSEmmanuel Vadot reg = <1>; 140d5b0e70fSEmmanuel Vadot }; 141d5b0e70fSEmmanuel Vadot }; 142d5b0e70fSEmmanuel Vadot }; 143d5b0e70fSEmmanuel Vadot... 144