devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] mmc: tmio: refactor TMIO core a bit and add UniPhier SD/eMMC controller support
@ 2018-08-23  4:44 Masahiro Yamada
  2018-08-23  4:44 ` [PATCH v3 3/6] dt-bindings: mmc: add DT binding for UniPhier SD/eMMC controller Masahiro Yamada
  2018-08-23 10:43 ` [PATCH v3 0/6] mmc: tmio: refactor TMIO core a bit and add UniPhier SD/eMMC controller support Ulf Hansson
  0 siblings, 2 replies; 4+ messages in thread
From: Masahiro Yamada @ 2018-08-23  4:44 UTC (permalink / raw)
  To: Wolfram Sang, linux-mmc
  Cc: Mark Rutland, devicetree, Ulf Hansson, Masahiro Yamada,
	linux-kernel, linux-renesas-soc, Jassi Brar, Rob Herring,
	Masami Hiramatsu, linux-arm-kernel


Add UniPhier SD/eMMC controller support.

As a preparation, I changed tmio_mmc_set_clock() to a platform hook.
The clock rate setting is platform-specific, and UniPhier variants
will add another way.  I thought it would be better to split this
to a hook to avoid a mess.

V3 is rebase on top of Linus' tree.

I dropped 6/7 because Renesas added more quirks
in the current MW.


Masahiro Yamada (6):
  mmc: tmio: replace tmio_mmc_clk_stop() calls with tmio_mmc_set_clock()
  mmc: tmio: move tmio_mmc_set_clock() to platform hook
  dt-bindings: mmc: add DT binding for UniPhier SD/eMMC controller
  mmc: uniphier-sd: add UniPhier SD/eMMC controller driver
  mmc: renesas_sdhi: merge clk_{start,stop} functions to set_clock
  mmc: tmio: refactor CLK_CTL bit calculation

 .../devicetree/bindings/mmc/uniphier-sd.txt        |  55 ++
 MAINTAINERS                                        |   1 +
 drivers/mmc/host/Kconfig                           |  10 +
 drivers/mmc/host/Makefile                          |   1 +
 drivers/mmc/host/renesas_sdhi_core.c               |  48 +-
 drivers/mmc/host/tmio_mmc.c                        |  56 ++
 drivers/mmc/host/tmio_mmc.h                        |   4 +-
 drivers/mmc/host/tmio_mmc_core.c                   |  92 +--
 drivers/mmc/host/uniphier-sd.c                     | 693 +++++++++++++++++++++
 9 files changed, 871 insertions(+), 89 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mmc/uniphier-sd.txt
 create mode 100644 drivers/mmc/host/uniphier-sd.c

-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 3/6] dt-bindings: mmc: add DT binding for UniPhier SD/eMMC controller
  2018-08-23  4:44 [PATCH v3 0/6] mmc: tmio: refactor TMIO core a bit and add UniPhier SD/eMMC controller support Masahiro Yamada
@ 2018-08-23  4:44 ` Masahiro Yamada
  2018-08-23 10:43 ` [PATCH v3 0/6] mmc: tmio: refactor TMIO core a bit and add UniPhier SD/eMMC controller support Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2018-08-23  4:44 UTC (permalink / raw)
  To: Wolfram Sang, linux-mmc
  Cc: Mark Rutland, devicetree, Ulf Hansson, Masahiro Yamada,
	linux-kernel, linux-renesas-soc, Jassi Brar, Rob Herring,
	Masami Hiramatsu, linux-arm-kernel

This SD/eMMC controller is used for UniPhier SoC family.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Changes in v3: None
Changes in v2:
  - Rename compatible "socionext,uniphier-sd-v3.1b"
    to "socionext,uniphier-sd-v3.1.1"

 .../devicetree/bindings/mmc/uniphier-sd.txt        | 55 ++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mmc/uniphier-sd.txt

