All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Trouble with u-boot on a ZynqMP board
@ 2021-06-15  7:50 Alvaro Gamez
  2021-06-16 20:52 ` Luca Ceresoli
  0 siblings, 1 reply; 7+ messages in thread
From: Alvaro Gamez @ 2021-06-15  7:50 UTC (permalink / raw)
  To: buildroot

Hi!

I'm trying to use buildroot to generate a system for the Digilent
Genesys board, which is based on the zynqmp SOC. Thanks to the
wonderful job of Luca and others, it should be pretty straightforward,
but I'm having trouble getting it to boot, and I was hoping I could
get some guidance on what to do next.

I'm using buildroot version 2021.05, with u-boot version 2021.04,
which has latest patches that should allow booting completely via
u-boot, without using Xilinx' FSBL

I'm using Digient's reference design to generate configuration object
pm_cfg_obj.c and PSU init file psu_init_gpl.c, which shall be fed to
u-boot. Alongside these files, I'm make buildroot download a generic
PMU firmware built by Luca at
https://github.com/lucaceresoli/zynqmp-pmufw-binaries/raw/master/bin/pmufw-v2018.3.bin
and here is the relevant configuration:

BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_Genesys_PATH)/uboot_defconfig"
BR2_TARGET_UBOOT_NEEDS_DTC=y
BR2_TARGET_UBOOT_SPL=y
BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
BR2_TARGET_UBOOT_ZYNQMP=y
BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/lucaceresoli/zynqmp-pmufw-binaries/raw/master/bin/pmufw-v2018.3.bin"
BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="/tmp/pm_cfg_obj.c"
BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE="/tmp/psu_init_gpl.c"
BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_Genesys_PATH)/orig.dts"

To provide Arm Trusted Firmware, I'm passing buildroot the same
configuration as already exists on configs/zynqmp_zcu106_defconfig
which is:

BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/ARM-software/arm-trusted-firmware.git"
BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="v1.5"
BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="zynqmp"
BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT=y

The device tree I'm using is extracted from Digilent's kernel image,
so it should be correct, although I had to manually patch u-boot to
include my "orig.dtb" as a target of dtb-$(CONFIG_ARCH_ZYNQMP)

So, it is assumption that this should make u-boot prompt appear after
power up, but I must be wrong because nothing appears at all on the
serial console.

Provided image by Digilent follows the Xilinx' booting workflow, so
only a BOOT.BIN file is on the sdcard which includes xilinx' FSBL, PMU
firmware with configuration object, u-boot, kernel, device tree, etc,
so at least I know that the board is fine as this firmware works
flawlessly. I also was able to load the kernel and device tree as
built by buildroot over this instance of u-boot, so at least I can
load my own kernel, but I can't progress deeper than that.

I've only worked before with Zynq based devices and they were no such
trouble, so I'm quite a bit lost right now and would appreciate any
help that I can get.

Thanks a lot!

-- 
?lvaro G?mez Machado

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Trouble with u-boot on a ZynqMP board
  2021-06-15  7:50 [Buildroot] Trouble with u-boot on a ZynqMP board Alvaro Gamez
@ 2021-06-16 20:52 ` Luca Ceresoli
  2021-06-22  5:58   ` Alvaro Gamez
  0 siblings, 1 reply; 7+ messages in thread
From: Luca Ceresoli @ 2021-06-16 20:52 UTC (permalink / raw)
  To: buildroot

Hi Alvaro,

On 15/06/21 09:50, Alvaro Gamez wrote:
> Hi!
> 
> I'm trying to use buildroot to generate a system for the Digilent
> Genesys board, which is based on the zynqmp SOC. Thanks to the
> wonderful job of Luca and others, it should be pretty straightforward,
> but I'm having trouble getting it to boot, and I was hoping I could
> get some guidance on what to do next.

Thanks for your appreciation! However I must say setting up zynqmp
booting is never straightforward... :-/

> I'm using buildroot version 2021.05, with u-boot version 2021.04,
> which has latest patches that should allow booting completely via
> u-boot, without using Xilinx' FSBL
> 
> I'm using Digient's reference design to generate configuration object
> pm_cfg_obj.c and PSU init file psu_init_gpl.c, which shall be fed to
> u-boot. Alongside these files, I'm make buildroot download a generic
> PMU firmware built by Luca at
> https://github.com/lucaceresoli/zynqmp-pmufw-binaries/raw/master/bin/pmufw-v2018.3.bin
> and here is the relevant configuration:
> 
> BR2_TARGET_UBOOT=y
> BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
> BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_Genesys_PATH)/uboot_defconfig"
> BR2_TARGET_UBOOT_NEEDS_DTC=y
> BR2_TARGET_UBOOT_SPL=y
> BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
> BR2_TARGET_UBOOT_ZYNQMP=y
> BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/lucaceresoli/zynqmp-pmufw-binaries/raw/master/bin/pmufw-v2018.3.bin"
> BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="/tmp/pm_cfg_obj.c"
> BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE="/tmp/psu_init_gpl.c"
> BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_Genesys_PATH)/orig.dts"
> 
> To provide Arm Trusted Firmware, I'm passing buildroot the same
> configuration as already exists on configs/zynqmp_zcu106_defconfig
> which is:
> 
> BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
> BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
> BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/ARM-software/arm-trusted-firmware.git"
> BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="v1.5"
> BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="zynqmp"
> BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT=y
> 
> The device tree I'm using is extracted from Digilent's kernel image,
> so it should be correct, although I had to manually patch u-boot to
> include my "orig.dtb" as a target of dtb-$(CONFIG_ARCH_ZYNQMP)
> 
> So, it is assumption that this should make u-boot prompt appear after
> power up, but I must be wrong because nothing appears at all on the
> serial console.
> 
> Provided image by Digilent follows the Xilinx' booting workflow, so
> only a BOOT.BIN file is on the sdcard which includes xilinx' FSBL, PMU
> firmware with configuration object, u-boot, kernel, device tree, etc,
> so at least I know that the board is fine as this firmware works
> flawlessly. I also was able to load the kernel and device tree as
> built by buildroot over this instance of u-boot, so at least I can
> load my own kernel, but I can't progress deeper than that.

I can't point out a specific potential cause for your problem. I would
expect to see at least the U-Boot SPL prompt. You might want to enable
some debug outputs in the pmufw code to see it it starts at least.

I haven't been working on zynqmp recently but back at the times
(2018~2019) one needed to have the various booting components "in sync",
expecially pmufw, U-Boot and SPL or FSBL. I don't remember whether ATF
was critical too in that respect. By "in sync" I mean the major version
number (the year) should be the same.

Here you are using a 2018 pmufw and 2021 U-Boot so you muight want to
build a more recent pmufw and see if you get any improvements.

I'm afraid I cannot be more helpful at the moment.

-- 
Luca

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Trouble with u-boot on a ZynqMP board
  2021-06-16 20:52 ` Luca Ceresoli
