Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Chukun Pan" <amadeus@jmu.edu.cn>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 1/1] riscv: dts: spacemit: set ETH MAC from eeprom for OrangePi
Date: Sun, 20 Sep 2026 10:05:38 +0000	[thread overview]
Message-ID: <20260920100538.C3CD61F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260920100000.3888256-1-amadeus@jmu.edu.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dts: removing standard aliases to bypass bootloader behavior
--

commit 8bb8e326a73a3935458461c280ad331fa5713466
Author: Chukun Pan <amadeus@jmu.edu.cn>

riscv: dts: spacemit: set ETH MAC from eeprom for OrangePi

This commit configures the OrangePi R2S and RV2 device trees to read
the Ethernet MAC address from an EEPROM. It also removes the ethernet0
and ethernet1 aliases to prevent U-Boot from patching the MAC address
incorrectly.

> diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
> index 7125f2882ce85..073cc975135f4 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-r2s.dts
> @@ -16,8 +16,6 @@ aliases {
>  		i2c2 = &i2c2;
>  		i2c8 = &i2c8;
>  		serial0 = &uart0;
> -		ethernet0 = &eth0;
> -		ethernet1 = &eth1;

[Severity: Medium]
Is it appropriate to remove these standard network aliases to bypass a
bootloader limitation? 

The device tree is intended to accurately describe the hardware structure
independent of bootloader software bugs or workarounds. Removing standard
aliases can disrupt predictable network interface naming and standard device
enumeration. 

As stated in the commit message, this change is made solely to avoid U-Boot
patching incorrect MAC addresses. Modifying an OS device tree to hack around
bootloader limitations, such as U-Boot's fdt_fixup_ethernet, is generally
considered an anti-pattern. 

Could this be addressed by changing U-Boot's configuration for this board
instead?

>  	};
>  
>  	chosen {

[ ... ]

> diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> index 837616255464a..609c4755775df 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> @@ -15,8 +15,6 @@ / {
>  
>  	aliases {
>  		serial0 = &uart0;
> -		ethernet0 = &eth0;
> -		ethernet1 = &eth1;

[Severity: Medium]
Does removing these aliases here also risk disrupting predictable network
interface naming for the OS? 

As mentioned above, it might be safer to fix the U-Boot configuration
rather than omitting standard hardware aliases in the OS device tree.

>  		i2c2 = &i2c2;
>  		i2c8 = &i2c8;
>  		mmc0 = &emmc;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260920100000.3888256-1-amadeus@jmu.edu.cn?part=1

  reply	other threads:[~2026-09-20 10:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-20 10:00 [PATCH 1/1] riscv: dts: spacemit: set ETH MAC from eeprom for OrangePi Chukun Pan
2026-09-20 10:05 ` sashiko-bot [this message]
2026-09-21 12:42 ` Yixun Lan
2026-09-22  6:50   ` Chukun Pan
2026-09-22  7:29     ` Yixun Lan
2026-09-23  6:40       ` Chukun Pan
2026-09-24  1:23         ` Troy Mitchell
2026-09-22  8:55 ` Troy Mitchell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260920100538.C3CD61F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=amadeus@jmu.edu.cn \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox