diff mbox

[U-Boot,V5,1/3] armv8/ls1043aqds: add DSPI support

Message ID 1453706167-39068-2-git-send-email-Qianyu.Gong@nxp.com
State Accepted
Delegated to: York Sun
Headers show

Commit Message

Gong Qianyu Jan. 25, 2016, 7:16 a.m. UTC
From: Gong Qianyu <Qianyu.Gong@freescale.com>

Enable three DSPI flash memories on board.

Commands:
=> sf probe 1:0
SF: Detected N25Q128A with page size 256 Bytes,
				erase size 64 KiB, total 16 MiB
=> sf probe 1:1
SF: Detected SST25WF040B with page size 256 Bytes,
				erase size 4 KiB, total 512 KiB
=> sf probe 1:2
SF: Detected EN25S64 with page size 256 Bytes,
				erase size 64 KiB, total 8 MiB

Signed-off-by: Gong Qianyu <Qianyu.Gong@freescale.com>
---
V5:
 - No change.
V4:
 - Fix for nor_ddr3_defconfig
V3:
 - No change.
V2:
 - Fix blank line issues.

 arch/arm/dts/fsl-ls1043a-qds.dts        | 32 ++++++++++++++++++++++++++++++++
 configs/ls1043aqds_defconfig            |  3 +++
 configs/ls1043aqds_nand_defconfig       |  5 +++++
 configs/ls1043aqds_nor_ddr3_defconfig   |  5 +++++
 configs/ls1043aqds_sdcard_ifc_defconfig |  5 +++++
 include/configs/ls1043a_common.h        | 12 ++++++++++++
 include/configs/ls1043ardb.h            | 10 ----------
 7 files changed, 62 insertions(+), 10 deletions(-)

Comments

York Sun Jan. 27, 2016, 5:20 p.m. UTC | #1
On 01/24/2016 11:25 PM, Gong Qianyu wrote:
> From: Gong Qianyu <Qianyu.Gong@freescale.com>
> 
> Enable three DSPI flash memories on board.
> 
> Commands:
> => sf probe 1:0
> SF: Detected N25Q128A with page size 256 Bytes,
> 				erase size 64 KiB, total 16 MiB
> => sf probe 1:1
> SF: Detected SST25WF040B with page size 256 Bytes,
> 				erase size 4 KiB, total 512 KiB
> => sf probe 1:2
> SF: Detected EN25S64 with page size 256 Bytes,
> 				erase size 64 KiB, total 8 MiB
> 
> Signed-off-by: Gong Qianyu <Qianyu.Gong@freescale.com>
> ---
> V5:
>  - No change.
> V4:
>  - Fix for nor_ddr3_defconfig
> V3:
>  - No change.
> V2:
>  - Fix blank line issues.
> 
>  arch/arm/dts/fsl-ls1043a-qds.dts        | 32 ++++++++++++++++++++++++++++++++
>  configs/ls1043aqds_defconfig            |  3 +++
>  configs/ls1043aqds_nand_defconfig       |  5 +++++
>  configs/ls1043aqds_nor_ddr3_defconfig   |  5 +++++
>  configs/ls1043aqds_sdcard_ifc_defconfig |  5 +++++
>  include/configs/ls1043a_common.h        | 12 ++++++++++++
>  include/configs/ls1043ardb.h            | 10 ----------
>  7 files changed, 62 insertions(+), 10 deletions(-)


Applied to u-boot-fsl-qoriq master. Awaiting upstream.

Thanks.

York
diff mbox

Patch

