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 26/28] armv8/ls2085ardb: Enable NAND SPL support
Date: Thu, 19 Mar 2015 09:45:57 -0700	[thread overview]
Message-ID: <1426783559-26610-26-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>

Enable NAND boot support using SPL framework. To boot from
NAND, either use DIP switches on board, or "qixis_reset nand"
command.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 arch/arm/Kconfig                  |    1 +
 board/freescale/ls2085ardb/ddr.c  |    4 ++++
 configs/ls2085ardb_nand_defconfig |    4 ++++
 include/configs/ls2085ardb.h      |   40 ++++++++++++++++++++++++++++++++-----
 4 files changed, 44 insertions(+), 5 deletions(-)
 create mode 100644 configs/ls2085ardb_nand_defconfig

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 46a48a0..7cbbf37 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -663,6 +663,7 @@ config TARGET_LS2085ARDB
 	bool "Support ls2085ardb"
 	select ARM64
 	select ARMV8_MULTIENTRY
+	select SUPPORT_SPL
 	help
 	  Support for Freescale LS2085ARDB platform.
 	  The LS2080A Reference design board (RDB) is a high-performance
diff --git a/board/freescale/ls2085ardb/ddr.c b/board/freescale/ls2085ardb/ddr.c
index 6cd5e8b..8d71ae1 100644
--- a/board/freescale/ls2085ardb/ddr.c
+++ b/board/freescale/ls2085ardb/ddr.c
@@ -147,9 +147,13 @@ phys_size_t initdram(int board_type)
 {
 	phys_size_t dram_size;
 
+#if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD)
+	return fsl_ddr_sdram_size();
+#else
 	puts("Initializing DDR....using SPD\n");
 
 	dram_size = fsl_ddr_sdram();
+#endif
 
 	return dram_size;
 }
diff --git a/configs/ls2085ardb_nand_defconfig b/configs/ls2085ardb_nand_defconfig
new file mode 100644
index 0000000..39ba8c5
--- /dev/null
+++ b/configs/ls2085ardb_nand_defconfig
@@ -0,0 +1,4 @@
++S:CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,NAND"
++S:CONFIG_SPL=y
++S:CONFIG_ARM=y
++S:CONFIG_TARGET_LS2085ARDB=y
diff --git a/include/configs/ls2085ardb.h b/include/configs/ls2085ardb.h
index 24400e4..34aa3e5 100644
--- a/include/configs/ls2085ardb.h
+++ b/include/configs/ls2085ardb.h
@@ -139,11 +139,13 @@ unsigned long get_board_sys_clk(void);
 #define QIXIS_LBMAP_SHIFT		0
 #define QIXIS_LBMAP_DFLTBANK		0x00
 #define QIXIS_LBMAP_ALTBANK		0x04
+#define QIXIS_LBMAP_NAND		0x09
 #define QIXIS_RST_CTL_RESET		0x31
 #define QIXIS_RST_CTL_RESET_EN		0x30
 #define QIXIS_RCFG_CTL_RECONFIG_IDLE	0x20
 #define QIXIS_RCFG_CTL_RECONFIG_START	0x21
 #define QIXIS_RCFG_CTL_WATCHDOG_ENBLE	0x08
+#define QIXIS_RCW_SRC_NAND		0x119
 #define	QIXIS_RST_FORCE_MEM		0x01
 
 #define CONFIG_SYS_CSPR3_EXT	(0x0)
@@ -169,6 +171,33 @@ unsigned long get_board_sys_clk(void);
 					FTIM2_GPCM_TWP(0x3E))
 #define CONFIG_SYS_CS3_FTIM3		0x0
 