@ 2021-06-22  5:58   ` Alvaro Gamez
  2021-06-24 21:51     ` Luca Ceresoli
  0 siblings, 1 reply; 7+ messages in thread
From: Alvaro Gamez @ 2021-06-22  5:58 UTC (permalink / raw)
  To: buildroot

Hi, Luca

El mi?, 16 jun 2021 a las 22:52, Luca Ceresoli
(<luca@lucaceresoli.net>) escribi?:
>
> Hi Alvaro,
>
> On 15/06/21 09:50, Alvaro Gamez wrote:
> > Hi!
> >
> > I'm trying to use buildroot to generate a system for the Digilent
> > Genesys board, which is based on the zynqmp SOC. Thanks to the
> > wonderful job of Luca and others, it should be pretty straightforward,
> > but I'm having trouble getting it to boot, and I was hoping I could
> > get some guidance on what to do next.
>
> Thanks for your appreciation! However I must say setting up zynqmp
> booting is never straightforward... :-/

Yeah, tell me about it :)

>
> > I'm using buildroot version 2021.05, with u-boot version 2021.04,
> > which has latest patches that should allow booting completely via
> > u-boot, without using Xilinx' FSBL
> >
> > I'm using Digient's reference design to generate configuration object
> > pm_cfg_obj.c and PSU init file psu_init_gpl.c, which shall be fed to
> > u-boot. Alongside these files, I'm make buildroot download a generic
> > PMU firmware built by Luca at
> > https://github.com/lucaceresoli/zynqmp-pmufw-binaries/raw/master/bin/pmufw-v2018.3.bin
> > and here is the relevant configuration:
> >
> > BR2_TARGET_UBOOT=y
> > BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
> > BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_Genesys_PATH)/uboot_defconfig"
> > BR2_TARGET_UBOOT_NEEDS_DTC=y
> > BR2_TARGET_UBOOT_SPL=y
> > BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
> > BR2_TARGET_UBOOT_ZYNQMP=y
> > BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/lucaceresoli/zynqmp-pmufw-binaries/raw/master/bin/pmufw-v2018.3.bin"
> > BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="/tmp/pm_cfg_obj.c"
> > BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE="/tmp/psu_init_gpl.c"
> > BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_Genesys_PATH)/orig.dts"
> >
> > To provide Arm Trusted Firmware, I'm passing buildroot the same
> > configuration as already exists on configs/zynqmp_zcu106_defconfig
> > which is:
> >
> > BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
> > BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
> > BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/ARM-software/arm-trusted-firmware.git"
> > BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="v1.5"
> > BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="zynqmp"
> > BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT=y
> >
> > The device tree I'm using is extracted from Digilent's kernel image,
> > so it should be correct, although I had to manually patch u-boot to
> > include my "orig.dtb" as a target of dtb-$(CONFIG_ARCH_ZYNQMP)
> >
> > So, it is assumption that this should make u-boot prompt appear after
> > power up, but I must be wrong because nothing appears at all on the
> > serial console.
> >
> > Provided image by Digilent follows the Xilinx' booting workflow, so
> > only a BOOT.BIN file is on the sdcard which includes xilinx' FSBL, PMU
> > firmware with configuration object, u-boot, kernel, device tree, etc,
> > so at least I know that the board is fine as this firmware works
> > flawlessly. I also was able to load the kernel and device tree as
> > built by buildroot over this instance of u-boot, so at least I can
> > load my own kernel, but I can't progress deeper than that.
>
> I can't point out a specific potential cause for your problem. I would
> expect to see at least the U-Boot SPL prompt. You might want to enable
> some debug outputs in the pmufw code to see it it starts at least.

