All of lore.kernel.org
 help / color / mirror / Atom feed
From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 25/28] freescale/qixis: Add support for booting from NAND
Date: Thu, 19 Mar 2015 09:45:56 -0700	[thread overview]
Message-ID: <1426783559-26610-25-git-send-email-yorksun@freescale.com> (raw)
In-Reply-To: <1426783559-26610-1-git-send-email-yorksun@freescale.com>

From: Scott Wood <scottwood@freescale.com>

Use "qixis_reset nand" to reset the board to boot from NAND.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 board/freescale/common/qixis.c |   31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/board/freescale/common/qixis.c b/board/freescale/common/qixis.c
index a49e300..9f6b0e7 100644
--- a/board/freescale/common/qixis.c
+++ b/board/freescale/common/qixis.c
@@ -138,24 +138,23 @@ void qixis_bank_reset(void)
 	QIXIS_WRITE(rcfg_ctl, QIXIS_RCFG_CTL_RECONFIG_START);
 }
 
-/* Set the boot bank to the power-on default bank */
-void clear_altbank(void)
+static void __maybe_unused set_lbmap(int lbmap)
 {
 	u8 reg;
 
 	reg = QIXIS_READ(brdcfg[0]);
-	reg = (reg & ~QIXIS_LBMAP_MASK) | QIXIS_LBMAP_DFLTBANK;
+	reg = (reg & ~QIXIS_LBMAP_MASK) | lbmap;
 	QIXIS_WRITE(brdcfg[0], reg);
 }
 
-/* Set the boot bank to the alternate bank */
-void set_altbank(void)
+static void __maybe_unused set_rcw_src(int rcw_src)
 {
 	u8 reg;
 
-	reg = QIXIS_READ(brdcfg[0]);
-	reg = (reg & ~QIXIS_LBMAP_MASK) | QIXIS_LBMAP_ALTBANK;
-	QIXIS_WRITE(brdcfg[0], reg);
+	reg = QIXIS_READ(dutcfg[1]);
+	reg = (reg & ~1) | (rcw_src & 1);
+	QIXIS_WRITE(dutcfg[1], reg);
+	QIXIS_WRITE(dutcfg[0], (rcw_src >> 1) & 0xff);
 }
 
 static void qixis_dump_regs(void)
@@ -201,11 +200,22 @@ int qixis_reset_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	int i;
 
 	if (argc <= 1) {
-		clear_altbank();
+		set_lbmap(QIXIS_LBMAP_DFLTBANK);
 		qixis_reset();
 	} else if (strcmp(argv[1], "altbank") == 0) {
-		set_altbank();
+		set_lbmap(QIXIS_LBMAP_ALTBANK);
 		qixis_bank_reset();
+	} else if (strcmp(argv[1], "nand") == 0) {
+#ifdef QIXIS_LBMAP_NAND
+		QIXIS_WRITE(rst_ctl, 0x30);
+		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);
+#else
+		printf("Not implemented\n");
+#endif
 	} else if (strcmp(argv[1], "watchdog") == 0) {
 		static char *period[9] = {"2s", "4s", "8s", "16s", "32s",
 					  "1min", "2min", "4min", "8min"};
@@ -244,6 +254,7 @@ U_BOOT_CMD(
 	"Reset the board using the FPGA sequencer",
 	"- hard reset to default bank\n"
 	"qixis_reset altbank - reset to alternate bank\n"
+	"qixis_reset nand - reset to nand\n"
 	"qixis watchdog <watchdog_period> - set the watchdog period\n"
 	"	period: 1s 2s 4s 8s 16s 32s 1min 2min 4min 8min\n"
 	"qixis_reset dump - display the QIXIS registers\n"
-- 
1.7.9.5

  parent reply	other threads:[~2015-03-19 16:45 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 16:45 [U-Boot] [PATCH 01/28] armv8/fsl-lsch3: Implement workaround for erratum A008585 York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 02/28] armv8/ls2085a: Update common header file York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 03/28] armv8/fsl-lsch3: Fix platform clock calculation York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 04/28] armv8/ls2085a: Fix generic timer clock source York Sun
