public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Tony Dinh <mibodhi@gmail.com>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Stefan Roese <sr@denx.de>, David Purdy <david.c.purdy@gmail.com>,
	Tom Rini <trini@konsulko.com>, Marek Beh_n <marek.behun@nic.cz>,
	Pali Roh_r <pali@kernel.org>,
	Christian Hewitt <christianshewitt@gmail.com>,
	Fabio Estevam <festevam@denx.de>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Lokesh Vutla <lokeshvutla@ti.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Peter Robinson <pbrobinson@gmail.com>,
	Tim Harvey <tharvey@gateworks.com>
Subject: Re: [PATCH 1/8] arm: kirkwood: Pogoplug-V4 : Add DTS files
Date: Sun, 19 Dec 2021 00:03:33 +0000	[thread overview]
Message-ID: <20211219000333.395f3ad2@slackpad.fritz.box> (raw)
In-Reply-To: <CAJaLiFxjCBR+Kg3qOm6Jf65Z4VESREUpY9QONE-OCpEHr78nSA@mail.gmail.com>

On Sat, 18 Dec 2021 14:05:39 -0800
Tony Dinh <mibodhi@gmail.com> wrote:

Hi Tony,

> On Sat, Dec 18, 2021 at 8:38 AM Andre Przywara <andre.przywara@arm.com> wrote:
> >
> > On Fri, 17 Dec 2021 20:23:27 -0800
> > Tony Dinh <mibodhi@gmail.com> wrote:
> >
> > Hi,
> >  
> > > Add DTS files for Pogoplug V4 board  
> >
> > is there any reason you didn't take the kirkwood-pogoplug-series-4.dts
> > file from the Linux tree? That is the same device, isn't it?
> >
> > Tom will ask you about the upstream status anyway...  
> 
> There were some differences that I dislike about the Linux tree
> version. Such as the NAND mtd0 is read-only, but we store the envs in
> mtd0 (a few blocks after the u-boot image). It seems we both created
> this DTS about the same time back then in early 2010's using the same
> source as a base. Both versions are identical in substance, but the
> node placements are different.
> 
> I'm not familiar with the thinking here. If we take the Linux upstream
> version, are we allowed to modify it? please advise.

In general the rule is to only take verbatim copies from the Linux
tree. The DT describes the hardware, so there should be no change
needed between U-Boot and Linux. The kernel has more reviewers for DT
changes, so their DTs are of better quality.

So if you think the DT in the kernel tree is wrong or missing out, you
should try to send a patch to Linux to get this fixed, then sync the
change into the U-Boot tree.

There is a way to make small changes to the DT that U-Boot sees: You
create a file with the same stub name, but add "-u-boot.dtsi", and put
your changes in there. Look into arch/arm/dts, there are plenty of
examples. However you should have a good reason for doing that, and
ideally would not need that at all.

Your case is somewhat interesting: the partition isn't technically
write-protected, I guess, it's probably just some Linux safe guarding
measure to prevent accidental overwrites of the firmware.
So read-only in there is strictly speaking not correct, so you should
try to get this fixed in Linux. Ideally U-Boot would add the read-only
property, after it consumed the node, so that the kernel does not stomp
over it (unless you want U-Boot environment access from Linux).

So in your case you should copy the existing kernel DT, and then
put: "/delete-property/ read-only;" in *-u-boot.dtsi.
What DT do you typically give to the kernel? Something loaded along
with the kernel? Or just the U-Boot DT, using $fdtcontroladdr?

Cheers,
Andre

