devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Lukasz Stelmach <l.stelmach@samsung.com>
Cc: "Rob Herring" <robh+dt@kernel.org>,
	"Kukjin Kim" <kgene@kernel.org>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Bartłomiej Żołnierkiewicz" <b.zolnierkie@samsung.com>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>
Subject: Re: [PATCH] ARM: dts: exynos: Add a placeholder for a MAC address
Date: Thu, 1 Oct 2020 11:16:48 +0200	[thread overview]
Message-ID: <CAJKOXPfghaFLruCJwkgoG0j_G6+EVZTPKY2MNsQ33CkxD2naxg@mail.gmail.com> (raw)
In-Reply-To: <dleftjr1qigx6p.fsf%l.stelmach@samsung.com>

On Thu, 1 Oct 2020 at 10:36, Lukasz Stelmach <l.stelmach@samsung.com> wrote:
>
> It was <2020-10-01 czw 09:22>, when Krzysztof Kozlowski wrote:
> > On Wed, Sep 30, 2020 at 04:31:51PM +0200, Łukasz Stelmach wrote:
> >> Add a placeholder for a MAC address. A bootloader may fill it
> >> to set the MAC address and override EEPROM settings.
> >>
> >> Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
> >> ---
> >>  arch/arm/boot/dts/exynos5422-odroidxu3.dts | 18 ++++++++++++++++++
> >>  1 file changed, 18 insertions(+)
> >>
> >> diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3.dts b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
> >> index db0bc17a667b..9f7f3eacb750 100644
> >> --- a/arch/arm/boot/dts/exynos5422-odroidxu3.dts
> >> +++ b/arch/arm/boot/dts/exynos5422-odroidxu3.dts
> >> @@ -70,3 +70,21 @@ &pwm {
> >>  &usbdrd_dwc3_1 {
> >>      dr_mode = "peripheral";
> >>  };
> >> +
> >> +&usbhost2 {
> >> +    #address-cells = <1>;
> >> +    #size-cells = <0>;
> >> +
> >> +    hub@1 {
> >> +            compatible = "usb8087,0024";
> >> +            reg = <1>;
> >> +            #address-cells = <1>;
> >> +            #size-cells = <0>;
> >> +
> >> +            ethernet: usbether@1 {
> >> +                    compatible = "usb0c45,6310";
> >> +                    reg = <1>;
> >> +                    mac-address = [00 00 00 00 00 00]; /* Filled in by a bootloader */
> >
> > Why do you need a placeholder? U-Boot can just append the
> > address/property.
>
> Several other dts files have such placeholder
>
> git grep 'mac-addr.*\[00 00 00 00 00 00\]' arch/arm/boot/dts/ | wc -l
> 26

Yeah, but if this is cargo cult, then it is not a good reason. First of all,
git grep '[^-]mac-addr.*\[.*00 00 00 00 00 00.*\]' arch/arm/boot/dts/
gives just seven boards. Not a big number to make a standard. :)

The meaning of mac-address, I think, is not a placeholder, but:
"should be used in cases where the MAC address assigned to the device
by the boot program is different from the local-mac-address property."

I think you actually wanted a local-mac-address and the majority of
DTSes use it. Not mac-address.

>
> I can see two scenarios where this patch may be helpful. Another
> (simple) boot loading code might be used.

OK, good point. However other bootloader still has to adhere to the DT
specification and the bindings.

> The value may also be
> customized during build time and used without any support of a
> bootloader.

Yes, with an overlay. You do not need a placeholder for this and
actually having a placeholder instead of using overlays is the wrong
approach for customization of boots/builds.

> Finding and filling a placeholder would be easier in u-boot too.

U-Boot already has the code for updating mac-address or
local-mac-address so how is it easier for him? You mean that it cannot
find an ethernet node here?

> And it serves as a reference how to configure a USB device in a dts

Great places for references are examples in bindings.

Best regards,
Krzysztof

  reply	other threads:[~2020-10-01  9:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200930143154eucas1p22c1560c485f5d8b8be729c76028c89c7@eucas1p2.samsung.com>
2020-09-30 14:31 ` [PATCH] ARM: dts: exynos: Add a placeholder for a MAC address Łukasz Stelmach
2020-10-01  7:22   ` Krzysztof Kozlowski
     [not found]     ` <CGME20201001083615eucas1p2886f47d032844823b419a92fa02994ad@eucas1p2.samsung.com>
2020-10-01  8:36       ` Lukasz Stelmach
2020-10-01  9:16         ` Krzysztof Kozlowski [this message]
     [not found]           ` <CGME20201001101051eucas1p2d6237daf16a89831e9b7b5bf106c7074@eucas1p2.samsung.com>
2020-10-01 10:10             ` Lukasz Stelmach
     [not found]   ` <CGME20201001135310eucas1p273e3799cec0ebb29891c1b7db38685e0@eucas1p2.samsung.com>
2020-10-01 13:52     ` [PATCH v2] " Łukasz Stelmach
2020-10-01 18:46       ` Krzysztof Kozlowski
2020-11-01 14:07       ` Anand Moon
2020-11-02 16:22         ` Marek Szyprowski
2020-11-05  8:06           ` Anand Moon
2020-11-05  8:18             ` Marek Szyprowski

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=CAJKOXPfghaFLruCJwkgoG0j_G6+EVZTPKY2MNsQ33CkxD2naxg@mail.gmail.com \
    --to=krzk@kernel.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kgene@kernel.org \
    --cc=l.stelmach@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).