diff mbox series

[v2] arm64: zynqmp: Do not assing MIO34 that early on zcu100

Message ID 175608f69633f3876bebdde1c2f7b9cf54b61716.1575387200.git.michal.simek@xilinx.com
State New
Delegated to: Michal Simek
Headers show
Series [v2] arm64: zynqmp: Do not assing MIO34 that early on zcu100 | expand

Commit Message

Michal Simek Dec. 3, 2019, 3:33 p.m. UTC
MIO34 is connected to POWER_KILL signal. When MIO configuration is done in
psu_init() and this pin is assigned to PMU but PMU configuration is not
loaded yet. PMU gpio output is high that means board is powered off
immediately.
The patch is fixing this sequence that MIO34 stays assing to ps gpio IP.
PMU config is loaded in SPL and then pin assigned to PMU through
psu_post_config_data().

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

Changes in v2:
- add missing declaration in header

 arch/arm/mach-zynqmp/include/mach/psu_init_gpl.h      | 1 +
 arch/arm/mach-zynqmp/psu_spl_init.c                   | 9 +++++++++
 arch/arm/mach-zynqmp/spl.c                            | 1 +
 board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c | 7 ++++++-
 4 files changed, 17 insertions(+), 1 deletion(-)

Comments

Michal Simek Jan. 16, 2020, 7:29 a.m. UTC | #1
Ășt 3. 12. 2019 v 16:33 odesĂ­latel Michal Simek <michal.simek@xilinx.com> napsal:
>
> MIO34 is connected to POWER_KILL signal. When MIO configuration is done in
> psu_init() and this pin is assigned to PMU but PMU configuration is not
> loaded yet. PMU gpio output is high that means board is powered off
> immediately.
> The patch is fixing this sequence that MIO34 stays assing to ps gpio IP.
> PMU config is loaded in SPL and then pin assigned to PMU through
> psu_post_config_data().
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> Changes in v2:
> - add missing declaration in header
>
>  arch/arm/mach-zynqmp/include/mach/psu_init_gpl.h      | 1 +
>  arch/arm/mach-zynqmp/psu_spl_init.c                   | 9 +++++++++
>  arch/arm/mach-zynqmp/spl.c                            | 1 +
>  board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c | 7 ++++++-
>  4 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-zynqmp/include/mach/psu_init_gpl.h b/arch/arm/mach-zynqmp/include/mach/psu_init_gpl.h
> index 15e54c049387..e37acda2f89e 100644
> --- a/arch/arm/mach-zynqmp/include/mach/psu_init_gpl.h
> +++ b/arch/arm/mach-zynqmp/include/mach/psu_init_gpl.h
> @@ -21,5 +21,6 @@ void prog_reg(unsigned long addr, unsigned long mask,
>               unsigned long shift, unsigned long value);
>
>  int psu_init(void);
> +unsigned long psu_post_config_data(void);
>
>  #endif /* _PSU_INIT_GPL_H_ */
> diff --git a/arch/arm/mach-zynqmp/psu_spl_init.c b/arch/arm/mach-zynqmp/psu_spl_init.c
> index b357de32358c..b6abdfd608ee 100644
> --- a/arch/arm/mach-zynqmp/psu_spl_init.c
> +++ b/arch/arm/mach-zynqmp/psu_spl_init.c
> @@ -77,3 +77,12 @@ __weak int psu_init(void)
>          */
>         return -1;
>  }
> +
> +__weak unsigned long psu_post_config_data(void)
> +{
> +       /*
> +        * This function is overridden by the one in
> +        * board/xilinx/zynqmp/(platform)/psu_init_gpl.c, if it exists.
> +        */
> +       return 0;
> +}
> diff --git a/arch/arm/mach-zynqmp/spl.c b/arch/arm/mach-zynqmp/spl.c
> index 6ba42bb42f62..6551b33f42d0 100644
> --- a/arch/arm/mach-zynqmp/spl.c
> +++ b/arch/arm/mach-zynqmp/spl.c
> @@ -60,6 +60,7 @@ void spl_board_init(void)
>         preloader_console_init();
>         ps_mode_reset(MODE_RESET);
>         board_init();
> +       psu_post_config_data();
>  }
>  #endif
>
> diff --git a/board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c b/board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c
> index e1fdabaeb9d1..585b3afc218a 100644
> --- a/board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c
> +++ b/board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c
> @@ -409,7 +409,6 @@ static unsigned long psu_mio_init_data(void)
>         psu_mask_write(0xFF18007C, 0x000000FEU, 0x00000000U);
>         psu_mask_write(0xFF180080, 0x000000FEU, 0x00000008U);
>         psu_mask_write(0xFF180084, 0x000000FEU, 0x00000008U);
> -       psu_mask_write(0xFF180088, 0x000000FEU, 0x00000008U);
>         psu_mask_write(0xFF18008C, 0x000000FEU, 0x00000000U);
>         psu_mask_write(0xFF180090, 0x000000FEU, 0x00000000U);
>         psu_mask_write(0xFF180094, 0x000000FEU, 0x00000000U);
> @@ -990,3 +989,9 @@ int psu_init(void)
>                 return 1;
>         return 0;
>  }
> +
> +unsigned long psu_post_config_data(void)
> +{
> +       psu_mask_write(0xFF180088, 0x000000FEU, 0x00000008U);
> +       return 0;
> +}
> --
> 2.24.0
>

