mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Luca Lauro via B4 Relay
	<devnull+famlauro93l.gmail.com@kernel.org>,
	 "open list:BAREBOX" <barebox@lists.infradead.org>,
	Luca Lauro <famlauro93l@gmail.com>
Subject: Re: [PATCH v3 01/15] ARM: mvebu: add Netgear RN102 support
Date: Mon, 3 Aug 2026 15:43:59 +0200	[thread overview]
Message-ID: <vcqxg6s7erwuuxe62wdhecqrqsuao427vigelmvkg5pqjamvz7@46g5a3zsbs43> (raw)
In-Reply-To: <E1wqsAC-00000007q3I-490Q@pty.whiteo.stw.pengutronix.de>

On 26-08-03, Sascha Hauer wrote:
> On 2026-08-02 15:16, Luca Lauro via B4 Relay wrote:
> > From: Luca Lauro <famlauro93l@gmail.com>
> > 
> > This adds full support for the Netgear ReadyNAS 102, including:
> > 
> >  - board driver matching on "netgear,rn102"
> >  - lowlevel initialization
> >  - barebox overlay with environment, state backend and
> > 	NAND partition layout
> >  - Kconfig entry
> >  - image support
> > 
> > Signed-off-by: Luca Lauro <famlauro93l@gmail.com>
> > ---
> >  arch/arm/boards/Makefile                 |   1 +
> >  arch/arm/boards/netgear-rn102/Makefile   |   4 +
> >  arch/arm/boards/netgear-rn102/board.c    | 243 +++++++++++++++++++++++++++++++
> >  arch/arm/boards/netgear-rn102/lowlevel.c |  58 ++++++++
> >  arch/arm/dts/Makefile                    |   1 +
> >  arch/arm/dts/armada-370-rn102-bb.dts     |  82 +++++++++++
> >  arch/arm/mach-mvebu/Kconfig              |   4 +
> >  images/Makefile.mvebu                    |  10 ++
> >  8 files changed, 403 insertions(+)
> > 
> > diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
> > index dd2f2c324e..aca1b45a81 100644
> > --- a/arch/arm/boards/Makefile
> > +++ b/arch/arm/boards/Makefile
> > @@ -64,6 +64,7 @@ obj-$(CONFIG_MACH_MARVELL_ARMADA_XP_DB)		+= marvell-armada-xp-db/
> >  obj-$(CONFIG_MACH_MX23EVK)			+= freescale-mx23-evk/
> >  obj-$(CONFIG_MACH_MX28EVK)			+= freescale-mx28-evk/
> >  obj-$(CONFIG_MACH_MYIRTECH_X335X)		+= myirtech-x335x/
> > +obj-$(CONFIG_MACH_NETGEAR_RN102)		+= netgear-rn102/
> >  obj-$(CONFIG_MACH_NETGEAR_RN104)		+= netgear-rn104/
> >  obj-$(CONFIG_MACH_NETGEAR_RN2120)		+= netgear-rn2120/
> >  obj-$(CONFIG_MACH_NVIDIA_BEAVER)		+= nvidia-beaver/
> > diff --git a/arch/arm/boards/netgear-rn102/Makefile b/arch/arm/boards/netgear-rn102/Makefile
> > new file mode 100644
> > index 0000000000..da63d2625f
> > --- /dev/null
> > +++ b/arch/arm/boards/netgear-rn102/Makefile
> > @@ -0,0 +1,4 @@
> > +# SPDX-License-Identifier: GPL-2.0-only
> > +
> > +obj-y += board.o
> > +lwl-y += lowlevel.o
> > diff --git a/arch/arm/boards/netgear-rn102/board.c b/arch/arm/boards/netgear-rn102/board.c
> > new file mode 100644
> > index 0000000000..dba3d11518
> > --- /dev/null
> > +++ b/arch/arm/boards/netgear-rn102/board.c
> > @@ -0,0 +1,243 @@
> > +// SPDX-License-Identifier: GPL-2.0-only
> > +
> > +#include <common.h>
> > +#include <init.h>
> > +#include <gpio.h>
> > +#include <driver.h>
> > +#include <of.h>
> > +#include <linux/device.h>
> > +#include <linux/mbus.h>
> > +#include <mach/mvebu/armada-370-xp-regs.h>
> > +#include <bbu.h>
> > +
> > +/*
> > + *  Early GPIO0 MMIO
> > + *
> > + * GPIO driver arrives too late for the disks to be
> > + * ready in time for AHCI driver probe.
> 
> barebox supports deep probe which means the devices are made available
> once needed or requested. Provided your dts carries the
> barebox,deep-probe property you can do this:
> 
> of_device_ensure_probed_by_alias("gpio0");
> of_device_ensure_probed_by_alias("gpio1");
> of_device_ensure_probed_by_alias("gpio2");
> 
> From that on the GPIO driver should be probed and you can use it.
> 
> It shouldn't be necessary to duplicate the GPIO driver here.
> 
> > +/*
> > + * RN102 board driver
> > + *
> > + * Preferred pattern: board-specific code as a platform driver
> > + * matching on the root DT node ("netgear,rn102").
> > + */
> > +static int rn102_probe(struct device *dev)
> > +{
> > +	/* CFU configuration */
> > +	writel(0xC6, 0xf1020228);
> > +
> > +	setup_usb0();
> > +	setup_bays();
> > +	init_disks();
> > +
> > +	/* Barebox Update handlers */
> > +	bbu_register_std_file_update("bootloader", 0,
> > +					 "/dev/nand0.bootloader",
> > +					 filetype_kwbimage_v1);
> > +
> > +	bbu_register_std_file_update("kernel", 0,
> > +					 "/dev/nand0.kernel",
> > +					 filetype_arm_zimage);
> > +
> > +	bbu_register_std_file_update("minirootfs", 0,
> > +					 "/dev/nand0.minirootfs",
> > +					 filetype_gzip);
> 
> That is a creative use of barebox update handlers. They are designed for
> updating barebox itself, not arbitrary other components.
> 
> I must think about this.

Hint:
You can expose the kernel and minirootfs via fastboot partitions to get
a nice user interface. Barebox can talk the fastboot protocol over USB
or NET.

Regards,
  Marco



  reply	other threads:[~2026-08-03 13:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-02 13:16 [PATCH v3 00/15] ARM: mvebu: add Netgear RN102/RN104 support and related drivers Luca Lauro via B4 Relay
2026-08-02 13:16 ` [PATCH v3 01/15] ARM: mvebu: add Netgear RN102 support Luca Lauro via B4 Relay
2026-08-03 12:53   ` Sascha Hauer
2026-08-03 13:43     ` Marco Felsch [this message]
2026-08-02 13:16 ` [PATCH v3 02/15] ARM: mvebu: enable RN102 in mvebu_defconfig Luca Lauro via B4 Relay
2026-08-02 13:16 ` [PATCH v3 03/15] ARM: mvebu: improve Netgear RN104 support Luca Lauro via B4 Relay
2026-08-02 13:16 ` [PATCH v3 04/15] ARM: mvebu: rename PUTC_LL to MVEBU_PUTC_LL Luca Lauro via B4 Relay
2026-08-02 13:16 ` [PATCH v3 05/15] drivers: fan: add fan subsystem, core API and G76x fan controller driver Luca Lauro via B4 Relay
2026-08-02 13:16 ` [PATCH v3 06/15] commands: add fan control command Luca Lauro via B4 Relay
2026-08-02 13:16 ` [PATCH v3 07/15] usb: ehci: add Marvell EHCI host controller driver Luca Lauro via B4 Relay
2026-08-02 13:16 ` [PATCH v3 08/15] usb: ehci: initialize periodic_queue_dma Luca Lauro via B4 Relay
2026-08-03 21:27   ` Sascha Hauer
2026-08-02 13:16 ` [PATCH v3 09/15] ata: ahci: add PCI AHCI and Marvell 9170 controller support Luca Lauro via B4 Relay
2026-08-03 21:33   ` Sascha Hauer
2026-08-02 13:16 ` [PATCH v3 10/15] ata: ahci: fix zero-length DMA handling Luca Lauro via B4 Relay
2026-08-02 13:16 ` [PATCH v3 11/15] ata: ahci: add helper for ATA commands without data Luca Lauro via B4 Relay
2026-08-02 13:16 ` [PATCH v3 12/15] ata: ahci: improve AHCI port bring-up sequence Luca Lauro via B4 Relay
2026-08-02 13:16 ` [PATCH v3 13/15] ata: ahci: add FLUSH EXT and STANDBY IMMEDIATE support during shutdown Luca Lauro via B4 Relay
2026-08-03 21:52   ` Sascha Hauer
2026-08-02 13:16 ` [PATCH v3 14/15] ata: ahci: add shutdown helpers for AHCI controllers Luca Lauro via B4 Relay
2026-08-03 21:55   ` Sascha Hauer
2026-08-02 13:16 ` [PATCH v3 15/15] 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=vcqxg6s7erwuuxe62wdhecqrqsuao427vigelmvkg5pqjamvz7@46g5a3zsbs43 \
    --to=m.felsch@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=devnull+famlauro93l.gmail.com@kernel.org \
    --cc=famlauro93l@gmail.com \
    --cc=s.hauer@pengutronix.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