Skip to contentSkip to conversation

arm: socfpga: remove re-added ad-hoc reset code

PATCH New Simon Goldschmidt 2 participants 3 messages May 13, 2019 – May 14, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 arm: socfpga: remove re-added ad-hoc reset code

commit c5de2b7eae68 ("arm: socfpga: implement proper peripheral reset") has removed the call to 'reset_deassert_peripherals_handoff()' from socfpga gen5 SPL since the reset driver now handles resets. However, commit c1d4b464c8b8 ("ARM: socfpga: Disable bridges in SPL unless booting from FPGA") has re-added this ad-hoc reset code, so that all peripherals were now again enabled instead of letting the drivers enable them by request.

While at it, remove this function for gen5 as it should not be used.

Fixes commit c1d4b464c8b8 ("ARM: socfpga: Disable bridges in SPL unless booting from FPGA")

---

 arch/arm/mach-socfpga/include/mach/reset_manager_gen5.h | 1 -
 arch/arm/mach-socfpga/reset_manager_gen5.c              | 8 --------
 arch/arm/mach-socfpga/spl_gen5.c                        | 3 +--
 3 files changed, 1 insertion(+), 11 deletions(-)
arch/arm/mach-socfpga/include/mach/reset_manager_gen5.h +0 -1
index 5e490d182e..f4dcb14623 100644
@@ -8,7 +8,6 @@
 
 #include <dt-bindings/reset/altr,rst-mgr.h>
 
-void reset_deassert_peripherals_handoff(void);
 void socfpga_bridges_set_handoff_regs(bool h2f, bool lwh2f, bool f2h);
 void socfpga_bridges_reset(int enable);
 
arch/arm/mach-socfpga/reset_manager_gen5.c +0 -8
index 89a384b59c..9a32f5abfe 100644
@@ -61,14 +61,6 @@ void socfpga_per_reset_all(void)
 	writel(0xffffffff, &reset_manager_base->per2_mod_reset);
 }
 
-/*
- * Release peripherals from reset based on handoff
- */
-void reset_deassert_peripherals_handoff(void)
-{
-	writel(0, &reset_manager_base->per_mod_reset);
-}
-
 #define L3REGS_REMAP_LWHPS2FPGA_MASK	0x10
 #define L3REGS_REMAP_HPS2FPGA_MASK	0x08
 #define L3REGS_REMAP_OCRAM_MASK		0x01
arch/arm/mach-socfpga/spl_gen5.c +1 -2
index bd2a9fe5ae..1a60cdc897 100644
@@ -175,8 +175,7 @@ void board_init_f(ulong dummy)
 	sysmgr_pinmux_init();
 	sysmgr_config_warmrstcfgio(0);
 
-	/* De-assert reset for peripherals and bridges based on handoff */
-	reset_deassert_peripherals_handoff();
+	/* Set bridges handoff value */
 	socfpga_bridges_set_handoff_regs(true, true, true);
 
 	debug("Unfreezing/Thaw all I/O banks\n");
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 arm: sofcpga: s10: remove unused ad-hoc reset code

The stratix 10 reset manager ad-hoc code in arch/arm contains an unused function 'reset_deassert_peripherals_handoff' that has been added from the beginning. As this is probably a result of copying the gen5 reset manager and this function has never been used, remove it.

---

 .../arm/mach-socfpga/include/mach/reset_manager_s10.h |  1 -
 arch/arm/mach-socfpga/reset_manager_s10.c             | 11 -----------
 2 files changed, 12 deletions(-)
arch/arm/mach-socfpga/include/mach/reset_manager_s10.h +0 -1
index b93bbaf537..452147b017 100644
@@ -8,7 +8,6 @@
 #define	_RESET_MANAGER_S10_
 
 void reset_cpu(ulong addr);
-void reset_deassert_peripherals_handoff(void);
 int cpu_has_been_warmreset(void);
 
 void socfpga_bridges_reset(int enable);
arch/arm/mach-socfpga/reset_manager_s10.c +0 -11
index 39753a13c4..499a84aff5 100644
@@ -94,17 +94,6 @@ void socfpga_bridges_reset(int enable)
 	}
 }
 
-/*
- * Release peripherals from reset based on handoff
- */
-void reset_deassert_peripherals_handoff(void)
-{
-	writel(0, &reset_manager_base->per1modrst);
-	/* Enable OCP first */
-	writel(~RSTMGR_PER0MODRST_OCP_MASK, &reset_manager_base->per0modrst);
-	writel(0, &reset_manager_base->per0modrst);
-}
-
 /*
  * Return non-zero if the CPU has been warm reset
  */
Signature · 1 line
2.20.1
Applied
#2 lore raw

PATCH 1/2 arm: socfpga: remove re-added ad-hoc reset code

In reply to Simon Goldschmidt
Quoted 11 lines · Simon Goldschmidt

commit c5de2b7eae68 ("arm: socfpga: implement proper peripheral reset") has removed the call to 'reset_deassert_peripherals_handoff()' from socfpga gen5 SPL since the reset driver now handles resets. However, commit c1d4b464c8b8 ("ARM: socfpga: Disable bridges in SPL unless booting from FPGA") has re-added this ad-hoc reset code, so that all peripherals were now again enabled instead of letting the drivers enable them by request.

While at it, remove this function for gen5 as it should not be used.

Fixes commit c1d4b464c8b8 ("ARM: socfpga: Disable bridges in SPL unless booting from FPGA")

Applied both, thanks

Signature · 2 lines
Best regards,
Marek Vasut