Applied.
M
diff mbox series

Patch

diff --git a/arch/arm/mach-zynqmp/include/mach/psu_init_gpl.h b/arch/arm/mach-zynqmp/include/mach/psu_init_gpl.h
index 15e54c049387..e37acda2f89e 100644
--- a/arch/arm/mach-zynqmp/include/mach/psu_init_gpl.h
+++ b/arch/arm/mach-zynqmp/include/mach/psu_init_gpl.h
@@ -21,5 +21,6 @@  void prog_reg(unsigned long addr, unsigned long mask,
 	      unsigned long shift, unsigned long value);
 
 int psu_init(void);
+unsigned long psu_post_config_data(void);
 
 #endif /* _PSU_INIT_GPL_H_ */
diff --git a/arch/arm/mach-zynqmp/psu_spl_init.c b/arch/arm/mach-zynqmp/psu_spl_init.c
index b357de32358c..b6abdfd608ee 100644
--- a/arch/arm/mach-zynqmp/psu_spl_init.c
+++ b/arch/arm/mach-zynqmp/psu_spl_init.c
@@ -77,3 +77,12 @@  __weak int psu_init(void)
 	 */
 	return -1;
 }
+
+__weak unsigned long psu_post_config_data(void)
+{
+	/*
+	 * This function is overridden by the one in
+	 * board/xilinx/zynqmp/(platform)/psu_init_gpl.c, if it exists.
+	 */
+	return 0;
+}
diff --git a/arch/arm/mach-zynqmp/spl.c b/arch/arm/mach-zynqmp/spl.c
index 6ba42bb42f62..6551b33f42d0 100644
--- a/arch/arm/mach-zynqmp/spl.c
+++ b/arch/arm/mach-zynqmp/spl.c
@@ -60,6 +60,7 @@  void spl_board_init(void)
 	preloader_console_init();
 	ps_mode_reset(MODE_RESET);
 	board_init();
+	psu_post_config_data();
 }
 #endif
 
diff --git a/board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c b/board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c
index e1fdabaeb9d1..585b3afc218a 100644
--- a/board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c
+++ b/board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c
@@ -409,7 +409,6 @@  static unsigned long psu_mio_init_data(void)
 	psu_mask_write(0xFF18007C, 0x000000FEU, 0x00000000U);
 	psu_mask_write(0xFF180080, 0x000000FEU, 0x00000008U);
 	psu_mask_write(0xFF180084, 0x000000FEU, 0x00000008U);
-	psu_mask_write(0xFF180088, 0x000000FEU, 0x00000008U);
 	psu_mask_write(0xFF18008C, 0x000000FEU, 0x00000000U);
 	psu_mask_write(0xFF180090, 0x000000FEU, 0x00000000U);
 	psu_mask_write(0xFF180094, 0x000000FEU, 0x00000000U);
@@ -990,3 +989,9 @@  int psu_init(void)
 		return 1;
 	return 0;
 }
+
+unsigned long psu_post_config_data(void)
+{
+	psu_mask_write(0xFF180088, 0x000000FEU, 0x00000008U);
+	return 0;
+}