All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Frager, Neal via buildroot" <buildroot@buildroot.org>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Neal Frager via buildroot <buildroot@buildroot.org>
Cc: "Simek, Michal" <michal.simek@amd.com>,
	"luca.ceresoli@bootlin.com" <luca.ceresoli@bootlin.com>,
	"Erkiaga Elorza, Ibai" <ibai.erkiaga-elorza@amd.com>
Subject: Re: [Buildroot] [PATCH v1 1/2] package/zynqmp-firmware: new package
Date: Mon, 27 Mar 2023 12:21:16 +0000	[thread overview]
Message-ID: <CH2PR12MB50044744141F901308BAAF8AF08B9@CH2PR12MB5004.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20230326220543.057f381d@windsurf>

Hi Thomas,

> 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?

> +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?

> +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

> +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?

> +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

> +
> +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 \
>		...

Could I possibly ask you for some assistance?  I have implemented all of the changes except this last one.

When I use:
	$(MAKE) -C $(@D)/lib/sw_apps/zynqmp_pmufw/src \
		COMPILER=$(ZYNQMP_FIRMWARE_EXTERNAL_TOOLCHAIN_PATH)/$(ZYNQMP_FIRMWARE_EXTERNAL_TOOLCHAIN_PREFIX)gcc \
		ARCHIVER=$(ZYNQMP_FIRMWARE_EXTERNAL_TOOLCHAIN_PATH)/$(ZYNQMP_FIRMWARE_EXTERNAL_TOOLCHAIN_PREFIX)gcc-ar \
		CC=$(ZYNQMP_FIRMWARE_EXTERNAL_TOOLCHAIN_PATH)/$(ZYNQMP_FIRMWARE_EXTERNAL_TOOLCHAIN_PREFIX)gcc \
		CFLAGS=$(ZYNQMP_CFLAGS)

The build fails as it does not seem to find the relative path ../misc containing necessary include files.

But if I add a change directory command before the make, everything works fine using below:
	cd $(@D)/lib/sw_apps/zynqmp_pmufw/src
	$(MAKE) -C $(@D)/lib/sw_apps/zynqmp_pmufw/src \
		COMPILER=$(ZYNQMP_FIRMWARE_EXTERNAL_TOOLCHAIN_PATH)/$(ZYNQMP_FIRMWARE_EXTERNAL_TOOLCHAIN_PREFIX)gcc \
		ARCHIVER=$(ZYNQMP_FIRMWARE_EXTERNAL_TOOLCHAIN_PATH)/$(ZYNQMP_FIRMWARE_EXTERNAL_TOOLCHAIN_PREFIX)gcc-ar \
		CC=$(ZYNQMP_FIRMWARE_EXTERNAL_TOOLCHAIN_PATH)/$(ZYNQMP_FIRMWARE_EXTERNAL_TOOLCHAIN_PREFIX)gcc \
		CFLAGS=$(ZYNQMP_CFLAGS)

Do you have any ideas why this would be?  Normally I would think the -C option would take care of this, but I am unable to get the zynqmp-firmware package to build without a manual change dir step.

Do you have a clean way to fix this?

Best regards,
Neal Frager
AMD
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2023-03-27 12:21 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
2023-03-27 13:22       ` Frager, Neal via buildroot
2023-03-27 12:21   ` Frager, Neal via buildroot [this message]
     [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=CH2PR12MB50044744141F901308BAAF8AF08B9@CH2PR12MB5004.namprd12.prod.outlook.com \
    --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.