Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: net: pcs: renesas,rzn1-miic: Add RZ/T2H and RZ/N2H support

Add device tree binding support for RZ/T2H and RZ/N2H SoCs to the
existing RZ/N1 MIIC converter binding. These SoCs share similar MIIC
functionality but have architectural differences that require schema
updates.

Add new compatible strings "renesas,r9a09g077-miic" for RZ/T2H and
"renesas,r9a09g087-miic" for RZ/N2H, with the latter falling back to
the RZ/T2H variant. The new SoCs require reset support with two reset
lines for converter register reset and converter reset, which are not
present on RZ/N1.

Update port configurations to accommodate the different architectures.
RZ/N1 supports 5 ports numbered 1-5 with complex input mappings
covering indices 0-13, while RZ/T2H and RZ/N2H support 4 ports
numbered 0-3 with simplified input mappings covering indices 0-8.
Extend the switch port configuration property to support value 0 for
the new SoCs.

Add a new dt-bindings header file with media interface connection
matrix constants that map GMAC, ESC, and ETHSW ports to numeric
identifiers for use with RZ/T2H and RZ/N2H device trees.

Update DT schema validation to ensure proper port numbering and input
mappings per SoC variant.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://patch.msgid.link/20250910204132.319975-2-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Lad Prabhakar and committed by
Jakub Kicinski
8c01cc23 943a4fd7