> > >
> > > Signed-off-by: Tony Dinh <mibodhi@gmail.com>
> > > ---
> > >
> > >  arch/arm/dts/Makefile                 |   1 +
> > >  arch/arm/dts/kirkwood-pogoplug_v4.dts | 145 ++++++++++++++++++++++++++
> > >  2 files changed, 146 insertions(+)
> > >  create mode 100644 arch/arm/dts/kirkwood-pogoplug_v4.dts
> > >
> > > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> > > index 7f622fedbd..716c6c0ed2 100644
> > > --- a/arch/arm/dts/Makefile
> > > +++ b/arch/arm/dts/Makefile
> > > @@ -68,6 +68,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += \
> > >       kirkwood-openrd-client.dtb \
> > >       kirkwood-openrd-ultimate.dtb \
> > >       kirkwood-pogo_e02.dtb \
> > > +     kirkwood-pogoplug_v4.dtb \
> > >       kirkwood-sheevaplug.dtb
> > >
> > >  dtb-$(CONFIG_MACH_S900) += \
> > > diff --git a/arch/arm/dts/kirkwood-pogoplug_v4.dts b/arch/arm/dts/kirkwood-pogoplug_v4.dts
> > > new file mode 100644
> > > index 0000000000..b4754f600e
> > > --- /dev/null
> > > +++ b/arch/arm/dts/kirkwood-pogoplug_v4.dts
> > > @@ -0,0 +1,145 @@
> > > +// SPDX-License-Identifier: GPL-2.0+
> > > +/*
> > > + * Copyright (C) 2014-2021 Tony Dinh <mibodhi@gmail.com>
> > > + *
> > > + * Device tree file for the Pogoplug V4/Mobile
> > > + *
> > > + */
> > > +
> > > +/dts-v1/;
> > > +
> > > +#include "kirkwood.dtsi"
> > > +#include "kirkwood-6192.dtsi"
> > > +
> > > +/ {
> > > +     model = "Pogoplug v4";
> > > +     compatible = "cloudengines,pogoplug-v4", "cloudengines,pogoplug-mobile",
> > > +             "marvell,kirkwood-88f6192", "marvell,kirkwood";
> > > +
> > > +     memory {
> > > +             device_type = "memory";
> > > +             reg = <0x00000000 0x8000000>;
> > > +     };
> > > +
> > > +     chosen {
> > > +             bootargs = "console=ttyS0,115200";
> > > +             stdout-path = &uart0;
> > > +     };
> > > +
> > > +     ocp@f1000000 {
> > > +             pinctrl: pin-controller@10000 {
> > > +                     pmx_led_green: pmx-led-green {
> > > +                             marvell,pins = "mpp22";
> > > +                             marvell,function = "gpio";
> > > +                     };
> > > +                     pmx_led_red: pmx-led-red {
> > > +                             marvell,pins = "mpp24";
> > > +                             marvell,function = "gpio";
> > > +                     };
> > > +                     pmx_button_eject: pmx-button-eject {
> > > +                             marvell,pins = "mpp29";
> > > +                             marvell,function = "gpio";
> > > +                     };
> > > +             };
> > > +
> > > +             serial@12000 {
> > > +                     status = "ok";
> > > +             };
> > > +
> > > +             sata@80000 {
> > > +                     status = "okay";
> > > +                     nr-ports = <2>;
> > > +             };
> > > +
> > > +             mvsdio@90000 {
> > > +                     pinctrl-0 = <&pmx_sdio>;
> > > +                     pinctrl-names = "default";
> > > +                     status = "okay";
> > > +                     cd-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
> > > +                     /* No WP GPIO */
> > > +             };
> > > +     };
> > > +
> > > +     gpio-leds {
> > > +             compatible = "gpio-leds";
> > > +             pinctrl-0 = <&pmx_led_red &pmx_led_green>;
> > > +             pinctrl-names = "default";
> > > +
> > > +             health {
> > > +                     label = "status:green:health";
> > > +                     gpios = <&gpio0 22 GPIO_ACTIVE_LOW>;
> > > +                     default-state = "keep";
> > > +             };
> > > +             fault {
> > > +                     label = "status:red:fault";
> > > +                     gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
> > > +             };
> > > +     };
> > > +
> > > +     gpio_keys {
> > > +             compatible = "gpio-keys";
> > > +             #address-cells = <1>;
> > > +             #size-cells = <0>;
> > > +             pinctrl-0 = <&pmx_button_eject>;
> > > +             pinctrl-names = "default";
> > > +
> > > +             button@1 {
> > > +                     label = "Eject Button";
> > > +                     linux,code = <KEY_EJECTCD>;
> > > +                     gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
> > > +             };
> > > +     };
> > > +
> > > +};
> > > +
> > > +&nand {
> > > +     status = "okay";
> > > +
> > > +     partition@0 {
> > > +             label = "u-boot";
> > > +             reg = <0x0000000 0x200000>;
> > > +     };
> > > +
> > > +     partition@200000 {
> > > +             label = "uImage";
> > > +             reg = <0x200000 0x300000>;
> > > +     };
> > > +
> > > +     partition@500000 {
> > > +             label = "uImage2";
> > > +             reg = <0x500000 0x300000>;
> > > +     };
> > > +
> > > +     partition@800000 {
> > > +             label = "failsafe";
> > > +             reg = <0x800000 0x800000>;
> > > +     };
> > > +
> > > +     partition@1000000 {
> > > +             label = "root";
> > > +             reg = <0x1000000 0x7000000>;
> > > +     };
> > > +};
> > > +
> > > +&mdio {
> > > +     status = "okay";
> > > +
> > > +     ethphy0: ethernet-phy@0 {
> > > +             reg = <0>;
> > > +     };
> > > +};
> > > +
> > > +&eth0 {
> > > +     status = "okay";
> > > +     ethernet0-port@0 {
> > > +             phy-handle = <&ethphy0>;
> > > +     };
> > > +};
> > > +
> > > +&pciec {
> > > +     status = "okay";
> > > +};
> > > +
> > > +&pcie0 {
> > > +     status = "okay";
> > > +};  
> >  


  reply	other threads:[~2021-12-19  0:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-18  4:23 [PATCH 0/8] arm: kirkwood: Add support for Pogoplug V4 Tony Dinh
2021-12-18  4:23 ` [PATCH 1/8] arm: kirkwood: Pogoplug-V4 : Add DTS files Tony Dinh
2021-12-18 16:38   ` Andre Przywara
2021-12-18 22:05     ` Tony Dinh
2021-12-19  0:03       ` Andre Przywara [this message]
2021-12-19  1:23         ` Tony Dinh
2021-12-18  4:23 ` [PATCH 2/8] arm: kirkwood: Pogoplug V4 : Add board defconfig file Tony Dinh
2021-12-18 13:17   ` Pali Rohár
2021-12-18 21:41     ` Tony Dinh
2021-12-20  7:18       ` Stefan Roese
2021-12-20 21:09         ` Tony Dinh
2021-12-18  4:23 ` [PATCH 3/8] arm: kirkwood: Pogoplug-V4 : Add Kconfig files Tony Dinh
2021-12-18  4:23 ` [PATCH 4/8] arm: kirkwood: Pogoplug-V4 : Add board include configs file Tony Dinh
2021-12-18 13:12   ` Pali Rohár
2021-12-18 21:27     ` Tony Dinh
2021-12-18  4:23 ` [PATCH 5/8] arm: kirkwood: Pogoplug-V4 : Add board kwbimage file Tony Dinh
2021-12-18  4:23 ` [PATCH 6/8] arm: kirkwood: Pogoplug-V4 : Add board implementation header Tony Dinh
2021-12-18 13:09   ` Pali Rohár
2021-12-18 21:47     ` Tony Dinh
2021-12-20  7:23       ` Stefan Roese
2021-12-20 21:14         ` Tony Dinh
2021-12-18  4:23 ` [PATCH 7/8] arm: kirkwood: Pogoplug-V4 : Add board implementation Tony Dinh
2021-12-18 22:59   ` Marek Behún
2021-12-18 23:28     ` Tony Dinh
2021-12-18 23:42       ` Marek Behún
2021-12-18  4:23 ` [PATCH 8/8] arm: kirkwood: Pogoplug-V4 : Add board maintainer Tony Dinh

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=20211219000333.395f3ad2@slackpad.fritz.box \
    --to=andre.przywara@arm.com \
    --cc=christianshewitt@gmail.com \
    --cc=david.c.purdy@gmail.com \
    --cc=festevam@denx.de \
    --cc=jagan@amarulasolutions.com \
    --cc=lokeshvutla@ti.com \
    --cc=marek.behun@nic.cz \
    --cc=mibodhi@gmail.com \
    --cc=narmstrong@baylibre.com \
    --cc=pali@kernel.org \
    --cc=pbrobinson@gmail.com \
    --cc=sr@denx.de \
    --cc=tharvey@gateworks.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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