RE: [PATCH V5 09/15] spi: Add stacked and parallel memories support in SPI core
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: RE: [PATCH V5 09/15] spi: Add stacked and parallel memories support in SPI core
- From: "Mahapatra, Amit Kumar" <amit.kumar-mahapatra@xxxxxxx>
- Date: Tue, 7 Mar 2023 11:09:41 +0000
- Accept-language: en-US
- Cc: "broonie@xxxxxxxxxx" <broonie@xxxxxxxxxx>, "miquel.raynal@xxxxxxxxxxx" <miquel.raynal@xxxxxxxxxxx>, "richard@xxxxxx" <richard@xxxxxx>, "vigneshr@xxxxxx" <vigneshr@xxxxxx>, "jic23@xxxxxxxxxx" <jic23@xxxxxxxxxx>, "tudor.ambarus@xxxxxxxxxxxxx" <tudor.ambarus@xxxxxxxxxxxxx>, "pratyush@xxxxxxxxxx" <pratyush@xxxxxxxxxx>, "Mehta, Sanju" <Sanju.Mehta@xxxxxxx>, "chin-ting_kuo@xxxxxxxxxxxxxx" <chin-ting_kuo@xxxxxxxxxxxxxx>, "clg@xxxxxxxx" <clg@xxxxxxxx>, "kdasu.kdev@xxxxxxxxx" <kdasu.kdev@xxxxxxxxx>, "f.fainelli@xxxxxxxxx" <f.fainelli@xxxxxxxxx>, "rjui@xxxxxxxxxxxx" <rjui@xxxxxxxxxxxx>, "sbranden@xxxxxxxxxxxx" <sbranden@xxxxxxxxxxxx>, "eajames@xxxxxxxxxxxxx" <eajames@xxxxxxxxxxxxx>, "olteanv@xxxxxxxxx" <olteanv@xxxxxxxxx>, "han.xu@xxxxxxx" <han.xu@xxxxxxx>, "john.garry@xxxxxxxxxx" <john.garry@xxxxxxxxxx>, "shawnguo@xxxxxxxxxx" <shawnguo@xxxxxxxxxx>, "s.hauer@xxxxxxxxxxxxxx" <s.hauer@xxxxxxxxxxxxxx>, "narmstrong@xxxxxxxxxxxx" <narmstrong@xxxxxxxxxxxx>, "khilman@xxxxxxxxxxxx" <khilman@xxxxxxxxxxxx>, "matthias.bgg@xxxxxxxxx" <matthias.bgg@xxxxxxxxx>, "haibo.chen@xxxxxxx" <haibo.chen@xxxxxxx>, "linus.walleij@xxxxxxxxxx" <linus.walleij@xxxxxxxxxx>, "daniel@xxxxxxxxxx" <daniel@xxxxxxxxxx>, "haojian.zhuang@xxxxxxxxx" <haojian.zhuang@xxxxxxxxx>, "robert.jarzmik@xxxxxxx" <robert.jarzmik@xxxxxxx>, "agross@xxxxxxxxxx" <agross@xxxxxxxxxx>, "bjorn.andersson@xxxxxxxxxx" <bjorn.andersson@xxxxxxxxxx>, "heiko@xxxxxxxxx" <heiko@xxxxxxxxx>, "krzysztof.kozlowski@xxxxxxxxxx" <krzysztof.kozlowski@xxxxxxxxxx>, "andi@xxxxxxxxxxx" <andi@xxxxxxxxxxx>, "mcoquelin.stm32@xxxxxxxxx" <mcoquelin.stm32@xxxxxxxxx>, "alexandre.torgue@xxxxxxxxxxx" <alexandre.torgue@xxxxxxxxxxx>, "wens@xxxxxxxx" <wens@xxxxxxxx>, "jernej.skrabec@xxxxxxxxx" <jernej.skrabec@xxxxxxxxx>, "samuel@xxxxxxxxxxxx" <samuel@xxxxxxxxxxxx>, "masahisa.kojima@xxxxxxxxxx" <masahisa.kojima@xxxxxxxxxx>, "jaswinder.singh@xxxxxxxxxx" <jaswinder.singh@xxxxxxxxxx>, "rostedt@xxxxxxxxxxx" <rostedt@xxxxxxxxxxx>, "mingo@xxxxxxxxxx" <mingo@xxxxxxxxxx>, "l.stelmach@xxxxxxxxxxx" <l.stelmach@xxxxxxxxxxx>, "davem@xxxxxxxxxxxxx" <davem@xxxxxxxxxxxxx>, "edumazet@xxxxxxxxxx" <edumazet@xxxxxxxxxx>, "kuba@xxxxxxxxxx" <kuba@xxxxxxxxxx>, "pabeni@xxxxxxxxxx" <pabeni@xxxxxxxxxx>, "alex.aring@xxxxxxxxx" <alex.aring@xxxxxxxxx>, "stefan@xxxxxxxxxxxxxxxxxx" <stefan@xxxxxxxxxxxxxxxxxx>, "kvalo@xxxxxxxxxx" <kvalo@xxxxxxxxxx>, "james.schulman@xxxxxxxxxx" <james.schulman@xxxxxxxxxx>, "david.rhodes@xxxxxxxxxx" <david.rhodes@xxxxxxxxxx>, "tanureal@xxxxxxxxxxxxxxxxxxxxx" <tanureal@xxxxxxxxxxxxxxxxxxxxx>, "rf@xxxxxxxxxxxxxxxxxxxxx" <rf@xxxxxxxxxxxxxxxxxxxxx>, "perex@xxxxxxxx" <perex@xxxxxxxx>, "tiwai@xxxxxxxx" <tiwai@xxxxxxxx>, "npiggin@xxxxxxxxx" <npiggin@xxxxxxxxx>, "christophe.leroy@xxxxxxxxxx" <christophe.leroy@xxxxxxxxxx>, "mpe@xxxxxxxxxxxxxx" <mpe@xxxxxxxxxxxxxx>, "oss@xxxxxxxxxxxx" <oss@xxxxxxxxxxxx>, "windhl@xxxxxxx" <windhl@xxxxxxx>, "yangyingliang@xxxxxxxxxx" <yangyingliang@xxxxxxxxxx>, "william.zhang@xxxxxxxxxxxx" <william.zhang@xxxxxxxxxxxx>, "kursad.oney@xxxxxxxxxxxx" <kursad.oney@xxxxxxxxxxxx>, "anand.gore@xxxxxxxxxxxx" <anand.gore@xxxxxxxxxxxx>, "rafal@xxxxxxxxxx" <rafal@xxxxxxxxxx>, "git (AMD-Xilinx)" <git@xxxxxxx>, "linux-spi@xxxxxxxxxxxxxxx" <linux-spi@xxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "joel@xxxxxxxxx" <joel@xxxxxxxxx>, "andrew@xxxxxxxx" <andrew@xxxxxxxx>, "radu_nicolae.pirea@xxxxxx" <radu_nicolae.pirea@xxxxxx>, "nicolas.ferre@xxxxxxxxxxxxx" <nicolas.ferre@xxxxxxxxxxxxx>, "alexandre.belloni@xxxxxxxxxxx" <alexandre.belloni@xxxxxxxxxxx>, "claudiu.beznea@xxxxxxxxxxxxx" <claudiu.beznea@xxxxxxxxxxxxx>, "bcm-kernel-feedback-list@xxxxxxxxxxxx" <bcm-kernel-feedback-list@xxxxxxxxxxxx>, "fancer.lancer@xxxxxxxxx" <fancer.lancer@xxxxxxxxx>, "kernel@xxxxxxxxxxxxxx" <kernel@xxxxxxxxxxxxxx>, "festevam@xxxxxxxxx" <festevam@xxxxxxxxx>, "linux-imx@xxxxxxx" <linux-imx@xxxxxxx>, "jbrunet@xxxxxxxxxxxx" <jbrunet@xxxxxxxxxxxx>, "martin.blumenstingl@xxxxxxxxxxxxxx" <martin.blumenstingl@xxxxxxxxxxxxxx>, "avifishman70@xxxxxxxxx" <avifishman70@xxxxxxxxx>, "tmaimon77@xxxxxxxxx" <tmaimon77@xxxxxxxxx>, "tali.perry1@xxxxxxxxx" <tali.perry1@xxxxxxxxx>, "venture@xxxxxxxxxx" <venture@xxxxxxxxxx>, "yuenn@xxxxxxxxxx" <yuenn@xxxxxxxxxx>, "benjaminfair@xxxxxxxxxx" <benjaminfair@xxxxxxxxxx>, "yogeshgaur.83@xxxxxxxxx" <yogeshgaur.83@xxxxxxxxx>, "konrad.dybcio@xxxxxxxxxxxxxx" <konrad.dybcio@xxxxxxxxxxxxxx>, "alim.akhtar@xxxxxxxxxxx" <alim.akhtar@xxxxxxxxxxx>, "ldewangan@xxxxxxxxxx" <ldewangan@xxxxxxxxxx>, "thierry.reding@xxxxxxxxx" <thierry.reding@xxxxxxxxx>, "jonathanh@xxxxxxxxxx" <jonathanh@xxxxxxxxxx>, "Simek, Michal" <michal.simek@xxxxxxx>, "linux-aspeed@xxxxxxxxxxxxxxxx" <linux-aspeed@xxxxxxxxxxxxxxxx>, "openbmc@xxxxxxxxxxxxxxxx" <openbmc@xxxxxxxxxxxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, "linux-rpi-kernel@xxxxxxxxxxxxxxxxxxx" <linux-rpi-kernel@xxxxxxxxxxxxxxxxxxx>, "linux-amlogic@xxxxxxxxxxxxxxxxxxx" <linux-amlogic@xxxxxxxxxxxxxxxxxxx>, "linux-mediatek@xxxxxxxxxxxxxxxxxxx" <linux-mediatek@xxxxxxxxxxxxxxxxxxx>, "linux-arm-msm@xxxxxxxxxxxxxxx" <linux-arm-msm@xxxxxxxxxxxxxxx>, "linux-rockchip@xxxxxxxxxxxxxxxxxxx" <linux-rockchip@xxxxxxxxxxxxxxxxxxx>, "linux-samsung-soc@xxxxxxxxxxxxxxx" <linux-samsung-soc@xxxxxxxxxxxxxxx>, "linux-stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx" <linux-stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, "linux-sunxi@xxxxxxxxxxxxxxx" <linux-sunxi@xxxxxxxxxxxxxxx>, "linux-tegra@xxxxxxxxxxxxxxx" <linux-tegra@xxxxxxxxxxxxxxx>, "netdev@xxxxxxxxxxxxxxx" <netdev@xxxxxxxxxxxxxxx>, "linux-wpan@xxxxxxxxxxxxxxx" <linux-wpan@xxxxxxxxxxxxxxx>, "libertas-dev@xxxxxxxxxxxxxxxxxxx" <libertas-dev@xxxxxxxxxxxxxxxxxxx>, "linux-wireless@xxxxxxxxxxxxxxx" <linux-wireless@xxxxxxxxxxxxxxx>, "linux-mtd@xxxxxxxxxxxxxxxxxxx" <linux-mtd@xxxxxxxxxxxxxxxxxxx>, "lars@xxxxxxxxxx" <lars@xxxxxxxxxx>, "Michael.Hennerich@xxxxxxxxxx" <Michael.Hennerich@xxxxxxxxxx>, "linux-iio@xxxxxxxxxxxxxxx" <linux-iio@xxxxxxxxxxxxxxx>, "michael@xxxxxxxx" <michael@xxxxxxxx>, "palmer@xxxxxxxxxxx" <palmer@xxxxxxxxxxx>, "linux-riscv@xxxxxxxxxxxxxxxxxxx" <linux-riscv@xxxxxxxxxxxxxxxxxxx>, "alsa-devel@xxxxxxxxxxxxxxxx" <alsa-devel@xxxxxxxxxxxxxxxx>, "patches@xxxxxxxxxxxxxxxxxxxxx" <patches@xxxxxxxxxxxxxxxxxxxxx>, "linuxppc-dev@xxxxxxxxxxxxxxxx" <linuxppc-dev@xxxxxxxxxxxxxxxx>, "amitrkcian2002@xxxxxxxxx" <amitrkcian2002@xxxxxxxxx>
- In-reply-to: <CAOiHx=nmsAh3ADL3s0eZKpEZJqCB_POi=8YjfxrHYLEbjRfwHg@mail.gmail.com>
- References: <20230306172109.595464-1-amit.kumar-mahapatra@amd.com> <20230306172109.595464-10-amit.kumar-mahapatra@amd.com> <CAOiHx=nmsAh3ADL3s0eZKpEZJqCB_POi=8YjfxrHYLEbjRfwHg@mail.gmail.com>
Hello,
> -----Original Message-----
> From: Jonas Gorski <jonas.gorski@xxxxxxxxx>
> Sent: Tuesday, March 7, 2023 1:31 AM
> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@xxxxxxx>
> Cc: broonie@xxxxxxxxxx; miquel.raynal@xxxxxxxxxxx; richard@xxxxxx;
> vigneshr@xxxxxx; jic23@xxxxxxxxxx; tudor.ambarus@xxxxxxxxxxxxx;
> pratyush@xxxxxxxxxx; Mehta, Sanju <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; james.schulman@xxxxxxxxxx; david.rhodes@xxxxxxxxxx;
> tanureal@xxxxxxxxxxxxxxxxxxxxx; rf@xxxxxxxxxxxxxxxxxxxxx;
> perex@xxxxxxxx; tiwai@xxxxxxxx; npiggin@xxxxxxxxx;
> christophe.leroy@xxxxxxxxxx; mpe@xxxxxxxxxxxxxx; oss@xxxxxxxxxxxx;
> windhl@xxxxxxx; yangyingliang@xxxxxxxxxx;
> william.zhang@xxxxxxxxxxxx; kursad.oney@xxxxxxxxxxxx;
> anand.gore@xxxxxxxxxxxx; rafal@xxxxxxxxxx; git (AMD-Xilinx)
> <git@xxxxxxx>; linux-spi@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> joel@xxxxxxxxx; andrew@xxxxxxxx; radu_nicolae.pirea@xxxxxx;
> nicolas.ferre@xxxxxxxxxxxxx; alexandre.belloni@xxxxxxxxxxx;
> claudiu.beznea@xxxxxxxxxxxxx; bcm-kernel-feedback-list@xxxxxxxxxxxx;
> fancer.lancer@xxxxxxxxx; kernel@xxxxxxxxxxxxxx; festevam@xxxxxxxxx;
> linux-imx@xxxxxxx; jbrunet@xxxxxxxxxxxx;
> martin.blumenstingl@xxxxxxxxxxxxxx; avifishman70@xxxxxxxxx;
> tmaimon77@xxxxxxxxx; tali.perry1@xxxxxxxxx; venture@xxxxxxxxxx;
> yuenn@xxxxxxxxxx; benjaminfair@xxxxxxxxxx; yogeshgaur.83@xxxxxxxxx;
> konrad.dybcio@xxxxxxxxxxxxxx; alim.akhtar@xxxxxxxxxxx;
> ldewangan@xxxxxxxxxx; thierry.reding@xxxxxxxxx; jonathanh@xxxxxxxxxx;
> Simek, Michal <michal.simek@xxxxxxx>; linux-aspeed@xxxxxxxxxxxxxxxx;
> openbmc@xxxxxxxxxxxxxxxx; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; linux-rpi-
> kernel@xxxxxxxxxxxxxxxxxxx; linux-amlogic@xxxxxxxxxxxxxxxxxxx; linux-
> mediatek@xxxxxxxxxxxxxxxxxxx; linux-arm-msm@xxxxxxxxxxxxxxx; linux-
> rockchip@xxxxxxxxxxxxxxxxxxx; linux-samsung-soc@xxxxxxxxxxxxxxx; linux-
> stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx; linux-sunxi@xxxxxxxxxxxxxxx; linux-
> tegra@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; linux-
> wpan@xxxxxxxxxxxxxxx; libertas-dev@xxxxxxxxxxxxxxxxxxx; linux-
> wireless@xxxxxxxxxxxxxxx; linux-mtd@xxxxxxxxxxxxxxxxxxx; lars@xxxxxxxxxx;
> Michael.Hennerich@xxxxxxxxxx; linux-iio@xxxxxxxxxxxxxxx;
> michael@xxxxxxxx; palmer@xxxxxxxxxxx; linux-riscv@xxxxxxxxxxxxxxxxxxx;
> alsa-devel@xxxxxxxxxxxxxxxx; patches@xxxxxxxxxxxxxxxxxxxxx; linuxppc-
> dev@xxxxxxxxxxxxxxxx; amitrkcian2002@xxxxxxxxx
> Subject: Re: [PATCH V5 09/15] spi: Add stacked and parallel memories
> support in SPI core
>
> Hi,
>
> On Mon, 6 Mar 2023 at 18:26, Amit Kumar Mahapatra <amit.kumar-
> mahapatra@xxxxxxx> wrote:
> >
> > For supporting multiple CS the SPI device need to be aware of all the
> > CS values. So, the "chip_select" member in the spi_device structure is
> > now an array that holds all the CS values.
> >
> > spi_device structure now has a "cs_index_mask" member. This acts as an
> > index to the chip_select array. If nth bit of spi->cs_index_mask is
> > set then the driver would assert spi->chip_select[n].
> >
> > In parallel mode all the chip selects are asserted/de-asserted
> > simultaneously and each byte of data is stored in both devices, the
> > even bits in one, the odd bits in the other. The split is
> > automatically handled by the GQSPI controller. The GQSPI controller
> > supports a maximum of two flashes connected in parallel mode. A
> > "multi-cs-cap" flag is added in the spi controntroller data, through
> > ctlr->multi-cs-cap the spi core will make sure that the controller is
> > capable of handling multiple chip selects at once.
> >
> > For supporting multiple CS via GPIO the cs_gpiod member of the
> > spi_device structure is now an array that holds the gpio descriptor
> > for each chipselect.
> >
> > Multi CS support using GPIO is not tested due to unavailability of
> > necessary hardware setup.
> >
> > Signed-off-by: Amit Kumar Mahapatra <amit.kumar-
> mahapatra@xxxxxxx>
> > ---
> > drivers/spi/spi.c | 213 +++++++++++++++++++++++++++-------------
> > include/linux/spi/spi.h | 34 +++++--
> > 2 files changed, 173 insertions(+), 74 deletions(-)
> >
> > diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index
> > 5866bf5813a4..8ec7f58fa111 100644
> > --- a/drivers/spi/spi.c
> > +++ b/drivers/spi/spi.c
> > @@ -613,7 +613,8 @@ static int spi_dev_check(struct device *dev, void
> *data)
> > struct spi_device *new_spi = data;
> >
> > if (spi->controller == new_spi->controller &&
> > - spi_get_chipselect(spi, 0) == spi_get_chipselect(new_spi, 0))
> > + spi_get_chipselect(spi, 0) == spi_get_chipselect(new_spi, 0) &&
> > + spi_get_chipselect(spi, 1) == spi_get_chipselect(new_spi,
> > + 1))
> > return -EBUSY;
>
> This will only reject new devices if both chip selects are identical, but not if
> they only share one, e.g. CS 1 + 2 vs 1 + 3, or 1 + 2 vs only 2, or if the order is
> different (1 + 2 vs 2 + 1 - haven't read the code too close to know if this is
> allowed/possible).
Agreed, will add in the next series.
Regards,
Amit
>
> Regards,
> Jonas
[Index of Archives]
[Linux Kernel]
[Linux ARM (vger)]
[Linux ARM MSM]
[Linux Omap]
[Linux Arm]
[Linux Tegra]
[Fedora ARM]
[Linux for Samsung SOC]
[eCos]
[Linux Fastboot]
[Gcc Help]
[Git]
[DCCP]
[IETF Announce]
[Security]
[Linux MIPS]
[Yosemite Campsites]
|