On 4/6/23 4:17 AM, Mike Looijmans wrote:
Okay, got langdale to build with my old SPL configuration.

Because Xilinx doesn't support SPL, I'll move to FSBL for the ZynqMP boards.

You can either provide a binary FSBL, or you can build it from source each time. If you build it from source, you need meta-xilinx-tools and the XSA for your board.

There is a generic one that can be built (thats what the BBMULTICONFIG enables), but being generic it doesn't understand the memory configurations if you deviate at all from whatever the default is.

So add meta-xilinx-tools, provide the path to your XSA and everything is automatic. Otherwise set 'FSBL_FILE' path in your local.conf (or machine.conf) to the path of the pre-built binary, or try to use the generic one (give it 50/50 if it will work for you.)

(pmufw is similar BTW, either use meta-xilinx-tools or provide a prebuilt one or try the generic one, that probably won't be right.)

But now I'm getting lost. There's apparently a bunch of ways to do this,
and I have no idea where to start.

This is implemented as a two step process for each firmware:

(See meta-xilinx-core/recipes-bsp/embeddedsw

Zynq/ZynqMP - fsbl and fsbl-firmware

ZynqMP - pmufw and pmu-firmware

Versal - plmfw and plm-firmware / psmfw and psm-firwmare

The first one is the "linux" recipe that all it does is package/deploy the firmware binary. The second is what actually builds it (if enabled).

The first has: <name>_DEPENDS and <name>_MCDEPENDS variables defined in it. This controls what we depend on. DEPENDS in the same config context, MCDEPENDS across the multiconfig boundary.

It also defines <name>_DEPLOY_DIR (the directory of the binary) and <name>_IMAGE_NAME (the name of the binary WITHOUT .elf or .bin). Note, prebuilts you need to provide BOTH .elf and .bin files.

You might ask why can't I just provide the .elf and the system generates the .bin, it's because main config objcopy may or may not be able to deal with the .elf binary for that firmware. If all you have is the .elf, you can generate the binary, using a compatible objcopy, by using:

   objcopy -O binary <binary>.elf <binary>.bin


Keeping in mind the above, when you add 'meta-xilinx-standalone', the system will bbappend each of the fsbl, pmufw, plmfw and psmfw files establishing a default multiconfig dependency set. This points to the corresponding firmware build, which actually builds the firmware in a baremetal context.

Similarly 'meta-xilinx-tools' (which depends on meta-xilinx-standalone) will further update the configuration to avoid the multiconfig (since it carries a copy of it's own compilers in XSCT), and will allow a single context build. So MCDEPENDS are zeroed and DEPENDS are defined, with a way for each firmware to build via XSCT.

I removed the SPL selection from the machine config, which results in
this build error:

ERROR: Nothing PROVIDES 'fsbl' (but
/.../meta-xilinx/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
DEPENDS on or otherwise requires it)
fsbl was skipped: The expect file
/.../build/tmp-glibc/deploy/images/tdpzu9/fsbl-tdpzu9.elf is not available.
Set FSBL_FILE to the path with a precompiled FSBL binary or you may need
to enable BBMULTICONFIG += 'fsbl-fw' to generate it.
ERROR: Required build target 'my-image' has no buildable providers.
Missing or unbuildable dependency chain was: ['my-image',
'u-boot-zynq-uenv', 'virtual/boot-bin', 'fsbl']

In "meta-xilinx-standalone/README.md" there are two solutions, both
don't work.

One is to use:
BBMULTICONFIG += "fsbl-fw zynqmp-pmufw"

This results in parse errors in
meta-xilinx/meta-xilinx-standalone/recipes-bsp/embeddedsw/fsbl-firmware_git.bb.

Which I can work around by simply removing that recipe.

That will be a problem, since that is the recipe that creates the firmware.

Without that, nothing is going to compile.


Your build should be:

bitbake mc:fsbl-fw:fsbl-firmware

As fsbl-firmware (without meta-xilinx-tools) has to run in a baremetal context.

If you do: bitbake fsbl

It will automatically call the multiconfig to do the build. (This is of course assuming you didn't change the base configuration.)

Then I get this:
ERROR: Nothing PROVIDES 'pmu-firmware'
pmu-firmware was skipped: incompatible with host aarch64-oe-linux (not
in COMPATIBLE_HOST)
pmu-firmware was skipped: incompatible with host aarch64-oe-linux (not
in COMPATIBLE_HOST)
pmu-firmware was skipped: incompatible with host aarch64-xilinx-elf (not
in COMPATIBLE_HOST)

pmu-firmware recipe is not an aarch64 recipe. It can only be built in a baremetal Microblaze configuration.

bitbake mc:zynqmp-pmufw:pmu-firmware

or

bitbake pmufw


All of the above can be avoided if you use meta-xilinx-tools, as the XSCT (Vivado based tooling) will construct the firmware you require inline, but it requires the board's XSA.


Primary usage (the suggested one):

clone down the layers
oe-init-build-env
add the meta-xilinx-core, meta-microblaze, meta-xilinx-standalone, meta-xilinx-tools layers (and their dependencies) to the project

MACHINE=zynqmp-generic bitbake core-image-minimal



Without meta-xilinx-tools, you need to provide the binaries or hope the default configuration is compatible with your configuration.


Provide the binaries yourself:

clone down the layers
oe-init-build-env
add the meta-xilinx-core, meta-microblaze, and meta-xilinx-standalone layers (and their dependencies) to the project

Add to the local.conf:
# Define where to pull the fsbl binary from
# First disable inter-package dependencies
# Then list provide the directory for the binaries
# Then the name of the package, both a .bin and .elf need to be provided
# See meta-xilinx-core/recipes-bsp/embeddedsw/fsbl.bb
FSBL_DEPENDS = ""
FSBL_MCDEPENDS = ""
FSBL_DEPLOY_DIR = "<path to fsbl firmware directory>"
FSBL_IMAGE_NAME = "<path to fsbl firmware, need both .bin and .elf>"


# Define where to pull the pmu-firmware binary from
# First disable inter-package dependencies
# Then list provide the directory for the binaries
# Then the name of the package, both a .bin and .elf need to be provided
# See meta-xilinx-core/recipes-bsp/embeddedsw/pmufw.bb
PMU_DEPENDS = ""
PMU_MCDEPENDS = ""
PMU_FIRMWARE_DEPLOY_DIR = "<path to pmu firmware binary>"
PMU_FIRMWARE_IMAGE_NAME = "<name of pmu firmware binary, need both .bin and 
.elf>

MACHINE=zynqmp-generic bitbake core-image-minimal



An example of using the default configurations (this may or may not work):

clone down the layers
oe-init-build-env
add the meta-xilinx-core, meta-microblaze, and meta-xilinx-standalone layers (and their dependencies) to the project
Add the BBMULTICONFIG line as above

MACHINE=zynqmp-generic bitbake core-image-minimal

This should generally compile, but may not function depending on your board's configuration.



So far for that...


In "meta-xilinx-standalone/README.md" it also mentions:

To build you should use a command similar to:
MACHINE=<machine> DISTRO=xilinx-standalone bitbake <recipe>

This is if you want to do a single context (not multiconfig) build of the components to get just the binaries out of them. You can directory build the firmwares, but you need to make sure everything is configured properly.

For FSBL:

MACHINE=<machine> DISTRO=xilinx-standalone bitbake fsbl-firmware

For pmu-firmware:

Edit your local.conf:
DEFAULTTUNE = "microblaze"
TUNE_FEATURES:tune-microblaze = "microblaze v9.2 barrel-shift pattern-compare reorder fpu-soft"

MACHINE=<machine> DISTRO=xilinx-standalone bitbake pmu-firmware

For plm/psm-firmware:

Edit your local.conf:
DEFAULTTUNE = "microblaze"
TUNE_FEATURES:tune-microblaze = "microblaze v10.0 barrel-shift pattern-compare fpu-soft"

MACHINE=<machine> DISTRO=xilinx-standalone bitbake plm-firmware psm-firmware

I'm fine with that, in the paragraph above it states that:

    cortexa53-zynqmp - ZynqMP based Cortex-A53 target
      Valid Targets: fsbl-firmware, meta-toolchain

But there's no "cortexa53-zynqmp" to be found anywhere.

This is old and I believe removed in the README file update that should be released in a few days. I have a pretty major update for master (mickledore) in testing, and then I'll be backporting the work to Langdale.

--Mark


Please help, how is this supposed to work?









-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#5199): 
https://lists.yoctoproject.org/g/meta-xilinx/message/5199
Mute This Topic: https://lists.yoctoproject.org/mt/98101406/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-xilinx/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to