diff --git a/Documentation/devicetree/bindings/mmc/uniphier-sd.txt b/Documentation/devicetree/bindings/mmc/uniphier-sd.txt
new file mode 100644
index 0000000..e1d6587
--- /dev/null
+++ b/Documentation/devicetree/bindings/mmc/uniphier-sd.txt
@@ -0,0 +1,55 @@
+UniPhier SD/eMMC controller
+
+Required properties:
+- compatible: should be one of the following:
+    "socionext,uniphier-sd-v2.91"  - IP version 2.91
+    "socionext,uniphier-sd-v3.1"   - IP version 3.1
+    "socionext,uniphier-sd-v3.1.1" - IP version 3.1.1
+- reg: offset and length of the register set for the device.
+- interrupts: a single interrupt specifier.
+- clocks: a single clock specifier of the controller clock.
+- reset-names: should contain the following:
+    "host"   - mandatory for all versions
+    "bridge" - should exist only for "socionext,uniphier-sd-v2.91"
+    "hw"     - should exist if eMMC hw reset line is available
+- resets: a list of reset specifiers, corresponding to the reset-names
+
+Optional properties:
+- pinctrl-names: if present, should contain the following:
+    "default" - should exist for all instances
+    "uhs"     - should exist for SD instance with UHS support
+- pinctrl-0: pin control state for the default mode
+- pinctrl-1: pin control state for the UHS mode
+- dma-names: should be "rx-tx" if present.
+  This property can exist only for "socionext,uniphier-sd-v2.91".
+- dmas: a single DMA channel specifier
+  This property can exist only for "socionext,uniphier-sd-v2.91".
+- bus-width: see mmc.txt
+- cap-sd-highspeed: see mmc.txt
+- cap-mmc-highspeed: see mmc.txt
+- sd-uhs-sdr12: see mmc.txt
+- sd-uhs-sdr25: see mmc.txt
+- sd-uhs-sdr50: see mmc.txt
+- cap-mmc-hw-reset: should exist if reset-names contains "hw". see mmc.txt
+- non-removable: see mmc.txt
+
+Example:
+
+	sd: sdhc@5a400000 {
+		compatible = "socionext,uniphier-sd-v2.91";
+		reg = <0x5a400000 0x200>;
+		interrupts = <0 76 4>;
+		pinctrl-names = "default", "uhs";
+		pinctrl-0 = <&pinctrl_sd>;
+		pinctrl-1 = <&pinctrl_sd_uhs>;
+		clocks = <&mio_clk 0>;
+		reset-names = "host", "bridge";
+		resets = <&mio_rst 0>, <&mio_rst 3>;
+		dma-names = "rx-tx";
+		dmas = <&dmac 4>;
+		bus-width = <4>;
+		cap-sd-highspeed;
+		sd-uhs-sdr12;
+		sd-uhs-sdr25;
+		sd-uhs-sdr50;
+	};
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 0/6] mmc: tmio: refactor TMIO core a bit and add UniPhier SD/eMMC controller support
  2018-08-23  4:44 [PATCH v3 0/6] mmc: tmio: refactor TMIO core a bit and add UniPhier SD/eMMC controller support Masahiro Yamada
  2018-08-23  4:44 ` [PATCH v3 3/6] dt-bindings: mmc: add DT binding for UniPhier SD/eMMC controller Masahiro Yamada
@ 2018-08-23 10:43 ` Ulf Hansson
  2018-08-29  8:27   ` Wolfram Sang
  1 sibling, 1 reply; 4+ messages in thread
From: Ulf Hansson @ 2018-08-23 10:43 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Wolfram Sang, linux-mmc@vger.kernel.org, Linux-Renesas,
	Masami Hiramatsu, Jassi Brar, DTML, Linux Kernel Mailing List,
	Rob Herring, Mark Rutland, Linux ARM

On 23 August 2018 at 06:44, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> Add UniPhier SD/eMMC controller support.
>
> As a preparation, I changed tmio_mmc_set_clock() to a platform hook.
> The clock rate setting is platform-specific, and UniPhier variants
> will add another way.  I thought it would be better to split this
> to a hook to avoid a mess.
>
> V3 is rebase on top of Linus' tree.

I have queued patch 1 -> 4, waiting for further reviews for patch 5 and 6.

One minor comment of patch 4, see separate email.

Kind regards
Uffe

>
> I dropped 6/7 because Renesas added more quirks
> in the current MW.
>
>
> Masahiro Yamada (6):
>   mmc: tmio: replace tmio_mmc_clk_stop() calls with tmio_mmc_set_clock()
>   mmc: tmio: move tmio_mmc_set_clock() to platform hook
>   dt-bindings: mmc: add DT binding for UniPhier SD/eMMC controller
>   mmc: uniphier-sd: add UniPhier SD/eMMC controller driver
>   mmc: renesas_sdhi: merge clk_{start,stop} functions to set_clock
>   mmc: tmio: refactor CLK_CTL bit calculation
>
>  .../devicetree/bindings/mmc/uniphier-sd.txt        |  55 ++
>  MAINTAINERS                                        |   1 +
>  drivers/mmc/host/Kconfig                           |  10 +
>  drivers/mmc/host/Makefile                          |   1 +
>  drivers/mmc/host/renesas_sdhi_core.c               |  48 +-
>  drivers/mmc/host/tmio_mmc.c                        |  56 ++
>  drivers/mmc/host/tmio_mmc.h                        |   4 +-
>  drivers/mmc/host/tmio_mmc_core.c                   |  92 +--
>  drivers/mmc/host/uniphier-sd.c                     | 693 +++++++++++++++++++++
>  9 files changed, 871 insertions(+), 89 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/mmc/uniphier-sd.txt
>  create mode 100644 drivers/mmc/host/uniphier-sd.c
>
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 0/6] mmc: tmio: refactor TMIO core a bit and add UniPhier SD/eMMC controller support
  2018-08-23 10:43 ` [PATCH v3 0/6] mmc: tmio: refactor TMIO core a bit and add UniPhier SD/eMMC controller support Ulf Hansson
