All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] board: zynqmp: Fix for wrong AMS setting by ROM
@ 2020-06-05  8:09 Michal Simek
  2020-06-25  8:07 ` Michal Simek
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Simek @ 2020-06-05  8:09 UTC (permalink / raw)
  To: u-boot

From: Mike Looijmans <mike.looijmans@topic.nl>

A bug in the ZynqMP bootrom sets the PS_SYSMON_ANALOG_BUS register
at 0xFFA50914 to the wrong value 0x3201. This causes the AMS to
exchange the PS supply voltages 0 and 1. On Xilinx boards this is
not noticeable since these are tied together, it's only really
noticeable if banks 500 and 501 have different supplies. Xilinx' tech
support reported this undocumented register to be the cause, and
this patch applies a fix for all boards by programming the correct
value.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

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

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index cb72914adb3c..a6cd41af1a09 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -359,6 +359,9 @@ static int multi_boot(void)
 	return 0;
 }
 
+#define PS_SYSMON_ANALOG_BUS_VAL	0x3210
+#define PS_SYSMON_ANALOG_BUS_REG	0xFFA50914
+
 int board_init(void)
 {
 #if defined(CONFIG_ZYNQMP_FIRMWARE)
@@ -378,6 +381,9 @@ int board_init(void)
 
 	printf("EL Level:\tEL%d\n", current_el());
 
+	/* Bug in ROM sets wrong value in this register */
+	writel(PS_SYSMON_ANALOG_BUS_VAL, PS_SYSMON_ANALOG_BUS_REG);
+
 #if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ZYNQMPPL) && \
     !defined(CONFIG_SPL_BUILD) || (defined(CONFIG_SPL_FPGA_SUPPORT) && \
     defined(CONFIG_SPL_BUILD))
-- 
2.27.0

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

* [PATCH] board: zynqmp: Fix for wrong AMS setting by ROM
  2020-06-05  8:09 [PATCH] board: zynqmp: Fix for wrong AMS setting by ROM Michal Simek
@ 2020-06-25  8:07 ` Michal Simek
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Simek @ 2020-06-25  8:07 UTC (permalink / raw)
  To: u-boot

p? 5. 6. 2020 v 10:09 odes?latel Michal Simek <michal.simek@xilinx.com> napsal:
>
> From: Mike Looijmans <mike.looijmans@topic.nl>
>
> A bug in the ZynqMP bootrom sets the PS_SYSMON_ANALOG_BUS register
> at 0xFFA50914 to the wrong value 0x3201. This causes the AMS to
> exchange the PS supply voltages 0 and 1. On Xilinx boards this is
> not noticeable since these are tied together, it's only really
> noticeable if banks 500 and 501 have different supplies. Xilinx' tech
> support reported this undocumented register to be the cause, and
> this patch applies a fix for all boards by programming the correct
> value.
>
> Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  board/xilinx/zynqmp/zynqmp.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
> index cb72914adb3c..a6cd41af1a09 100644
> --- a/board/xilinx/zynqmp/zynqmp.c
> +++ b/board/xilinx/zynqmp/zynqmp.c
> @@ -359,6 +359,9 @@ static int multi_boot(void)
>         return 0;
>  }
>
> +#define PS_SYSMON_ANALOG_BUS_VAL       0x3210
> +#define PS_SYSMON_ANALOG_BUS_REG       0xFFA50914
> +
>  int board_init(void)
>  {
>  #if defined(CONFIG_ZYNQMP_FIRMWARE)
> @@ -378,6 +381,9 @@ int board_init(void)
>
>         printf("EL Level:\tEL%d\n", current_el());
>
> +       /* Bug in ROM sets wrong value in this register */
> +       writel(PS_SYSMON_ANALOG_BUS_VAL, PS_SYSMON_ANALOG_BUS_REG);
> +
>  #if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ZYNQMPPL) && \
>      !defined(CONFIG_SPL_BUILD) || (defined(CONFIG_SPL_FPGA_SUPPORT) && \
>      defined(CONFIG_SPL_BUILD))
> --
> 2.27.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] 2+ messages in thread

end of thread, other threads:[~2020-06-25  8:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05  8:09 [PATCH] board: zynqmp: Fix for wrong AMS setting by ROM Michal Simek
2020-06-25  8:07 ` 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.