From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: "Michał Kruszewski" <mkru@protonmail.com>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>,
Alexander Shiyan <eagle.alexander923@gmail.com>
Subject: Re: Compiling barebox without PBL and using dts from Linux dts upstream for Zynq SoC
Date: Thu, 26 Mar 2026 10:28:14 +0100 [thread overview]
Message-ID: <9ae2b9e7-c83d-478e-83b3-9a6f82562259@pengutronix.de> (raw)
In-Reply-To: <mTw4y_xR5aiHEkjdE2rA6eEGvVkxqees8prnFukfaV5DSv4qcIUBmdtZJ--nwcZQjjf_84O-TDQ8cBHlZubeOfUZeInYOK76kyxGVFxrbvc=@protonmail.com>
Hello,
On 3/26/26 10:06 AM, Michał Kruszewski wrote:
>> Do you use upstream or a fork? There seems to be no Z-turn board support upstream.
>
> Upstream, release 2026.03.1.
>
>
>> barebox can generate multiple images in a build, which image did you use?
>
> I think I don't understand the question.
A zynq_defconfig build will report at the end the generated images:
images built:
barebox-avnet-zedboard.img
barebox-dt-2nd.img
Is images/barebox-avnet-zedboard.img the image you used?
>> Every barebox image on ARM has a prebootloader prepended that:
>>
>> - decompresses barebox proper
>> - loads it and configures the MMU
>> - executes it while passing a device tree
>
> How Does PBL pass a device tree to the barebox?
This is the line that does it for the Zynq Zedboard:
barebox_arm_entry(0, SZ_512M, __dtb_z_zynq_zed_start);
This function takes care to extract barebox and invoke it
with these arguments.
>> I am looking at start_avnet_zedboard() and at the start of
>> avnet_zedboard_ps7_init(), it skips the low level init if started
>> second stage, which is what you seem to be after?
>
> This is true.
> However, I don't use the avnet zedboard board.
> I don't want any code realted to some other board to be executed.
barebox generates bootloader images for boards, so you must have
either used an image for an existing board or some intermediate build
artifact, hence my question above.
> What is the point of this?
I am asking to clarify what you did. Your original email didn't
elaborate what you did, only what you thought was the problem.
> The FSBL has already configured everything at this stage.
> If PBL is required, I just want minimal PBL that only does whatever is required to start barebox.
> Is it possible to configure PBL in such a way?
Yes, of course. Just add a new ENTRY_FUNCTION(_WITHSTACK) that does
only the parts you are interested in and reference it in
images/Makefile.zynq.
The skipping logic should still work though.
>> For quick testing, you can replace in arch/arm/dts/zynq-zed.dts
>>
>> #include <arm/xilinx/zynq-zed.dts>
>>
>> with your own board. Check that the stdout-path is correct.
>
> If I do so, the dtb compilation fails with:
> FATAL ERROR: Couldn't open "zynq-zturn-common.dtsi": No such file or directory
> 'zynq-zturn-common.dtsi' is included in 'dts/src/arm/xilinx/zynq-zturn-v5.dts'.
> Is is placed in the same directory as 'zynq-zturn-v5.dts' ('dts/src/arm/xilinx/').
> If I replace
> /include/ "zynq-zturn-common.dtsi"
> with
> /include/ "arm/xilinx/zynq-zturn-common.dtsi"
> the dtc still can't find the file:
> FATAL ERROR: Couldn't open "arm/xilinx/zynq-zturn-common.dtsi": No such file or directory
Argh, I thought /include/ was something that only old PowerPC device
trees still had..
You can replace do
-#include <arm/xilinx/zynq-zed.dts>
+/include/ "../../../dts/src/arm/xilinx/zynq-zturn-v5.dts"
instead for now. Needs some more thought put into it how to do this
in a cleaner manner.
>> dts/ are just the device trees as they are in Linux. You can only build
>> device tree in arch/${ARCH/dts/.
>>
>> You can read more about barebox device tree handling at:
>>
>> https://www.barebox.org/doc/latest/devicetree/index.html
>
> So the help message of the Makefile in the dts directory is misleading.
If you really want, you can build it if you use the correct Makefile:
make -C dts src/arm/xilinx/zynq-zturn-v5.dtb
But it doesn't make barebox magically use that DT, so not sure why
you want to.
> Is is simply copied from the Linux?
Here's the upstream:
https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/
But yes, these DTs are 1:1 from Linux. If you want to make use of them,
a device tree in arch/${ARCH}/dts/ needs to include them.
Cheers,
Ahmad
>
>
> Regards,
> Michał Kruszewski
>
--
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 |
next prev parent reply other threads:[~2026-03-26 9:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 7:29 Michał Kruszewski
2026-03-26 8:19 ` Ahmad Fatoum
2026-03-26 9:06 ` Michał Kruszewski
2026-03-26 9:28 ` Ahmad Fatoum [this message]
2026-03-26 10:35 ` Michał Kruszewski
2026-03-26 14:07 ` Ahmad Fatoum
2026-03-27 10:37 ` Michał Kruszewski
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=9ae2b9e7-c83d-478e-83b3-9a6f82562259@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=eagle.alexander923@gmail.com \
--cc=mkru@protonmail.com \
/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