+#if defined(CONFIG_SPL) && defined(CONFIG_NAND)
+#define CONFIG_SYS_CSPR2_EXT		CONFIG_SYS_NOR0_CSPR_EXT
+#define CONFIG_SYS_CSPR2		CONFIG_SYS_NOR0_CSPR_EARLY
+#define CONFIG_SYS_CSPR2_FINAL		CONFIG_SYS_NOR0_CSPR
+#define CONFIG_SYS_AMASK2		CONFIG_SYS_NOR_AMASK
+#define CONFIG_SYS_CSOR2		CONFIG_SYS_NOR_CSOR
+#define CONFIG_SYS_CS2_FTIM0		CONFIG_SYS_NOR_FTIM0
+#define CONFIG_SYS_CS2_FTIM1		CONFIG_SYS_NOR_FTIM1
+#define CONFIG_SYS_CS2_FTIM2		CONFIG_SYS_NOR_FTIM2
+#define CONFIG_SYS_CS2_FTIM3		CONFIG_SYS_NOR_FTIM3
+#define CONFIG_SYS_CSPR0_EXT		CONFIG_SYS_NAND_CSPR_EXT
+#define CONFIG_SYS_CSPR0		CONFIG_SYS_NAND_CSPR
+#define CONFIG_SYS_AMASK0		CONFIG_SYS_NAND_AMASK
+#define CONFIG_SYS_CSOR0		CONFIG_SYS_NAND_CSOR
+#define CONFIG_SYS_CS0_FTIM0		CONFIG_SYS_NAND_FTIM0
+#define CONFIG_SYS_CS0_FTIM1		CONFIG_SYS_NAND_FTIM1
+#define CONFIG_SYS_CS0_FTIM2		CONFIG_SYS_NAND_FTIM2
+#define CONFIG_SYS_CS0_FTIM3		CONFIG_SYS_NAND_FTIM3
+
+#define CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OFFSET		(1536 * 1024)
+#define CONFIG_ENV_SECT_SIZE		0x20000
+#define CONFIG_ENV_SIZE			0x2000
+#define CONFIG_SPL_PAD_TO		0x7ff40
+#define CONFIG_SYS_NAND_U_BOOT_OFFS	(512 * 1024)
+#define CONFIG_SYS_NAND_U_BOOT_SIZE	(512 * 1024)
+#else
 #define CONFIG_SYS_CSPR0_EXT		CONFIG_SYS_NOR0_CSPR_EXT
 #define CONFIG_SYS_CSPR0		CONFIG_SYS_NOR0_CSPR_EARLY
 #define CONFIG_SYS_CSPR0_FINAL		CONFIG_SYS_NOR0_CSPR
@@ -187,6 +216,12 @@ unsigned long get_board_sys_clk(void);
 #define CONFIG_SYS_CS2_FTIM2		CONFIG_SYS_NAND_FTIM2
 #define CONFIG_SYS_CS2_FTIM3		CONFIG_SYS_NAND_FTIM3
 
+#define CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_ADDR			(CONFIG_SYS_FLASH_BASE + 0x200000)
+#define CONFIG_ENV_SECT_SIZE		0x20000
+#define CONFIG_ENV_SIZE			0x2000
+#endif
+
 /* Debug Server firmware */
 #define CONFIG_SYS_DEBUG_SERVER_FW_IN_NOR
 #define CONFIG_SYS_DEBUG_SERVER_FW_ADDR	0x580D00000ULL
@@ -232,11 +267,6 @@ unsigned long get_board_sys_clk(void);
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
 
-#define CONFIG_ENV_IS_IN_FLASH
-#define CONFIG_ENV_ADDR			(CONFIG_SYS_FLASH_BASE + 0x200000)
-#define CONFIG_ENV_SECT_SIZE		0x20000
-#define CONFIG_ENV_SIZE			0x2000
-
 #define CONFIG_FSL_MEMAC
 #define CONFIG_PCI		/* Enable PCIE */
 #define CONFIG_PCIE_LAYERSCAPE	/* Use common FSL Layerscape PCIe code */
-- 
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 ` [U-Boot] [PATCH 25/28] freescale/qixis: Add support for booting from NAND York Sun
2015-03-19 16:45 ` York Sun [this message]
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-26-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.