xilinx: Fix issues in v2022.04-rc1/2
Subsystems (3)
cover xilinx: Fix issues in v2022.04-rc1/2
Hi,
I found that two commits which were recently merged to u-boot are breaking especially Xilinx ZynqMP boards.
The commit 985503439762 ("fdt: Don't call board_fdt_blob_setup() and commit 0dba45864b2a ("arm: Init the debug UART") requires changes in platform to get u-boot work as worked before.
Thanks,
Michal
Michal Simek (5):
xilinx: Enable OF_BOARD for zynq and zynqmp boards
arm64: zynqmp: Build psu_spl_init for SPL all the time
arm64: zynqmp: Fix dependencies around ZYNQMP_PSU_INIT_ENABLED
ARM: zynq: Fix debug uart initialization
arm64: zynqmp: Fix debug uart initialization
arch/arm/Kconfig | 2 ++ arch/arm/mach-zynq/spl.c | 15 +++++---- arch/arm/mach-zynqmp/Kconfig | 1 + arch/arm/mach-zynqmp/Makefile | 2 +- .../mach-zynqmp/include/mach/psu_init_gpl.h | 1 + arch/arm/mach-zynqmp/spl.c | 12 ++++++- board/xilinx/common/board.c | 3 +- board/xilinx/zynq/board.c | 7 ++++ board/xilinx/zynqmp/zynqmp.c | 32 +++++++++++++------ configs/xilinx_zynq_virt_defconfig | 1 + configs/xilinx_zynqmp_virt_defconfig | 3 +- 11 files changed, 59 insertions(+), 20 deletions(-)
Signature · 1 line
2.35.0
PATCH 1/5 xilinx: Enable OF_BOARD for zynq and zynqmp boards
The commit 985503439762 ("fdt: Don't call board_fdt_blob_setup() without OF_BOARD") forced to enable OF_BOARD for platforms which provide DT externally. Zynq/ZynqMP boards are using this feature for a long time that's why there is a need to enable it by default.
Also code expects to return error in case of error that's why also fill it.
---
board/xilinx/common/board.c | 3 ++- configs/xilinx_zynq_virt_defconfig | 1 + configs/xilinx_zynqmp_virt_defconfig | 1 + 3 files changed, 4 insertions(+), 1 deletion(-)
board/xilinx/common/board.c +2 -1
@@ -319,7 +319,7 @@ __maybe_unused int xilinx_read_eeprom(void)return 0 ; } -#if defined(CONFIG_OF_BOARD ) || defined(CONFIG_OF_SEPARATE ) +#if defined(CONFIG_OF_BOARD )void *board_fdt_blob_setup (int *err) {void *fdt_blob;
@@ -355,6 +355,7 @@ void *board_fdt_blob_setup(int *err)debug ("DTB is also not passed via %p\n" , fdt_blob); + *err = -EINVAL ; return NULL; }#endif
configs/xilinx_zynq_virt_defconfig +1 -0
@@ -59,6 +59,7 @@ CONFIG_CMD_MTDPARTS=y CONFIG_CMD_MTDPARTS_SPREAD=y CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES=y CONFIG_CMD_UBI=y +CONFIG_OF_BOARD=y CONFIG_OF_LIST="zynq-zc702 zynq-zc706 zynq-zc770-xm010 zynq-zc770-xm011 zynq-zc770-xm011-x16 zynq-zc770-xm012 zynq-zc770-xm013 zynq-cc108 zynq-microzed zynq-minized zynq-picozed zynq-zed zynq-zturn zynq-zturn-v5 zynq-zybo zynq-zybo-z7 zynq-dlc20-rev1.0" CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_FAT=y
configs/xilinx_zynqmp_virt_defconfig +1 -0
@@ -84,6 +84,7 @@ CONFIG_CMD_MTDPARTS_SHOW_NET_SIZES=y CONFIG_CMD_UBI=y CONFIG_PARTITION_TYPE_GUID=y CONFIG_SPL_OF_CONTROL=y +CONFIG_OF_BOARD=y CONFIG_OF_LIST="avnet-ultra96-rev1 zynqmp-a2197-revA zynqmp-e-a2197-00-revA zynqmp-g-a2197-00-revA zynqmp-m-a2197-01-revA zynqmp-m-a2197-02-revA zynqmp-m-a2197-03-revA zynqmp-p-a2197-00-revA zynqmp-zc1232-revA zynqmp-zc1254-revA zynqmp-zc1751-xm015-dc1 zynqmp-zc1751-xm016-dc2 zynqmp-zc1751-xm017-dc3 zynqmp-zc1751-xm018-dc4 zynqmp-zc1751-xm019-dc5 zynqmp-zcu100-revC zynqmp-zcu102-rev1.1 zynqmp-zcu102-rev1.0 zynqmp-zcu102-revA zynqmp-zcu102-revB zynqmp-zcu104-revA zynqmp-zcu104-revC zynqmp-zcu106-revA zynqmp-zcu111-revA zynqmp-zcu1275-revA zynqmp-zcu1275-revB zynqmp-zcu1285-revA zynqmp-zcu208-revA zynqmp-zcu216-revA zynqmp-topic-miamimp-xilinx-xdp-v1r1 zynqmp-sm-k26-revA zynqmp-smk-k26-revA zynqmp-dlc21-revA" CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names interrupt-parent interrupts iommus power-domains" CONFIG_ENV_IS_NOWHERE=y
Signature · 1 line
2.35.0
PATCH 3/5 arm64: zynqmp: Fix dependencies around ZYNQMP_PSU_INIT_ENABLED
In reply to Michal SimekZYNQMP_PSU_INIT_ENABLED is called only when BOARD_EARLY_INIT_F is defined that's why cover this dependency in Kconfig.
board_early_init_f() is only part related toCONFIG_ZYNQMP_PSU_INIT_ENABLED which is disabled now that's why disable BOARD_EARLY_INIT_F and also build board_early_init_f() only when CONFIG_BOARD_EARLY_INIT_F is enabled.
---
arch/arm/mach-zynqmp/Kconfig | 1 + board/xilinx/zynqmp/zynqmp.c | 2 ++ configs/xilinx_zynqmp_virt_defconfig | 1 - 3 files changed, 3 insertions(+), 1 deletion(-)
arch/arm/mach-zynqmp/Kconfig +1 -0
@@ -140,6 +140,7 @@ config DEFINE_TCM_OCM_MMAP config ZYNQMP_PSU_INIT_ENABLED bool "Include psu_init" + select BOARD_EARLY_INIT_F help Include psu_init to full u-boot. SPL include psu_init by default.
board/xilinx/zynqmp/zynqmp.c +2 -0
@@ -313,6 +313,7 @@ static char *zynqmp_get_silicon_idcode_name(void) }#endif +#if defined(CONFIG_BOARD_EARLY_INIT_F )int board_early_init_f (void ) {#if defined(CONFIG_ZYNQMP_PSU_INIT_ENABLED )
@@ -345,6 +346,7 @@ int board_early_init_f(void) return 0; } +#endif static int multi_boot (void ) {
configs/xilinx_zynqmp_virt_defconfig +0 -1
@@ -30,7 +30,6 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x10000000 # CONFIG_ARCH_FIXUP_FDT_MEMORY is not set CONFIG_USE_PREBOOT=y CONFIG_PREBOOT="run scsi_init;usb start" -CONFIG_BOARD_EARLY_INIT_F=y CONFIG_BOARD_EARLY_INIT_R=y CONFIG_SPL_STACK_R=y CONFIG_SPL_FPGA=y
Signature · 1 line
2.35.0
PATCH 2/5 arm64: zynqmp: Build psu_spl_init for SPL all the time
In reply to Michal SimekZYNQMP_PSU_INIT_ENABLED specifically saying that has connection to full U-Boot not SPL that's why build psu_spl_init for SPL all the time.
Also disable ZYNQMP_PSU_INIT_ENABLED because it ends up in situation that psu_init() is called twice which is wrong. By default only SPL should call it.
---
arch/arm/mach-zynqmp/Makefile | 2 +- configs/xilinx_zynqmp_virt_defconfig | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
arch/arm/mach-zynqmp/Makefile +1 -1
@@ -6,6 +6,6 @@ obj-y += clk.o obj-y += cpu.o obj-$(CONFIG_MP) += mp.o -obj-$(CONFIG_SPL_BUILD) += spl.o handoff.o +obj-$(CONFIG_SPL_BUILD) += spl.o handoff.o psu_spl_init.o obj-$(CONFIG_SPL_ZYNQMP_DRAM_ECC_INIT) += ecc_spl_init.o obj-$(CONFIG_ZYNQMP_PSU_INIT_ENABLED) += psu_spl_init.o
configs/xilinx_zynqmp_virt_defconfig +0 -1
@@ -20,7 +20,6 @@ CONFIG_CMD_FRU=y CONFIG_PMUFW_INIT_FILE="/mnt/disk/som/pmufw.bin" CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE="/mnt/disk/u-boot/pmu_obj.bin" CONFIG_ZYNQMP_USB=y -CONFIG_ZYNQMP_PSU_INIT_ENABLED=y CONFIG_AHCI=y CONFIG_DISTRO_DEFAULTS=y CONFIG_SYS_LOAD_ADDR=0x8000000
Signature · 1 line
2.35.0
PATCH 4/5 ARM: zynq: Fix debug uart initialization
In reply to Michal SimekThe commit 0dba45864b2a ("arm: Init the debug UART") calls debug_uart_init() from crt0.S but it won't work because SOC is not configured yet. That's why create board_debug_uart_init() which calls ps7_init() earlier before the first access to UART.
---
arch/arm/Kconfig | 1 + arch/arm/mach-zynq/spl.c | 15 +++++++++------ board/xilinx/zynq/board.c | 7 +++++++ 3 files changed, 17 insertions(+), 6 deletions(-)
arch/arm/Kconfig +1 -0
@@ -1157,6 +1157,7 @@ config ARCH_ZYNQ select CLK select CLK_ZYNQ select CPU_V7A + select DEBUG_UART_BOARD_INIT if SPL && DEBUG_UART select DM select DM_ETH if NET select DM_MMC if MMC
arch/arm/mach-zynq/spl.c +9 -6
@@ -16,17 +16,20 @@#include <asm/arch/sys_proto.h> #include <asm/arch/ps7_init_gpl.h> +#if defined(CONFIG_DEBUG_UART_BOARD_INIT ) +void board_debug_uart_init (void ) +{ +ps7_init (); +} +#endif +void board_init_f (ulong dummy) { +#if !defined(CONFIG_DEBUG_UART_BOARD_INIT )ps7_init (); +#endif arch_cpu_init (); - -#ifdef CONFIG_DEBUG_UART -/* Uart debug for sure */ -debug_uart_init (); -puts ("Debug uart enabled\n" );/* or printch() */ -#endif }#ifdef CONFIG_SPL_BOARD_INIT
board/xilinx/zynq/board.c +7 -0
@@ -25,6 +25,13 @@DECLARE_GLOBAL_DATA_PTR ; +#if !defined(CONFIG_SPL_BUILD ) && defined(CONFIG_DEBUG_UART_BOARD_INIT ) +void board_debug_uart_init (void ) +{ +/* Add initialization sequence if UART is not configured */ +} +#endif +int board_init (void ) {if (IS_ENABLED (CONFIG_SPL_BUILD ))
Signature · 1 line
2.35.0
PATCH 5/5 arm64: zynqmp: Fix debug uart initialization
In reply to Michal SimekThe commit 0dba45864b2a ("arm: Init the debug UART") calls debug_uart_init() from crt0.S but it won't work because SOC is not configured yet. That's why create board_debug_uart_init() which calls psu_init() via new psu_uboot_init() earlier before the first access to UART in SPL. In full U-Boot call psu_uboot_init() only when CONFIG_ZYNQMP_PSU_INIT_ENABLED is enabled.
---
arch/arm/Kconfig | 1 + .../mach-zynqmp/include/mach/psu_init_gpl.h | 1 + arch/arm/mach-zynqmp/spl.c | 12 ++++++- board/xilinx/zynqmp/zynqmp.c | 32 +++++++++++++------ 4 files changed, 35 insertions(+), 11 deletions(-)
arch/arm/Kconfig +1 -0
@@ -1199,6 +1199,7 @@ config ARCH_ZYNQMP select ARM64 select CLK select DM + select DEBUG_UART_BOARD_INIT if SPL && DEBUG_UART select DM_ETH if NET select DM_MAILBOX select DM_MMC if MMC
arch/arm/mach-zynqmp/include/mach/psu_init_gpl.h +1 -0
@@ -22,5 +22,6 @@ void prog_reg(unsigned long addr, unsigned long mask,int psu_init (void );unsigned long psu_post_config_data (void ); +int psu_uboot_init (void );#endif /* _PSU_INIT_GPL_H_ */
arch/arm/mach-zynqmp/spl.c +11 -1
@@ -19,9 +19,19 @@#include <asm/arch/psu_init_gpl.h> #include <asm/arch/sys_proto.h> +#if defined(CONFIG_DEBUG_UART_BOARD_INIT ) +void board_debug_uart_init (void ) +{ +psu_uboot_init (); +} +#endif +void board_init_f (ulong dummy) { -board_early_init_f (); +#if !defined(CONFIG_DEBUG_UART_BOARD_INIT ) +psu_uboot_init (); +#endif +board_early_init_r ();#ifdef CONFIG_SPL_ZYNQMP_DRAM_ECC_INIT zynqmp_ecc_init ();
board/xilinx/zynqmp/zynqmp.c +22 -10
@@ -313,10 +313,8 @@ static char *zynqmp_get_silicon_idcode_name(void) }#endif -#if defined(CONFIG_BOARD_EARLY_INIT_F ) -int board_early_init_f (void ) +int __maybe_unused psu_uboot_init (void ) { -#if defined(CONFIG_ZYNQMP_PSU_INIT_ENABLED )int ret; ret =psu_init ();
@@ -336,16 +334,30 @@ int board_early_init_f(void)/* Delay is required for clocks to be propagated */ udelay (1000000 ); -#endif + +return 0 ; +} -#ifdef CONFIG_DEBUG_UART -/* Uart debug for sure */ -debug_uart_init (); -puts ("Debug uart enabled\n" );/* or printch() */ -#endif +#if !defined(CONFIG_SPL_BUILD ) +# if defined(CONFIG_DEBUG_UART_BOARD_INIT ) +void board_debug_uart_init (void ) +{ +# if defined(CONFIG_ZYNQMP_PSU_INIT_ENABLED ) +psu_uboot_init (); +# endif +} +# endif - return 0; +# if defined(CONFIG_BOARD_EARLY_INIT_F ) +int board_early_init_f (void ) +{ +int ret =0 ; +# if defined(CONFIG_ZYNQMP_PSU_INIT_ENABLED ) && !defined(CONFIG_DEBUG_UART_BOARD_INIT ) + ret =psu_uboot_init (); +# endif +return ret; } +# endif #endif static int multi_boot (void )
Signature · 1 line
2.35.0
Michal Simek
Appliedčt 17. 2. 2022 v 14:28 odesílatel Michal Simek <[email protected]> napsal:
Quoted 33 lines
Hi,
I found that two commits which were recently merged to u-boot are breaking especially Xilinx ZynqMP boards.
The commit 985503439762 ("fdt: Don't callboard_fdt_blob_setup()and commit0dba45864b2a("arm: Init the debug UART") requires changes in platform to get u-boot work as worked before.Thanks,
MichalMichal Simek (5):
xilinx: EnableOF_BOARDfor zynq and zynqmp boards
arm64: zynqmp: Buildpsu_spl_initfor SPL all the time
arm64: zynqmp: Fix dependencies aroundZYNQMP_PSU_INIT_ENABLED
ARM: zynq: Fix debug uart initialization
arm64: zynqmp: Fix debug uart initializationarch/arm/Kconfig | 2 ++ arch/arm/mach-zynq/spl.c | 15 +++++---- arch/arm/mach-zynqmp/Kconfig | 1 + arch/arm/mach-zynqmp/Makefile | 2 +- .../mach-zynqmp/include/mach/psu_init_gpl.h | 1 + arch/arm/mach-zynqmp/spl.c | 12 ++++++- board/xilinx/common/board.c | 3 +- board/xilinx/zynq/board.c | 7 ++++ board/xilinx/zynqmp/zynqmp.c | 32 +++++++++++++------ configs/xilinx_zynq_virt_defconfig | 1 + configs/xilinx_zynqmp_virt_defconfig | 3 +- 11 files changed, 59 insertions(+), 20 deletions(-)
Quoted 3 lines
--
2.35.0
Applied.
M
Signature · 5 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Xilinx Microblaze Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs