xilinx: zynqmp: Fixes for silicon ID detection
cover xilinx: zynqmp: Fixes for silicon ID detection
Hi,
I found some issues with SPL where silicons were not properly detected. This series is fixing this and also fixing some minor related issues.
Thanks,
Michal
Michal Simek (4):
xilinx: zynqmp: Check return value from xilinx_pm_request()
xilinx: zynqmp: Fix debug message in zynqmp_get_silicon_idcode_name()
xilinx: zynqmp: Do not check 0 as invalid return from snprintf
xilinx: zynqmp: Use tab for macro indentation
board/xilinx/zynqmp/zynqmp.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
Signature · 1 line
2.28.0
PATCH 1/4 xilinx: zynqmp: Check return value from xilinx_pm_request()
xilinx_pm_request() can failed that's why also check return value.
---
board/xilinx/zynqmp/zynqmp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
board/xilinx/zynqmp/zynqmp.c +5 -1
@@ -192,7 +192,11 @@ static char *zynqmp_get_silicon_idcode_name(void)u32 ret_payload[PAYLOAD_ARG_CNT ];int ret; -xilinx_pm_request (PM_GET_CHIPID ,0 ,0 ,0 ,0 , ret_payload); + ret =xilinx_pm_request (PM_GET_CHIPID ,0 ,0 ,0 ,0 , ret_payload); +if (ret) { +debug ("%s: Getting chipid failed\n" , __func__); +return "unknown" ; + }/* * Firmware returns:
Signature · 1 line
2.28.0
PATCH 2/4 xilinx: zynqmp: Fix debug message in zynqmp_get_silicon_idcode_name()
In reply to Michal SimekFix hex format from 0x%0X to 0x%0x to show correct numbers.
---
board/xilinx/zynqmp/zynqmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/xilinx/zynqmp/zynqmp.c +1 -1
@@ -209,7 +209,7 @@ static char *zynqmp_get_silicon_idcode_name(void) idcode = ret_payload[1 ]; idcode2 = ret_payload[2 ] >>ZYNQMP_CSU_VERSION_EMPTY_SHIFT ; -debug ("%s, IDCODE: 0x%0X, IDCODE2: 0x%0X\r\n" , __func__, idcode, +debug ("%s, IDCODE: 0x%0x, IDCODE2: 0x%0x\r\n" , __func__, idcode, idcode2);for (i =0 ; i <ARRAY_SIZE (zynqmp_devices); i++) {
Signature · 1 line
2.28.0
PATCH 3/4 xilinx: zynqmp: Do not check 0 as invalid return from snprintf
In reply to Michal SimekU-Boot SPL on ZynqMP is using CONFIG_SPL_USE_TINY_PRINTF which doesn't return any return value and all the time returns 0. That's why even correct snprintf was returning in SPL chip ID as "unknown". Change checking condition and allow snprintf to return 0 which is according manual patch successful return.
"If an output error is encountered, a negative value is returned."
---
board/xilinx/zynqmp/zynqmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
board/xilinx/zynqmp/zynqmp.c +1 -1
@@ -223,7 +223,7 @@ static char *zynqmp_get_silicon_idcode_name(void)/* Add device prefix to the name */ ret =snprintf (name,ZYNQMP_VERSION_SIZE ,"zu%d" , zynqmp_devices[i].device); -if (ret <=0 ) +if (ret <0 )return "unknown" ;if (zynqmp_devices[i].variants &ZYNQMP_VARIANT_EV ) {
Signature · 1 line
2.28.0
PATCH 4/4 xilinx: zynqmp: Use tab for macro indentation
In reply to Michal SimekTrivial fix.
---
board/xilinx/zynqmp/zynqmp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
board/xilinx/zynqmp/zynqmp.c +6 -6
@@ -40,12 +40,12 @@#include "pm_cfg_obj.h" #define ZYNQMP_VERSION_SIZE 7 -#define EFUSE_VCU_DIS_MASK 0x100 -#define EFUSE_VCU_DIS_SHIFT 8 -#define EFUSE_GPU_DIS_MASK 0x20 -#define EFUSE_GPU_DIS_SHIFT 5 -#define IDCODE2_PL_INIT_MASK 0x200 -#define IDCODE2_PL_INIT_SHIFT 9 +#define EFUSE_VCU_DIS_MASK 0x100 +#define EFUSE_VCU_DIS_SHIFT 8 +#define EFUSE_GPU_DIS_MASK 0x20 +#define EFUSE_GPU_DIS_SHIFT 5 +#define IDCODE2_PL_INIT_MASK 0x200 +#define IDCODE2_PL_INIT_SHIFT 9DECLARE_GLOBAL_DATA_PTR ;
Signature · 1 line
2.28.0
Michal Simek
Appliedcover xilinx: zynqmp: Fixes for silicon ID detection
In reply to Michal Simekst 21. 10. 2020 v 12:29 odes?latel Michal Simek
<[email protected]> napsal:
Quoted 16 lines
Hi,
I found some issues with SPL where silicons were not properly detected. This series is fixing this and also fixing some minor related issues.
Thanks,
MichalMichal Simek (4):
xilinx: zynqmp: Check return value fromxilinx_pm_request()
xilinx: zynqmp: Fix debug message inzynqmp_get_silicon_idcode_name()
xilinx: zynqmp: Do not check 0 as invalid return from snprintf
xilinx: zynqmp: Use tab for macro indentation
Quoted 6 lines
board/xilinx/zynqmp/zynqmp.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)--
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