All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] xilinx: zynqmp: Fixes for silicon ID detection
@ 2020-10-21 10:29 Michal Simek
  2020-10-21 10:29 ` [PATCH 1/4] xilinx: zynqmp: Check return value from xilinx_pm_request() Michal Simek
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Michal Simek @ 2020-10-21 10:29 UTC (permalink / raw)
  To: u-boot

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(-)

-- 
2.28.0

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

* [PATCH 1/4] xilinx: zynqmp: Check return value from xilinx_pm_request()
  2020-10-21 10:29 [PATCH 0/4] xilinx: zynqmp: Fixes for silicon ID detection Michal Simek
@ 2020-10-21 10:29 ` Michal Simek
  2020-10-21 10:29 ` [PATCH 2/4] xilinx: zynqmp: Fix debug message in zynqmp_get_silicon_idcode_name() Michal Simek
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Michal Simek @ 2020-10-21 10:29 UTC (permalink / raw)
  To: u-boot

xilinx_pm_request() can failed that's why also check return value.

Fixes: 050f10f103cd ("xilinx: zynqmp: remove chip_id function")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 board/xilinx/zynqmp/zynqmp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index db3f5978a928..e65824540809 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -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:
-- 
2.28.0

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

* [PATCH 2/4] xilinx: zynqmp: Fix debug message in zynqmp_get_silicon_idcode_name()
  2020-10-21 10:29 [PATCH 0/4] xilinx: zynqmp: Fixes for silicon ID detection Michal Simek
  2020-10-21 10:29 ` [PATCH 1/4] xilinx: zynqmp: Check return value from xilinx_pm_request() Michal Simek
@ 2020-10-21 10:29 ` Michal Simek
  2020-10-21 10:29 ` [PATCH 3/4] xilinx: zynqmp: Do not check 0 as invalid return from snprintf Michal Simek
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Michal Simek @ 2020-10-21 10:29 UTC (permalink / raw)
  To: u-boot

Fix hex format from 0x%0X to 0x%0x to show correct numbers.

Fixes: fa793165daf7 ("xilinx: zynqmp: refactor silicon name function")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 board/xilinx/zynqmp/zynqmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index e65824540809..7ba2c789751e 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -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++) {
-- 
2.28.0

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

* [PATCH 3/4] xilinx: zynqmp: Do not check 0 as invalid return from snprintf
  2020-10-21 10:29 [PATCH 0/4] xilinx: zynqmp: Fixes for silicon ID detection Michal Simek
  2020-10-21 10:29 ` [PATCH 1/4] xilinx: zynqmp: Check return value from xilinx_pm_request() Michal Simek
  2020-10-21 10:29 ` [PATCH 2/4] xilinx: zynqmp: Fix debug message in zynqmp_get_silicon_idcode_name() Michal Simek
@ 2020-10-21 10:29 ` Michal Simek
  2020-10-21 10:29 ` [PATCH 4/4] xilinx: zynqmp: Use tab for macro indentation Michal Simek
  2020-10-27  7:26 ` [PATCH 0/4] xilinx: zynqmp: Fixes for silicon ID detection Michal Simek
  4 siblings, 0 replies; 6+ messages in thread
From: Michal Simek @ 2020-10-21 10:29 UTC (permalink / raw)
  To: u-boot

U-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."

Fixes: 43a138956f7e ("arm64: zynqmp: Get rid of simple_itoa and replace it by snprintf")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 board/xilinx/zynqmp/zynqmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 7ba2c789751e..c4f24982843e 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -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) {
-- 
2.28.0

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

* [PATCH 4/4] xilinx: zynqmp: Use tab for macro indentation
  2020-10-21 10:29 [PATCH 0/4] xilinx: zynqmp: Fixes for silicon ID detection Michal Simek
                   ` (2 preceding siblings ...)
  2020-10-21 10:29 ` [PATCH 3/4] xilinx: zynqmp: Do not check 0 as invalid return from snprintf Michal Simek
@ 2020-10-21 10:29 ` Michal Simek
  2020-10-27  7:26 ` [PATCH 0/4] xilinx: zynqmp: Fixes for silicon ID detection Michal Simek
  4 siblings, 0 replies; 6+ messages in thread
From: Michal Simek @ 2020-10-21 10:29 UTC (permalink / raw)
  To: u-boot

Trivial fix.

Fixes: fa793165daf7 ("xilinx: zynqmp: refactor silicon name function")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 board/xilinx/zynqmp/zynqmp.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index c4f24982843e..731285a73674 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -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	9
 
 DECLARE_GLOBAL_DATA_PTR;
 
-- 
2.28.0

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

* [PATCH 0/4] xilinx: zynqmp: Fixes for silicon ID detection
  2020-10-21 10:29 [PATCH 0/4] xilinx: zynqmp: Fixes for silicon ID detection Michal Simek
                   ` (3 preceding siblings ...)
  2020-10-21 10:29 ` [PATCH 4/4] xilinx: zynqmp: Use tab for macro indentation Michal Simek
@ 2020-10-27  7:26 ` Michal Simek
  4 siblings, 0 replies; 6+ messages in thread
From: Michal Simek @ 2020-10-27  7:26 UTC (permalink / raw)
  To: u-boot

st 21. 10. 2020 v 12:29 odes?latel Michal Simek
<michal.simek@xilinx.com> napsal:
>
> 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(-)
>
> --
> 2.28.0
>

Applied.
M

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

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

end of thread, other threads:[~2020-10-27  7:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21 10:29 [PATCH 0/4] xilinx: zynqmp: Fixes for silicon ID detection Michal Simek
2020-10-21 10:29 ` [PATCH 1/4] xilinx: zynqmp: Check return value from xilinx_pm_request() Michal Simek
2020-10-21 10:29 ` [PATCH 2/4] xilinx: zynqmp: Fix debug message in zynqmp_get_silicon_idcode_name() Michal Simek
2020-10-21 10:29 ` [PATCH 3/4] xilinx: zynqmp: Do not check 0 as invalid return from snprintf Michal Simek
2020-10-21 10:29 ` [PATCH 4/4] xilinx: zynqmp: Use tab for macro indentation Michal Simek
2020-10-27  7:26 ` [PATCH 0/4] xilinx: zynqmp: Fixes for silicon ID detection Michal Simek

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.