All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] arm64: zynqmp: Add support for debug uart also for U-Boot proper
@ 2020-03-20  8:03 Michal Simek
  2020-03-20  8:03 ` [PATCH 2/2] arm64: zynqmp: Move timeout for clock propagation below psu_init Michal Simek
  2020-04-06 11:07 ` [PATCH 1/2] arm64: zynqmp: Add support for debug uart also for U-Boot proper Michal Simek
  0 siblings, 2 replies; 4+ messages in thread
From: Michal Simek @ 2020-03-20  8:03 UTC (permalink / raw)
  To: u-boot

board_early_init_f() is the right location where debug uart can be
configurated (after MIO initialization).
The patch is taking this call from SPL to also make it available for U-Boot
proper.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 arch/arm/mach-zynqmp/spl.c   |  6 ------
 board/xilinx/zynqmp/zynqmp.c | 15 ++++++++++++---
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-zynqmp/spl.c b/arch/arm/mach-zynqmp/spl.c
index b3830182e250..c53945e57f39 100644
--- a/arch/arm/mach-zynqmp/spl.c
+++ b/arch/arm/mach-zynqmp/spl.c
@@ -6,7 +6,6 @@
  */
 
 #include <common.h>
-#include <debug_uart.h>
 #include <init.h>
 #include <spl.h>
 
@@ -21,11 +20,6 @@ void board_init_f(ulong dummy)
 	board_early_init_f();
 	board_early_init_r();
 
-#ifdef CONFIG_DEBUG_UART
-	/* Uart debug for sure */
-	debug_uart_init();
-	puts("Debug uart enabled\n"); /* or printch() */
-#endif
 	/* Delay is required for clocks to be propagated */
 	udelay(1000000);
 }
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index c6c55caa1ce0..04fd3bd0a443 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <cpu_func.h>
+#include <debug_uart.h>
 #include <env.h>
 #include <init.h>
 #include <sata.h>
@@ -319,13 +320,21 @@ static char *zynqmp_get_silicon_idcode_name(void)
 
 int board_early_init_f(void)
 {
-	int ret = 0;
-
 #if defined(CONFIG_ZYNQMP_PSU_INIT_ENABLED)
+	int ret;
+
 	ret = psu_init();
+	if (ret)
+		return ret;
 #endif
 
-	return ret;
+#ifdef CONFIG_DEBUG_UART
+	/* Uart debug for sure */
+	debug_uart_init();
+	puts("Debug uart enabled\n"); /* or printch() */
+#endif
+
+	return 0;
 }
 
 static int multi_boot(void)
-- 
2.25.1

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

* [PATCH 2/2] arm64: zynqmp: Move timeout for clock propagation below psu_init
  2020-03-20  8:03 [PATCH 1/2] arm64: zynqmp: Add support for debug uart also for U-Boot proper Michal Simek
@ 2020-03-20  8:03 ` Michal Simek
  2020-04-06 11:08   ` Michal Simek
  2020-04-06 11:07 ` [PATCH 1/2] arm64: zynqmp: Add support for debug uart also for U-Boot proper Michal Simek
  1 sibling, 1 reply; 4+ messages in thread
From: Michal Simek @ 2020-03-20  8:03 UTC (permalink / raw)
  To: u-boot

Delay required for clock propagation is tighly coupled with initialization
done in psu_init(). That's why call it also for u-boot proper with
CONFIG_ZYNQMP_PSU_INIT_ENABLED enabled.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 arch/arm/mach-zynqmp/spl.c   | 3 ---
 board/xilinx/zynqmp/zynqmp.c | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-zynqmp/spl.c b/arch/arm/mach-zynqmp/spl.c
index c53945e57f39..68df0a79c4e5 100644
--- a/arch/arm/mach-zynqmp/spl.c
+++ b/arch/arm/mach-zynqmp/spl.c
@@ -19,9 +19,6 @@ void board_init_f(ulong dummy)
 {
 	board_early_init_f();
 	board_early_init_r();
-
-	/* Delay is required for clocks to be propagated */
-	udelay(1000000);
 }
 
 static void ps_mode_reset(ulong mode)
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 04fd3bd0a443..eb1bc0861e2f 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -326,6 +326,9 @@ int board_early_init_f(void)
 	ret = psu_init();
 	if (ret)
 		return ret;
+
+	/* Delay is required for clocks to be propagated */
+	udelay(1000000);
 #endif
 
 #ifdef CONFIG_DEBUG_UART
-- 
2.25.1

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

* [PATCH 1/2] arm64: zynqmp: Add support for debug uart also for U-Boot proper
  2020-03-20  8:03 [PATCH 1/2] arm64: zynqmp: Add support for debug uart also for U-Boot proper Michal Simek
  2020-03-20  8:03 ` [PATCH 2/2] arm64: zynqmp: Move timeout for clock propagation below psu_init Michal Simek
