Skip to contentSkip to conversation

socfpga: Adding Freeze Controller driver

PATCH Superseded Chin Liang See 2 participants 5 messages Oct 14, 2013 – Oct 16, 2013 Arm (32-bit)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 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.

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
index 0859e44..10d20f2 100644
@@ -14,7 +14,7 @@ LIB	=  $(obj)lib$(SOC).o
 
 SOBJS	:= lowlevel_init.o
 COBJS-y	:= misc.o timer.o reset_manager.o system_manager.o
-COBJS-$(CONFIG_SPL_BUILD) += spl.o
+COBJS-$(CONFIG_SPL_BUILD) += spl.o freeze_controller.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
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
index 74bceab..36a00c3 100644
@@ -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
#1 lore raw

PATCH v4 1/1 socfpga: Adding Freeze Controller driver

Hi Chin,

Quoted 5 lines · Chin Liang See

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.

Quoted 7 lines
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]>

---

V4 was already posted under patchwork number 277520, and is reposted here under 283228. What is the difference?

Amicalement,

Signature · 1 line
Albert.
#2 lore raw

PATCH v4 1/1 socfpga: Adding Freeze Controller driver

Hi Albert,

Quoted 18 lines · ZY - albert.u.boot

Hi Chin,

Quoted 5 lines · Chin Liang See

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.

Quoted 7 lines
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]>

---

Quoted 2 lines

V4 was already posted under patchwork number 277520, and is reposted here under 283228. What is the difference?

They are the same except have your email part of CC list. This is revision 4 patch and went through few rounds of review by Pavel and Dinh previously. As I believe it is in good state now, I am cc to you for your attention :)

Thanks and have a nice day!

Chin Liang

Quoted 2 lines

Amicalement,

#3 lore raw

PATCH v4 1/1 socfpga: Adding Freeze Controller driver

Hi Chin,

Quoted 21 lines · Chin Liang See

Hi Albert,

Quoted 18 lines · ZY - albert.u.boot

Hi Chin,

Quoted 12 lines · Chin Liang See

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.

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]>

---

Quoted 8 lines
Quoted 2 lines

V4 was already posted under patchwork number 277520, and is reposted here under 283228. What is the difference?

They are the same except have your email part of CC list. This is revision 4 patch and went through few rounds of review by Pavel and Dinh previously. As I believe it is in good state now, I am cc to you for your attention :)

Understood -- next time you want to ping someone on an already posted patch, do not repost it to the list, as this creates duplicate entries in patchwork. Rather, send a reply to the initial patch post, adding whoever you nee to as Cc: or To:.

Quoted 3 lines

Thanks and have a nice day!

Chin Liang

Amicalement,

Signature · 1 line
Albert.
#4 lore raw

PATCH v4 1/1 socfpga: Adding Freeze Controller driver

Hi Albert,

Quoted 35 lines · ZY - albert.u.boot

Hi Chin,

Quoted 21 lines · Chin Liang See

Hi Albert,

Quoted 18 lines · ZY - albert.u.boot

Hi Chin,

Quoted 12 lines · Chin Liang See

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.

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]>

---

Quoted 8 lines
Quoted 2 lines

V4 was already posted under patchwork number 277520, and is reposted here under 283228. What is the difference?

They are the same except have your email part of CC list. This is revision 4 patch and went through few rounds of review by Pavel and Dinh previously. As I believe it is in good state now, I am cc to you for your attention :)

Quoted 4 lines

Understood -- next time you want to ping someone on an already posted patch, do not repost it to the list, as this creates duplicate entries in patchwork. Rather, send a reply to the initial patch post, adding whoever you nee to as Cc: or To:.

Noted. Thanks again for your helps.

Chin Liang

Quoted 6 lines
Quoted 4 lines

Thanks and have a nice day!

Chin Liang

Amicalement,