fsl-quadspi: Allow additional device combinations.
Subsystems (3)
cover fsl-quadspi: Allow additional device combinations.
This patch series fixes and extends the fsl-quadspi driver to allow for non-contiguous and non-homogeneous SPI NOR device layouts. The current driver assumes that attached devices are all of the same type, and are populated "in order" beginning with QSPIn_A_CS0.
The updated driver and DT changes make use of the 'reg' property for each flash to determine the interface and chip select to which each device is attached.
Patchset was tested on a custom VF610-based board with a single SPI NOR connected to QSPI0_B_CS0, and also on a Rev. H TWR board with dual SPI NOR devices connected to QSPI0_A_CS0 and QSPI0_B_CS0. MTD tests passed for all devices (readtest, speedtest, and stresstest), and independent access to both devices was verified on the TWR system.
Regards,
-Cory
Cory Tusar (7):
ARM: dts: vf610: Add missing QuadSPI register mapping and names.
ARM: dts: vfxxx: Include support for qspi1 functionality.
mtd: fsl-quadspi: Support both 24- and 32-bit addressed commands.
mtd: fsl-quadspi: Use per-device clk_rate.
mtd: fsl-quadspi: Allow non-contiguous flash layouts.
mtd: spi-nor: Add support for Micron MT25QL02GC serial flash.
ARM: dts: vf610-twr: Enable QSPI and map flash devices.
.../devicetree/bindings/mtd/fsl-quadspi.txt | 15 +- arch/arm/boot/dts/vf610-twr.dts | 39 +++ arch/arm/boot/dts/vfxxx.dtsi | 16 +- drivers/mtd/spi-nor/fsl-quadspi.c | 313 +++++++++++---------- drivers/mtd/spi-nor/spi-nor.c | 1 + 5 files changed, 232 insertions(+), 152 deletions(-)
Signature · 1 line
2.3.6
RFC PATCH 1/7 ARM: dts: vf610: Add missing QuadSPI register mapping and names.
Both 'reg' and 'reg-names' are required properties according to binding documentation, and both should contain two items.
--- arch/arm/boot/dts/vfxxx.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/boot/dts/vfxxx.dtsi +2 -1
@@ -242,7 +242,8 @@ #address-cells = <1>; #size-cells = <0>; compatible = "fsl,vf610-qspi"; - reg = <0x40044000 0x1000>; + reg = <0x40044000 0x1000>, <0x20000000 0x10000000>; + reg-names = "QuadSPI", "QuadSPI-memory"; interrupts = <24 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks VF610_CLK_QSPI0_EN>, <&clks VF610_CLK_QSPI0>;
Signature · 1 line
2.3.6
Re: [RFC PATCH 1/7] ARM: dts: vf610: Add missing QuadSPI register mapping and names.
Quoted 13 lines · Cory Tusar
Both 'reg' and 'reg-names' are required properties according to binding documentation, and both should contain two items.
Signed-off-by Cory Tusar <[email protected]>--- arch/arm/boot/dts/vfxxx.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/arm/boot/dts/vfxxx.dtsi +0
-0
arch/arm/boot/dts/vfxxx.dtsi line 249
Quoted 9 lines
arch/arm/boot/dts/vfxxx.dtsi +2
-1@@ -242,7 +242,8 @@ #address-cells = <1>; #size-cells = <0>; compatible = "fsl,vf610-qspi"; - reg = <0x40044000 0x1000>; + reg = <0x40044000 0x1000>, <0x20000000 0x10000000>; + reg-names = "QuadSPI", "QuadSPI-memory"; interrupts = <24 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clks VF610_CLK_QSPI0_EN>, <&clks VF610_CLK_QSPI0>;
Hm, this seem to have been wrong since the beginning...
--
Stefan
RFC PATCH 2/7 ARM: dts: vfxxx: Include support for qspi1 functionality.
In reply to Cory TusarThis commit extends the existing Vybrid QSPI devicetree implementation to also describe the qspi1 functional block.
--- arch/arm/boot/dts/vfxxx.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/arm/boot/dts/vfxxx.dtsi +13 -0
@@ -251,6 +251,19 @@ status = "disabled"; }; + qspi1: quadspi at 400c4000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,vf610-qspi"; + reg = <0x400c4000 0x1000>, <0x50000000 0x10000000>; + reg-names = "QuadSPI", "QuadSPI-memory"; + interrupts = <25 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks VF610_CLK_QSPI1_EN>, + <&clks VF610_CLK_QSPI1>; + clock-names = "qspi_en", "qspi"; + status = "disabled"; + }; + iomuxc: iomuxc at 40048000 { compatible = "fsl,vf610-iomuxc"; reg = <0x40048000 0x1000>;
Signature · 1 line
2.3.6
Re: [RFC PATCH 2/7] ARM: dts: vfxxx: Include support for qspi1 functionality.
Quoted 22 lines · Cory Tusar
This commit extends the existing Vybrid QSPI devicetree implementation to also describe the qspi1 functional block.
Signed-off-by Cory Tusar <[email protected]>--- arch/arm/boot/dts/vfxxx.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+)arch/arm/boot/dts/vfxxx.dtsi +6
-0@@ -251,6 +251,19 @@ status = "disabled"; }; + qspi1: quadspi at 400c4000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,vf610-qspi"; + reg = <0x400c4000 0x1000>, <0x50000000 0x10000000>; + reg-names = "QuadSPI", "QuadSPI-memory";
arch/arm/boot/dts/vfxxx.dtsi line 269
Quoted 10 lines
arch/arm/boot/dts/vfxxx.dtsi +7
-0+ interrupts = <25 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks VF610_CLK_QSPI1_EN>, + <&clks VF610_CLK_QSPI1>; + clock-names = "qspi_en", "qspi"; + status = "disabled"; + }; + iomuxc: iomuxc at 40048000 { compatible = "fsl,vf610-iomuxc"; reg = <0x40048000 0x1000>;
This seem to be at the wrong place under aips0. qspi1 should be under aips1. just before fec0. But other than that, I checked the addresses looks good to me. Hence with that change applied you can include:
--
Stefan
Re: [RFC PATCH 2/7] ARM: dts: vfxxx: Include support for qspi1 functionality.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 38 lines · Stefan Agner
Quoted 22 lines · Cory Tusar
This commit extends the existing Vybrid QSPI devicetree implementation to also describe the qspi1 functional block.
Signed-off-by Cory Tusar <[email protected]>--- arch/arm/boot/dts/vfxxx.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+)arch/arm/boot/dts/vfxxx.dtsi +6
-0@@ -251,6 +251,19 @@ status = "disabled"; }; + qspi1: quadspi at 400c4000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,vf610-qspi"; + reg = <0x400c4000 0x1000>, <0x50000000 0x10000000>; + reg-names = "QuadSPI", "QuadSPI-memory";arch/arm/boot/dts/vfxxx.dtsi line 269
Quoted 10 lines
arch/arm/boot/dts/vfxxx.dtsi +7
-0+ interrupts = <25 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks VF610_CLK_QSPI1_EN>, + <&clks VF610_CLK_QSPI1>; + clock-names = "qspi_en", "qspi"; + status = "disabled"; + }; + iomuxc: iomuxc at 40048000 { compatible = "fsl,vf610-iomuxc"; reg = <0x40048000 0x1000>;This seem to be at the wrong place under aips0. qspi1 should be under aips1. just before fec0. But other than that, I checked the addresses looks good to me. Hence with that change applied you can include:
Quoted 1 line
Reviewed-by Stefan Agner <[email protected]>
Hi Stefan,
Thanks for the review. Will update for the next version.
You'd think I would've checked that after making the same goof with i2c... :/
- -Cory
- --
Cory Tusar
Principal
PID 1 Solutions, Inc.
"There are two ways of constructing a software design. One way is to
make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies." --Sir Charles Anthony Richard Hoare
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEARECAAYFAlWVa34ACgkQHT1tsfGwHJ/yCwCfU0jadwpYzOmZ86jDqSvtht+A XvkAoKqfQJQmwVSibjxRDe57DcCWYlXd
=+QPB
-----END PGP SIGNATURE-----
RFC PATCH 3/7 mtd: fsl-quadspi: Support both 24- and 32-bit addressed commands.
In reply to Cory TusarThe current fsl-quadspi implementation assumes that all connected devices are of the same size and type. This commit adds lookup table entries for both 24- and 32-bit addressed variants of the read, sector erase, and page program operations as a precursor to later changes which generalize the flash layout parsing logic and allow for non-contiguous and non-homogeneous chip combinations.
--- drivers/mtd/spi-nor/fsl-quadspi.c | 116 ++++++++++++++++++++------------------ 1 file changed, 60 insertions(+), 56 deletions(-)
drivers/mtd/spi-nor/fsl-quadspi.c +60 -56
@@ -178,18 +178,21 @@#define QUADSPI_LUT_NUM 64/* SEQID -- we can have 16 seqids at most. */ -#define SEQID_QUAD_READ 0 -#define SEQID_WREN 1 -#define SEQID_WRDI 2 -#define SEQID_RDSR 3 -#define SEQID_SE 4 -#define SEQID_CHIP_ERASE 5 -#define SEQID_PP 6 -#define SEQID_RDID 7 -#define SEQID_WRSR 8 -#define SEQID_RDCR 9 -#define SEQID_EN4B 10 -#define SEQID_BRWR 11 +#define SEQID_QUAD_READ_24 0 +#define SEQID_QUAD_READ_32 1 +#define SEQID_WREN 2 +#define SEQID_WRDI 3 +#define SEQID_RDSR 4 +#define SEQID_SE_24 5 +#define SEQID_SE_32 5 +#define SEQID_CHIP_ERASE 7 +#define SEQID_PP_24 8 +#define SEQID_PP_32 8 +#define SEQID_RDID 9 +#define SEQID_WRSR 10 +#define SEQID_RDCR 11 +#define SEQID_EN4B 12 +#define SEQID_BRWR 13enum fsl_qspi_devtype {FSL_QUADSPI_VYBRID ,
@@ -287,7 +290,6 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)void __iomem *base = q->iobase;int rxfifo = q->devtype_data->rxfifo;u32 lut_base; -u8 cmd, addrlen, dummy;int i;fsl_qspi_unlock_lut (q);
@@ -297,22 +299,16 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)writel (0 , base +QUADSPI_LUT_BASE + i *4 );/* Quad Read */ - lut_base =SEQID_QUAD_READ *4 ; - -if (q->nor_size <=SZ_16M ) { - cmd =SPINOR_OP_READ_1_1_4 ; - addrlen =ADDR24BIT ; - dummy =8 ; - }else { -/* use the 4-byte address */ - cmd =SPINOR_OP_READ_1_1_4 ; - addrlen =ADDR32BIT ; - dummy =8 ; - } + lut_base =SEQID_QUAD_READ_24 *4 ; +writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_READ_1_1_4 ) |LUT1 (ADDR ,PAD1 ,ADDR24BIT ), + base +QUADSPI_LUT (lut_base)); +writel (LUT0 (DUMMY ,PAD1 ,8 ) |LUT1 (READ ,PAD4 , rxfifo), + base +QUADSPI_LUT (lut_base +1 )); -writel (LUT0 (CMD ,PAD1 , cmd) |LUT1 (ADDR ,PAD1 , addrlen), + lut_base =SEQID_QUAD_READ_32 *4 ; +writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_READ_1_1_4 ) |LUT1 (ADDR ,PAD1 ,ADDR32BIT ), base +QUADSPI_LUT (lut_base)); -writel (LUT0 (DUMMY ,PAD1 , dummy) |LUT1 (READ ,PAD4 , rxfifo), +writel (LUT0 (DUMMY ,PAD1 ,8 ) |LUT1 (READ ,PAD4 , rxfifo), base +QUADSPI_LUT (lut_base +1 ));/* Write enable */
@@ -320,18 +316,13 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_WREN ), base +QUADSPI_LUT (lut_base));/* Page Program */ - lut_base =SEQID_PP *4 ; - -if (q->nor_size <=SZ_16M ) { - cmd =SPINOR_OP_PP ; - addrlen =ADDR24BIT ; - }else { -/* use the 4-byte address */ - cmd =SPINOR_OP_PP ; - addrlen =ADDR32BIT ; - } + lut_base =SEQID_PP_24 *4 ; +writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_PP ) |LUT1 (ADDR ,PAD1 ,ADDR24BIT ), + base +QUADSPI_LUT (lut_base)); +writel (LUT0 (WRITE ,PAD1 ,0 ), base +QUADSPI_LUT (lut_base +1 )); -writel (LUT0 (CMD ,PAD1 , cmd) |LUT1 (ADDR ,PAD1 , addrlen), + lut_base =SEQID_PP_32 *4 ; +writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_PP ) |LUT1 (ADDR ,PAD1 ,ADDR32BIT ), base +QUADSPI_LUT (lut_base));writel (LUT0 (WRITE ,PAD1 ,0 ), base +QUADSPI_LUT (lut_base +1 ));
@@ -341,18 +332,12 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q) base + QUADSPI_LUT(lut_base));/* Erase a sector */ - lut_base =SEQID_SE *4 ; - -if (q->nor_size <=SZ_16M ) { - cmd =SPINOR_OP_SE ; - addrlen =ADDR24BIT ; - }else { -/* use the 4-byte address */ - cmd =SPINOR_OP_SE ; - addrlen =ADDR32BIT ; - } + lut_base =SEQID_SE_24 *4 ; +writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_SE ) |LUT1 (ADDR ,PAD1 ,ADDR24BIT ), + base +QUADSPI_LUT (lut_base)); -writel (LUT0 (CMD ,PAD1 , cmd) |LUT1 (ADDR ,PAD1 , addrlen), + lut_base =SEQID_SE_32 *4 ; +writel (LUT0 (CMD ,PAD1 ,SPINOR_OP_SE ) |LUT1 (ADDR ,PAD1 ,ADDR32BIT ), base +QUADSPI_LUT (lut_base));/* Erase the whole chip */
@@ -391,11 +376,17 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q) }/* Get the SEQID for the command */ -static int fsl_qspi_get_seqid (struct fsl_qspi *q,u8 cmd) +static int fsl_qspi_get_seqid (struct fsl_qspi *q,u8 cmd,u8 addr_width) {switch (cmd) {case SPINOR_OP_READ_1_1_4 : -return SEQID_QUAD_READ ; +if (addr_width ==3 ) +return SEQID_QUAD_READ_24 ; +if (addr_width ==4 ) +return SEQID_QUAD_READ_32 ; +dev_err (q->dev,"Unsupported addr_width (%d) for cmd 0x%.2x\n" , + addr_width, cmd); +break ;case SPINOR_OP_WREN :return SEQID_WREN ;case SPINOR_OP_WRDI :
@@ -403,11 +394,23 @@ static int fsl_qspi_get_seqid(struct fsl_qspi *q, u8 cmd)case SPINOR_OP_RDSR :return SEQID_RDSR ;case SPINOR_OP_SE : -return SEQID_SE ; +if (addr_width ==3 ) +return SEQID_SE_24 ; +if (addr_width ==4 ) +return SEQID_SE_32 ; +dev_err (q->dev,"Unsupported addr_width (%d) for cmd 0x%.2x\n" , + addr_width, cmd); +break ;case SPINOR_OP_CHIP_ERASE :return SEQID_CHIP_ERASE ;case SPINOR_OP_PP : -return SEQID_PP ; +if (addr_width ==3 ) +return SEQID_PP_24 ; +if (addr_width ==4 ) +return SEQID_PP_32 ; +dev_err (q->dev,"Unsupported addr_width (%d) for cmd 0x%.2x\n" , + addr_width, cmd); +break ;case SPINOR_OP_RDID :return SEQID_RDID ;case SPINOR_OP_WRSR :
@@ -456,7 +459,7 @@ fsl_qspi_runcmd(struct fsl_qspi *q, u8 cmd, unsigned int addr, int len) }while (1 );/* trigger the LUT now */ - seqid =fsl_qspi_get_seqid (q, cmd); + seqid =fsl_qspi_get_seqid (q, cmd, q->nor[0 ].addr_width);writel ((seqid <<QUADSPI_IPCR_SEQID_SHIFT ) | len, base +QUADSPI_IPCR );/* Wait for the interrupt. */
@@ -601,9 +604,10 @@ static void fsl_qspi_init_abh_read(struct fsl_qspi *q)writel (0 , base +QUADSPI_BUF2IND );/* Set the default lut sequence for AHB Read. */ - seqid =fsl_qspi_get_seqid (q, q->nor[0 ].read_opcode); + seqid =fsl_qspi_get_seqid (q, q->nor[0 ].read_opcode, + q->nor[0 ].addr_width);writel (seqid <<QUADSPI_BFGENCR_SEQID_SHIFT , - q->iobase +QUADSPI_BFGENCR ); + q->iobase +QUADSPI_BFGENCR ); }/* We use this function to do some basic init for spi_nor_scan(). */
Signature · 1 line
2.3.6
RFC PATCH 4/7 mtd: fsl-quadspi: Use per-device clk_rate.
In reply to Cory TusarThe current fsl-quadspi implementation re-parses the 'spi-max-frequency' property for each device, potentially allowing for an earlier, lower frequency to be overwritten with a greater value. This commit modifies the parsing logic to extract the clock frequency for each flash device and then configures for that frequency as part of the prepare() method prior to accessing a given device.
--- drivers/mtd/spi-nor/fsl-quadspi.c | 41 +++++++++++++++------------------------ 1 file changed, 16 insertions(+), 25 deletions(-)
drivers/mtd/spi-nor/fsl-quadspi.c +16 -25
@@ -233,7 +233,7 @@ struct fsl_qspi {struct fsl_qspi_devtype_data *devtype_data;u32 nor_size;u32 nor_num; -u32 clk_rate; +u32 clk_rate[FSL_QSPI_MAX_CHIP ];unsigned int chip_base_addr;/* We may support two chips. */ bool has_second_chip; };
@@ -645,25 +645,13 @@ static int fsl_qspi_nor_setup(struct fsl_qspi *q)return 0 ; } -static int fsl_qspi_nor_setup_last (struct fsl_qspi *q) +static void fsl_qspi_nor_setup_last (struct fsl_qspi *q) { -unsigned long rate = q->clk_rate; -int ret; - -if (is_imx6sx_qspi (q)) - rate *=4 ; - - ret =clk_set_rate (q->clk, rate); -if (ret) -return ret; -/* Init the LUT table again. */ fsl_qspi_init_lut (q);/* Init for AHB read */ fsl_qspi_init_abh_read (q); - -return 0 ; }static const struct of_device_id fsl_qspi_dt_ids[] = {
@@ -763,6 +751,8 @@ static int fsl_qspi_erase(struct spi_nor *nor, loff_t offs)static int fsl_qspi_prep (struct spi_nor *nor,enum spi_nor_ops ops) {struct fsl_qspi *q = nor->priv; +int nor_idx = nor - q->nor; +unsigned long rate = q->clk_rate[nor_idx];int ret; ret =clk_enable (q->clk_en);
@@ -775,6 +765,16 @@ static int fsl_qspi_prep(struct spi_nor *nor, enum spi_nor_ops ops)return ret; } +if (is_imx6sx_qspi (q)) + rate *=4 ; + + ret =clk_set_rate (q->clk, rate); +if (ret) { +clk_disable (q->clk); +clk_disable (q->clk_en); +return ret; + } +fsl_qspi_set_base_addr (q, nor);return 0 ; }
@@ -899,7 +899,7 @@ static int fsl_qspi_probe(struct platform_device *pdev) goto irq_failed; ret =of_property_read_u32 (np,"spi-max-frequency" , - &q->clk_rate); + &q->clk_rate[i]);if (ret <0 ) goto irq_failed;
@@ -939,21 +939,12 @@ static int fsl_qspi_probe(struct platform_device *pdev) }/* finish the rest init. */ - ret =fsl_qspi_nor_setup_last (q); -if (ret) - goto last_init_failed; +fsl_qspi_nor_setup_last (q);clk_disable (q->clk);clk_disable (q->clk_en);return 0 ; -last_init_failed: -for (i =0 ; i < q->nor_num; i++) { -/* skip the holes */ -if (!q->has_second_chip) - i *=2 ; -mtd_device_unregister (&q->mtd[i]); - } irq_failed:clk_disable_unprepare (q->clk); clk_failed:
Signature · 1 line
2.3.6
RFC PATCH 5/7 mtd: fsl-quadspi: Allow non-contiguous flash layouts.
In reply to Cory TusarThe current fsl-quadspi implementation assumes that the first NOR device is always physically connected to QSPIn_A_CS0, and that all connected devices are of the same type.
This commit separates the DT parsing and flash probe logic into two passes, allowing devices of different sizes and types to be attached in arbitrary order to the various chip selects associated with each QSPI interface.
Tested on a custom VF610-based board with a single SPI NOR connected to QSPI0_B_CS0, and also on a Rev. H TWR board with dual SPI NOR devices connected to QSPI0_A_CS0 and QSPI0_B_CS0.
--- .../devicetree/bindings/mtd/fsl-quadspi.txt | 15 +- drivers/mtd/spi-nor/fsl-quadspi.c | 166 +++++++++++++-------- 2 files changed, 106 insertions(+), 75 deletions(-)
Documentation/devicetree/bindings/mtd/fsl-quadspi.txt +6 -9
@@ -9,15 +9,6 @@ Required properties: - clocks : The clocks needed by the QuadSPI controller - clock-names : the name of the clocks -Optional properties: - - fsl,qspi-has-second-chip: The controller has two buses, bus A and bus B. - Each bus can be connected with two NOR flashes. - Most of the time, each bus only has one NOR flash - connected, this is the default case. - But if there are two NOR flashes connected to the - bus, you should enable this property. - (Please check the board's schematic.) - Example: qspi0: quadspi at 40044000 {
@@ -30,6 +21,12 @@ qspi0: quadspi at 40044000 { clock-names = "qspi_en", "qspi"; flash0: s25fl128s at 0 { + reg = <0>; /* QSPI0_A_CS0 */ + .... + }; + + flash1: s25fl128s at 3 { + reg = <3>; /* QSPI0_B_CS1 */ .... }; };
drivers/mtd/spi-nor/fsl-quadspi.c +100 -66
331 lines not on this page · raw message
Signature · 1 line
2.3.6
RFC PATCH 6/7 mtd: spi-nor: Add support for Micron MT25QL02GC serial flash.
In reply to Cory TusarAdd Micron (mt25ql02gc) 256 MiB flash to the list of supported devices.
--- drivers/mtd/spi-nor/spi-nor.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/spi-nor/spi-nor.c +1 -0
@@ -596,6 +596,7 @@ static const struct spi_device_id spi_nor_ids[] = { { "n25q512a", INFO(0x20bb20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) }, { "n25q512ax3", INFO(0x20ba20, 0, 64 * 1024, 1024, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) }, { "n25q00", INFO(0x20ba21, 0, 64 * 1024, 2048, SECT_4K | USE_FSR | SPI_NOR_QUAD_READ) }, + { "mt25ql02gc", INFO(0x20ba22, 0, 64 * 1024, 4096, SPI_NOR_QUAD_READ) },/* PMC */ { "pm25lv512", INFO(0, 0, 32 * 1024, 2, SECT_4K_PMC) },
Signature · 1 line
2.3.6
RFC PATCH 7/7 ARM: dts: vf610-twr: Enable QSPI and map flash devices.
In reply to Cory TusarThis commit enables the qspi0 functional block, and maps the two flash devices connected to QSPI0_A_CS0 and QSPI0_B_CS0 to individual MTD devices.
Tested using mtd_readtest, mtd_speedtest, and mtd_stresstest on a Rev. H TWR board.
--- arch/arm/boot/dts/vf610-twr.dts | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
arch/arm/boot/dts/vf610-twr.dts +39 -0
@@ -246,6 +246,23 @@ >; }; + pinctrl_qspi0: qspi0grp { + fsl,pins = < + VF610_PAD_PTD0__QSPI0_A_QSCK 0x31e2 + VF610_PAD_PTD1__QSPI0_A_CS0 0x31e2 + VF610_PAD_PTD2__QSPI0_A_DATA3 0x31e3 + VF610_PAD_PTD3__QSPI0_A_DATA2 0x31e3 + VF610_PAD_PTD4__QSPI0_A_DATA1 0x31e3 + VF610_PAD_PTD5__QSPI0_A_DATA0 0x31e3 + VF610_PAD_PTD7__QSPI0_B_QSCK 0x31e2 + VF610_PAD_PTD8__QSPI0_B_CS0 0x31e2 + VF610_PAD_PTD9__QSPI0_B_DATA3 0x31e3 + VF610_PAD_PTD10__QSPI0_B_DATA2 0x31e3 + VF610_PAD_PTD11__QSPI0_B_DATA1 0x31e3 + VF610_PAD_PTD12__QSPI0_B_DATA0 0x31e3 + >; + }; + pinctrl_sai2: sai2grp { fsl,pins = < VF610_PAD_PTA16__SAI2_TX_BCLK 0x02ed
@@ -280,6 +297,28 @@ status = "okay"; }; +&qspi0 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_qspi0>; + status = "okay"; + + flash0: s25fl128s at 0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spansion,s25fl128s"; + spi-max-frequency = <66000000>; + reg = <0>; + }; + + flash1: s25fl128s at 2 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spansion,s25fl128s"; + spi-max-frequency = <66000000>; + reg = <2>; + }; +}; + &sai2 { #sound-dai-cells = <0>; pinctrl-names = "default";
Signature · 1 line
2.3.6