From: Andrey Skvortsov <andrej.skvortzov@gmail.com>
To: Andre Przywara <andre.przywara@arm.com>,
Arnaud Ferraris <arnaud.ferraris@collabora.com>
Cc: "Jagan Teki" <jagan@amarulasolutions.com>,
"Hans de Goede" <hdegoede@redhat.com>,
u-boot@lists.denx.de, "Samuel Holland" <samuel@sholland.org>,
"Jarrah Gosbell" <kernel@undef.tools>,
"Jernej Škrabec" <jernej.skrabec@gmail.com>,
"Vagrant Cascadian" <vagrant@debian.org>,
"Jonas Smedegaard" <dr@jones.dk>
Subject: Re: [PATCH] sunxi: board: provide CPU idle states to loaded OS
Date: Wed, 6 Sep 2023 23:53:51 +0300 [thread overview]
Message-ID: <ZPjm30KGDpY30D7k@skv.local> (raw)
In-Reply-To: <20230906011232.05ee691a@slackpad.lan>
Hi Andre,
On 23-09-06 01:12, Andre Przywara wrote:
> On Tue, 5 Sep 2023 11:37:31 +0300
> Andrey Skvortsov <andrej.skvortzov@gmail.com> wrote:
>
> Hi,
>
> > On 23-09-05 09:27, Andre Przywara wrote:
> > > On Mon, 4 Sep 2023 23:54:30 +0300
> > > Andrey Skvortsov <andrej.skvortzov@gmail.com> wrote:
> > >
> > > Hi Andrey,
> > >
> > > > When using SCPI as the PSCI backend, firmware can wake up the CPUs and
> > > > cluster from sleep, so CPU idle states are available for loaded OS to
> > > > use. TF-A modifies DTB to advertise available CPU idle states, when
> > > > SCPI is detected. This change copies nodes added by TF-A to any new
> > > > dtb that is used for loaded OS.
> > >
> > > Why do you need that, exactly? Why not just use $fdtcontroladdr for the
> > > kernel? We now keep the U-Boot copy of the .dts files in sync with the
> > > kernel. If you need to modify the DT in U-Boot, for instance by applying
> > > overlays, you can copy that DTB into a better suitable location first:
> > > => fdt move $fdtcontroladdr $fdt_addr_r
> > >
> > > In any case, there shall be only one DT, that one in the U-Boot image. Why
> > > do you need to load another one for the kernel?
> >
> > extlinux is used by distributions (sometimes with device-specific changes especially
>
> What distros are that? I guess some special ones, targeting embedded
> devices, like the Pinephone?
It's more likely universal operating system. In my particular case
this is Mobian (several device-specific packages on top of
Debian). It's very-very close to Debian with a goal to be
pure Debian in the near future.
Rhino Linux is using extlinux as well and will benefit for this change
as well.
> And who is generating extlinux.conf then? Is that some distro specific
> scripting, similar to how grub is configured?
extlinux.conf is automatically generated by standard Debian
u-boot-menu package. See [1] and [2].
> Honest questions, I am not a user of extlinux, I mostly use UEFI
> booting, or type U-Boot commands directly for experiments, or use
> boot.scr, as a quick-and-dirty hack.
> > for platforms not fully supported by mainline yet),
>
> Do you need any changes to the DT? Do you need to apply overlays?
> If you run on a non-mainlined platform, you could still put your DT
> into the U-Boot tree, then you wouldn't need to load another DTB, which
> also simplifies the deployment on the kernel/distro side.
Currently Mobian linux kernel for sunxi-devices contains 36 extra patches with DT
modifications (add/remove nodes, modify existing properties). One of
them unconditionally adds cpuidle states to DT, that I'm trying to fix
upstream here with the proposed change.
DT overlays are not used.
Honestly I don't think that using dtb from u-boot will simplify
distribution deployment and maintenance. IMHO, it will make things
more complex. Currently on my device there are records in extlinux.conf
for 5.9, 5.10, 5.15, several 6.1 kernels, that I'm working on. All of
them have slightly (or sometimes more) different device-trees. Having
kernel and dtb deployed together makes life so much easier.
Mobian's dtb can't be put into u-boot. Mobian doesn't provide
device-specific bootloader (u-boot) and there is on-going work on
making device-independent universal images.
As many other mobile Linux distributions Mobian relies on
Tow-Boot. That is used as a cross-distribution firmware (u-boot/tf-a/crust). [3]
> > then U-Boot loads DT defined in
> > extlinux.conf file. u-boot scripts are not used in case of extlinux at all.
>
> That's fine, you don't need any U-Boot scripts for this to work. If
> there is no "fdt" or "fdtdir" label in extlinux.conf, then the U-Boot
> PXE code will eventually fall back to $fdtcontroladdr - I just tested
> that.
> So could you make that work for you? I guess all you need to change is
> to remove any fdtdir label from extlinux.conf?
>
> Cheers,
> Andre
Regardless proposed change. Changes to dtb nodes already copied in
u-boot on the fly in boot/image-fdt.c:image_setup_libfdt. For example,
created optee nodes are copied there. I've just put platform specific
changes into platform specific ft_board_setup, that was made
apparently exactly for that.
1. https://packages.debian.org/trixie/u-boot-menu
2. https://salsa.debian.org/debian/u-boot-menu
3. https://tow-boot.org/
--
Best regards,
Andrey Skvortsov
next prev parent reply other threads:[~2023-09-06 20:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-04 20:54 [PATCH] sunxi: board: provide CPU idle states to loaded OS Andrey Skvortsov
2023-09-05 8:27 ` Andre Przywara
2023-09-05 8:37 ` Andrey Skvortsov
2023-09-06 0:12 ` Andre Przywara
2023-09-06 20:53 ` Andrey Skvortsov [this message]
2023-09-11 22:15 ` Andre Przywara
2023-09-14 20:22 ` Andrey Skvortsov
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=ZPjm30KGDpY30D7k@skv.local \
--to=andrej.skvortzov@gmail.com \
--cc=andre.przywara@arm.com \
--cc=arnaud.ferraris@collabora.com \
--cc=dr@jones.dk \
--cc=hdegoede@redhat.com \
--cc=jagan@amarulasolutions.com \
--cc=jernej.skrabec@gmail.com \
--cc=kernel@undef.tools \
--cc=samuel@sholland.org \
--cc=u-boot@lists.denx.de \
--cc=vagrant@debian.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