+165 -48
+129 -48
Documentation/devicetree/bindings/net/pcs/renesas,rzn1-miic.yaml
··· 4 4 $id: http://devicetree.org/schemas/net/pcs/renesas,rzn1-miic.yaml# 5 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 6 6 7 - title: Renesas RZ/N1 MII converter 7 + title: Renesas RZ/N1, RZ/N2H and RZ/T2H MII converter 8 8 9 9 maintainers: 10 10 - Clément Léger <clement.leger@bootlin.com> 11 + - Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> 11 12 12 13 description: | 13 - This MII converter is present on the Renesas RZ/N1 SoC family. It is 14 - responsible to do MII passthrough or convert it to RMII/RGMII. 14 + This MII converter is present on the Renesas RZ/N1, RZ/N2H and RZ/T2H SoC 15 + families. It is responsible to do MII passthrough or convert it to RMII/RGMII. 15 16 16 17 properties: 17 18 '#address-cells': ··· 22 21 const: 0 23 22 24 23 compatible: 25 - items: 26 - - enum: 27 - - renesas,r9a06g032-miic 28 - - const: renesas,rzn1-miic 24 + oneOf: 25 + - items: 26 + - enum: 27 + - renesas,r9a06g032-miic 28 + - const: renesas,rzn1-miic 29 + - items: 30 + - const: renesas,r9a09g077-miic # RZ/T2H 31 + - items: 32 + - const: renesas,r9a09g087-miic # RZ/N2H 33 + - const: renesas,r9a09g077-miic 29 34 30 35 reg: 31 36 maxItems: 1 ··· 50 43 - const: rmii_ref 51 44 - const: hclk 52 45 46 + resets: 47 + items: 48 + - description: Converter register reset 49 + - description: Converter reset 50 + 51 + reset-names: 52 + items: 53 + - const: rst 54 + - const: crst 55 + 53 56 renesas,miic-switch-portin: 54 57 description: MII Switch PORTIN configuration. This value should use one of 55 - the values defined in dt-bindings/net/pcs-rzn1-miic.h. 58 + the values defined in dt-bindings/net/pcs-rzn1-miic.h for RZ/N1 SoC and 59 + include/dt-bindings/net/renesas,r9a09g077-pcs-miic.h for RZ/N2H, RZ/T2H SoCs. 56 60 $ref: /schemas/types.yaml#/definitions/uint32 57 - enum: [1, 2] 61 + enum: [0, 1, 2] 58 62 59 63 power-domains: 60 64 maxItems: 1 ··· 78 60 properties: 79 61 reg: 80 62 description: MII Converter port number. 81 - enum: [1, 2, 3, 4, 5] 63 + enum: [0, 1, 2, 3, 4, 5] 82 64 83 65 renesas,miic-input: 84 66 description: Converter input port configuration. This value should use 85 - one of the values defined in dt-bindings/net/pcs-rzn1-miic.h. 67 + one of the values defined in dt-bindings/net/pcs-rzn1-miic.h for RZ/N1 SoC 68 + and include/dt-bindings/net/renesas,r9a09g077-pcs-miic.h for RZ/N2H, RZ/T2H SoCs. 86 69 $ref: /schemas/types.yaml#/definitions/uint32 87 70 88 71 required: ··· 92 73 93 74 additionalProperties: false 94 75 95 - allOf: 96 - - if: 76 + allOf: 77 + - if: 78 + properties: 79 + compatible: 80 + contains: 81 + const: renesas,rzn1-miic 82 + then: 83 + properties: 84 + renesas,miic-switch-portin: 85 + enum: [1, 2] 86 + resets: false 87 + reset-names: false 88 + patternProperties: 89 + "^mii-conv@[0-5]$": 97 90 properties: 98 91 reg: 99 - const: 1 100 - then: 101 - properties: 102 - renesas,miic-input: 103 - const: 0 104 - - if: 92 + enum: [1, 2, 3, 4, 5] 93 + allOf: 94 + - if: 95 + properties: 96 + reg: 97 + const: 1 98 + then: 99 + properties: 100 + renesas,miic-input: 101 + const: 0 102 + - if: 103 + properties: 104 + reg: 105 + const: 2 106 + then: 107 + properties: 108 + renesas,miic-input: 109 + enum: [1, 11] 110 + - if: 111 + properties: 112 + reg: 113 + const: 3 114 + then: 115 + properties: 116 + renesas,miic-input: 117 + enum: [7, 10] 118 + - if: 119 + properties: 120 + reg: 121 + const: 4 122 + then: 123 + properties: 124 + renesas,miic-input: 125 + enum: [4, 6, 9, 13] 126 + - if: 127 + properties: 128 + reg: 129 + const: 5 130 + then: 131 + properties: 132 + renesas,miic-input: 133 + enum: [3, 5, 8, 12] 134 + else: 135 + properties: 136 + renesas,miic-switch-portin: 137 + const: 0 138 + required: 139 + - resets 140 + - reset-names 141 + patternProperties: 142 + "^mii-conv@[0-5]$": 105 143 properties: 106 144 reg: 107 - const: 2 108 - then: 109 - properties: 110 - renesas,miic-input: 111 - enum: [1, 11] 112 - - if: 113 - properties: 114 - reg: 115 - const: 3 116 - then: 117 - properties: 118 - renesas,miic-input: 119 - enum: [7, 10] 120 - - if: 121 - properties: 122 - reg: 123 - const: 4 124 - then: 125 - properties: 126 - renesas,miic-input: 127 - enum: [4, 6, 9, 13] 128 - - if: 129 - properties: 130 - reg: 131 - const: 5 132 - then: 133 - properties: 134 - renesas,miic-input: 135 - enum: [3, 5, 8, 12] 145 + enum: [0, 1, 2, 3] 146 + allOf: 147 + - if: 148 + properties: 149 + reg: 150 + const: 0 151 + then: 152 + properties: 153 + renesas,miic-input: 154 + enum: [0, 3, 6] 155 + - if: 156 + properties: 157 + reg: 158 + const: 1 159 + then: 160 + properties: 161 + renesas,miic-input: 162 + enum: [1, 4, 7] 163 + - if: 164 + properties: 165 + reg: 166 + const: 2 167 + then: 168 + properties: 169 + renesas,miic-input: 170 + enum: [2, 5, 8] 171 + - if: 172 + properties: 173 + reg: 174 + const: 3 175 + then: 176 + properties: 177 + renesas,miic-input: 178 + const: 1 136 179 137 180 required: 138 181 - '#address-cells'
+36
include/dt-bindings/net/renesas,r9a09g077-pcs-miic.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 + /* 3 + * Copyright (C) 2025 Renesas Electronics Corporation. 4 + */ 5 + 6 + #ifndef _DT_BINDINGS_RENASAS_R9A09G077_PCS_MIIC_H 7 + #define _DT_BINDINGS_RENASAS_R9A09G077_PCS_MIIC_H 8 + 9 + /* 10 + * Media Interface Connection Matrix 11 + * =========================================================== 12 + * 13 + * Selects the function of the Media interface of the MAC to be used 14 + * 15 + * SW_MODE[2:0] | Port 0 | Port 1 | Port 2 | Port 3 16 + * -------------|-------------|-------------|-------------|------------- 17 + * 000b | ETHSW Port0 | ETHSW Port1 | ETHSW Port2 | GMAC1 18 + * 001b | ESC Port0 | ESC Port1 | GMAC2 | GMAC1 19 + * 010b | ESC Port0 | ESC Port1 | ETHSW Port2 | GMAC1 20 + * 011b | ESC Port0 | ESC Port1 | ESC Port2 | GMAC1 21 + * 100b | ETHSW Port0 | ESC Port1 | ESC Port2 | GMAC1 22 + * 101b | ETHSW Port0 | ESC Port1 | ETHSW Port2 | GMAC1 23 + * 110b | ETHSW Port0 | ETHSW Port1 | GMAC2 | GMAC1 24 + * 111b | GMAC0 | GMAC1 | GMAC2 | - 25 + */ 26 + #define ETHSS_GMAC0_PORT 0 27 + #define ETHSS_GMAC1_PORT 1 28 + #define ETHSS_GMAC2_PORT 2 29 + #define ETHSS_ESC_PORT0 3 30 + #define ETHSS_ESC_PORT1 4 31 + #define ETHSS_ESC_PORT2 5 32 + #define ETHSS_ETHSW_PORT0 6 33 + #define ETHSS_ETHSW_PORT1 7 34 + #define ETHSS_ETHSW_PORT2 8 35 + 36 + #endif