All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Ceresoli via buildroot <buildroot@buildroot.org>
To: "Frager, Neal" <neal.frager@amd.com>
Cc: "Erkiaga Elorza, Ibai" <ibai.erkiaga-elorza@amd.com>,
	"Simek, Michal" <michal.simek@amd.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Neal Frager via buildroot <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH v1 1/2] package/zynqmp-firmware: new package
Date: Mon, 27 Mar 2023 15:11:23 +0200	[thread overview]
Message-ID: <20230327151123.14c46304@booty> (raw)
In-Reply-To: <B1C2F9E6-C87B-4B1A-A6F9-9A312663D946@amd.com>

Hi Neal,

On Mon, 27 Mar 2023 05:45:45 +0000
"Frager, Neal" <neal.frager@amd.com> wrote:

> Hi Thomas,
> 
> > Le 26 mars 2023 à 22:05, Thomas Petazzoni <thomas.petazzoni@bootlin.com> a écrit :
> > 
> > Hello Neal,
> >   
> >> On Sun, 26 Mar 2023 15:09:48 +0100
> >> Neal Frager via buildroot <buildroot@buildroot.org> wrote:
> >> 
> >> This patch adds a new package to buildroot for building the zynqmp pmufw
> >> with the requirement that the user must provide an external microblaze
> >> toolchain.  
> > 
> > This is not really nice :-/ Was this the conclusion of the discussion
> > we had on this topic?  
> 
> I would not say this is the conclusion of our discussion, but rather a next step.  Once we have a microblaze compiler package, we can update the zynqmp-firmware package to use the included compiler by default or allow users to select an external one, in case they prefer to use the Xilinx distributed compiler.
> 
> >   
> >> +config BR2_PACKAGE_ZYNQMP_FIRMWARE_KRIA_K26
> >> +    bool "kria-k26"
> >> +    help
> >> +      Adds additional CFLAGS for Kria K26 SOMs.  
> > 
> > This doesn't look super extensible. Why are these CFLAGS needed in
> > particular for this platform? Is this a per-SoC or per-board
> > configuration? Do we expect more platforms to need custom CFLAGS?  
> 
> These CFLAGS are needed for the k26 SOMs, so we will need to include them for the kv260 and kr260 defconfigs.  I agree with you that custom flags are not so nice, and hopefully Xilinx will find a better solution for this in future versions.
> 
> For now, I think we have to live with it.
>
> >   
> >> +ZYNQMP_FIRMWARE_VERSION = $(call qstrip,$(BR2_PACKAGE_ZYNQMP_FIRMWARE_VERSION))
> >> +ZYNQMP_FIRMWARE_SOURCE = xilinx_$(ZYNQMP_FIRMWARE_VERSION).tar.gz
> >> +ZYNQMP_FIRMWARE_SITE = https://github.com/Xilinx/embeddedsw/archive/refs/tags  
> > 
> > Use $(call github,...) instead
> >   
> 
> Ok
> 
> >> +ifeq ($(BR2_PACKAGE_ZYNQMP_FIRMWARE_KRIA_K26),y)
> >> +ZYNQMP_CFLAGS = "-Os -flto -ffat-lto-objects -DBOARD_SHUTDOWN_PIN=2 -DBOARD_SHUTDOWN_PIN_STATE=0 \
> >> +        -DENABLE_EM -DENABLE_MOD_OVERTEMP -DENABLE_DYNAMIC_MIO_CONFIG -DENABLE_IOCTL \
> >> +        -DCONNECT_PMU_GPO_2_VAL=0"  
> > 
> > All these CFLAGS are really weird... why isn't this part of the
> > zynqmp-firmware build system itself?

Given you (Neal) are working on this, and you are already active in fixing
some issues in the embeddedsw repository (which is greatly appreciated
here!), why not trying to have a proper solution in there in the first
place?

Fixing things upstream can possibly take time, but in the end it will avoid
adding cruft&hacks in various places, of which I can count 3 now: yocto,
zynqmp-pmufw-builder, and hopefully soon Buildroot.

> >> +else
> >> +ZYNQMP_CFLAGS = "-Os -flto -ffat-lto-objects"
> >> +endif  
> > 
> > In any case, this should be:
> > 
> > ZYNQMP_CFLAGS = -Os -flto -ffat-lto-objects
> > 
> > ifeq ($(BR2_PACKAGE_ZYNQMP_FIRMWARE_KRIA_K26),y)
> > ZYNQMP_CFLAGS += \
> >    -DBOARD_SHUTDOWN_PIN=2 \
> >    -DBOARD_SHUTDOWN_PIN_STATE=0 \
> >    -DENABLE_EM \
> >    -DENABLE_MOD_OVERTEMP \
> >    -DENABLE_DYNAMIC_MIO_CONFIG \
> >    -DENABLE_IOCTL \
> >    -DCONNECT_PMU_GPO_2_VAL=0
> > endif
> >   
> 
> Ok
> 
> >> +
> >> +define ZYNQMP_FIRMWARE_BUILD_CMDS
> >> +    cd $(@D)/lib/sw_apps/zynqmp_pmufw/src && make \
> >> +        COMPILER=$(ZYNQMP_FIRMWARE_TOOLCHAIN_PATH)/$(ZYNQMP_FIRMWARE_TOOLCHAIN_PREFIX)gcc \
> >> +        ARCHIVER=$(ZYNQMP_FIRMWARE_TOOLCHAIN_PATH)/$(ZYNQMP_FIRMWARE_TOOLCHAIN_PREFIX)gcc-ar \
> >> +        CC=$(ZYNQMP_FIRMWARE_TOOLCHAIN_PATH)/$(ZYNQMP_FIRMWARE_TOOLCHAIN_PREFIX)gcc \
> >> +        CFLAGS=$(ZYNQMP_CFLAGS)  
> > 
> > Please use:
> > 
> >    $(MAKE) -C $(@D)/lib/sw_apps/zynqmp_pmufw/src \
> >        ...
> >   

Even better: should you use $(MAKE1) here, would it be possible to get
rid of the 'make -j1' patch?

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2023-03-27 13:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26 14:09 [Buildroot] [PATCH v1 1/2] package/zynqmp-firmware: new package Neal Frager via buildroot
2023-03-26 14:09 ` [Buildroot] [PATCH v1 2/2] boot/uboot.mk: new BR2_TARGET_UBOOT_NEEDS_ZYNQMP_FIRMWARE Neal Frager via buildroot
2023-03-26 20:09   ` Thomas Petazzoni via buildroot
2023-03-27 11:08     ` Frager, Neal via buildroot
2023-03-26 20:05 ` [Buildroot] [PATCH v1 1/2] package/zynqmp-firmware: new package Thomas Petazzoni via buildroot
2023-03-27  5:45   ` Frager, Neal via buildroot
2023-03-27  7:42     ` Thomas Petazzoni via buildroot
2023-03-27  9:00       ` Frager, Neal via buildroot
2023-03-27 13:11     ` Luca Ceresoli via buildroot [this message]
2023-03-27 13:22       ` Frager, Neal via buildroot
2023-03-27 12:21   ` Frager, Neal via buildroot
     [not found]     ` <MN0PR12MB60041E824606160DF5277406A08B9@MN0PR12MB6004.namprd12.prod.outlook.com>
2023-03-27 12:47       ` Frager, Neal via buildroot
2023-03-27 12:57         ` Thomas Petazzoni via buildroot
2023-03-27 13:03           ` 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=20230327151123.14c46304@booty \
    --to=buildroot@buildroot.org \
    --cc=ibai.erkiaga-elorza@amd.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.