Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: "Frager, Neal" <neal.frager@amd.com>
Cc: "Simek, Michal" <michal.simek@amd.com>,
	"luca.ceresoli@bootlin.com" <luca.ceresoli@bootlin.com>,
	"thomas.petazzoni@bootlin.com" <thomas.petazzoni@bootlin.com>,
	"buildroot@buildroot.org" <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH v1 1/3] add package/versal-firmware
Date: Sat, 20 Aug 2022 21:17:36 +0200	[thread overview]
Message-ID: <20220820191736.GQ2167049@scaer> (raw)
In-Reply-To: <CH2PR12MB50042583296DCDC5716F5ACDF06F9@CH2PR12MB5004.namprd12.prod.outlook.com>

Neal, All,

On 2022-08-20 17:52 +0000, Frager, Neal via buildroot spake thusly:
> > This looks like your personal git tree, not the official one. (Yeah,
> > I noticed your email address, but I would still have expected something
> > under https://github.com/Xilinx/).
> I am working on this and am using my own personal github location in
> the meantime to figure out how this could work with buildroot.

Ah, I understand now. Next time, mark your patch as RFC.

> > +if BR2_PACKAGE_VERSAL_FIRMWARE
> > +
> > +config BR2_PACKAGE_VERSAL_FIRMWARE_LOCATION
> > +     string "versal firmware location"
> > The prompt should be "Custom git repository"
> Could you clarify this a bit?  Are you speaking of the BR2 name or the
> string text when you say the prompt?

The prompt is the ârt that is displayed to the user, i.e. the string
between quotes after the option type, in this case:  "versal firmware
location" should be replace with "Custom git repository".

And of course, the astute reader you are noticed that the option name
als needs a rename, BR2_PACKAGE_VERSAL_FIRMWARE_CUSTOM_GIT

However, this will ultimately be uneeded, because the firmware files
hould be downloadable login-less from an official location.

So, the two options that specify the git tree location adn version are
not needed. Just hard-code them in the .mk file

So, the Config.in file should only contain (skeleton with abreviations,
extend as/where appropriate):

    config BR2_PKG_VERSAL_FW
        bool "versal firmware
        help
          Firmware files the the Xilinx Versal familly of boards.

          https://official.xilinix/location/github/whatever/

    if BR2_PKG_VERSAL_FW

    choice
        bool "Versal board"

    config BR2_PKG_VERSAL_FW_VCK190
        bool "vck190

    config BR2_PKG_VERSAL_FW_SOMETHING_ELSE
        bool "something else"

    endchoice

    config BR2_PKG_VERSAL_FW_BOARD
        string
        default "vck190" if BR2_PKG_VERSAL_FW_VCK190
        default "something-else" if BR2_PKG_VERSAL_FW_SOMETHING_ELSE

    endif

and the .mk would look like:

    VERSAL_FW_VERSION = 076d4b4f02b475dd9c65ad51992bfcad8d98b002
    VERSAL_FW_SITE = $(call github,nealfrager,versal_boot,$(VERSALE_FW_VERSION))

    VERSAL_FW_INSTALL_TARGET = NO
    VERSAL_FIRMWARE_INSTALL_IMAGES = YES

    define VERSAL_FW_INSTALL_IMAGES_CMDS
        $(INSTALL) -D -m 0644 $(@D)/$(VERSAL_FW_BOARD)/boot.bin \
            $(BINARIES_DIR)/boot.bin
    endef

    $(eval $(generic-package))

> > +     help
> > +       Location of a versal firmware boot.bin.
> > +
> > +       The value should be a git repository.
> 
> > So, there is not even a default location?
> 
> The official default solution (aside from petalinux) is to clone the
> embeddedsw github location and build the plm.elf and psmfw.elf from
> that with a microblaze compiler.
> And then use bootgen to generate a boot.bin.
> While I can build u-boot and atf easily with buildroot, I do not have
> a clean solution for building the plm and psmfw images and generating
> the boot.bin.

Yeah, I can see it being quite cumbersome. But it is not unheard of in
Buildroot already. For example, we have package/arm-gnu-toolchain/
that provides a pre-built armv7 toolchain, that is used to buid the
boot/arm-trusted-firmware/ in certain conditions.

So, it would be technically possible to package a microblaze compiler
like we've done for arm-gnu-toolchain, and use it to build the plm.elf
and psmfw.elf from "the embeddedsw".

But that is a bit of a stretch to go. Unless...

> This is why I am looking for a short term solution of just downloading
> a prebuilt boot.bin.
> At the moment, distribution of pre-built binaries requires the
> click-wrap downloading procedure which does not lend itself well for
> an automated buildroot download.

Above, you seemed to imply you were looking internally to lift this
click-wrap restriction. If that is not possible, and you can't have the
pre-built blobs hosted in an official Xilinx location, then downloading
the "embeddedsw" and building them would be a fallback.

> > Also, no need for a seaprate macro; just add this code to VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS.
> Same comment as above.  I was working from other examples of firmware
> downloading to create this patch set, and I appreciate your feedback
> for making it simpler.

Looking at other examples is a good refelex! :-) But other may install
more than one file at a time, so they need this complexity of
conditional append-assignments. In your case, it is my understanding
that only one file will ever be copied.

> > In the end, I don't think we should apply this package, as it looks
> > like it tries to circumvent the official distrobution restrictions
> > on these firmware files.
> I understand, and I hope to be able to come up with a solution.

Great! In the meantime, as it is a WIP, I've marked the series as
changes-requested in patchwork. Thanks for the feedback!

> If you have any ideas for how buildroot might be able to generate the
> boot.bin, I am happy to receive any help.

I hope the lead I pointed to above will be enough as a starting point
for you. Do not hesitate to ask further if you have concerns.

Thanks!

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-08-20 19:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-19  6:37 [Buildroot] [PATCH v1 1/3] add package/versal-firmware Neal Frager
2022-08-19  6:37 ` [Buildroot] [PATCH v1 2/3] add board/versal Neal Frager
2022-08-19  6:37 ` [Buildroot] [PATCH v1 3/3] add configs/versal_vck190_defconfig Neal Frager
2022-08-20 15:12 ` [Buildroot] [PATCH v1 1/3] add package/versal-firmware Yann E. MORIN
2022-08-20 17:52   ` Frager, Neal via buildroot
2022-08-20 19:17     ` Yann E. MORIN [this message]
2022-08-21  7:27       ` Frager, Neal via buildroot
2022-08-22 10:01       ` Frager, Neal via buildroot
2022-08-23 19:49         ` Arnout Vandecappelle
2022-08-24  6:43           ` Frager, Neal via buildroot
2022-08-21 19:06   ` Thomas Petazzoni via buildroot
  -- strict thread matches above, loose matches on Subject: below --
2022-10-24 14:22 Neal Frager via buildroot
2022-11-02 16:11 ` Frager, Neal via buildroot
2022-11-02 16:44 ` Thomas Petazzoni via buildroot
2022-11-02 17:10   ` Frager, Neal via buildroot
2022-11-03  7:46 ` Luca Ceresoli via buildroot
2022-11-03  9:08   ` Frager, Neal via buildroot

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=20220820191736.GQ2167049@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=michal.simek@amd.com \
    --cc=neal.frager@amd.com \
    --cc=thomas.petazzoni@bootlin.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