armv8/ls1043aqds: add DSPI support
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/3 armv8/ls1043aqds: add DSPI support
Quoted 24 lines
-----Original Message-----
From: Gong Qianyu [mailto:Qianyu.Gong at nxp.com]
Sent: Thursday, December 24, 2015 4:40 PM
To: u-boot at lists.denx.de
Cc: Mingkai Hu; R58495 at freescale.com; B48286 at freescale.com; Shaohui.Xie at freescale.com; Wenbin.Song at freescale.com; B07421 at freescale.com; Gong Qianyu; Qianyu Gong
Subject: [PATCH 1/3] armv8/ls1043aqds: add DSPI supportFrom: Gong Qianyu <[email protected]>
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
Quoted 2 lines
Signed-off-by Gong Qianyu <[email protected]>Signed-off-by Gong Qianyu <[email protected]>
[S.H] keep one email address.
Quoted 25 lines
--- arch/arm/dts/fsl-ls1043a-qds.dts | 30 ++++++++++++++++++++++++++++++ configs/ls1043aqds_defconfig | 3 +++ configs/ls1043aqds_nand_defconfig | 5 +++++ configs/ls1043aqds_sdcard_ifc_defconfig | 5 +++++ include/configs/ls1043a_common.h | 13 +++++++++++++ include/configs/ls1043ardb.h | 10 ---------- 6 files changed, 56 insertions(+), 10 deletions(-)arch/arm/dts/fsl-ls1043a- renamed from arch/arm/dts/fsl-ls1043a-qds.dts +0
-0
qds.dts
index 7435222..0fe9c54 100644arch/arm/dts/fsl-ls1043a-qds.dts +6
-0@@ -15,6 +15,36 @@ / { model = "LS1043A QDS Board"; + aliases { + spi1 = &dspi0; + }; +}; + +&dspi0 {
arch/arm/dts/fsl-ls1043a-qds.dts line 33
Quoted 10 lines
arch/arm/dts/fsl-ls1043a-qds.dts +10
-0+ bus-num = <0>; + status = "okay"; + + dflash0: n25q128a { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-flash"; + reg = <0>; + spi-max-frequency = <1000000>; /* input clock */ + };
[S.H] empty line.
arch/arm/dts/fsl-ls1043a-qds.dts line 40
Quoted 7 lines
arch/arm/dts/fsl-ls1043a-qds.dts +7
-0+ dflash1: sst25wf040b { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-flash"; + spi-max-frequency = <3500000>; + reg = <1>; + };
[S.H] ditto.
Quoted 62 lines
arch/arm/dts/fsl-ls1043a-qds.dts +7
-0+ dflash2: en25s64 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-flash"; + spi-max-frequency = <3500000>; + reg = <2>; + }; }; &i2c0 {configs/ls1043aqds_defconfig +0
-0@@ -4,3 +4,6 @@ CONFIG_TARGET_LS1043AQDS=y CONFIG_SYS_NS16550=y
CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds"
CONFIG_OF_CONTROL=yconfigs/ls1043aqds_defconfig +3
-0+CONFIG_DM=y +CONFIG_SPI_FLASH=y +CONFIG_DM_SPI=yconfigs/ls1043aqds_nand_defconfig +0
-0@@ -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=yconfigs/ls1043aqds_nand_defconfig +5
-0+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds" +CONFIG_OF_CONTROL=y +CONFIG_DM=y +CONFIG_SPI_FLASH=y +CONFIG_DM_SPI=yconfigs/ls1043aqds_sdcard_ifc_defconfig +0
-0@@ -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=yconfigs/ls1043aqds_sdcard_ifc_defconfig +5
-0+CONFIG_DEFAULT_DEVICE_TREE="fsl-ls1043a-qds" +CONFIG_OF_CONTROL=y +CONFIG_DM=y +CONFIG_SPI_FLASH=y +CONFIG_DM_SPI=yinclude/configs/ls1043a_common.h +3
-0@@ -197,6 +197,19 @@#define CONFIG_DOS_PARTITION #endif +/* DSPI */ +#define CONFIG_FSL_DSPI +#ifdef CONFIG_FSL_DSPI
include/configs/ls1043a_common.h line 212
Quoted 10 lines
include/configs/ls1043a_common.h +10
-0+#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 + +
[S.H] remove one empty line.
Quoted 26 lines
include/configs/ls1043a_common.h +0
-0/* FMan ucode */ #define CONFIG_SYS_DPAA_FMAN #ifdef CONFIG_SYS_DPAA_FMAN include/configs/ls1043ardb.h +0
-11@@ -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 */ --2.1.0.27.g96db324
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/3 armv8/ls1043aqds: add QSPI support in SD boot
Quoted 28 lines · Gong Qianyu
From: Gong Qianyu <[email protected]>
QSPI and IFC are pin-multiplexed on LS1043A. So we use
ls1043aqds_sdcard_ifc_defconfigto support IFC in SD boot andls1043aqds_sdcard_qspi_defconfigto support QSPI in SD boot. If QSPI is enabled, IFC should be disabled in kernel as well.Signed-off-by Gong Qianyu <[email protected]>Signed-off-by Gong Qianyu <[email protected]>--- arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 5 +++++ arch/arm/cpu/armv8/fsl-layerscape/soc.c | 3 +++ arch/arm/dts/fsl-ls1043a-qds.dts | 14 +++++++++++++ arch/arm/dts/fsl-ls1043a.dtsi | 11 +++++++++++ board/freescale/ls1043aqds/MAINTAINERS | 1 + .../ls1043aqds/ls1043aqds_rcw_sd_qspi.cfg | 8 ++++++++ configs/ls1043aqds_sdcard_qspi_defconfig | 10 ++++++++++ include/configs/ls1043a_common.h | 13 ++++++++++++ include/configs/ls1043aqds.h | 23 ++++++++++++++++++++++ 9 files changed, 88 insertions(+)arch/arm/cpu/armv8/fsl-layerscape/fdt.c +0
-0
arch/arm/cpu/armv8/fsl-layerscape/fdt.c void ft_cpu_setup(void *blob, bd_t *bd) · line 208
Quoted 8 lines
arch/arm/cpu/armv8/fsl-layerscape/fdt.c +5
-0@@ -201,4 +201,9 @@ void ft_cpu_setup(void *blob, bd_t *bd)#ifdef CONFIG_FSL_LSCH3 fdt_fixup_smmu (blob);#endif + +#ifdef CONFIG_FSL_QSPI +do_fixup_by_compat (blob,"fsl,ifc" , +"status" ,"disabled" ,8 +1 ,1 ); +#endif
This needs to only happen on LS1043A (and any other chips that have the same muxing).
arch/arm/cpu/armv8/fsl-layerscape/soc.c void fsl_lsch2_early_init_f(void) · line 224
Quoted 13 lines
arch/arm/cpu/armv8/fsl-layerscape/fdt.c +0
-0}arch/arm/cpu/armv8/fsl-layerscape/soc.c +3
-0@@ -219,6 +219,9 @@ void fsl_lsch2_early_init_f(void)init_early_memctl_regs ();/* tighten IFC timing */ #endif +#ifdef CONFIG_FSL_QSPI +out_be32 (&scfg->qspi_cfg,SCFG_QSPI_CLKSEL ); +#endif
Likewise.
-Scott
PATCH 2/3 armv8/ls1043aqds: add QSPI support in SD boot
Quoted 33 lines
-----Original Message-----
From: Scott Wood [mailto:scottwood at freescale.com]
Sent: Tuesday, December 29, 2015 5:52 AM
To: Qianyu Gong <[email protected]>; u-boot at lists.denx.de
Cc: Mingkai Hu <[email protected]>; R58495 at freescale.com; B48286 at freescale.com; Shaohui.Xie at freescale.com; Wenbin.Song at freescale.com; B07421 at freescale.com; Gong Qianyu <[email protected]>
Subject: Re: [PATCH 2/3] armv8/ls1043aqds: add QSPI support in SD bootQuoted 22 lines · Gong Qianyu
From: Gong Qianyu <[email protected]>
QSPI and IFC are pin-multiplexed on LS1043A. So we use
ls1043aqds_sdcard_ifc_defconfigto support IFC in SD boot andls1043aqds_sdcard_qspi_defconfigto support QSPI in SD boot. If QSPI is enabled, IFC should be disabled in kernel as well.Signed-off-by Gong Qianyu <[email protected]>Signed-off-by Gong Qianyu <[email protected]>--- arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 5 +++++ arch/arm/cpu/armv8/fsl-layerscape/soc.c | 3 +++ arch/arm/dts/fsl-ls1043a-qds.dts | 14 +++++++++++++ arch/arm/dts/fsl-ls1043a.dtsi | 11 +++++++++++ board/freescale/ls1043aqds/MAINTAINERS | 1 + .../ls1043aqds/ls1043aqds_rcw_sd_qspi.cfg | 8 ++++++++ configs/ls1043aqds_sdcard_qspi_defconfig | 10 ++++++++++ include/configs/ls1043a_common.h | 13 ++++++++++++ include/configs/ls1043aqds.h | 23 ++++++++++++++++++++++ 9 files changed, 88 insertions(+)
Quoted 17 lines
arch/arm/cpu/armv8/fsl-layerscape/fdt.c
Quoted 13 lines
arch/arm/cpu/armv8/fsl-layerscape/fdt.c +0
-0@@ -201,4 +201,9 @@ void ft_cpu_setup(void *blob, bd_t *bd) #ifdef
CONFIG_FSL_LSCH3arch/arm/cpu/armv8/fsl-layerscape/fdt.c +4
-0fdt_fixup_smmu (blob);#endif + +#ifdef CONFIG_FSL_QSPI +do_fixup_by_compat (blob,"fsl,ifc" , +"status" ,"disabled" ,8 +1 ,1 );#endif This needs to only happen on LS1043A (and any other chips that have the same muxing).
Hi Scott,
Yes, LS1046A and LS1088A also have the same muxing and it's only different on LS2085A. Or we can just remove this fixup in U-Boot and make kernel deal with it respectively. Which do you prefer?
Quoted 10 lines
Quoted 10 lines
}
arch/arm/cpu/armv8/fsl-layerscape/soc.c +0
-0@@ -219,6 +219,9 @@ void fsl_lsch2_early_init_f(void)init_early_memctl_regs ();/* tighten IFC timing */ #endif
Quoted 6 lines
arch/arm/cpu/armv8/fsl-layerscape/soc.c void fsl_lsch2_early_init_f(void) · line 223
Quoted 2 lines
arch/arm/cpu/armv8/fsl-layerscape/soc.c +2
-0+#ifdef CONFIG_FSL_QSPI +out_be32 (&scfg->qspi_cfg,SCFG_QSPI_CLKSEL );#endif Likewise.
-Scott
fsl_lsch2_early_init_f() isn't called on LS2085A.
I think currently it's ok with known chips.
Regards,
Qianyu