@ 2018-08-29  8:27   ` Wolfram Sang
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2018-08-29  8:27 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Masahiro Yamada, Wolfram Sang, linux-mmc@vger.kernel.org,
	Linux-Renesas, Masami Hiramatsu, Jassi Brar, DTML,
	Linux Kernel Mailing List, Rob Herring, Mark Rutland, Linux ARM

[-- Attachment #1: Type: text/plain, Size: 983 bytes --]

On Thu, Aug 23, 2018 at 12:43:31PM +0200, Ulf Hansson wrote:
> On 23 August 2018 at 06:44, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
> >
> > Add UniPhier SD/eMMC controller support.
> >
> > As a preparation, I changed tmio_mmc_set_clock() to a platform hook.
> > The clock rate setting is platform-specific, and UniPhier variants
> > will add another way.  I thought it would be better to split this
> > to a hook to avoid a mess.
> >
> > V3 is rebase on top of Linus' tree.
> 
> I have queued patch 1 -> 4, waiting for further reviews for patch 5 and 6.

I have re-tested patches 1-4 as applied to mmc/next and it all works
fine. For those

Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Now, going to check patches 5+6...

> > I dropped 6/7 because Renesas added more quirks
> > in the current MW.

Totally fine. We need to cleanup HS400 support more, then we can try the
simplification you did for tmio_mmc.c, too. Thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-29  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-23  4:44 [PATCH v3 0/6] mmc: tmio: refactor TMIO core a bit and add UniPhier SD/eMMC controller support Masahiro Yamada
2018-08-23  4:44 ` [PATCH v3 3/6] dt-bindings: mmc: add DT binding for UniPhier SD/eMMC controller Masahiro Yamada
2018-08-23 10:43 ` [PATCH v3 0/6] mmc: tmio: refactor TMIO core a bit and add UniPhier SD/eMMC controller support Ulf Hansson
2018-08-29  8:27   ` Wolfram Sang

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).