xilinx: common: Several minor fixups
Subsystems (3)
cover xilinx: common: Several minor fixups
Hi,
I am sending some patches to fix minor stuff. There are several things as setting up proper variables, enabling commands.
This series is based on my latest patches I have sent.
Thanks,
Michal
Michal Simek (7):
xilinx: common: Protect board_late_init_xilinx()
xilinx: Enable FRU command for all ARM based platforms
xilinx: zynq: Change types from u32 to uint32_t
xilinx: zynq: Enable AES command
xilinx: Enable SF_TEST command for all ARM based platforms
xilinx: Remove additional newline in config files
xilinx: Merge together BOOT_SCRIPT_OFFSET between MB and ARM
Siva Durga Prasad Paladugu (1):
arm64: versal: Set initrd_high to as high as possible
T Karthik Reddy (2):
arm64: zynqmp: Fix zynqmp mini qspi max frequency
xilinx: Add DDR base address to bootscript address
arch/arm/dts/zynqmp-mini-qspi.dts | 2 +- arch/microblaze/Kconfig | 1 + board/xilinx/Kconfig | 6 +++--- board/xilinx/common/board.c | 11 +++++++++++ board/xilinx/microblaze-generic/Kconfig | 5 ----- board/xilinx/versal/board.c | 4 ++++ configs/xilinx_versal_virt_defconfig | 2 ++ configs/xilinx_zynq_virt_defconfig | 3 +++ configs/xilinx_zynqmp_virt_defconfig | 2 ++ include/configs/xilinx_versal.h | 1 - include/configs/xilinx_versal_mini.h | 1 - include/configs/xilinx_zynqmp_mini.h | 1 - include/u-boot/rsa-mod-exp.h | 2 +- lib/rsa/rsa-mod-exp.c | 2 +- 14 files changed, 29 insertions(+), 14 deletions(-)
Signature · 1 line
2.28.0
PATCH 1/10 arm64: zynqmp: Fix zynqmp mini qspi max frequency
From: T Karthik Reddy <[email protected]>
For zynqmp qspi, frequencies up to 40MHz will work irrespective of feedback clock enabled or disabled. If we want higher than 40Mhz the feedback clock should be enabled.
With spi-max-frequency 108MHz it is not working when the feedback clock is disabled. Change it to 40MHz so that it works irrespective of feedback clock enabled or disabled.
---
arch/arm/dts/zynqmp-mini-qspi.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/dts/zynqmp-mini-qspi.dts +1 -1
@@ -70,7 +70,7 @@ reg = <0x0>; spi-tx-bus-width = <1>; spi-rx-bus-width = <4>; - spi-max-frequency = <108000000>; + spi-max-frequency = <40000000>; }; };
Signature · 1 line
2.28.0
PATCH 2/10 xilinx: common: Protect board_late_init_xilinx()
In reply to Michal SimekDo not call board_late_init_xilinx() when BOARD_LATE_INIT is not enabled.
---
board/xilinx/common/board.c | 2 ++ 1 file changed, 2 insertions(+)
board/xilinx/common/board.c +2 -0
@@ -352,6 +352,7 @@ void *board_fdt_blob_setup(void) }#endif +#if defined(CONFIG_BOARD_LATE_INIT )static int env_set_by_index (const char *name,int index,char *data) {char var[32 ];
@@ -414,3 +415,4 @@ int board_late_init_xilinx(void) return 0; } +#endif
Signature · 1 line
2.28.0
PATCH 3/10 xilinx: Add DDR base address to bootscript address
In reply to Michal SimekFrom: T Karthik Reddy <[email protected]>
Add ram base address to scriptaddr env variable to make boot script address to be a valid address when ddr base address changes.
This works properly if the first memory region is the region where uboot runs. Also the solution was taken in respect of a lot of jtag script putting u-boot script to certain address. For standard cases bd->bi_dram[0].start is 0 all the time. Only for systems with DDR placed out of this location it does calculation.
This is not the best solution and should be done differently in future but enough for now till we don't have full solution ready yet.
---
board/xilinx/common/board.c | 9 +++++++++ 1 file changed, 9 insertions(+)
board/xilinx/common/board.c +9 -0
@@ -371,6 +371,15 @@ int board_late_init_xilinx(void)int i, id, macid =0 ;struct xilinx_board_description *desc;phys_size_t bootm_size = gd->ram_size; +struct bd_info *bd = gd->bd; + +if (bd->bi_dram[0 ].start) { +ulong scriptaddr; + + scriptaddr =env_get_hex ("scriptaddr" ,0 ); + ret |=env_set_hex ("scriptaddr" , + bd->bi_dram[0 ].start + scriptaddr); + }if (CONFIG_IS_ENABLED (ARCH_ZYNQ )) bootm_size =min (bootm_size, (phys_size_t)(SZ_512M +SZ_256M ));
Signature · 1 line
2.28.0
PATCH 4/10 xilinx: Enable FRU command for all ARM based platforms
In reply to Michal SimekEnable it by default for board detection.
---
configs/xilinx_versal_virt_defconfig | 1 + configs/xilinx_zynq_virt_defconfig | 1 + configs/xilinx_zynqmp_virt_defconfig | 1 + 3 files changed, 3 insertions(+)
configs/xilinx_versal_virt_defconfig +1 -0
@@ -4,6 +4,7 @@ CONFIG_ARCH_VERSAL=y CONFIG_SYS_TEXT_BASE=0x8000000 CONFIG_SYS_MALLOC_F_LEN=0x100000 CONFIG_DM_GPIO=y +CONFIG_CMD_FRU=y CONFIG_DEFINE_TCM_OCM_MMAP=y CONFIG_COUNTER_FREQUENCY=100000000 CONFIG_DISTRO_DEFAULTS=y
configs/xilinx_zynq_virt_defconfig +1 -0
@@ -6,6 +6,7 @@ CONFIG_SYS_SPI_U_BOOT_OFFS=0x100000 CONFIG_DM_GPIO=y CONFIG_SPL_STACK_R_ADDR=0x200000 CONFIG_SPL=y +CONFIG_CMD_FRU=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc706" CONFIG_DISTRO_DEFAULTS=y CONFIG_SYS_CUSTOM_LDSCRIPT=y
configs/xilinx_zynqmp_virt_defconfig +1 -0
@@ -9,6 +9,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_ZYNQ_MAC_IN_EEPROM=y CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x20 +CONFIG_CMD_FRU=y CONFIG_ZYNQMP_USB=y CONFIG_DEFAULT_DEVICE_TREE="zynqmp-zcu100-revC" CONFIG_AHCI=y
Signature · 1 line
2.28.0
PATCH 5/10 xilinx: zynq: Change types from u32 to uint32_t
In reply to Michal SimekChange parameter type to avoid compilation error:
In file included from ./tools/../lib/rsa/rsa-verify.c:23:0,
from tools/lib/rsa/rsa-verify.c:1:include/u-boot/rsa-mod-exp.h:69:18: error: unknown type name ?u32?; did you mean ?__u32??
int zynq_pow_mod(u32 *keyptr, u32 *inout);
^~~
__u32
include/u-boot/rsa-mod-exp.h:69:31: error: unknown type name ?u32?; did you mean ?__u32??
int zynq_pow_mod(u32 *keyptr, u32 *inout);
^~~
__u32---
include/u-boot/rsa-mod-exp.h | 2 +- lib/rsa/rsa-mod-exp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/u-boot/rsa-mod-exp.h +1 -1
@@ -66,7 +66,7 @@ int rsa_mod_exp(struct udevice *dev, const uint8_t *sig, uint32_t sig_len, struct key_prop *node, uint8_t *out);#if defined(CONFIG_CMD_ZYNQ_RSA ) -int zynq_pow_mod (u32 *keyptr,u32 *inout); +int zynq_pow_mod (uint32_t *keyptr,uint32_t *inout);#endif /**
lib/rsa/rsa-mod-exp.c +1 -1
@@ -321,7 +321,7 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t sig_len,* pow_mod calculation required for zynq is bit different from * pw_mod above here, hence defined zynq specific routine. */ -int zynq_pow_mod (u32 *keyptr,u32 *inout) +int zynq_pow_mod (uint32_t *keyptr,uint32_t *inout) {u32 *result, *ptr;uint i;
Signature · 1 line
2.28.0
PATCH 6/10 xilinx: zynq: Enable AES command
In reply to Michal SimekEnable AES command to be able to use it directly.
---
configs/xilinx_zynq_virt_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/xilinx_zynq_virt_defconfig +1 -0
@@ -7,6 +7,7 @@ CONFIG_DM_GPIO=y CONFIG_SPL_STACK_R_ADDR=0x200000 CONFIG_SPL=y CONFIG_CMD_FRU=y +CONFIG_CMD_ZYNQ_AES=y CONFIG_DEFAULT_DEVICE_TREE="zynq-zc706" CONFIG_DISTRO_DEFAULTS=y CONFIG_SYS_CUSTOM_LDSCRIPT=y
Signature · 1 line
2.28.0
PATCH 7/10 xilinx: Enable SF_TEST command for all ARM based platforms
In reply to Michal SimekEnable this command by default.
---
configs/xilinx_versal_virt_defconfig | 1 + configs/xilinx_zynq_virt_defconfig | 1 + configs/xilinx_zynqmp_virt_defconfig | 1 + 3 files changed, 3 insertions(+)
configs/xilinx_versal_virt_defconfig +1 -0
@@ -28,6 +28,7 @@ CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_MTD=y +CONFIG_CMD_SF_TEST=y CONFIG_CMD_USB=y CONFIG_CMD_TFTPPUT=y CONFIG_CMD_CACHE=y
configs/xilinx_zynq_virt_defconfig +1 -0
@@ -42,6 +42,7 @@ CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_MTD=y CONFIG_CMD_NAND_LOCK_UNLOCK=y +CONFIG_CMD_SF_TEST=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_TFTPPUT=y
configs/xilinx_zynqmp_virt_defconfig +1 -0
@@ -49,6 +49,7 @@ CONFIG_CMD_MTD=y CONFIG_CMD_NAND_LOCK_UNLOCK=y CONFIG_CMD_POWEROFF=y CONFIG_CMD_SDRAM=y +CONFIG_CMD_SF_TEST=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y
Signature · 1 line
2.28.0
PATCH 8/10 xilinx: Remove additional newline in config files
In reply to Michal SimekTrivial fix.
---
include/configs/xilinx_versal.h | 1 - include/configs/xilinx_versal_mini.h | 1 - include/configs/xilinx_zynqmp_mini.h | 1 - 3 files changed, 3 deletions(-)
include/configs/xilinx_versal.h +0 -1
@@ -18,7 +18,6 @@#define GICD_BASE 0xF9000000#define GICR_BASE 0xF9080000 -#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE/* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */
include/configs/xilinx_versal_mini.h +0 -1
@@ -10,7 +10,6 @@#ifndef __CONFIG_VERSAL_MINI_H#define __CONFIG_VERSAL_MINI_H -#define CONFIG_EXTRA_ENV_SETTINGS #include <configs/xilinx_versal.h>
include/configs/xilinx_zynqmp_mini.h +0 -1
@@ -10,7 +10,6 @@#ifndef __CONFIG_ZYNQMP_MINI_H#define __CONFIG_ZYNQMP_MINI_H -#define CONFIG_EXTRA_ENV_SETTINGS #include <configs/xilinx_zynqmp.h>
Signature · 1 line
2.28.0
PATCH 9/10 xilinx: Merge together BOOT_SCRIPT_OFFSET between MB and ARM
In reply to Michal SimekThere is no reason not to use commong Kconfig by Microblaze too.
---
arch/microblaze/Kconfig | 1 + board/xilinx/Kconfig | 6 +++--- board/xilinx/microblaze-generic/Kconfig | 5 ----- 3 files changed, 4 insertions(+), 8 deletions(-)
arch/microblaze/Kconfig +1 -0
@@ -23,6 +23,7 @@ config TARGET_MICROBLAZE_GENERIC endchoice +source "board/xilinx/Kconfig" source "board/xilinx/microblaze-generic/Kconfig" endmenu
board/xilinx/Kconfig +3 -3
@@ -50,12 +50,12 @@ config XILINX_OF_BOARD_DTB_ADDR config BOOT_SCRIPT_OFFSET hex "Boot script offset" - depends on ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL - default 0xFC0000 if ARCH_ZYNQ + depends on ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL || MICROBLAZE + default 0xFC0000 if ARCH_ZYNQ || MICROBLAZE default 0x3E80000 if ARCH_ZYNQMP default 0x7F80000 if ARCH_VERSAL help - Specifies distro boot script offset in NAND/NOR flash. + Specifies distro boot script offset in NAND/QSPI/NOR flash. config ZYNQ_MAC_IN_EEPROM bool "Reading MAC address from EEPROM"
board/xilinx/microblaze-generic/Kconfig +0 -5
@@ -38,9 +38,4 @@ config XILINX_MICROBLAZE0_HW_VER string "Core version number" default "7.10.d" -config BOOT_SCRIPT_OFFSET - hex "Boot script offset" - default 0xFC0000 - help - Specifies distro boot script offset in NAND/QSPI flash. endif
Signature · 1 line
2.28.0
PATCH 10/10 arm64: versal: Set initrd_high to as high as possible
In reply to Michal SimekFrom: Siva Durga Prasad Paladugu <[email protected]>
This patch is setting up the initrd_high to as high as possible by leaving max stack size for u-boot so that bigger rootfs can also be loaded by u-boot for booting kernel.
---
board/xilinx/versal/board.c | 4 ++++ 1 file changed, 4 insertions(+)
board/xilinx/versal/board.c +4 -0
@@ -217,6 +217,10 @@ int board_late_init(void)env_set ("boot_targets" , new_targets); + initrd_hi = gd->start_addr_sp -CONFIG_STACK_SIZE ; + initrd_hi =round_down (initrd_hi,SZ_16M ); +env_set_addr ("initrd_high" , (void *)initrd_hi); +return board_late_init_xilinx (); }
Signature · 1 line
2.28.0
PATCH 10/10 arm64: versal: Set initrd_high to as high as possible
Quoted 18 lines · Michal Simek
From: Siva Durga Prasad Paladugu <[email protected]>
This patch is setting up the
initrd_highto as high as possible by leaving max stack size for u-boot so that bigger rootfs can also be loaded by u-boot for booting kernel.Signed-off-by Siva Durga Prasad Paladugu <[email protected]>Signed-off-by Michal Simek <[email protected]>---
board/xilinx/versal/board.c | 4 ++++ 1 file changed, 4 insertions(+)board/xilinx/versal/board.c +0
-0
board/xilinx/versal/board.c int board_late_init(void) · line 225
Quoted 9 lines
board/xilinx/versal/board.c +4
-0@@ -217,6 +217,10 @@ int board_late_init(void)env_set ("boot_targets" , new_targets); + initrd_hi = gd->start_addr_sp -CONFIG_STACK_SIZE ; + initrd_hi =round_down (initrd_hi,SZ_16M ); +env_set_addr ("initrd_high" , (void *)initrd_hi); +return board_late_init_xilinx (); }
My concern here (and also microblaze-generic, after some grepping) is that wouldn't it be best to set bootm_size and let fdt and initrd be relocated as needed?
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201022/85822e0d/attachment.sig>
PATCH 10/10 arm64: versal: Set initrd_high to as high as possible
Quoted 24 lines · Tom Rini
Quoted 22 lines · Michal Simek
From: Siva Durga Prasad Paladugu
<[email protected]>This patch is setting up the
initrd_highto as high as possible by leaving max stack size for u-boot so that bigger rootfs can also be loaded by u-boot for booting kernel.Signed-off-by: Siva Durga Prasad Paladugu <[email protected]> Signed-off-by: Michal Simek <[email protected]> ---
board/xilinx/versal/board.c| 4 ++++ 1 file changed, 4 insertions(+)(quoted diff) +0
-0
b/board/xilinx/versal/board.cindex912c1143a8ad..09229e0a75a4100644 ---a/board/xilinx/versal/board.c+++b/board/xilinx/versal/board.c@@ -217,6 +217,10 @@ intboard_late_init(void)
env_set("boot_targets", new_targets);
Quoted 7 lines
Quoted 3 lines
(quoted diff) +1
-0+ initrd_hi = gd->start_addr_sp - CONFIG_STACK_SIZE; + initrd_hi=
round_down(initrd_hi, SZ_16M); + env_set_addr("initrd_high",
(void *)initrd_hi); + returnboard_late_init_xilinx(); }My concern here (and also microblaze-generic, after some grepping) is that wouldn't it be best to set
bootm_sizeand let fdt and initrd be relocated as needed?
You are right and I have already done it in this way but forget to remove this patch from my queue. Will drop this patch.
Thanks,
Michal
Michal Simek
maintainerPATCH 10/10 arm64: versal: Set initrd_high to as high as possible
p? 23. 10. 2020 v 7:44 odes?latel Michal Simek <[email protected]> napsal:
Quoted 36 lines · Tom Rini
Quoted 24 lines · Michal Simek
Quoted 23 lines
From: Siva Durga Prasad Paladugu
<[email protected]>This patch is setting up the
initrd_highto as high as possible by leaving max stack size for u-boot so that bigger rootfs can also be loaded by u-boot for booting kernel.Signed-off-by: Siva Durga Prasad Paladugu <[email protected]> Signed-off-by: Michal Simek <[email protected]> ---
board/xilinx/versal/board.c| 4 ++++ 1 file changed, 4 insertions(+)(quoted diff) +0
-0
b/board/xilinx/versal/board.cindex912c1143a8ad..09229e0a75a4100644 ---a/board/xilinx/versal/board.c+++b/board/xilinx/versal/board.c@@ -217,6 +217,10 @@ intboard_late_init(void)
env_set("boot_targets", new_targets);Quoted 7 lines
Quoted 3 lines
+
initrd_hi=gd->start_addr_sp-CONFIG_STACK_SIZE; +initrd_hi
=round_down(initrd_hi, SZ_16M); + env_set_addr("initrd_high",
(void *)initrd_hi); + returnboard_late_init_xilinx(); }My concern here (and also microblaze-generic, after some grepping) is that wouldn't it be best to set
bootm_sizeand let fdt and initrd be relocated as needed?
Quoted 5 lines
You are right and I have already done it in this way but forget to remove this patch from my queue. Will drop this patch.
Thanks,
Michal
This patch has been dropped from the series.
1-9 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
cover xilinx: common: Several minor fixups
In reply to Michal Simek?t 22. 10. 2020 v 12:32 odes?latel Michal Simek
<[email protected]> napsal:
Quoted 43 lines
Hi,
I am sending some patches to fix minor stuff. There are several things as setting up proper variables, enabling commands.
This series is based on my latest patches I have sent.Thanks,
MichalMichal Simek (7):
xilinx: common: Protectboard_late_init_xilinx()
xilinx: Enable FRU command for all ARM based platforms
xilinx: zynq: Change types from u32 touint32_t
xilinx: zynq: Enable AES command
xilinx: EnableSF_TESTcommand for all ARM based platforms
xilinx: Remove additional newline in config files
xilinx: Merge togetherBOOT_SCRIPT_OFFSETbetween MB and ARMSiva Durga Prasad Paladugu (1):
arm64: versal: Setinitrd_highto as high as possibleT Karthik Reddy (2):
arm64: zynqmp: Fix zynqmp mini qspi max frequency
xilinx: Add DDR base address to bootscript addressarch/arm/dts/zynqmp-mini-qspi.dts | 2 +- arch/microblaze/Kconfig | 1 + board/xilinx/Kconfig | 6 +++--- board/xilinx/common/board.c | 11 +++++++++++ board/xilinx/microblaze-generic/Kconfig | 5 ----- board/xilinx/versal/board.c | 4 ++++ configs/xilinx_versal_virt_defconfig | 2 ++ configs/xilinx_zynq_virt_defconfig | 3 +++ configs/xilinx_zynqmp_virt_defconfig | 2 ++ include/configs/xilinx_versal.h | 1 - include/configs/xilinx_versal_mini.h | 1 - include/configs/xilinx_zynqmp_mini.h | 1 - include/u-boot/rsa-mod-exp.h | 2 +- lib/rsa/rsa-mod-exp.c | 2 +- 14 files changed, 29 insertions(+), 14 deletions(-)
Quoted 3 lines
--
2.28.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