I'm going all crazy about configuring U-Boot and my headache is noticeable now.
Won't you happen to have a working u-boot with SPL defconfig that works on any
particular zynqmp board?

> I haven't been working on zynqmp recently but back at the times
> (2018~2019) one needed to have the various booting components "in sync",
> expecially pmufw, U-Boot and SPL or FSBL. I don't remember whether ATF
> was critical too in that respect. By "in sync" I mean the major version
> number (the year) should be the same.
>
> Here you are using a 2018 pmufw and 2021 U-Boot so you muight want to
> build a more recent pmufw and see if you get any improvements.

Great, that's a nice idea, thank you!

>
> I'm afraid I cannot be more helpful at the moment.
>
> --
> Luca

Thanks for your time anyhow, and for your previous work on all this!

Best regards!

-- 
?lvaro G?mez Machado

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Trouble with u-boot on a ZynqMP board
  2021-06-22  5:58   ` Alvaro Gamez
@ 2021-06-24 21:51     ` Luca Ceresoli
  2021-06-28 16:47       ` Luca Ceresoli
  0 siblings, 1 reply; 7+ messages in thread
From: Luca Ceresoli @ 2021-06-24 21:51 UTC (permalink / raw)
  To: buildroot

Hi Alvaro,

On 22/06/21 07:58, Alvaro Gamez wrote:
> Hi, Luca
> 
> El mi?, 16 jun 2021 a las 22:52, Luca Ceresoli
> (<luca@lucaceresoli.net>) escribi?:
>>
>> Hi Alvaro,
>>
>> On 15/06/21 09:50, Alvaro Gamez wrote:
>>> Hi!
>>>
>>> I'm trying to use buildroot to generate a system for the Digilent
>>> Genesys board, which is based on the zynqmp SOC. Thanks to the
>>> wonderful job of Luca and others, it should be pretty straightforward,
>>> but I'm having trouble getting it to boot, and I was hoping I could
>>> get some guidance on what to do next.
>>
>> Thanks for your appreciation! However I must say setting up zynqmp
>> booting is never straightforward... :-/
> 
> Yeah, tell me about it :)
> 
>>
>>> I'm using buildroot version 2021.05, with u-boot version 2021.04,
>>> which has latest patches that should allow booting completely via
>>> u-boot, without using Xilinx' FSBL
>>>
>>> I'm using Digient's reference design to generate configuration object
>>> pm_cfg_obj.c and PSU init file psu_init_gpl.c, which shall be fed to
>>> u-boot. Alongside these files, I'm make buildroot download a generic
>>> PMU firmware built by Luca at
>>> https://github.com/lucaceresoli/zynqmp-pmufw-binaries/raw/master/bin/pmufw-v2018.3.bin
>>> and here is the relevant configuration:
>>>
>>> BR2_TARGET_UBOOT=y
>>> BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
>>> BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_Genesys_PATH)/uboot_defconfig"
>>> BR2_TARGET_UBOOT_NEEDS_DTC=y
>>> BR2_TARGET_UBOOT_SPL=y
>>> BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
>>> BR2_TARGET_UBOOT_ZYNQMP=y
>>> BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/lucaceresoli/zynqmp-pmufw-binaries/raw/master/bin/pmufw-v2018.3.bin"
>>> BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="/tmp/pm_cfg_obj.c"
>>> BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE="/tmp/psu_init_gpl.c"
>>> BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_Genesys_PATH)/orig.dts"
>>>
>>> To provide Arm Trusted Firmware, I'm passing buildroot the same
>>> configuration as already exists on configs/zynqmp_zcu106_defconfig
>>> which is:
>>>
>>> BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
>>> BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
>>> BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/ARM-software/arm-trusted-firmware.git"
>>> BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="v1.5"
>>> BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="zynqmp"
>>> BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT=y
>>>
>>> The device tree I'm using is extracted from Digilent's kernel image,
>>> so it should be correct, although I had to manually patch u-boot to
>>> include my "orig.dtb" as a target of dtb-$(CONFIG_ARCH_ZYNQMP)
>>>
>>> So, it is assumption that this should make u-boot prompt appear after
>>> power up, but I must be wrong because nothing appears at all on the
>>> serial console.
>>>
>>> Provided image by Digilent follows the Xilinx' booting workflow, so
>>> only a BOOT.BIN file is on the sdcard which includes xilinx' FSBL, PMU
>>> firmware with configuration object, u-boot, kernel, device tree, etc,
>>> so at least I know that the board is fine as this firmware works
>>> flawlessly. I also was able to load the kernel and device tree as
>>> built by buildroot over this instance of u-boot, so at least I can
>>> load my own kernel, but I can't progress deeper than that.
>>
>> I can't point out a specific potential cause for your problem. I would
>> expect to see at least the U-Boot SPL prompt. You might want to enable
>> some debug outputs in the pmufw code to see it it starts at least.
> 
> I'm going all crazy about configuring U-Boot and my headache is noticeable now.
> Won't you happen to have a working u-boot with SPL defconfig that works on any
> particular zynqmp board?

No, sadly. I haven't been working on zynqmp for years.

> 
>> I haven't been working on zynqmp recently but back at the times
>> (2018~2019) one needed to have the various booting components "in sync",
>> expecially pmufw, U-Boot and SPL or FSBL. I don't remember whether ATF
>> was critical too in that respect. By "in sync" I mean the major version
>> number (the year) should be the same.
>>
>> Here you are using a 2018 pmufw and 2021 U-Boot so you muight want to
>> build a more recent pmufw and see if you get any improvements.
> 
> Great, that's a nice idea, thank you!

Try that, which seems to be required:
https://forums.xilinx.com/t5/Embedded-Linux/problem-on-u-boot-quot-Synchronous-Abort-quot-handler-esr/m-p/1060937/highlight/true#M39206

Also try with debug prints in the pmufw code.

-- 
Luca

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Trouble with u-boot on a ZynqMP board
  2021-06-24 21:51     ` Luca Ceresoli
