]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
stm32mp: stpmic1: remove the debug unit request by debugger
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Wed, 1 Jun 2022 16:33:40 +0000 (18:33 +0200)
committerPatrick Delaunay <patrick.delaunay@foss.st.com>
Fri, 17 Jun 2022 12:12:27 +0000 (14:12 +0200)
Depending on backup register value, U-Boot SPL maintains the debug unit
powered-on for debugging purpose; only BUCK1 is required for powering
the debug unit, so revert the setting for all the other power lanes,
except BUCK3 that has to be always on.

To be functional this patch requires a modification in the debugger
,openocd for example, to update the STM32MP15 backup register when it is
required to debug SPL after reset. After deeper analysis this behavior
will be never supported in tools so the associated code, will be never
used and the associated code can be removed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
arch/arm/mach-stm32mp/include/mach/stm32.h
board/st/common/stpmic1.c
include/power/stpmic1.h

index cdb58fd40ece800cbea65dfc43f555b517d3f6ba..c70375a723cbcd3728029b752e17893e2af6e6ac 100644 (file)
@@ -135,7 +135,6 @@ enum boot_device {
 #define TAMP_BOOT_DEVICE_MASK          GENMASK(7, 4)
 #define TAMP_BOOT_INSTANCE_MASK                GENMASK(3, 0)
 #define TAMP_BOOT_FORCED_MASK          GENMASK(7, 0)
-#define TAMP_BOOT_DEBUG_ON             BIT(16)
 
 enum forced_boot_mode {
        BOOT_NORMAL = 0x00,
index 5fb1be2fd3d36c805707b7e2803cb079429273d8..d52dce4f657e125d10bb296fa46dc67674bbe513 100644 (file)
@@ -202,18 +202,4 @@ void stpmic1_init(u32 voltage_mv)
                        STPMIC1_BUCKS_MRST_CR,
                        STPMIC1_MRST_BUCK(STPMIC1_BUCK3),
                        STPMIC1_MRST_BUCK(STPMIC1_BUCK3));
-
-       /* Check if debug is enabled to program PMIC according to the bit */
-       if (readl(TAMP_BOOT_CONTEXT) & TAMP_BOOT_DEBUG_ON) {
-               log_info("Keep debug unit ON\n");
-
-               pmic_clrsetbits(dev, STPMIC1_BUCKS_MRST_CR,
-                               STPMIC1_MRST_BUCK_DEBUG,
-                               STPMIC1_MRST_BUCK_DEBUG);
-
-               if (STPMIC1_MRST_LDO_DEBUG)
-                       pmic_clrsetbits(dev, STPMIC1_LDOS_MRST_CR,
-                                       STPMIC1_MRST_LDO_DEBUG,
-                                       STPMIC1_MRST_LDO_DEBUG);
-       }
 }
index d3567df326cfb9a212ac01beb0efd391a97cdef4..201b1df762e39618b8ee2ff34f5395a0364f0951 100644 (file)
 
 /* BUCKS_MRST_CR */
 #define STPMIC1_MRST_BUCK(buck)                BIT(buck)
-#define STPMIC1_MRST_BUCK_DEBUG                (STPMIC1_MRST_BUCK(STPMIC1_BUCK1) | \
-                                        STPMIC1_MRST_BUCK(STPMIC1_BUCK3))
 
 /* LDOS_MRST_CR */
 #define STPMIC1_MRST_LDO(ldo)          BIT(ldo)
-#define STPMIC1_MRST_LDO_DEBUG         0
 
 /* BUCKx_MAIN_CR (x=1...4) */
 #define STPMIC1_BUCK_ENA               BIT(0)