[U-Boot] [PATCH 11/12] freescale: cmd: qixis: tidy up the duplicated code

Yuan Yao yao.yuan at freescale.com
Wed Mar 2 11:32:02 CET 2016


From: Yuan Yao <yao.yuan at nxp.com>

Signed-off-by: Yuan Yao <yao.yuan at nxp.com>
---
 board/freescale/common/qixis.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/board/freescale/common/qixis.c b/board/freescale/common/qixis.c
index 113295f..de9daeb 100644
--- a/board/freescale/common/qixis.c
+++ b/board/freescale/common/qixis.c
@@ -211,8 +211,7 @@ int qixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		QIXIS_WRITE(rcfg_ctl, 0);
 		set_lbmap(QIXIS_LBMAP_NAND);
 		set_rcw_src(QIXIS_RCW_SRC_NAND);
-		QIXIS_WRITE(rcfg_ctl, 0x20);
-		QIXIS_WRITE(rcfg_ctl, 0x21);
+		qixis_bank_reset();
 #else
 		printf("Not implemented\n");
 #endif
@@ -222,8 +221,7 @@ int qixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		QIXIS_WRITE(rcfg_ctl, 0);
 		set_lbmap(QIXIS_LBMAP_SD);
 		set_rcw_src(QIXIS_RCW_SRC_SD);
-		QIXIS_WRITE(rcfg_ctl, 0x20);
-		QIXIS_WRITE(rcfg_ctl, 0x21);
+		qixis_bank_reset();
 #else
 		printf("Not implemented\n");
 #endif
@@ -233,8 +231,7 @@ int qixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		QIXIS_WRITE(rcfg_ctl, 0);
 		set_lbmap(QIXIS_LBMAP_SD_QSPI);
 		set_rcw_src(QIXIS_RCW_SRC_SD);
-		qixis_write_i2c(offsetof(struct qixis, rcfg_ctl), 0x20);
-		qixis_write_i2c(offsetof(struct qixis, rcfg_ctl), 0x21);
+		qixis_bank_reset();
 #else
 		printf("Not implemented\n");
 #endif
@@ -244,8 +241,7 @@ int qixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		QIXIS_WRITE(rcfg_ctl, 0);
 		set_lbmap(QIXIS_LBMAP_QSPI);
 		set_rcw_src(QIXIS_RCW_SRC_QSPI);
-		qixis_write_i2c(offsetof(struct qixis, rcfg_ctl), 0x20);
-		qixis_write_i2c(offsetof(struct qixis, rcfg_ctl), 0x21);
+		qixis_bank_reset();
 #else
 		printf("Not implemented\n");
 #endif
-- 
2.1.0.27.g96db324



More information about the U-Boot mailing list