diff --git a/arch/arm/dts/fsl-ls1043a-qds.dts b/arch/arm/dts/fsl-ls1043a-qds.dts
index 7435222..93d73a6 100644
--- a/arch/arm/dts/fsl-ls1043a-qds.dts
+++ b/arch/arm/dts/fsl-ls1043a-qds.dts
@@ -15,6 +15,38 @@ 
 
 / {
 	model = "LS1043A QDS Board";
+	aliases {
+		spi1 = &dspi0;
+	};
+};
+
+&dspi0 {
+	bus-num = <0>;
+	status = "okay";
+
+	dflash0: n25q128a {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "spi-flash";
+		reg = <0>;
+		spi-max-frequency = <1000000>; /* input clock */
+	};
+
+	dflash1: sst25wf040b {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "spi-flash";
+		spi-max-frequency = <3500000>;
+		reg = <1>;
+	};
+
+	dflash2: en25s64 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "spi-flash";
+		spi-max-frequency = <3500000>;
+		reg = <2>;
+	};
 };
 
 &i2c0 {
diff --git a/configs/ls1043aqds_defconfig b/configs/ls1043aqds_defconfig
index 60fb0ad..5b12632 100644
--- a/configs/ls1043aqds_defconfig
+++ b/configs/ls1043aqds_defconfig
@@ -4,3 +4,6 @@  CONFIG_TARGET_LS1043AQDS=y
 CONFIG_SYS_NS16550=y
 CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds"
 CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPI_FLASH=y
+CONFIG_DM_SPI=y
diff --git a/configs/ls1043aqds_nand_defconfig b/configs/ls1043aqds_nand_defconfig
index e9d5afd..d4f758c 100644
--- a/configs/ls1043aqds_nand_defconfig
+++ b/configs/ls1043aqds_nand_defconfig
@@ -3,3 +3,8 @@  CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,RAMBOOT_PBL,SPL_FSL_PBL,NAND_BOOT"
 CONFIG_ARM=y
 CONFIG_TARGET_LS1043AQDS=y
 CONFIG_SYS_NS16550=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds"
+CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPI_FLASH=y
+CONFIG_DM_SPI=y
diff --git a/configs/ls1043aqds_nor_ddr3_defconfig b/configs/ls1043aqds_nor_ddr3_defconfig
index 5221ddb..438c992 100644
--- a/configs/ls1043aqds_nor_ddr3_defconfig
+++ b/configs/ls1043aqds_nor_ddr3_defconfig
@@ -1,3 +1,8 @@ 
 CONFIG_ARM=y
 CONFIG_TARGET_LS1043AQDS=y
 CONFIG_SYS_NS16550=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds"
+CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPI_FLASH=y
+CONFIG_DM_SPI=y
diff --git a/configs/ls1043aqds_sdcard_ifc_defconfig b/configs/ls1043aqds_sdcard_ifc_defconfig
index 6765d3d..25ae9cc 100644
--- a/configs/ls1043aqds_sdcard_ifc_defconfig
+++ b/configs/ls1043aqds_sdcard_ifc_defconfig
@@ -3,3 +3,8 @@  CONFIG_SYS_EXTRA_OPTIONS="SYS_FSL_DDR4,RAMBOOT_PBL,SPL_FSL_PBL,SD_BOOT"
 CONFIG_ARM=y
 CONFIG_TARGET_LS1043AQDS=y
 CONFIG_SYS_NS16550=y
+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds"
+CONFIG_OF_CONTROL=y
+CONFIG_DM=y
+CONFIG_SPI_FLASH=y
+CONFIG_DM_SPI=y
diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h
index 677d281..38e5b9b 100644
--- a/include/configs/ls1043a_common.h
+++ b/include/configs/ls1043a_common.h
@@ -197,6 +197,18 @@ 
 #define CONFIG_DOS_PARTITION
 #endif
 
+/*  DSPI  */
+#define CONFIG_FSL_DSPI
+#ifdef CONFIG_FSL_DSPI
+#define CONFIG_CMD_SF
+#define CONFIG_DM_SPI_FLASH
+#define CONFIG_SPI_FLASH_STMICRO	/* cs0 */
+#define CONFIG_SPI_FLASH_SST		/* cs1 */
+#define CONFIG_SPI_FLASH_EON		/* cs2 */
+#define CONFIG_SF_DEFAULT_BUS		1
+#define CONFIG_SF_DEFAULT_CS		0
+#endif
+
 /* FMan ucode */
 #define CONFIG_SYS_DPAA_FMAN
 #ifdef CONFIG_SYS_DPAA_FMAN
diff --git a/include/configs/ls1043ardb.h b/include/configs/ls1043ardb.h
index 585114f..f768348 100644
--- a/include/configs/ls1043ardb.h
+++ b/include/configs/ls1043ardb.h
@@ -222,16 +222,6 @@ 
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	3
 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	5
 
-/* DSPI */
-#define CONFIG_FSL_DSPI
-#ifdef CONFIG_FSL_DSPI
-#define CONFIG_CMD_SF
-#define CONFIG_DM_SPI_FLASH
-#define CONFIG_SPI_FLASH_STMICRO
-#define CONFIG_SF_DEFAULT_BUS		1
-#define CONFIG_SF_DEFAULT_CS		0
-#endif
-
 /*
  * Environment
  */