diff mbox series

[1/3] arm64: tegra: Add ethernet alias on Jetson TX1

Message ID 20190613161517.2837-1-thierry.reding@gmail.com
State Deferred
Headers show
Series [1/3] arm64: tegra: Add ethernet alias on Jetson TX1 | expand

Commit Message

Thierry Reding June 13, 2019, 4:15 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

Adding this alias for the Ethernet interface on Jetson TX1 allows the
bootloader to pass the MAC address to the Linux kernel.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Stephen Warren June 13, 2019, 4:22 p.m. UTC | #1
On 6/13/19 10:15 AM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Adding this alias for the Ethernet interface on Jetson TX1 allows the
> bootloader to pass the MAC address to the Linux kernel.

> diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi b/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi

> +	aliases {
> +		ethernet = "/usb@70090000/ethernet@1";
> +	};

Don't aliases require an ID in the property name, i.e shouldn't this be 
"ethernet0" rather than just "ethernet"? This is a bit more obvious in 
the TX2 patch where sdhci0, sdhci1, and serial0 are shown in the diff 
context.

Patch should probably be CC'd to some/all of ARM/DT/... mailing lists?
Thierry Reding June 13, 2019, 4:34 p.m. UTC | #2
On Thu, Jun 13, 2019 at 10:22:23AM -0600, Stephen Warren wrote:
> On 6/13/19 10:15 AM, Thierry Reding wrote:
> > From: Thierry Reding <treding@nvidia.com>
> > 
> > Adding this alias for the Ethernet interface on Jetson TX1 allows the
> > bootloader to pass the MAC address to the Linux kernel.
> 
> > diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi b/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi
> 
> > +	aliases {
> > +		ethernet = "/usb@70090000/ethernet@1";
> > +	};
> 
> Don't aliases require an ID in the property name, i.e shouldn't this be
> "ethernet0" rather than just "ethernet"? This is a bit more obvious in the
> TX2 patch where sdhci0, sdhci1, and serial0 are shown in the diff context.

I don't think there's a requirement for aliases to have an ID. The IDs,
in the cases that I'm aware of, are used to fix the index given to the
controllers in Linux (which is sometimes abused to get fixed numbering
that can be hardcoded, rather than having a more robust way to look up
the right hardware block).

U-Boot has a comment somewhere about ethernet being equivalent to
ethernet0 and it treats them the same way, if I remember correctly.

As for upstream Linux, there does indeed seem to be a slight tendency
towards ethernet0, though it's pretty well mixed. 32-bit ARM is mostly
balanced, whereas 64-bit ARM uses ethernet0 almost exclusively. Maybe
this means that recently there's been a push to standardize on always
adding the index?

> Patch should probably be CC'd to some/all of ARM/DT/... mailing lists?

Oops... I meant to include those. Added now.

Thierry
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi b/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi
index 9ba69e68a844..c7cc81994f2c 100644
--- a/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi
@@ -5,6 +5,10 @@ 
 	model = "NVIDIA Tegra210 P2597 I/O board";
 	compatible = "nvidia,p2597", "nvidia,tegra210";
 
+	aliases {
+		ethernet = "/usb@70090000/ethernet@1";
+	};
+
 	host1x@50000000 {
 		dpaux@54040000 {
 			status = "okay";
@@ -1342,6 +1346,13 @@ 
 		avdd-usb-supply = <&vdd_3v3_sys>;
 
 		status = "okay";
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethernet@1 {
+			reg = <1>;
+		};
 	};
 
 	padctl@7009f000 {