From: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> To: <broonie@kernel.org>, <tudor.ambarus@linaro.org>, <pratyush@kernel.org>, <miquel.raynal@bootlin.com>, <richard@nod.at>, <vigneshr@ti.com>, <michael@walle.cc> Cc: <sbinding@opensource.cirrus.com>, <git@amd.com>, <linux-spi@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-mtd@lists.infradead.org>, <nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com>, <claudiu.beznea@microchip.com>, <michal.simek@amd.com>, <linux-arm-kernel@lists.infradead.org>, <amitrkcian2002@gmail.com>, Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> Subject: [PATCH V8 5/7] spi: spi-zynqmp-gqspi: Add stacked memories support in GQSPI driver Date: Thu, 11 May 2023 13:01:32 +0530 [thread overview] Message-ID: <20230511073134.41180-6-amit.kumar-mahapatra@amd.com> (raw) In-Reply-To: <20230511073134.41180-1-amit.kumar-mahapatra@amd.com> GQSPI supports two chip select CS0 & CS1. Update the driver to assert/de-assert the appropriate chip select as per the bits set in qspi->cs_index_mask. Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> --- drivers/spi/spi-zynqmp-gqspi.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index fb2ca9b90eab..3d2b92a88e8a 100644 --- a/drivers/spi/spi-zynqmp-gqspi.c +++ b/drivers/spi/spi-zynqmp-gqspi.c @@ -156,6 +156,9 @@ #define GQSPI_FREQ_100MHZ 100000000 #define GQSPI_FREQ_150MHZ 150000000 +#define GQSPI_SELECT_LOWER_CS BIT(0) +#define GQSPI_SELECT_UPPER_CS BIT(1) + #define SPI_AUTOSUSPEND_TIMEOUT 3000 enum mode_type {GQSPI_MODE_IO, GQSPI_MODE_DMA}; @@ -467,15 +470,17 @@ static void zynqmp_qspi_chipselect(struct spi_device *qspi, bool is_high) genfifoentry |= GQSPI_GENFIFO_MODE_SPI; + if (qspi->cs_index_mask & GQSPI_SELECT_UPPER_CS) { + zynqmp_gqspi_selectslave(xqspi, + GQSPI_SELECT_FLASH_CS_UPPER, + GQSPI_SELECT_FLASH_BUS_LOWER); + } else if (qspi->cs_index_mask & GQSPI_SELECT_LOWER_CS) { + zynqmp_gqspi_selectslave(xqspi, + GQSPI_SELECT_FLASH_CS_LOWER, + GQSPI_SELECT_FLASH_BUS_LOWER); + } + genfifoentry |= xqspi->genfifobus; if (!is_high) { - if (!spi_get_chipselect(qspi, 0)) { - xqspi->genfifobus = GQSPI_GENFIFO_BUS_LOWER; - xqspi->genfifocs = GQSPI_GENFIFO_CS_LOWER; - } else { - xqspi->genfifobus = GQSPI_GENFIFO_BUS_UPPER; - xqspi->genfifocs = GQSPI_GENFIFO_CS_UPPER; - } - genfifoentry |= xqspi->genfifobus; genfifoentry |= xqspi->genfifocs; genfifoentry |= GQSPI_GENFIFO_CS_SETUP; } else { -- 2.17.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
WARNING: multiple messages have this Message-ID (diff)
From: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> To: <broonie@kernel.org>, <tudor.ambarus@linaro.org>, <pratyush@kernel.org>, <miquel.raynal@bootlin.com>, <richard@nod.at>, <vigneshr@ti.com>, <michael@walle.cc> Cc: <sbinding@opensource.cirrus.com>, <git@amd.com>, <linux-spi@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-mtd@lists.infradead.org>, <nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com>, <claudiu.beznea@microchip.com>, <michal.simek@amd.com>, <linux-arm-kernel@lists.infradead.org>, <amitrkcian2002@gmail.com>, Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> Subject: [PATCH V8 5/7] spi: spi-zynqmp-gqspi: Add stacked memories support in GQSPI driver Date: Thu, 11 May 2023 13:01:32 +0530 [thread overview] Message-ID: <20230511073134.41180-6-amit.kumar-mahapatra@amd.com> (raw) In-Reply-To: <20230511073134.41180-1-amit.kumar-mahapatra@amd.com> GQSPI supports two chip select CS0 & CS1. Update the driver to assert/de-assert the appropriate chip select as per the bits set in qspi->cs_index_mask. Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com> --- drivers/spi/spi-zynqmp-gqspi.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index fb2ca9b90eab..3d2b92a88e8a 100644 --- a/drivers/spi/spi-zynqmp-gqspi.c +++ b/drivers/spi/spi-zynqmp-gqspi.c @@ -156,6 +156,9 @@ #define GQSPI_FREQ_100MHZ 100000000 #define GQSPI_FREQ_150MHZ 150000000 +#define GQSPI_SELECT_LOWER_CS BIT(0) +#define GQSPI_SELECT_UPPER_CS BIT(1) + #define SPI_AUTOSUSPEND_TIMEOUT 3000 enum mode_type {GQSPI_MODE_IO, GQSPI_MODE_DMA}; @@ -467,15 +470,17 @@ static void zynqmp_qspi_chipselect(struct spi_device *qspi, bool is_high) genfifoentry |= GQSPI_GENFIFO_MODE_SPI; + if (qspi->cs_index_mask & GQSPI_SELECT_UPPER_CS) { + zynqmp_gqspi_selectslave(xqspi, + GQSPI_SELECT_FLASH_CS_UPPER, + GQSPI_SELECT_FLASH_BUS_LOWER); + } else if (qspi->cs_index_mask & GQSPI_SELECT_LOWER_CS) { + zynqmp_gqspi_selectslave(xqspi, + GQSPI_SELECT_FLASH_CS_LOWER, + GQSPI_SELECT_FLASH_BUS_LOWER); + } + genfifoentry |= xqspi->genfifobus; if (!is_high) { - if (!spi_get_chipselect(qspi, 0)) { - xqspi->genfifobus = GQSPI_GENFIFO_BUS_LOWER; - xqspi->genfifocs = GQSPI_GENFIFO_CS_LOWER; - } else { - xqspi->genfifobus = GQSPI_GENFIFO_BUS_UPPER; - xqspi->genfifocs = GQSPI_GENFIFO_CS_UPPER; - } - genfifoentry |= xqspi->genfifobus; genfifoentry |= xqspi->genfifocs; genfifoentry |= GQSPI_GENFIFO_CS_SETUP; } else { -- 2.17.1
next prev parent reply other threads:[~2023-05-11 7:33 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-05-11 7:31 [PATCH V8 0/7] spi: Add support for stacked/parallel memories Amit Kumar Mahapatra 2023-05-11 7:31 ` Amit Kumar Mahapatra 2023-05-11 7:31 ` [PATCH V8 1/7] spi: Add stacked and parallel memories support in SPI core Amit Kumar Mahapatra 2023-05-11 7:31 ` Amit Kumar Mahapatra 2023-05-11 16:50 ` Stefan Binding 2023-05-11 16:50 ` Stefan Binding 2023-05-16 5:47 ` Mahapatra, Amit Kumar 2023-05-16 5:47 ` Mahapatra, Amit Kumar 2023-05-16 5:47 ` Mahapatra, Amit Kumar 2023-05-18 16:19 ` Stefan Binding 2023-05-18 16:19 ` Stefan Binding 2023-05-18 16:19 ` Stefan Binding 2023-05-30 16:25 ` Pratyush Yadav 2023-05-30 16:25 ` Pratyush Yadav 2023-05-30 16:25 ` Pratyush Yadav 2023-06-08 9:29 ` Mahapatra, Amit Kumar 2023-06-08 9:29 ` Mahapatra, Amit Kumar 2023-06-08 9:29 ` Mahapatra, Amit Kumar 2023-05-11 7:31 ` [PATCH V8 2/7] mtd: spi-nor: Convert macros with inline functions Amit Kumar Mahapatra 2023-05-11 7:31 ` Amit Kumar Mahapatra 2023-05-11 7:31 ` [PATCH V8 3/7] mtd: spi-nor: Add APIs to set/get nor->params Amit Kumar Mahapatra 2023-05-11 7:31 ` Amit Kumar Mahapatra 2023-05-11 7:31 ` [PATCH V8 4/7] mtd: spi-nor: Add stacked memories support in spi-nor Amit Kumar Mahapatra 2023-05-11 7:31 ` Amit Kumar Mahapatra 2023-05-11 7:31 ` Amit Kumar Mahapatra [this message] 2023-05-11 7:31 ` [PATCH V8 5/7] spi: spi-zynqmp-gqspi: Add stacked memories support in GQSPI driver Amit Kumar Mahapatra 2023-05-11 7:31 ` [PATCH V8 6/7] mtd: spi-nor: Add parallel memories support in spi-nor Amit Kumar Mahapatra 2023-05-11 7:31 ` Amit Kumar Mahapatra 2023-05-11 7:31 ` [PATCH V8 7/7] spi: spi-zynqmp-gqspi: Add parallel memories support in GQSPI driver Amit Kumar Mahapatra 2023-05-11 7:31 ` Amit Kumar Mahapatra
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=20230511073134.41180-6-amit.kumar-mahapatra@amd.com \ --to=amit.kumar-mahapatra@amd.com \ --cc=alexandre.belloni@bootlin.com \ --cc=amitrkcian2002@gmail.com \ --cc=broonie@kernel.org \ --cc=claudiu.beznea@microchip.com \ --cc=git@amd.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mtd@lists.infradead.org \ --cc=linux-spi@vger.kernel.org \ --cc=michael@walle.cc \ --cc=michal.simek@amd.com \ --cc=miquel.raynal@bootlin.com \ --cc=nicolas.ferre@microchip.com \ --cc=pratyush@kernel.org \ --cc=richard@nod.at \ --cc=sbinding@opensource.cirrus.com \ --cc=tudor.ambarus@linaro.org \ --cc=vigneshr@ti.com \ /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: linkBe 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.