@ 2020-04-06 11:07 ` Michal Simek
  1 sibling, 0 replies; 4+ messages in thread
From: Michal Simek @ 2020-04-06 11:07 UTC (permalink / raw)
  To: u-boot

p? 20. 3. 2020 v 9:03 odes?latel Michal Simek <michal.simek@xilinx.com> napsal:
>
> board_early_init_f() is the right location where debug uart can be
> configurated (after MIO initialization).
> The patch is taking this call from SPL to also make it available for U-Boot
> proper.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  arch/arm/mach-zynqmp/spl.c   |  6 ------
>  board/xilinx/zynqmp/zynqmp.c | 15 ++++++++++++---
>  2 files changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm/mach-zynqmp/spl.c b/arch/arm/mach-zynqmp/spl.c
> index b3830182e250..c53945e57f39 100644
> --- a/arch/arm/mach-zynqmp/spl.c
> +++ b/arch/arm/mach-zynqmp/spl.c
> @@ -6,7 +6,6 @@
>   */
>
>  #include <common.h>
> -#include <debug_uart.h>
>  #include <init.h>
>  #include <spl.h>
>
> @@ -21,11 +20,6 @@ void board_init_f(ulong dummy)
>         board_early_init_f();
>         board_early_init_r();
>
> -#ifdef CONFIG_DEBUG_UART
> -       /* Uart debug for sure */
> -       debug_uart_init();
> -       puts("Debug uart enabled\n"); /* or printch() */
> -#endif
>         /* Delay is required for clocks to be propagated */
>         udelay(1000000);
>  }
> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
> index c6c55caa1ce0..04fd3bd0a443 100644
> --- a/board/xilinx/zynqmp/zynqmp.c
> +++ b/board/xilinx/zynqmp/zynqmp.c
> @@ -6,6 +6,7 @@
>
>  #include <common.h>
>  #include <cpu_func.h>
> +#include <debug_uart.h>
>  #include <env.h>
>  #include <init.h>
>  #include <sata.h>
> @@ -319,13 +320,21 @@ static char *zynqmp_get_silicon_idcode_name(void)
>
>  int board_early_init_f(void)
>  {
> -       int ret = 0;
> -
>  #if defined(CONFIG_ZYNQMP_PSU_INIT_ENABLED)
> +       int ret;
> +
>         ret = psu_init();
> +       if (ret)
> +               return ret;
>  #endif
>
> -       return ret;
> +#ifdef CONFIG_DEBUG_UART
> +       /* Uart debug for sure */
> +       debug_uart_init();
> +       puts("Debug uart enabled\n"); /* or printch() */
> +#endif
> +
> +       return 0;
>  }
>
>  static int multi_boot(void)
> --
> 2.25.1
>

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] 4+ messages in thread

* [PATCH 2/2] arm64: zynqmp: Move timeout for clock propagation below psu_init
  2020-03-20  8:03 ` [PATCH 2/2] arm64: zynqmp: Move timeout for clock propagation below psu_init Michal Simek
@ 2020-04-06 11:08   ` Michal Simek
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Simek @ 2020-04-06 11:08 UTC (permalink / raw)
  To: u-boot

p? 20. 3. 2020 v 9:03 odes?latel Michal Simek <michal.simek@xilinx.com> napsal:
>
> Delay required for clock propagation is tighly coupled with initialization
> done in psu_init(). That's why call it also for u-boot proper with
> CONFIG_ZYNQMP_PSU_INIT_ENABLED enabled.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  arch/arm/mach-zynqmp/spl.c   | 3 ---
>  board/xilinx/zynqmp/zynqmp.c | 3 +++
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-zynqmp/spl.c b/arch/arm/mach-zynqmp/spl.c
> index c53945e57f39..68df0a79c4e5 100644
> --- a/arch/arm/mach-zynqmp/spl.c
> +++ b/arch/arm/mach-zynqmp/spl.c
> @@ -19,9 +19,6 @@ void board_init_f(ulong dummy)
>  {
>         board_early_init_f();
>         board_early_init_r();
> -
> -       /* Delay is required for clocks to be propagated */
> -       udelay(1000000);
>  }
>
>  static void ps_mode_reset(ulong mode)
> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
> index 04fd3bd0a443..eb1bc0861e2f 100644
> --- a/board/xilinx/zynqmp/zynqmp.c
> +++ b/board/xilinx/zynqmp/zynqmp.c
> @@ -326,6 +326,9 @@ int board_early_init_f(void)
>         ret = psu_init();
>         if (ret)
>                 return ret;
> +
> +       /* Delay is required for clocks to be propagated */
> +       udelay(1000000);
>  #endif
>
>  #ifdef CONFIG_DEBUG_UART
> --
> 2.25.1
>

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] 4+ messages in thread

end of thread, other threads:[~2020-04-06 11:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20  8:03 [PATCH 1/2] arm64: zynqmp: Add support for debug uart also for U-Boot proper Michal Simek
2020-03-20  8:03 ` [PATCH 2/2] arm64: zynqmp: Move timeout for clock propagation below psu_init Michal Simek
2020-04-06 11:08   ` Michal Simek
2020-04-06 11:07 ` [PATCH 1/2] arm64: zynqmp: Add support for debug uart also for U-Boot proper 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.