10 commenti su “Building the ZynqMP PMU firmware, the simple way”

  1. This script has been a life-saver. I struggled for weeks to sort out the complexity of Xilinx Yocto layers and building PMU firmware. It’s amazing how much simpler it can be. Thanks for your effort to solve this problem.

    Rispondi
  2. Hi Luca,
    I followed the steps in https://github.com/lucaceresoli/zynqmp-pmufw-builder. After step 2 I have pmu_cfg_obj.c in two different directories (./embeddedsw/lib/sw_apps/zynqmp_fsbl/misc/pm_cfg_obj.c and ./embeddedsw/lib/sw_apps/zynqmp_pmufw/src/pm_cfg_obj.c).

    I tried to ran anyway the step 4 but it returns:

    patching file lib/sw_apps/zynqmp_pmufw/src/pm_binding.c
    Hunk #1 succeeded at 23 (offset -25 lines).
    Hunk #2 succeeded at 65 (offset -25 lines).
    sed: impossibile leggere pm_cfg_obj.c: File o directory non esistente

    Should I copy one of the two files mentioned above in current dir? And then, should I rerun ./build.sh pmufw-patch?

    Thanks. I need to find a way to fix pmu-firmuware issue to create a yocto build for zcu102.

    Rispondi
    • Hi Raffaele,

      patching the PMUFW sources to use an hard-coded configuration object is not supported anymore. There is a better way, see https://lucaceresoli.net/zynqmp-uboot-spl-pmufw-cfg-load/ for more info. Apologies, I should have updated README.md, I’ll do it now.

      BTW you probably can still use the old, unsupported way by copying your pm_cfg_obj.c in the root of your zynqmp-pmufw-builder clone.

      What matters it that you must use the pm_cfg_obj.c for _your_ hardware and configuration. If you are using a supported development board _and_ you are using it with the same configuration as the vendor, then you can use a pm_cfg_obj.c provided by the vendor or found in the U-Boot sources, but to be generic you should produce that file for your board and configuration. i.e. from your Vivado project.

      I know only one way to produce it: take the XSA (or HDF) file generated by Vivado and open it with Vitis (or XSDK), then follow the wizard to create a FSBL project. You can find your pm_cfg_obj.c somewhere in the generated files: take that file and throw away the rest.

      Hope it helps.
      Luca

      Rispondi
      • Hi Luca,

        I tried again following your updated README.md, after I pulled your git.
        When I ran “$ ./build.sh pmufw-build” I encountered an error:

        microblaze_selftest.S: Assembler messages:
        microblaze_selftest.S:554: Error: unknown opcode “bsifi”
        microblaze_selftest.S:555: Error: unknown opcode “bsefi”
        make: *** [Makefile:61: ../../../lib/microblaze_selftest.o] Error 1
        make: Leaving directory ‘/home/raffaele/yocto/ultra-scale/zynqmp-pmufw-builder/embeddedsw/lib/sw_apps/zynqmp_pmufw/misc/zynqmp_pmufw_bsp/psu_pmu_0/libsrc/standalone/src’

        Rispondi
        • Hi Raffaele,

          I think an issue or bug report is more effectively reported as a github issue.

          However, to reply your question: I just tested building and it succeeds. However I tried more recent PMUFW versions (2020.2) instead of 2020.1 that is currently supported by zynqmp-pmufw-builder, and that failed with the same error message. Are you trying to build PMUFW >= 2020.2?

          I will try to look at these versions, but that won’t be very soon I’m afraid. If you solve it before I do, please send a patch or pull request!

          Rispondi
  3. Thank you for this. Going to see how hard it’ll be to weld this into Yocto as a build step because there is ABSOLUTELY no reasons for AMD tying you up so when they provide the bulk of the core as FOSS stuff in bitbake metadata layers.

    Rispondi
    • Hello Frank,

      a Yocto integration that is simple (unlike the meta-xilinx one, the last time I looked at it at least) would be great indeed!

      However using a script like the one I wrote is probably not the best way to go, especially the step building a toolchain using crosstool-NG does not make much sense in the context of a build system, that has building toolchains in its DNA by its very nature.

      There is work in progress in the Buildroot community to be able to build the PMU firmware along with the Microblaze toolchain within an otherwise ARM64 build. The idea is to add the necessary packages (equivalent to recipes in Yocto terminology) to build the necessary components of a bare metal toolchain: binutils, gcc and newlib. Here is the latest iteration of the patch series. This looks like the most correct approach, and I think it would be for Yocto/OE as well.

      With a proper toolchain in place, building the PMU firmware is really simple, as you can see in patch 5 of the series mentioned above.

      Luca

      Rispondi

Rispondi a Luca Ceresoli Annulla risposta

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close