@ 2021-06-28 16:47       ` Luca Ceresoli
  2021-06-29  9:19         ` Alvaro Gamez
  0 siblings, 1 reply; 7+ messages in thread
From: Luca Ceresoli @ 2021-06-28 16:47 UTC (permalink / raw)
  To: buildroot

Hi Alvaro,

On 24/06/21 23:51, Luca Ceresoli wrote:
[...]
>>> I haven't been working on zynqmp recently but back at the times
>>> (2018~2019) one needed to have the various booting components "in sync",
>>> expecially pmufw, U-Boot and SPL or FSBL. I don't remember whether ATF
>>> was critical too in that respect. By "in sync" I mean the major version
>>> number (the year) should be the same.
>>>
>>> Here you are using a 2018 pmufw and 2021 U-Boot so you muight want to
>>> build a more recent pmufw and see if you get any improvements.
>>
>> Great, that's a nice idea, thank you!
> 
> Try that, which seems to be required:
> https://forums.xilinx.com/t5/Embedded-Linux/problem-on-u-boot-quot-Synchronous-Abort-quot-handler-esr/m-p/1060937/highlight/true#M39206

Did you make any progress?

I was able to build and test more recent versions of pmufw (2019.2 amd
2020.1) and pushed them to [0]. They are tested and working. Not sure
it's useful, but that's what I can provide at the moment.

