mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH] ARM: clps711x: Switch to devicetree usage
Date: Fri, 20 May 2022 14:31:42 +0300	[thread overview]
Message-ID: <CAP1tNvQO_6FULYt9tFeY1KQNSCuEdEBERm28N7csV89kGb+0ig@mail.gmail.com> (raw)
In-Reply-To: <30d02935-d1c8-edb2-2117-3ac6f1e0f7d6@pengutronix.de>

Hello.

пт, 20 мая 2022 г. в 12:56, Ahmad Fatoum <a.fatoum@pengutronix.de>:
>
> Hello,
>
> On 20.05.22 10:24, Alexander Shiyan wrote:
> > This is a complex patch that switches the ARM CLPS711X architecture
> > to work with the device tree. Includes changes to board initialization
> > and any architecture drivers used.
...
> > +static __init int clep7212_fixup(void)
> > +{
> > +     if (of_machine_is_compatible("cirrus,ep7209"))
> > +             of_register_fixup(clep7212_dt_fixup, NULL);
> > +
> > +     return 0;
> > +}
> > +postcore_initcall(clep7212_fixup);
>
> You can replace this with the new barebox_set_serial_number(), see:
> https://git.pengutronix.de/cgit/barebox/commit/?h=next&id=f6756e9ce6f26dc22506e25bd5cf1a4f6a173636

This change is currently in the next branch, but Ok.

> > +ENTRY_FUNCTION(start_ep7212_clep7212, r0, r1, r2)
> >  {
> > +     void *fdt;
> > +
> >       arm_cpu_lowlevel_init();
> >
> > -     clps711x_barebox_entry(CLPS711X_CPU_PLL_MULT, NULL);
> > +     /* Stack in SRAM */
> > +     arm_setup_stack(CS6_BASE - 16);
>
> please use ENTRY_FUNCTION_WITHSTACK instead to be a bit more
> future-proof. Also - 16 is not necessary, see
> 6b3dc4abd884 ("ARM: Cleanup stack offset cargo cult").

Ok.

> > +static void clps711x_bus_patch(struct device_node *node,
> > +                            u32 compare, u32 change)
> > +{
>
> Could you add a comment why this is necessary?

Because the barebox cannot use address 0 (NOR MTD in my case), the bus driver
scans for devices that start at zero address and maps them to a
different unused address.
To start the kernel, a fixup is used that rewrites the address of the
patched device to its original state.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2022-05-20 11:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20  8:24 Alexander Shiyan
2022-05-20  9:56 ` Ahmad Fatoum
2022-05-20 11:31   ` Alexander Shiyan [this message]
2022-05-20 11:38     ` Sascha Hauer

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=CAP1tNvQO_6FULYt9tFeY1KQNSCuEdEBERm28N7csV89kGb+0ig@mail.gmail.com \
    --to=eagle.alexander923@gmail.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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