[8/8] arm64: dts: allwinner: orangepi-zero2: Add i2c aliases

Message ID 20261110-h616-zero2-dt-v1-8-05506d760f21@gmail.com (mailing list archive)
State New
Headers
Series arm64: dts: allwinner: h616: Orange Pi Zero2 fixes, GPU DVFS and GPU cooling |

Commit Message

Arun Iyengar via B4 Relay Nov. 10, 2026, 5:37 a.m. UTC
From: Arun Iyengar <aiyengar1990@gmail.com>

The I2C core numbers adapters after the "i2cN" aliases and hands out
dynamic numbers, in probe order, to adapters without one. The Orange Pi
Zero2 DT has no i2c aliases, so a TWI controller enabled by an overlay
for the header pins gets whatever number is free when it probes: TWI3
on header pins 3 and 5 does not show up as /dev/i2c-3, and the number
changes with the set of enabled buses. The vendor manual and the
vendor BSP name the buses after the controller.

Pin the numbering as the vendor BSP does: i2c0 to i2c4 are TWI0 to
TWI4, i2c5 is R_TWI. Disabled controllers get no adapter, so nothing
changes for buses that stay off.

Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

Jernej Skrabec Nov. 10, 2026, 4:11 p.m. UTC | #1
Dne torek, 10. november 2026 ob 06:37:02 Srednjeevropski standardni čas je Arun Iyengar via B4 Relay napisal(a):
> From: Arun Iyengar <aiyengar1990@gmail.com>
> 
> The I2C core numbers adapters after the "i2cN" aliases and hands out
> dynamic numbers, in probe order, to adapters without one. The Orange Pi
> Zero2 DT has no i2c aliases, so a TWI controller enabled by an overlay
> for the header pins gets whatever number is free when it probes: TWI3
> on header pins 3 and 5 does not show up as /dev/i2c-3, and the number
> changes with the set of enabled buses. The vendor manual and the
> vendor BSP name the buses after the controller.
> 
> Pin the numbering as the vendor BSP does: i2c0 to i2c4 are TWI0 to
> TWI4, i2c5 is R_TWI. Disabled controllers get no adapter, so nothing
> changes for buses that stay off.
> 
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>

NAK. 

Extension connector is not covered by board DT. Use overlays
if you want to use them.

Best regards,
Jernej

> ---
>  arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> index d5d39bac5915..98fc83291dc8 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> @@ -12,6 +12,15 @@
>  / {
>  	model = "OrangePi Zero2";
>  	compatible = "xunlong,orangepi-zero2", "allwinner,sun50i-h616";
> +
> +	aliases {
> +		i2c0 = &i2c0;
> +		i2c1 = &i2c1;
> +		i2c2 = &i2c2;
> +		i2c3 = &i2c3;
> +		i2c4 = &i2c4;
> +		i2c5 = &r_i2c;
> +	};
>  };
>  
>  &cpu0 {
> 
>
  
Arun Iyengar Nov. 12, 2026, 5:03 a.m. UTC | #2
Understood - please disregard v2, v3 will fix this issue.

On Tue, Nov 10, 2026 at 8:11 AM Jernej Škrabec <jernej.skrabec@gmail.com> wrote:
>
> Dne torek, 10. november 2026 ob 06:37:02 Srednjeevropski standardni čas je Arun Iyengar via B4 Relay napisal(a):
> > From: Arun Iyengar <aiyengar1990@gmail.com>
> >
> > The I2C core numbers adapters after the "i2cN" aliases and hands out
> > dynamic numbers, in probe order, to adapters without one. The Orange Pi
> > Zero2 DT has no i2c aliases, so a TWI controller enabled by an overlay
> > for the header pins gets whatever number is free when it probes: TWI3
> > on header pins 3 and 5 does not show up as /dev/i2c-3, and the number
> > changes with the set of enabled buses. The vendor manual and the
> > vendor BSP name the buses after the controller.
> >
> > Pin the numbering as the vendor BSP does: i2c0 to i2c4 are TWI0 to
> > TWI4, i2c5 is R_TWI. Disabled controllers get no adapter, so nothing
> > changes for buses that stay off.
> >
> > Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
>
> NAK.
>
> Extension connector is not covered by board DT. Use overlays
> if you want to use them.
>
> Best regards,
> Jernej
>
> > ---
> >  arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> > index d5d39bac5915..98fc83291dc8 100644
> > --- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> > @@ -12,6 +12,15 @@
> >  / {
> >       model = "OrangePi Zero2";
> >       compatible = "xunlong,orangepi-zero2", "allwinner,sun50i-h616";
> > +
> > +     aliases {
> > +             i2c0 = &i2c0;
> > +             i2c1 = &i2c1;
> > +             i2c2 = &i2c2;
> > +             i2c3 = &i2c3;
> > +             i2c4 = &i2c4;
> > +             i2c5 = &r_i2c;
> > +     };
> >  };
> >
> >  &cpu0 {
> >
> >
>
>
>
>
  

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
index d5d39bac5915..98fc83291dc8 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
@@ -12,6 +12,15 @@ 
 / {
 	model = "OrangePi Zero2";
 	compatible = "xunlong,orangepi-zero2", "allwinner,sun50i-h616";
+
+	aliases {
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;
+		i2c3 = &i2c3;
+		i2c4 = &i2c4;
+		i2c5 = &r_i2c;
+	};
 };
 
 &cpu0 {