All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Linus Walleij <linus.walleij@linaro.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Simon Horman <horms@verge.net.au>,
	Chris Paterson <Chris.Paterson2@renesas.com>,
	Biju Das <biju.das@bp.renesas.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>
Subject: Re: [PATCH 4/5] pinctrl: sh-pfc: r8a77470: Add SDHI2 pin groups
Date: Thu, 20 Sep 2018 12:04:02 +0200	[thread overview]
Message-ID: <CAMuHMdW2XGA_jUCOqZ5x5m7Vx_r0NeKJW=_zunVSvXX9sApXEQ@mail.gmail.com> (raw)
In-Reply-To: <TY1PR01MB1770EE6046C6FD96C17DB829C01C0@TY1PR01MB1770.jpnprd01.prod.outlook.com>

Hi Fabrizio,

CC wolfram

On Wed, Sep 19, 2018 at 12:19 PM Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> Although this patch is pretty much standard, I would like to start a discussion as while testing SDHI2 (which goes on the uSD connector on the bottom side of the iwg23s) I have come across an issue. The POC Control Register (IOCTRL6) of the RZ/G1C is structured in a completely different way from the other members of the RZ/G1 family, only one bit is used to control the interface, as opposed to the usual one bit per pin layout.
>
> There are 3 possible ways to fix this:
> 1) keep the clk pin of the interface in a pin group on its own in the PFC driver (which means I would need to drop this patch or rework the pin groups with an additional patch), specify SH_PFC_PIN_CFG_IO_VOLTAGE for the clock line alone, keep the clk pin in a device tree node on its own in the board specific device tree and specify power-source only within the device tree node containing the clk line. The SD card device tree node in the board specific device tree would look like the following:
> ...
> pinctrl-0 = <&sdhi2_pins>, <&sdhi2_pins_clk>;
> pinctrl-1 = <&sdhi2_pins>, <&sdhi2_pins_clk_uhs>;
> pinctrl-names = "default", "state_uhs";
> ....

That matches the datasheet, which says the bit is for the CLK line,
but that can't
be true, as the voltage selection should affect other lines, too.

> 2) Specify SH_PFC_PIN_CFG_IO_VOLTAGE for every line that belongs to the interface, keep the SD card pin groups as specified by this patch, map all of the pins to the same bit in the POC register (as per pin_to_pocctrl is concerned), and the board specific device tree definitions would look like every other RZ/G1 or R-Car Gen2 boards that support SDR*
> The only downside would be that the kernel would read-modify-write the POC Control Register with the same value for every line in the interface.

This looks the most sensible solution to me: just map in your
.pin_to_pocctrl() method
all pins of the interface to the single bit.

> 3) specify SH_PFC_PIN_CFG_IO_VOLTAGE for the clock line alone, come up with another macro for the other lines, keep the pin groups as specified by this patch, modify the logic of sh_pfc_pinconf_set and sh_pfc_pinconf_validate, and the board specific device tree would look like any other RZ/G1 or R-Car Gen2 board that supports SDR*

This looks overly complex.
So .pin_to_pocctrl() would need to return "ignore" for the other pins,
which can work easily for the "set" case, but not for the "get" case.

> I am not particularly enthusiastic about option 3), but option 1) and option 2) seem equally sound to me.
>
> What do you think about this?

I'd go for option 2.

Wolfram: what do you think?

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.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

  reply	other threads:[~2018-09-20 15:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18 13:47 [PATCH 0/5] Add I2C4/DU0/QSPI0/SDHI2/USB to r8a77470 Fabrizio Castro
2018-09-18 13:47 ` [PATCH 1/5] pinctrl: sh-pfc: r8a77470: Add I2C4 pin groups Fabrizio Castro
2018-09-19  8:57   ` Geert Uytterhoeven
2018-09-19  9:49     ` Fabrizio Castro
2018-09-20 10:07       ` Geert Uytterhoeven
2018-09-18 13:47 ` [PATCH 2/5] pinctrl: sh-pfc: r8a77470: Add DU0 " Fabrizio Castro
2018-09-19  9:07   ` Geert Uytterhoeven
2018-09-19  9:53     ` Fabrizio Castro
2018-09-18 13:47 ` [PATCH 3/5] pinctrl: sh-pfc: r8a77470: Add QSPI0 " Fabrizio Castro
2018-09-19  9:16   ` Geert Uytterhoeven
2018-09-19  9:55     ` Fabrizio Castro
2018-09-18 13:47 ` [PATCH 4/5] pinctrl: sh-pfc: r8a77470: Add SDHI2 " Fabrizio Castro
2018-09-19  9:19   ` Geert Uytterhoeven
2018-09-19 10:19     ` Fabrizio Castro
2018-09-20 10:04       ` Geert Uytterhoeven [this message]
2018-09-21 11:54         ` Fabrizio Castro
2018-09-21 15:47         ` Wolfram Sang
2018-09-21 15:57           ` Fabrizio Castro
2018-09-18 13:47 ` [PATCH 5/5] pinctrl: sh-pfc: r8a77470: Add USB " Fabrizio Castro
2018-09-19  9:21   ` Geert Uytterhoeven

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='CAMuHMdW2XGA_jUCOqZ5x5m7Vx_r0NeKJW=_zunVSvXX9sApXEQ@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=Chris.Paterson2@renesas.com \
    --cc=biju.das@bp.renesas.com \
    --cc=fabrizio.castro@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=horms@verge.net.au \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.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: link
Be 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.