socfpga: Adding Freeze Controller driver
PATCH RESEND v4 1/1 socfpga: Adding Freeze Controller driver
Adding Freeze Controller driver. All HPS IOs need to be in freeze state during pin mux or IO buffer configuration. It is to avoid any glitch which might happen
during the configuration from propagating to external devices.
Signed-off-by Chin Liang See <[email protected]>
Cc Wolfgang Denk <[email protected]>
CC Pavel Machek <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Tom Rini <[email protected]>
Cc Albert Aribaud <[email protected]>
---
Changes for v4
- Removed additional lines
- Single function call to freeze and thaw all channels Changes for v3
- Removed unused macro in freeze_controller.h
Changes for v2
- Removed FREEZE_CONTROLLER_FSM_HW
- Removed the get_timer_count_masked and convert to use delay in us
- Used shorter local variables
--- arch/arm/cpu/armv7/socfpga/Makefile | 2 +- arch/arm/cpu/armv7/socfpga/freeze_controller.c | 216 ++++++++++++++++++++ arch/arm/cpu/armv7/socfpga/spl.c | 9 + .../include/asm/arch-socfpga/freeze_controller.h | 50 +++++ 4 files changed, 276 insertions(+), 1 deletion(-) create mode 100644 arch/arm/cpu/armv7/socfpga/freeze_controller.c create mode 100644 arch/arm/include/asm/arch-socfpga/freeze_controller.h
arch/arm/cpu/armv7/socfpga/Makefile +1 -1
@@ -9,4 +9,4 @@ obj-y := lowlevel_init.o obj-y += misc.o timer.o reset_manager.o system_manager.o -obj-$(CONFIG_SPL_BUILD) += spl.o +obj-$(CONFIG_SPL_BUILD) += spl.o freeze_controller.o
arch/arm/cpu/armv7/socfpga/freeze_controller.c new file +216 -0
216 lines not on this page · raw message
arch/arm/cpu/armv7/socfpga/spl.c +9 -0
@@ -13,6 +13,7 @@#include <asm/arch/reset_manager.h> #include <spl.h> #include <asm/arch/system_manager.h> +#include <asm/arch/freeze_controller.h> DECLARE_GLOBAL_DATA_PTR ;
@@ -27,6 +28,10 @@ u32 spl_boot_device(void)void spl_board_init (void ) {#ifndef CONFIG_SOCFPGA_VIRTUAL_TARGET +debug ("Freezing all I/O banks\n" ); +/* freeze all IO banks */ +sys_mgr_frzctrl_freeze_req (); +/* configure the pin muxing through system manager */ sysmgr_pinmux_init ();#endif /* CONFIG_SOCFPGA_VIRTUAL_TARGET */
@@ -34,6 +39,10 @@ void spl_board_init(void)/* de-assert reset for peripherals and bridges based on handoff */ reset_deassert_peripherals_handoff (); +debug ("Unfreezing/Thaw all I/O banks\n" ); +/* unfreeze / thaw all IO banks */ +sys_mgr_frzctrl_thaw_req (); +/* enable console uart printing */ preloader_console_init (); }
arch/arm/include/asm/arch-socfpga/freeze_controller.h new file +50 -0
50 lines not on this page · raw message
Signature · 1 line
1.7.9.5