[PATCH v2 11/13] spi: spi-zynqmp-gqspi: Add stacked memories support in GQSPI driver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: <broonie@xxxxxxxxxx>, <miquel.raynal@xxxxxxxxxxx>, <richard@xxxxxx>, <vigneshr@xxxxxx>, <jic23@xxxxxxxxxx>, <tudor.ambarus@xxxxxxxxxxxxx>, <pratyush@xxxxxxxxxx>, <sanju.mehta@xxxxxxx>, <chin-ting_kuo@xxxxxxxxxxxxxx>, <clg@xxxxxxxx>, <kdasu.kdev@xxxxxxxxx>, <f.fainelli@xxxxxxxxx>, <rjui@xxxxxxxxxxxx>, <sbranden@xxxxxxxxxxxx>, <eajames@xxxxxxxxxxxxx>, <olteanv@xxxxxxxxx>, <han.xu@xxxxxxx>, <john.garry@xxxxxxxxxx>, <shawnguo@xxxxxxxxxx>, <s.hauer@xxxxxxxxxxxxxx>, <narmstrong@xxxxxxxxxxxx>, <khilman@xxxxxxxxxxxx>, <matthias.bgg@xxxxxxxxx>, <haibo.chen@xxxxxxx>, <linus.walleij@xxxxxxxxxx>, <daniel@xxxxxxxxxx>, <haojian.zhuang@xxxxxxxxx>, <robert.jarzmik@xxxxxxx>, <agross@xxxxxxxxxx>, <bjorn.andersson@xxxxxxxxxx>, <heiko@xxxxxxxxx>, <krzysztof.kozlowski@xxxxxxxxxx>, <andi@xxxxxxxxxxx>, <mcoquelin.stm32@xxxxxxxxx>, <alexandre.torgue@xxxxxxxxxxx>, <wens@xxxxxxxx>, <jernej.skrabec@xxxxxxxxx>, <samuel@xxxxxxxxxxxx>, <masahisa.kojima@xxxxxxxxxx>, <jaswinder.singh@xxxxxxxxxx>, <rostedt@xxxxxxxxxxx>, <mingo@xxxxxxxxxx>, <l.stelmach@xxxxxxxxxxx>, <davem@xxxxxxxxxxxxx>, <edumazet@xxxxxxxxxx>, <kuba@xxxxxxxxxx>, <pabeni@xxxxxxxxxx>, <alex.aring@xxxxxxxxx>, <stefan@xxxxxxxxxxxxxxxxxx>, <kvalo@xxxxxxxxxx>, <thierry.reding@xxxxxxxxx>, <jonathanh@xxxxxxxxxx>, <skomatineni@xxxxxxxxxx>, <sumit.semwal@xxxxxxxxxx>, <christian.koenig@xxxxxxx>, <j.neuschaefer@xxxxxxx>, <vireshk@xxxxxxxxxx>, <rmfrfs@xxxxxxxxx>, <johan@xxxxxxxxxx>, <elder@xxxxxxxxxx>, <gregkh@xxxxxxxxxxxxxxxxxxx>
- Subject: [PATCH v2 11/13] spi: spi-zynqmp-gqspi: Add stacked memories support in GQSPI driver
- From: Amit Kumar Mahapatra <amit.kumar-mahapatra@xxxxxxx>
- Date: Fri, 20 Jan 2023 00:23:40 +0530
- In-reply-to: <20230119185342.2093323-1-amit.kumar-mahapatra@amd.com>
- References: <20230119185342.2093323-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@xxxxxxx>
---
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 319cdd5a0bdc..4759f704bf5c 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
_______________________________________________
greybus-dev mailing list -- greybus-dev@xxxxxxxxxxxxxxxx
To unsubscribe send an email to greybus-dev-leave@xxxxxxxxxxxxxxxx
[Index of Archives]
[Asterisk App Development]
[PJ SIP]
[Gnu Gatekeeper]
[IETF Sipping]
[Info Cyrus]
[ALSA User]
[Fedora Linux Users]
[Linux SCTP]
[DCCP]
[Gimp]
[Yosemite News]
[Deep Creek Hot Springs]
[Yosemite Campsites]
[ISDN Cause Codes]
[Asterisk Books]