From: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
To: Chris Packham
<Chris.Packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
Cc: "Mark Brown" <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"Jan Kundrát"
<jan.kundrat-xoNZbkdr4U2lVyrhU4qvOw@public.gmane.org>,
linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"Ben Whitten"
<ben.whitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] spi: orion: Allow specifying which HW CS to use with a GPIO CS
Date: Thu, 25 Jan 2018 22:27:24 +0100 [thread overview]
Message-ID: <CAMuHMdVESS=_JhsO2pziFshWF+d=g78H8XSny34HTJn=1Lei7g@mail.gmail.com> (raw)
In-Reply-To: <5dec18c8e18845d39999ca60547fefff-5g7mGxlPNYb6GjIOKuZY+ItlCAj8ZROq@public.gmane.org>
Hi Chris,
On Thu, Jan 25, 2018 at 10:18 PM, Chris Packham
<Chris.Packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org> wrote:
> On 26/01/18 00:57, Mark Brown wrote:
>> ")
>> Fcc: +sent-mail
>>
>> On Thu, Jan 25, 2018 at 09:51:06AM +0100, Geert Uytterhoeven wrote:
>>> On Wed, Jan 24, 2018 at 10:29 PM, Chris Packham
>>
>>> However, Jan wrote:
>>>> semi-public datahseet, it seems that the SPI hardware really insists on
>>>> driving *some* HW CS signal whenever a SPI transaction is in progress.
>>
>>> If that is correct, it behaves like MSIOF, so you must leave one native chip
>>> select unused. If all native chip selects are in use, one of them must be
>>> replaced by a GPIO chip select (which could be the same physical pin,
>>> depending on pinmux capabilities).
>>
>> Using the same pin is the ideal thing obviously, or if not then
>> something that we know isn't routed out of the SoC (which may or may not
>> be possible with a given chip design).
>>
>>>> spi-flash@0 {
>>>> /* This is on CS0 when GPIO 17 is high */
>>>> };
>>>>
>>>> spi-sram@1 {
>>>> /* This is on CS0 when GPIO 17 is low */
>>>> };
>>>> };
>>
>>>> I'm not sure what else I could do. I can't claim the GPIO twice. If I
>>>> could I could probably use spi-cs-high to handle the high/low toggle.
>>
>>> So this uses GPIO17 to drive a mux to connect CS0 to either the first or
>>> second device?
>
> Correct. GPIO17 directs CS0 with the addition of a logic gate.
>
>> Interesting, coincidentally there was someone else sending a patch for
>> muxing the other day which looked like having some support for chip
>> select muxing would be the most sensible implementation. I've copied in
>> Ben who had initially approached this with a mux for the full bus which
>> I'm not so convincd about.
>>
>>> But you describe this as @0 being driven by CS0, and @1 by GPIO17, and you
>>> rely on CS0 still being driven when @1 is selected, right?
>>> That indeed won't work when an unused native chip select is driven when
>>> using cs-gpio.
>
> Yes that's my problem.
>
>>
>>> IMHO, this needs the mux to be described properly in DT.
>>
>> Yes.
>
> I'm more than happy to update the DT on this product. But I've no idea
> what that update would look like.
(Un)fortunately a mux driver is WIP, as Mark mentioned above.
See https://lkml.org/lkml/2018/1/22/859
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-01-25 21:27 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-23 19:56 [PATCH] spi: orion: Allow specifying which HW CS to use with a GPIO CS Jan Kundrát
[not found] ` <a1884719d4381cc3254408229cf5d9f94d4f2995.1516744108.git.jan.kundrat-xoNZbkdr4U2lVyrhU4qvOw@public.gmane.org>
2018-01-24 13:41 ` Geert Uytterhoeven
[not found] ` <CAMuHMdU-06YxWm3MPSBY5weCRCRVRQPUiabGxa-n8ikXi9D-3A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-24 15:03 ` Jan Kundrát
[not found] ` <60b34619-5034-4e71-b0b2-75a62de0cf2c-xoNZbkdr4U2lVyrhU4qvOw@public.gmane.org>
2018-01-24 17:56 ` Jan Kundrát
[not found] ` <52b64615-7c67-47ee-8f00-059decfc2c93-xoNZbkdr4U2lVyrhU4qvOw@public.gmane.org>
2018-01-24 18:17 ` Geert Uytterhoeven
[not found] ` <CAMuHMdUaLV522qihJibmTO1NR6NK0DNjMT8soGvLsi=ffGg71A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-26 19:56 ` Jan Kundrát
2018-01-26 22:56 ` [PATCH v2] spi: orion: Rework GPIO CS handling Jan Kundrát
[not found] ` <92369661c99f83e656004288fcc06a510b4b8c58.1517007569.git.jan.kundrat-xoNZbkdr4U2lVyrhU4qvOw@public.gmane.org>
2018-02-14 16:26 ` Mark Brown
2018-01-24 21:29 ` [PATCH] spi: orion: Allow specifying which HW CS to use with a GPIO CS Chris Packham
[not found] ` <96ca6f6776cf4146bcfb56a884236165-5g7mGxlPNYb6GjIOKuZY+ItlCAj8ZROq@public.gmane.org>
2018-01-25 8:51 ` Geert Uytterhoeven
[not found] ` <CAMuHMdUOFJS=s-8Dv-BBLayXxKqZ0kPAUednA-3NL0+AZYuq-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-25 11:57 ` Mark Brown
2018-01-25 21:18 ` Chris Packham
[not found] ` <5dec18c8e18845d39999ca60547fefff-5g7mGxlPNYb6GjIOKuZY+ItlCAj8ZROq@public.gmane.org>
2018-01-25 21:27 ` Geert Uytterhoeven [this message]
[not found] ` <CAMuHMdVESS=_JhsO2pziFshWF+d=g78H8XSny34HTJn=1Lei7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-26 11:51 ` Mark Brown
2018-01-24 14:19 ` Andy Shevchenko
[not found] ` <CAHp75VdB2e8Qwr7+LT3jT6HB2rSiSJ3TrMdBqVZYqO=KE6QBmg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-24 15:09 ` Mark Brown
2018-01-30 1:13 ` Trent Piepho
[not found] ` <1517274816.25398.136.camel-cgc2CodaaHDQT0dZR+AlfA@public.gmane.org>
2018-01-30 8:03 ` Jan Kundrát
[not found] ` <368d1a46-8fc8-466d-b292-8ab8eaf11f4b-xoNZbkdr4U2lVyrhU4qvOw@public.gmane.org>
2018-01-30 15:54 ` Mark Brown
[not found] ` <20180130155409.GD10525-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2018-01-30 16:09 ` Jan Kundrát
[not found] ` <3988555e-0439-4cff-a91c-bb947fae6b1e-xoNZbkdr4U2lVyrhU4qvOw@public.gmane.org>
2018-01-30 20:54 ` Trent Piepho
2018-01-30 19:46 ` Trent Piepho
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='CAMuHMdVESS=_JhsO2pziFshWF+d=g78H8XSny34HTJn=1Lei7g@mail.gmail.com' \
--to=geert-td1emuhucqxl1znqvxdv9g@public.gmane.org \
--cc=Chris.Packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org \
--cc=ben.whitten-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=jan.kundrat-xoNZbkdr4U2lVyrhU4qvOw@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).