arm64: zynqmp: Do not assing MIO34 that early on zcu100
authorMichal Simek <michal.simek@xilinx.com>
Tue, 3 Dec 2019 14:02:50 +0000 (15:02 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 14 Jan 2020 08:05:53 +0000 (09:05 +0100)
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>
arch/arm/mach-zynqmp/include/mach/psu_init_gpl.h
arch/arm/mach-zynqmp/psu_spl_init.c
arch/arm/mach-zynqmp/spl.c
board/xilinx/zynqmp/zynqmp-zcu100-revC/psu_init_gpl.c

index 15e54c0493875fd490f1ef87cf746de28efb1d88..e37acda2f89e7c6643eec2d194abe01b706eeee7 100644 (file)
@@ -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_ */
index b357de32358c61758e7fe75221690813855a7d71..b6abdfd608ee7358484ae07b81fb125b39b0504d 100644 (file)
@@ -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;
+}
index a2079535a58b380d2f9d7680beaf8f125561a817..527646875a9d6378b9dac1eddddb320f6c2e6caf 100644 (file)
@@ -13,6 +13,7 @@
 #include <asm/io.h>
 #include <asm/spl.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/psu_init_gpl.h>
 #include <asm/arch/sys_proto.h>
 
 void board_init_f(ulong dummy)
@@ -53,6 +54,7 @@ void spl_board_init(void)
        preloader_console_init();
        ps_mode_reset(MODE_RESET);
        board_init();
+       psu_post_config_data();
 }
 #endif
 
index e1fdabaeb9d1c066906f8a1be43ecfa11be5dc99..585b3afc218a9b26e3bd7f4b88cbcfe51b6ab67e 100644 (file)
@@ -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;
+}