arm: socfpga: system: Rework sysmgr_enable_warmrstcfgio()
authorMarek Vasut <marex@denx.de>
Thu, 9 Jul 2015 02:40:11 +0000 (04:40 +0200)
committerMarek Vasut <marex@denx.de>
Sat, 8 Aug 2015 12:14:07 +0000 (14:14 +0200)
Rework sysmgr_enable_warmrstcfgio() into sysmgr_config_warmrstcfgio(),
which allows both enabling and disabling the warm reset config I/O
functionality.

Signed-off-by: Marek Vasut <marex@denx.de>
arch/arm/mach-socfpga/include/mach/system_manager.h
arch/arm/mach-socfpga/spl.c
arch/arm/mach-socfpga/system_manager.c

index 51d98157783538a2a06ad3505a4f749c71112039..de05aaf198494eab081629160fd6ed08f8253884 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef __ASSEMBLY__
 
 void sysmgr_pinmux_init(void);
-void sysmgr_enable_warmrstcfgio(void);
+void sysmgr_config_warmrstcfgio(int enable);
 
 /* declaration for handoff table type */
 extern unsigned long sys_mgr_init_table[CONFIG_HPS_PINMUX_NUM];
index 1fecfdc4f776518371ef8cd5ca50d8d6b51eda62..fd54ea979d78176a685517ddff69148d46695cfc 100644 (file)
@@ -78,7 +78,7 @@ void spl_board_init(void)
        cm_basic_init(cm_default_cfg);
 
        /* Enable bootrom to configure IOs. */
-       sysmgr_enable_warmrstcfgio();
+       sysmgr_config_warmrstcfgio(1);
 
        /* configure the IOCSR / IO buffer settings */
        if (scan_mgr_configure_iocsr())
index 8126e0d43cf12929152119fdaa3c792deba7621c..5ed47c3cff354a90e9513feea9895c4a7b561cfc 100644 (file)
@@ -70,8 +70,12 @@ void sysmgr_pinmux_init(void)
 /*
  * This bit allows the bootrom to configure the IOs after a warm reset.
  */
-void sysmgr_enable_warmrstcfgio(void)
+void sysmgr_config_warmrstcfgio(int enable)
 {
-       setbits_le32(&sysmgr_regs->romcodegrp_ctrl,
-                    SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGIO);
+       if (enable)
+               setbits_le32(&sysmgr_regs->romcodegrp_ctrl,
+                            SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGIO);
+       else
+               clrbits_le32(&sysmgr_regs->romcodegrp_ctrl,
+                            SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGIO);
 }