2015-03-19 18:08   ` Mark Rutland
2015-03-19 18:16     ` York Sun
2015-03-19 18:17       ` Mark Rutland
2015-03-19 18:24         ` York Sun
2015-03-19 18:46           ` Mark Rutland
2015-03-19 19:26             ` York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 05/28] armv8/ls2085a: Add support for reset request York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 06/28] armv8/fsl-lsch3: Set nodes in DVM domain York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 07/28] armv8/fsl-lsch3: Update early MMU table York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 08/28] fsl-lsch3: Introduce place for common early SoC init York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 09/28] armv8/ls2085a: Add workaround for USB erratum A-008751 York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 10/28] armv8/fsl-lsch3: Use correct compatible for serial clock fixup York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 11/28] driver/ldpaa_eth: Update ldpaa ethernet driver York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 12/28] armv8: Add SerDes framework for LayerScape Architecture York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 13/28] net/phy/cortina: Fix compilation warning York Sun
2015-03-19 17:17   ` Joe Hershberger
2015-03-19 16:45 ` [U-Boot] [PATCH 14/28] drivers/fsl-mc: Changed MC firmware loading for new boot architecture York Sun
2015-03-19 17:53   ` Kim Phillips
2015-03-23 20:06     ` Jose Rivera
2015-03-23 20:34       ` Kim Phillips
2015-03-23 21:15         ` Jose Rivera
2015-03-23 22:05           ` Kim Phillips
2015-03-24 15:14             ` Jose Rivera
2015-03-24 15:35               ` Kim Phillips
     [not found]                 ` <CALRxmdDfZKYh3QOSnz1LzvkpWuS2OzontG_fLECuMgzz2N68uA@mail.gmail.com>
2015-03-25 21:12                   ` Kim Phillips
2015-03-26 23:57                     ` Jose Rivera
2015-03-27 16:01                       ` Kim Phillips
2015-03-19 16:45 ` [U-Boot] [PATCH 15/28] net/memac_phy: reuse driver for little endian SoCs York Sun
2015-03-19 18:03   ` Joe Hershberger
2015-03-20  3:06     ` Shaohui Xie
2015-03-20  3:33       ` Joe Hershberger
2015-03-20  3:48         ` Shaohui Xie
2015-03-20  3:58           ` Joe Hershberger
2015-03-19 16:45 ` [U-Boot] [PATCH 16/28] armv8/fsl-ch3: Add support to print RCW configuration York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 17/28] armv8/fsl-lsch3: Enable system error aborts York Sun
2015-03-19 18:14   ` Mark Rutland
2015-03-19 19:52     ` Scott Wood
2015-03-19 19:54       ` York Sun
2015-03-19 19:58         ` Scott Wood
2015-03-19 20:02           ` York Sun
2015-03-19 20:06             ` Scott Wood
2015-03-19 20:27               ` York Sun
2015-03-19 20:37                 ` Scott Wood
2015-03-19 20:47                   ` York Sun
2015-03-19 20:51                     ` Scott Wood
2015-03-19 20:56                       ` York Sun
2015-03-19 21:34                         ` Scott Wood
2015-03-20 11:31       ` Mark Rutland
2015-03-19 16:45 ` [U-Boot] [PATCH 18/28] driver/ldpaa: Add support of WRIOP static data structure York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 19/28] armv8/ls2085aqds: Add support of LS2085AQDS platform York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 20/28] armv8/ls2085ardb: Add support of LS2085ARDB platform York Sun
2015-03-20 23:01   ` Scott Wood
2015-03-21  0:08     ` York Sun
2015-03-21  0:12       ` Scott Wood
2015-03-21  0:16         ` York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 21/28] drivers/fsl-mc: Autoload AOIP image from NOR flash York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 22/28] board/ls2085qds: Add support ethernet York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 23/28] driver/ifc: Add 64KB page support York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 24/28] armv8/ls2085aqds: NAND boot support York Sun
2015-03-19 16:45 ` York Sun [this message]
2015-03-19 16:45 ` [U-Boot] [PATCH 26/28] armv8/ls2085ardb: Enable NAND SPL support York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 27/28] ls2085a: esdhc: Add esdhc support for ls2085a York Sun
2015-03-19 16:45 ` [U-Boot] [PATCH 28/28] armv8/fsl-lsch3: Implement workaround for I2C issue York Sun
2015-03-20  5:35   ` Heiko Schocher
2015-03-20 16:08     ` York Sun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426783559-26610-25-git-send-email-yorksun@freescale.com \
    --to=yorksun@freescale.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.