mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Luca Lauro <famlauro93l@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: "open list:BAREBOX" <barebox@lists.infradead.org>, ukleinek@kernel.org
Subject: Re: [PATCH v4 01/14] ARM: mvebu: add Netgear RN102 support
Date: Fri, 21 Aug 2026 13:23:34 +0200	[thread overview]
Message-ID: <CANRe2WK8LAhc4we3m36k7Qcj6yd-=MTugo8K2jeoap2wGy_7Pg@mail.gmail.com> (raw)
In-Reply-To: <4df2a9de-cc31-40ee-8328-a1db9f7aaa7a@pengutronix.de>

Il giorno ven 21 ago 2026 alle ore 11:17 Sascha Hauer
<s.hauer@pengutronix.de> ha scritto:
>
> On 2026-08-20 16:27, Luca Lauro wrote:
> > Hi Sascha,
> >
> > about the NAND node: the upstream DTS does contain the NAND configuration
> > properties, but they are placed inside the `nand@0` child node. Barebox
> > pxa3xx-nand reads these properties from the controller node instead, so
> > the upstream layout is not sufficient for barebox to probe and configure
> > the NAND controller correctly.
> >
> > For this reason the overlay needs to replicate NAND configuration
> > properties in the controller node. Without them, barebox does not apply
> > settings and NAND doesn't work.
> >
> > The only part that is truly duplicated is `status = "okay"`, which I can
> > drop in v5.
> >
> > Thanks for the review.
> >
> > Il giorno lun 17 ago 2026 alle ore 09:51 Sascha Hauer <
> > s.hauer@pengutronix.de> ha scritto:
> >
> > > On 2026-08-13 17:26, Luca Lauro via B4 Relay wrote:
> > > > +                                      filetype_kwbimage_v1);
> > > > +
> > > > +     return 0;
> > > > +}
> > > > +
> > > > +static const struct of_device_id rn102_of_match[] = {
> > > > +     { .compatible = "netgear,rn102" },
> > >
> > > How is the driver probed? The string "netgear,rn102" is in no dts.
> > > Unless I am missing something this should be "netgear,readynas-102".
> > >
> > > Same for the rn104 patch.
> > >
> > > > +/*
> > > > + * NOTE:
> > > > + * armada_370_xp_barebox_entry() cannot be used here because the
> > > > + * upstream SDRAM size detection for Armada 370-XP misinterprets
> > > > + * the DDR_SIZE_CSn registers on this board and reports an incorrect
> > > > + * memory size (256MB instead of 512MB on RN102).
> > > > + *
> > > > + * Until the generic detection code is fixed, we compute the SDRAM
> > > > + * size manually using the DDR_SIZE_CSn values.
> > > > + */
> > > > +static unsigned long armada_370_xp_memory_find(void)
> > > > +{
> > > > +     unsigned long mem_size = 0;
> > > > +
> > > > +     for (int cs = 0; cs < 4; cs++) {
> > > > +             u32 ctrl = readl(ARMADA_370_XP_SDRAM_BASE +
> > > DDR_SIZE_CSn(cs));
> > > > +
> > > > +             /* Skip non-enabled CS */
> > > > +             if ((ctrl & DDR_SIZE_ENABLED) != DDR_SIZE_ENABLED)
> > > > +                     continue;
> > > > +
> > > > +             mem_size += (ctrl | ~DDR_SIZE_MASK) + 1;
> > > > +     }
> > > > +
> > > > +     return mem_size;
> > > > +}
> > >
> > > The only difference I can spot here between this function and the
> > > existing variant in arch/arm/mach-mvebu/common.c is:
> > >
> > > #define  DDR_SIZE_MASK                       0xff000000
> > >
> > > whereas the common.c variant uses:
> > >
> > > #define ARMADA_370_XP_DDR_SIZE_MASK     0xffff0000
> > >
> > > The latter goes down to this:
> > >
> > > > commit 7351b6b5c59c7a280787998006f39a5cd3a2f18b
> > > > Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > > Date:   Tue Jun 13 00:37:49 2017 +0200
> > > >
> > > >     ARM: mvebu: fix size mask for RAM window
> > > >
> > > >     The size field in the window control register occupies bits 31:16. So
> > > >     adapt ARMADA_370_XP_DDR_SIZE_MASK accordingly. This fixes detection
> > > of
> > > >     RAM chips smaller than 32 MiB and so probably doesn't affect any
> > > >     supported machine.
> > > >
> > > >     Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > >     Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > > >
> > > > diff --git a/arch/arm/mach-mvebu/common.c b/arch/arm/mach-mvebu/common.c
> > > > index 06bfb72615..fa971da11e 100644
> > > > --- a/arch/arm/mach-mvebu/common.c
> > > > +++ b/arch/arm/mach-mvebu/common.c
> > > > @@ -47,7 +47,7 @@
> > > >  #define ARMADA_370_XP_SDRAM_BASE       (IOMEM(MVEBU_REMAP_INT_REG_BASE)
> > > + 0x20000)
> > > >  #define ARMADA_370_XP_DDR_SIZE_CSn(n)  (0x184 + ((n) * 0x8))
> > > >  #define ARMADA_370_XP_DDR_SIZE_ENABLED BIT(0)
> > > > -#define ARMADA_370_XP_DDR_SIZE_MASK    0xff000000
> > > > +#define ARMADA_370_XP_DDR_SIZE_MASK    0xffff0000
> > > >
> > > >  /*
> > > >   * Marvell MVEBU SoC id and revision can be read from any PCIe
> > >
> > > @Uwe, Where did you get that information from. Could it be that we
> > > should just revert this one given that it seems to be untested on your
> > > side?
> > >
> > > > +
> > > > +&nand_controller {
> > > > +     compatible = "marvell,armada370-nand", "marvell,pxa3xx-nand";
> > > > +     status = "okay";
> > >
> > > These two properties are already in the upstream dts files, please drop.
>
> Could you retry on current -next? It contains
>
> fac937411f mtd: nand: nand_mrvl_nfc: support the nand-controller bindings
>
> which seems to fix that issue. At least that fixed the binding on my
> pxa3xx board.

I tested the RN102 on current barebox-next, including commit
fac937411f (“mtd: nand: nand_mrvl_nfc: support the nand-controller
bindings”).

Results:

- The NAND controller on RN102 is now probed correctly without any
  workaround in the controller node. ECC strength and step size are
  taken from the upstream DTS, and the BBT is detected properly.

- The barebox DT overlay can now limit itself to redefining the
  partition layout under nand@0. The duplicated NAND configuration
  properties in the controller node are no longer required.

- Environment and barebox-state backends work correctly with the
  updated overlay.

So the upstream nand-controller binding support fixes the issue on
RN102 as well. I will drop the duplicated NAND properties in v5 and
keep only the partition definitions.

Thanks,
Luca

>
> Sascha
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
>



  reply	other threads:[~2026-08-21 11:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 15:26 [PATCH v4 00/14] (no cover subject) Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 01/14] ARM: mvebu: add Netgear RN102 support Luca Lauro via B4 Relay
2026-08-17  7:51   ` Sascha Hauer
2026-08-18  8:44     ` Uwe Kleine-König
2026-08-19  7:16       ` Sascha Hauer
2026-08-19  7:39         ` Uwe Kleine-König
     [not found]       ` <6a85585d.5770c427.2e0747.7f3dSMTPIN_ADDED_MISSING@mx.google.com>
2026-08-20 17:59         ` Luca Lauro
2026-08-21 10:07           ` Sascha Hauer
2026-08-21 11:57             ` Luca Lauro
2026-08-20 14:35     ` Luca Lauro
     [not found]     ` <CANRe2W+Cp82qe+R_VNf_hXV+NRet+F63fq34pEw3FR-s4kw3zg@mail.gmail.com>
2026-08-21  9:17       ` Sascha Hauer
2026-08-21 11:23         ` Luca Lauro [this message]
2026-08-13 15:26 ` [PATCH v4 02/14] ARM: mvebu: enable RN102 in mvebu_defconfig Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 03/14] ARM: mvebu: improve Netgear RN104 support Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 04/14] ARM: mvebu: rename PUTC_LL to MVEBU_PUTC_LL Luca Lauro via B4 Relay
2026-08-21 10:38   ` Sascha Hauer
2026-08-21 12:26     ` Luca Lauro
2026-08-13 15:26 ` [PATCH v4 05/14] drivers: fan: add fan subsystem, core API and G76x fan controller driver Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 06/14] commands: add fan control command Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 07/14] usb: ehci: add Marvell EHCI host controller driver Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 08/14] usb: ehci: initialize periodic_queue_dma Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 09/14] ata: ahci: add PCI AHCI and Marvell 9170 controller support Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 10/14] ata: ahci: fix zero-length DMA handling Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 11/14] ata: ahci: add helper for ATA commands without data Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 12/14] ata: ahci: improve AHCI port bring-up sequence Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 13/14] ata: ahci: add FLUSH EXT and STANDBY IMMEDIATE support during shutdown Luca Lauro via B4 Relay
2026-08-13 15:26 ` [PATCH v4 14/14] ata: ahci: cleanup legacy code and remove unused paths Luca Lauro via B4 Relay

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='CANRe2WK8LAhc4we3m36k7Qcj6yd-=MTugo8K2jeoap2wGy_7Pg@mail.gmail.com' \
    --to=famlauro93l@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    --cc=ukleinek@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