I generated them with an unmodified zynqmp-pmufw-builder. You can do the
same to generate similar images but with debug messages enabled. Here's
a dirty patch to apply to the 'embeddedsw' submodule to enable _lots_ of
messages:

----------------------------8<----------------------------
diff --git a/lib/sw_apps/zynqmp_pmufw/src/pm_common.h
b/lib/sw_apps/zynqmp_pmufw/src/pm_common.h
index 1bed98e76630..3a06a15b62dc 100644
--- a/lib/sw_apps/zynqmp_pmufw/src/pm_common.h
+++ b/lib/sw_apps/zynqmp_pmufw/src/pm_common.h
@@ -52,6 +52,7 @@ typedef struct PmNode PmNode;
 #define PM_ERROR	2U
 #define PM_WARNING	3U
 #define PM_INFO		4U
+#define PM_LOG_LEVEL 4U /////////////////////////////////

 #if defined(PM_LOG_LEVEL) && (PM_LOG_LEVEL >= PM_INFO)
 	#define PmInfo(...)	pm_printf(__VA_ARGS__)
diff --git a/lib/sw_apps/zynqmp_pmufw/src/xpfw_config.h
b/lib/sw_apps/zynqmp_pmufw/src/xpfw_config.h
index 4816a2dfd06b..2420a7a47493 100644
--- a/lib/sw_apps/zynqmp_pmufw/src/xpfw_config.h
+++ b/lib/sw_apps/zynqmp_pmufw/src/xpfw_config.h
@@ -17,8 +17,8 @@ extern "C" {

 /* PMUFW print levels */
 #define XPFW_PRINT_VAL (1U)
-#define XPFW_DEBUG_ERROR_VAL (0U)
-#define XPFW_DEBUG_DETAILED_VAL (0U)
+#define XPFW_DEBUG_ERROR_VAL (1U)
+#define XPFW_DEBUG_DETAILED_VAL (1U)

 /**
  * PMUFW Debug options
----------------------------8<----------------------------

[0] https://github.com/lucaceresoli/zynqmp-pmufw-binaries/

-- 
Luca

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] Trouble with u-boot on a ZynqMP board
  2021-06-28 16:47       ` Luca Ceresoli
@ 2021-06-29  9:19         ` Alvaro Gamez
  2021-06-29 21:32           ` Luca Ceresoli
  0 siblings, 1 reply; 7+ messages in thread
From: Alvaro Gamez @ 2021-06-29  9:19 UTC (permalink / raw)
  To: buildroot

Hi Luca,

El lun, 28 jun 2021 a las 18:47, Luca Ceresoli
(<luca@lucaceresoli.net>) escribi?:
>
> Hi Alvaro,
>
> On 24/06/21 23:51, Luca Ceresoli wrote:
> [...]
> >>> I haven't been working on zynqmp recently but back at the times
> >>> (2018~2019) one needed to have the various booting components "in sync",
> >>> expecially pmufw, U-Boot and SPL or FSBL. I don't remember whether ATF
> >>> was critical too in that respect. By "in sync" I mean the major version
> >>> number (the year) should be the same.
> >>>
> >>> Here you are using a 2018 pmufw and 2021 U-Boot so you muight want to
> >>> build a more recent pmufw and see if you get any improvements.
> >>
> >> Great, that's a nice idea, thank you!
> >
> > Try that, which seems to be required:
> > https://forums.xilinx.com/t5/Embedded-Linux/problem-on-u-boot-quot-Synchronous-Abort-quot-handler-esr/m-p/1060937/highlight/true#M39206
>
> Did you make any progress?

Thanks for asking and continuing with your help! Indeed I did, just a
couple hours ago. I am now able to run U-Boot SPL, which runs
U-boot, which is able to reprogram the FPGA, and boot linux!

I started from scratch since I was accumulating lots of different tries and,
either I or the computer were about to go crazy, so I reset everything
and carefully crafted the final buildroot and u-boot configurations. I was
able to use your pmufw 2018 version.

I need to finish a few things before, but I want to send a patch to add this
configuration as board/digilent/genesys-zu/ , which I hope to send in some
moment during the next few days.

> I was able to build and test more recent versions of pmufw (2019.2 amd
> 2020.1) and pushed them to [0]. They are tested and working. Not sure
> it's useful, but that's what I can provide at the moment.

Great, thanks a lot! I will try them too and will use either the
latest or the one that
matches the kernel I'm using, but it looks that it's not a requirement
to have all
pieces of software running the same version

I was wondering... there are lots of boards and SoCs which fit
different types of
processors, of different architectures. Wouldn't it be nice if
buildroot itself could
compile additional firmware, such as pmufw? Its toolchain for microblaze should
be able to, but then Buildroot for zynqpm would need three toolchains: arm64,
host and microblaze. It's probably too much and probably out of scope for a
"root filesystem generator".

Thanks again, best regards!


> I generated them with an unmodified zynqmp-pmufw-builder. You can do the
> same to generate similar images but with debug messages enabled. Here's
> a dirty patch to apply to the 'embeddedsw' submodule to enable _lots_ of
> messages:
>
> ----------------------------8<----------------------------
> diff --git a/lib/sw_apps/zynqmp_pmufw/src/pm_common.h
> b/lib/sw_apps/zynqmp_pmufw/src/pm_common.h
> index 1bed98e76630..3a06a15b62dc 100644
> --- a/lib/sw_apps/zynqmp_pmufw/src/pm_common.h
> +++ b/lib/sw_apps/zynqmp_pmufw/src/pm_common.h
> @@ -52,6 +52,7 @@ typedef struct PmNode PmNode;
>  #define PM_ERROR       2U
>  #define PM_WARNING     3U
>  #define PM_INFO                4U
> +#define PM_LOG_LEVEL 4U /////////////////////////////////
>
>  #if defined(PM_LOG_LEVEL) && (PM_LOG_LEVEL >= PM_INFO)
>         #define PmInfo(...)     pm_printf(__VA_ARGS__)
> diff --git a/lib/sw_apps/zynqmp_pmufw/src/xpfw_config.h
> b/lib/sw_apps/zynqmp_pmufw/src/xpfw_config.h
> index 4816a2dfd06b..2420a7a47493 100644
> --- a/lib/sw_apps/zynqmp_pmufw/src/xpfw_config.h
> +++ b/lib/sw_apps/zynqmp_pmufw/src/xpfw_config.h
> @@ -17,8 +17,8 @@ extern "C" {
>
>  /* PMUFW print levels */
>  #define XPFW_PRINT_VAL (1U)
> -#define XPFW_DEBUG_ERROR_VAL (0U)
> -#define XPFW_DEBUG_DETAILED_VAL (0U)
> +#define XPFW_DEBUG_ERROR_VAL (1U)
> +#define XPFW_DEBUG_DETAILED_VAL (1U)
>
>  /**
>   * PMUFW Debug options
> ----------------------------8<----------------------------
>
> [0] https://github.com/lucaceresoli/zynqmp-pmufw-binaries/
>
> --
> Luca



--
?lvaro G?mez Machado

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] Trouble with u-boot on a ZynqMP board
  2021-06-29  9:19         ` Alvaro Gamez
@ 2021-06-29 21:32           ` Luca Ceresoli
  0 siblings, 0 replies; 7+ messages in thread
From: Luca Ceresoli @ 2021-06-29 21:32 UTC (permalink / raw)
  To: buildroot

Hi Alvaro,

On 29/06/21 11:19, Alvaro Gamez wrote:
> Hi Luca,
> 
> El lun, 28 jun 2021 a las 18:47, Luca Ceresoli
> (<luca@lucaceresoli.net>) escribi?:
>>
>> Hi Alvaro,
>>
>> On 24/06/21 23:51, Luca Ceresoli wrote:
>> [...]
>>>>> I haven't been working on zynqmp recently but back at the times
>>>>> (2018~2019) one needed to have the various booting components "in sync",
>>>>> expecially pmufw, U-Boot and SPL or FSBL. I don't remember whether ATF
>>>>> was critical too in that respect. By "in sync" I mean the major version
>>>>> number (the year) should be the same.
>>>>>
>>>>> Here you are using a 2018 pmufw and 2021 U-Boot so you muight want to
>>>>> build a more recent pmufw and see if you get any improvements.
>>>>
>>>> Great, that's a nice idea, thank you!
>>>
>>> Try that, which seems to be required:
>>> https://forums.xilinx.com/t5/Embedded-Linux/problem-on-u-boot-quot-Synchronous-Abort-quot-handler-esr/m-p/1060937/highlight/true#M39206
>>
>> Did you make any progress?
> 
> Thanks for asking and continuing with your help! Indeed I did, just a
> couple hours ago. I am now able to run U-Boot SPL, which runs
> U-boot, which is able to reprogram the FPGA, and boot linux!
> 
> I started from scratch since I was accumulating lots of different tries and,
> either I or the computer were about to go crazy, so I reset everything
> and carefully crafted the final buildroot and u-boot configurations. I was
> able to use your pmufw 2018 version.

Cool! I can feel your relief feeling now. ;)

> I need to finish a few things before, but I want to send a patch to add this
> configuration as board/digilent/genesys-zu/ , which I hope to send in some
> moment during the next few days.

Yes, please do so!
Don't forget to Cc: me.

>> I was able to build and test more recent versions of pmufw (2019.2 amd
>> 2020.1) and pushed them to [0]. They are tested and working. Not sure
>> it's useful, but that's what I can provide at the moment.
> 
> Great, thanks a lot! I will try them too and will use either the
> latest or the one that
> matches the kernel I'm using, but it looks that it's not a requirement
> to have all
> pieces of software running the same version

I think these pieces of firmware have grown more stable recently than
they used to be in early zynqmp era when I have been working on them.
Thus mixing them is now possible, and it's OK until it works. But I
still would start with versions from the same year when starting from
scratch as it's what Xilinx is testing IIUC, so it has more probability
of success.

> I was wondering... there are lots of boards and SoCs which fit
> different types of
> processors, of different architectures. Wouldn't it be nice if
> buildroot itself could
> compile additional firmware, such as pmufw? Its toolchain for microblaze should
> be able to, but then Buildroot for zynqpm would need three toolchains: arm64,
> host and microblaze. It's probably too much and probably out of scope for a
> "root filesystem generator".

I agree it would be out of scope, Buildroot is not really meant to build
a single firmware. The complexity of the zyqmp-pmufw-builder script
confirms that pmufw needs very little to build.

Enjoy to fun part of zynqmp hacking now!

-- 
Luca

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-06-29 21:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15  7:50 [Buildroot] Trouble with u-boot on a ZynqMP board Alvaro Gamez
2021-06-16 20:52 ` Luca Ceresoli
2021-06-22  5:58   ` Alvaro Gamez
2021-06-24 21:51     ` Luca Ceresoli
2021-06-28 16:47       ` Luca Ceresoli
2021-06-29  9:19         ` Alvaro Gamez
2021-06-29 21:32           ` Luca Ceresoli

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.