Add SDHI support
Subsystems (5)
cover Add SDHI support
This patch series add SDHI support for EK874 platform.
This patch series is based on linux-4.19.y-cip and all the patches in this series are cherry-picked from linux rc tree.
This patch series is depend on the below patch series
https://patchwork.kernel.org/project/cip-dev/list/?series=95321
Biju Das (2):
mmc: renesas_sdhi_internal_dmac: Whitelist r8a774c0
arm64: dts: renesas: r8a774c0-cat874: Add uSD support
Fabrizio Castro (5):
mmc: renesas_sdhi: Add r8a774a1 support
mmc: renesas_sdhi_internal_dmac: Whitelist r8a774a1
dt-bindings: mmc: renesas_sdhi: Add r8a77470 support
dt-bindings: mmc: renesas_sdhi: Add r8a774c0 support
arm64: dts: renesas: r8a774c0: Add SDHI nodes
Takeshi Kihara (4):
pinctrl: sh-pfc: r8a77990: Add Audio clock pins, groups and functions
pinctrl: sh-pfc: r8a77990: Add Audio SSI pins, groups and functions
pinctrl: sh-pfc: r8a77990: Add SDHI pins, groups and functions
pinctrl: sh-pfc: r8a77990: Add voltage switch operations for SDHI
Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 9 +- arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts | 50 ++ arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 36 ++ drivers/mmc/host/renesas_sdhi_internal_dmac.c | 2 + drivers/pinctrl/sh-pfc/pfc-r8a77990.c | 692 ++++++++++++++++++++- 5 files changed, 783 insertions(+), 6 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/11 pinctrl: sh-pfc: r8a77990: Add Audio clock pins, groups and functions
From: Takeshi Kihara <[email protected]>
This patch adds AUDIO_CLK{A,B,C}, AUDIO_CLKOUT, AUDIO_CLKOUT{1,2,3} pins, groups and functions to the R8A77990 SoC.
--- drivers/pinctrl/sh-pfc/pfc-r8a77990.c | 207 +++++++++++++++++++++++++++++++++- 1 file changed, 205 insertions(+), 2 deletions(-)
drivers/pinctrl/sh-pfc/pfc-r8a77990.c +205 -2
@@ -1299,6 +1299,169 @@ static const struct sh_pfc_pin pinmux_pins[] = { SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 3, PRESETOUT_N, CFG_FLAGS), }; +/* - AUDIO CLOCK ------------------------------------------------------------ */ +static const unsigned int audio_clk_a_pins[] = { +/* CLK A */ +RCAR_GP_PIN (6 ,8 ), +}; + +static const unsigned int audio_clk_a_mux[] = { +AUDIO_CLKA_MARK , +}; + +static const unsigned int audio_clk_b_a_pins[] = { +/* CLK B_A */ +RCAR_GP_PIN (5 ,7 ), +}; + +static const unsigned int audio_clk_b_a_mux[] = { +AUDIO_CLKB_A_MARK , +}; + +static const unsigned int audio_clk_b_b_pins[] = { +/* CLK B_B */ +RCAR_GP_PIN (6 ,7 ), +}; + +static const unsigned int audio_clk_b_b_mux[] = { +AUDIO_CLKB_B_MARK , +}; + +static const unsigned int audio_clk_b_c_pins[] = { +/* CLK B_C */ +RCAR_GP_PIN (6 ,13 ), +}; + +static const unsigned int audio_clk_b_c_mux[] = { +AUDIO_CLKB_C_MARK , +}; + +static const unsigned int audio_clk_c_a_pins[] = { +/* CLK C_A */ +RCAR_GP_PIN (5 ,16 ), +}; + +static const unsigned int audio_clk_c_a_mux[] = { +AUDIO_CLKC_A_MARK , +}; + +static const unsigned int audio_clk_c_b_pins[] = { +/* CLK C_B */ +RCAR_GP_PIN (6 ,3 ), +}; + +static const unsigned int audio_clk_c_b_mux[] = { +AUDIO_CLKC_B_MARK , +}; + +static const unsigned int audio_clk_c_c_pins[] = { +/* CLK C_C */ +RCAR_GP_PIN (6 ,14 ), +}; + +static const unsigned int audio_clk_c_c_mux[] = { +AUDIO_CLKC_C_MARK , +}; + +static const unsigned int audio_clkout_a_pins[] = { +/* CLKOUT_A */ +RCAR_GP_PIN (5 ,3 ), +}; + +static const unsigned int audio_clkout_a_mux[] = { +AUDIO_CLKOUT_A_MARK , +}; + +static const unsigned int audio_clkout_b_pins[] = { +/* CLKOUT_B */ +RCAR_GP_PIN (5 ,13 ), +}; + +static const unsigned int audio_clkout_b_mux[] = { +AUDIO_CLKOUT_B_MARK , +}; + +static const unsigned int audio_clkout1_a_pins[] = { +/* CLKOUT1_A */ +RCAR_GP_PIN (5 ,4 ), +}; + +static const unsigned int audio_clkout1_a_mux[] = { +AUDIO_CLKOUT1_A_MARK , +}; + +static const unsigned int audio_clkout1_b_pins[] = { +/* CLKOUT1_B */ +RCAR_GP_PIN (5 ,5 ), +}; + +static const unsigned int audio_clkout1_b_mux[] = { +AUDIO_CLKOUT1_B_MARK , +}; + +static const unsigned int audio_clkout1_c_pins[] = { +/* CLKOUT1_C */ +RCAR_GP_PIN (6 ,7 ), +}; + +static const unsigned int audio_clkout1_c_mux[] = { +AUDIO_CLKOUT1_C_MARK , +}; + +static const unsigned int audio_clkout2_a_pins[] = { +/* CLKOUT2_A */ +RCAR_GP_PIN (5 ,8 ), +}; + +static const unsigned int audio_clkout2_a_mux[] = { +AUDIO_CLKOUT2_A_MARK , +}; + +static const unsigned int audio_clkout2_b_pins[] = { +/* CLKOUT2_B */ +RCAR_GP_PIN (6 ,4 ), +}; + +static const unsigned int audio_clkout2_b_mux[] = { +AUDIO_CLKOUT2_B_MARK , +}; + +static const unsigned int audio_clkout2_c_pins[] = { +/* CLKOUT2_C */ +RCAR_GP_PIN (6 ,15 ), +}; + +static const unsigned int audio_clkout2_c_mux[] = { +AUDIO_CLKOUT2_C_MARK , +}; + +static const unsigned int audio_clkout3_a_pins[] = { +/* CLKOUT3_A */ +RCAR_GP_PIN (5 ,9 ), +}; + +static const unsigned int audio_clkout3_a_mux[] = { +AUDIO_CLKOUT3_A_MARK , +}; + +static const unsigned int audio_clkout3_b_pins[] = { +/* CLKOUT3_B */ +RCAR_GP_PIN (5 ,6 ), +}; + +static const unsigned int audio_clkout3_b_mux[] = { +AUDIO_CLKOUT3_B_MARK , +}; + +static const unsigned int audio_clkout3_c_pins[] = { +/* CLKOUT3_C */ +RCAR_GP_PIN (6 ,16 ), +}; + +static const unsigned int audio_clkout3_c_mux[] = { +AUDIO_CLKOUT3_C_MARK , +}; +/* - EtherAVB --------------------------------------------------------------- */ static const unsigned int avb_link_pins[] = {/* AVB_LINK */
@@ -2434,10 +2597,28 @@ static const unsigned int usb30_id_mux[] = { };static const struct { -struct sh_pfc_pin_group common[123 ]; +struct sh_pfc_pin_group common[141 ];struct sh_pfc_pin_group automotive[0 ]; } pinmux_groups = { .common = { +SH_PFC_PIN_GROUP (audio_clk_a), +SH_PFC_PIN_GROUP (audio_clk_b_a), +SH_PFC_PIN_GROUP (audio_clk_b_b), +SH_PFC_PIN_GROUP (audio_clk_b_c), +SH_PFC_PIN_GROUP (audio_clk_c_a), +SH_PFC_PIN_GROUP (audio_clk_c_b), +SH_PFC_PIN_GROUP (audio_clk_c_c), +SH_PFC_PIN_GROUP (audio_clkout_a), +SH_PFC_PIN_GROUP (audio_clkout_b), +SH_PFC_PIN_GROUP (audio_clkout1_a), +SH_PFC_PIN_GROUP (audio_clkout1_b), +SH_PFC_PIN_GROUP (audio_clkout1_c), +SH_PFC_PIN_GROUP (audio_clkout2_a), +SH_PFC_PIN_GROUP (audio_clkout2_b), +SH_PFC_PIN_GROUP (audio_clkout2_c), +SH_PFC_PIN_GROUP (audio_clkout3_a), +SH_PFC_PIN_GROUP (audio_clkout3_b), +SH_PFC_PIN_GROUP (audio_clkout3_c),SH_PFC_PIN_GROUP (avb_link),SH_PFC_PIN_GROUP (avb_magic),SH_PFC_PIN_GROUP (avb_phy_int),
@@ -2564,6 +2745,27 @@ static const struct { } }; +static const char *const audio_clk_groups[] = { +"audio_clk_a" , +"audio_clk_b_a" , +"audio_clk_b_b" , +"audio_clk_b_c" , +"audio_clk_c_a" , +"audio_clk_c_b" , +"audio_clk_c_c" , +"audio_clkout_a" , +"audio_clkout_b" , +"audio_clkout1_a" , +"audio_clkout1_b" , +"audio_clkout1_c" , +"audio_clkout2_a" , +"audio_clkout2_b" , +"audio_clkout2_c" , +"audio_clkout3_a" , +"audio_clkout3_b" , +"audio_clkout3_c" , +}; +static const char *const avb_groups[] = {"avb_link" ,"avb_magic" ,
@@ -2775,10 +2977,11 @@ static const char * const usb30_groups[] = { };static const struct { -struct sh_pfc_function common[29 ]; +struct sh_pfc_function common[30 ];struct sh_pfc_function automotive[0 ]; } pinmux_functions = { .common = { +SH_PFC_FUNCTION (audio_clk),SH_PFC_FUNCTION (avb),SH_PFC_FUNCTION (du),SH_PFC_FUNCTION (i2c1),
Signature · 1 line
2.7.4
PATCH 1/11 pinctrl: sh-pfc: r8a77990: Add Audio clock pins, groups and functions
Quoted 5 lines · Biju Das
From: Takeshi Kihara <[email protected]>
This patch adds AUDIO_CLK{A,B,C},
AUDIO_CLKOUT, AUDIO_CLKOUT{1,2,3} pins, groups and functions to the R8A77990 SoC.
Quoted 7 lines
Signed-off-by Takeshi Kihara <[email protected]>[simon: rebase]Signed-off-by Simon Horman <[email protected]>Signed-off-by Geert Uytterhoeven <[email protected]>(cherry picked from commit 4c833b2fa5b6b121cc657e5f24b8c3585a8c37ea)Signed-off-by Biju Das <[email protected]>
I could not apply this on c312fd1d432e36f9012127fe3c1d2b7023afae48-based tree.
I have struct sh_pfc_pin_group common[117];
while the patch expects struct sh_pfc_pin_group common[123];
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Pavel Machek
AppliedPATCH 1/11 pinctrl: sh-pfc: r8a77990: Add Audio clock pins, groups and functions
In reply to Biju DasQuoted 4 lines · Biju Das
From: Takeshi Kihara <[email protected]>
This patch adds AUDIO_CLK{A,B,C},
AUDIO_CLKOUT, AUDIO_CLKOUT{1,2,3} pins, groups and functions to the R8A77990 SoC.
Applied the series. Thanks!
Signature · 9 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 181 bytes Desc: Digital signature URL: <http://lists.cip-project.org/pipermail/cip-dev/attachments/20190411/4d3ef6c2/attachment.sig>
PATCH 2/11 pinctrl: sh-pfc: r8a77990: Add Audio SSI pins, groups and functions
In reply to Biju DasFrom: Takeshi Kihara <[email protected]>
This patch adds Audio SSI{0,1,2,3,4,5,6,7,8,9} pins, groups and functions to the R8A77990 SoC.
--- drivers/pinctrl/sh-pfc/pfc-r8a77990.c | 240 +++++++++++++++++++++++++++++++++- 1 file changed, 238 insertions(+), 2 deletions(-)
drivers/pinctrl/sh-pfc/pfc-r8a77990.c +238 -2
@@ -2549,6 +2549,196 @@ static const unsigned int scif_clk_b_mux[] = { SCIF_CLK_B_MARK, }; +/* - SSI -------------------------------------------------------------------- */ +static const unsigned int ssi0_data_pins[] = { +/* SDATA */ +RCAR_GP_PIN (6 ,2 ), +}; + +static const unsigned int ssi0_data_mux[] = { +SSI_SDATA0_MARK , +}; + +static const unsigned int ssi01239_ctrl_pins[] = { +/* SCK, WS */ +RCAR_GP_PIN (6 ,0 ),RCAR_GP_PIN (6 ,1 ), +}; + +static const unsigned int ssi01239_ctrl_mux[] = { +SSI_SCK01239_MARK ,SSI_WS01239_MARK , +}; + +static const unsigned int ssi1_data_pins[] = { +/* SDATA */ +RCAR_GP_PIN (6 ,3 ), +}; + +static const unsigned int ssi1_data_mux[] = { +SSI_SDATA1_MARK , +}; + +static const unsigned int ssi1_ctrl_pins[] = { +/* SCK, WS */ +RCAR_GP_PIN (3 ,14 ),RCAR_GP_PIN (3 ,15 ), +}; + +static const unsigned int ssi1_ctrl_mux[] = { +SSI_SCK1_MARK ,SSI_WS1_MARK , +}; + +static const unsigned int ssi2_data_pins[] = { +/* SDATA */ +RCAR_GP_PIN (6 ,4 ), +}; + +static const unsigned int ssi2_data_mux[] = { +SSI_SDATA2_MARK , +}; + +static const unsigned int ssi2_ctrl_a_pins[] = { +/* SCK, WS */ +RCAR_GP_PIN (5 ,1 ),RCAR_GP_PIN (5 ,2 ), +}; + +static const unsigned int ssi2_ctrl_a_mux[] = { +SSI_SCK2_A_MARK ,SSI_WS2_A_MARK , +}; + +static const unsigned int ssi2_ctrl_b_pins[] = { +/* SCK, WS */ +RCAR_GP_PIN (3 ,12 ),RCAR_GP_PIN (3 ,13 ), +}; + +static const unsigned int ssi2_ctrl_b_mux[] = { +SSI_SCK2_B_MARK ,SSI_WS2_B_MARK , +}; + +static const unsigned int ssi3_data_pins[] = { +/* SDATA */ +RCAR_GP_PIN (6 ,7 ), +}; + +static const unsigned int ssi3_data_mux[] = { +SSI_SDATA3_MARK , +}; + +static const unsigned int ssi349_ctrl_pins[] = { +/* SCK, WS */ +RCAR_GP_PIN (6 ,5 ),RCAR_GP_PIN (6 ,6 ), +}; + +static const unsigned int ssi349_ctrl_mux[] = { +SSI_SCK349_MARK ,SSI_WS349_MARK , +}; + +static const unsigned int ssi4_data_pins[] = { +/* SDATA */ +RCAR_GP_PIN (6 ,10 ), +}; + +static const unsigned int ssi4_data_mux[] = { +SSI_SDATA4_MARK , +}; + +static const unsigned int ssi4_ctrl_pins[] = { +/* SCK, WS */ +RCAR_GP_PIN (5 ,14 ),RCAR_GP_PIN (5 ,15 ), +}; + +static const unsigned int ssi4_ctrl_mux[] = { +SSI_SCK4_MARK ,SSI_WS4_MARK , +}; + +static const unsigned int ssi5_data_pins[] = { +/* SDATA */ +RCAR_GP_PIN (6 ,13 ), +}; + +static const unsigned int ssi5_data_mux[] = { +SSI_SDATA5_MARK , +}; + +static const unsigned int ssi5_ctrl_pins[] = { +/* SCK, WS */ +RCAR_GP_PIN (6 ,11 ),RCAR_GP_PIN (6 ,12 ), +}; + +static const unsigned int ssi5_ctrl_mux[] = { +SSI_SCK5_MARK ,SSI_WS5_MARK , +}; + +static const unsigned int ssi6_data_pins[] = { +/* SDATA */ +RCAR_GP_PIN (6 ,16 ), +}; + +static const unsigned int ssi6_data_mux[] = { +SSI_SDATA6_MARK , +}; + +static const unsigned int ssi6_ctrl_pins[] = { +/* SCK, WS */ +RCAR_GP_PIN (6 ,14 ),RCAR_GP_PIN (6 ,15 ), +}; + +static const unsigned int ssi6_ctrl_mux[] = { +SSI_SCK6_MARK ,SSI_WS6_MARK , +}; + +static const unsigned int ssi7_data_pins[] = { +/* SDATA */ +RCAR_GP_PIN (5 ,12 ), +}; + +static const unsigned int ssi7_data_mux[] = { +SSI_SDATA7_MARK , +}; + +static const unsigned int ssi78_ctrl_pins[] = { +/* SCK, WS */ +RCAR_GP_PIN (5 ,10 ),RCAR_GP_PIN (5 ,11 ), +}; + +static const unsigned int ssi78_ctrl_mux[] = { +SSI_SCK78_MARK ,SSI_WS78_MARK , +}; + +static const unsigned int ssi8_data_pins[] = { +/* SDATA */ +RCAR_GP_PIN (5 ,13 ), +}; + +static const unsigned int ssi8_data_mux[] = { +SSI_SDATA8_MARK , +}; + +static const unsigned int ssi9_data_pins[] = { +/* SDATA */ +RCAR_GP_PIN (5 ,16 ), +}; + +static const unsigned int ssi9_data_mux[] = { +SSI_SDATA9_MARK , +}; + +static const unsigned int ssi9_ctrl_a_pins[] = { +/* SCK, WS */ +RCAR_GP_PIN (6 ,4 ),RCAR_GP_PIN (6 ,10 ), +}; + +static const unsigned int ssi9_ctrl_a_mux[] = { +SSI_SCK9_A_MARK ,SSI_WS9_A_MARK , +}; + +static const unsigned int ssi9_ctrl_b_pins[] = { +/* SCK, WS */ +RCAR_GP_PIN (5 ,5 ),RCAR_GP_PIN (5 ,6 ), +}; + +static const unsigned int ssi9_ctrl_b_mux[] = { +SSI_SCK9_B_MARK ,SSI_WS9_B_MARK , +}; +/* - USB0 ------------------------------------------------------------------- */ static const unsigned int usb0_a_pins[] = {/* PWEN, OVC */
@@ -2597,7 +2787,7 @@ static const unsigned int usb30_id_mux[] = { };static const struct { -struct sh_pfc_pin_group common[141 ]; +struct sh_pfc_pin_group common[162 ];struct sh_pfc_pin_group automotive[0 ]; } pinmux_groups = { .common = {
@@ -2737,6 +2927,27 @@ static const struct {SH_PFC_PIN_GROUP (scif5_data_c),SH_PFC_PIN_GROUP (scif_clk_a),SH_PFC_PIN_GROUP (scif_clk_b), +SH_PFC_PIN_GROUP (ssi0_data), +SH_PFC_PIN_GROUP (ssi01239_ctrl), +SH_PFC_PIN_GROUP (ssi1_data), +SH_PFC_PIN_GROUP (ssi1_ctrl), +SH_PFC_PIN_GROUP (ssi2_data), +SH_PFC_PIN_GROUP (ssi2_ctrl_a), +SH_PFC_PIN_GROUP (ssi2_ctrl_b), +SH_PFC_PIN_GROUP (ssi3_data), +SH_PFC_PIN_GROUP (ssi349_ctrl), +SH_PFC_PIN_GROUP (ssi4_data), +SH_PFC_PIN_GROUP (ssi4_ctrl), +SH_PFC_PIN_GROUP (ssi5_data), +SH_PFC_PIN_GROUP (ssi5_ctrl), +SH_PFC_PIN_GROUP (ssi6_data), +SH_PFC_PIN_GROUP (ssi6_ctrl), +SH_PFC_PIN_GROUP (ssi7_data), +SH_PFC_PIN_GROUP (ssi78_ctrl), +SH_PFC_PIN_GROUP (ssi8_data), +SH_PFC_PIN_GROUP (ssi9_data), +SH_PFC_PIN_GROUP (ssi9_ctrl_a), +SH_PFC_PIN_GROUP (ssi9_ctrl_b),SH_PFC_PIN_GROUP (usb0_a),SH_PFC_PIN_GROUP (usb0_b), SH_PFC_PIN_GROUP(usb0_id),
@@ -2965,6 +3176,30 @@ static const char * const scif_clk_groups[] = { "scif_clk_b", }; +static const char *const ssi_groups[] = { +"ssi0_data" , +"ssi01239_ctrl" , +"ssi1_data" , +"ssi1_ctrl" , +"ssi2_data" , +"ssi2_ctrl_a" , +"ssi2_ctrl_b" , +"ssi3_data" , +"ssi349_ctrl" , +"ssi4_data" , +"ssi4_ctrl" , +"ssi5_data" , +"ssi5_ctrl" , +"ssi6_data" , +"ssi6_ctrl" , +"ssi7_data" , +"ssi78_ctrl" , +"ssi8_data" , +"ssi9_data" , +"ssi9_ctrl_a" , +"ssi9_ctrl_b" , +}; +static const char *const usb0_groups[] = {"usb0_a" ,"usb0_b" ,
@@ -2977,7 +3212,7 @@ static const char * const usb30_groups[] = { };static const struct { -struct sh_pfc_function common[30 ]; +struct sh_pfc_function common[31 ];struct sh_pfc_function automotive[0 ]; } pinmux_functions = { .common = {
@@ -3009,6 +3244,7 @@ static const struct {SH_PFC_FUNCTION (scif4),SH_PFC_FUNCTION (scif5),SH_PFC_FUNCTION (scif_clk), +SH_PFC_FUNCTION (ssi),SH_PFC_FUNCTION (usb0), SH_PFC_FUNCTION(usb30), }
Signature · 1 line
2.7.4
PATCH 3/11 pinctrl: sh-pfc: r8a77990: Add SDHI pins, groups and functions
In reply to Biju DasFrom: Takeshi Kihara <[email protected]>
This patch adds SDHI{0,1,3} pins, groups and functions to the R8A77990 SoC.
--- drivers/pinctrl/sh-pfc/pfc-r8a77990.c | 218 +++++++++++++++++++++++++++++++++- 1 file changed, 216 insertions(+), 2 deletions(-)
drivers/pinctrl/sh-pfc/pfc-r8a77990.c +216 -2
@@ -2549,6 +2549,174 @@ static const unsigned int scif_clk_b_mux[] = { SCIF_CLK_B_MARK, }; +/* - SDHI0 ------------------------------------------------------------------ */ +static const unsigned int sdhi0_data1_pins[] = { +/* D0 */ +RCAR_GP_PIN (3 ,2 ), +}; + +static const unsigned int sdhi0_data1_mux[] = { +SD0_DAT0_MARK , +}; + +static const unsigned int sdhi0_data4_pins[] = { +/* D[0:3] */ +RCAR_GP_PIN (3 ,2 ),RCAR_GP_PIN (3 ,3 ), +RCAR_GP_PIN (3 ,4 ),RCAR_GP_PIN (3 ,5 ), +}; + +static const unsigned int sdhi0_data4_mux[] = { +SD0_DAT0_MARK ,SD0_DAT1_MARK , +SD0_DAT2_MARK ,SD0_DAT3_MARK , +}; + +static const unsigned int sdhi0_ctrl_pins[] = { +/* CLK, CMD */ +RCAR_GP_PIN (3 ,0 ),RCAR_GP_PIN (3 ,1 ), +}; + +static const unsigned int sdhi0_ctrl_mux[] = { +SD0_CLK_MARK ,SD0_CMD_MARK , +}; + +static const unsigned int sdhi0_cd_pins[] = { +/* CD */ +RCAR_GP_PIN (3 ,12 ), +}; + +static const unsigned int sdhi0_cd_mux[] = { +SD0_CD_MARK , +}; + +static const unsigned int sdhi0_wp_pins[] = { +/* WP */ +RCAR_GP_PIN (3 ,13 ), +}; + +static const unsigned int sdhi0_wp_mux[] = { +SD0_WP_MARK , +}; + +/* - SDHI1 ------------------------------------------------------------------ */ +static const unsigned int sdhi1_data1_pins[] = { +/* D0 */ +RCAR_GP_PIN (3 ,8 ), +}; + +static const unsigned int sdhi1_data1_mux[] = { +SD1_DAT0_MARK , +}; + +static const unsigned int sdhi1_data4_pins[] = { +/* D[0:3] */ +RCAR_GP_PIN (3 ,8 ),RCAR_GP_PIN (3 ,9 ), +RCAR_GP_PIN (3 ,10 ),RCAR_GP_PIN (3 ,11 ), +}; + +static const unsigned int sdhi1_data4_mux[] = { +SD1_DAT0_MARK ,SD1_DAT1_MARK , +SD1_DAT2_MARK ,SD1_DAT3_MARK , +}; + +static const unsigned int sdhi1_ctrl_pins[] = { +/* CLK, CMD */ +RCAR_GP_PIN (3 ,6 ),RCAR_GP_PIN (3 ,7 ), +}; + +static const unsigned int sdhi1_ctrl_mux[] = { +SD1_CLK_MARK ,SD1_CMD_MARK , +}; + +static const unsigned int sdhi1_cd_pins[] = { +/* CD */ +RCAR_GP_PIN (3 ,14 ), +}; + +static const unsigned int sdhi1_cd_mux[] = { +SD1_CD_MARK , +}; + +static const unsigned int sdhi1_wp_pins[] = { +/* WP */ +RCAR_GP_PIN (3 ,15 ), +}; + +static const unsigned int sdhi1_wp_mux[] = { +SD1_WP_MARK , +}; + +/* - SDHI3 ------------------------------------------------------------------ */ +static const unsigned int sdhi3_data1_pins[] = { +/* D0 */ +RCAR_GP_PIN (4 ,2 ), +}; + +static const unsigned int sdhi3_data1_mux[] = { +SD3_DAT0_MARK , +}; + +static const unsigned int sdhi3_data4_pins[] = { +/* D[0:3] */ +RCAR_GP_PIN (4 ,2 ),RCAR_GP_PIN (4 ,3 ), +RCAR_GP_PIN (4 ,4 ),RCAR_GP_PIN (4 ,5 ), +}; + +static const unsigned int sdhi3_data4_mux[] = { +SD3_DAT0_MARK ,SD3_DAT1_MARK , +SD3_DAT2_MARK ,SD3_DAT3_MARK , +}; + +static const unsigned int sdhi3_data8_pins[] = { +/* D[0:7] */ +RCAR_GP_PIN (4 ,2 ),RCAR_GP_PIN (4 ,3 ), +RCAR_GP_PIN (4 ,4 ),RCAR_GP_PIN (4 ,5 ), +RCAR_GP_PIN (4 ,6 ),RCAR_GP_PIN (4 ,7 ), +RCAR_GP_PIN (4 ,8 ),RCAR_GP_PIN (4 ,9 ), +}; + +static const unsigned int sdhi3_data8_mux[] = { +SD3_DAT0_MARK ,SD3_DAT1_MARK , +SD3_DAT2_MARK ,SD3_DAT3_MARK , +SD3_DAT4_MARK ,SD3_DAT5_MARK , +SD3_DAT6_MARK ,SD3_DAT7_MARK , +}; + +static const unsigned int sdhi3_ctrl_pins[] = { +/* CLK, CMD */ +RCAR_GP_PIN (4 ,0 ),RCAR_GP_PIN (4 ,1 ), +}; + +static const unsigned int sdhi3_ctrl_mux[] = { +SD3_CLK_MARK ,SD3_CMD_MARK , +}; + +static const unsigned int sdhi3_cd_pins[] = { +/* CD */ +RCAR_GP_PIN (3 ,12 ), +}; + +static const unsigned int sdhi3_cd_mux[] = { +SD3_CD_MARK , +}; + +static const unsigned int sdhi3_wp_pins[] = { +/* WP */ +RCAR_GP_PIN (3 ,13 ), +}; + +static const unsigned int sdhi3_wp_mux[] = { +SD3_WP_MARK , +}; + +static const unsigned int sdhi3_ds_pins[] = { +/* DS */ +RCAR_GP_PIN (4 ,10 ), +}; + +static const unsigned int sdhi3_ds_mux[] = { +SD3_DS_MARK , +}; +/* - SSI -------------------------------------------------------------------- */ static const unsigned int ssi0_data_pins[] = {/* SDATA */
@@ -2787,7 +2955,7 @@ static const unsigned int usb30_id_mux[] = { };static const struct { -struct sh_pfc_pin_group common[162 ]; +struct sh_pfc_pin_group common[179 ];struct sh_pfc_pin_group automotive[0 ]; } pinmux_groups = { .common = {
@@ -2927,6 +3095,23 @@ static const struct {SH_PFC_PIN_GROUP (scif5_data_c),SH_PFC_PIN_GROUP (scif_clk_a),SH_PFC_PIN_GROUP (scif_clk_b), +SH_PFC_PIN_GROUP (sdhi0_data1), +SH_PFC_PIN_GROUP (sdhi0_data4), +SH_PFC_PIN_GROUP (sdhi0_ctrl), +SH_PFC_PIN_GROUP (sdhi0_cd), +SH_PFC_PIN_GROUP (sdhi0_wp), +SH_PFC_PIN_GROUP (sdhi1_data1), +SH_PFC_PIN_GROUP (sdhi1_data4), +SH_PFC_PIN_GROUP (sdhi1_ctrl), +SH_PFC_PIN_GROUP (sdhi1_cd), +SH_PFC_PIN_GROUP (sdhi1_wp), +SH_PFC_PIN_GROUP (sdhi3_data1), +SH_PFC_PIN_GROUP (sdhi3_data4), +SH_PFC_PIN_GROUP (sdhi3_data8), +SH_PFC_PIN_GROUP (sdhi3_ctrl), +SH_PFC_PIN_GROUP (sdhi3_cd), +SH_PFC_PIN_GROUP (sdhi3_wp), +SH_PFC_PIN_GROUP (sdhi3_ds),SH_PFC_PIN_GROUP (ssi0_data),SH_PFC_PIN_GROUP (ssi01239_ctrl), SH_PFC_PIN_GROUP(ssi1_data),
@@ -3176,6 +3361,32 @@ static const char * const scif_clk_groups[] = { "scif_clk_b", }; +static const char *const sdhi0_groups[] = { +"sdhi0_data1" , +"sdhi0_data4" , +"sdhi0_ctrl" , +"sdhi0_cd" , +"sdhi0_wp" , +}; + +static const char *const sdhi1_groups[] = { +"sdhi1_data1" , +"sdhi1_data4" , +"sdhi1_ctrl" , +"sdhi1_cd" , +"sdhi1_wp" , +}; + +static const char *const sdhi3_groups[] = { +"sdhi3_data1" , +"sdhi3_data4" , +"sdhi3_data8" , +"sdhi3_ctrl" , +"sdhi3_cd" , +"sdhi3_wp" , +"sdhi3_ds" , +}; +static const char *const ssi_groups[] = {"ssi0_data" ,"ssi01239_ctrl" ,
@@ -3212,7 +3423,7 @@ static const char * const usb30_groups[] = { };static const struct { -struct sh_pfc_function common[31 ]; +struct sh_pfc_function common[34 ];struct sh_pfc_function automotive[0 ]; } pinmux_functions = { .common = {
@@ -3244,6 +3455,9 @@ static const struct {SH_PFC_FUNCTION (scif4),SH_PFC_FUNCTION (scif5),SH_PFC_FUNCTION (scif_clk), +SH_PFC_FUNCTION (sdhi0), +SH_PFC_FUNCTION (sdhi1), +SH_PFC_FUNCTION (sdhi3),SH_PFC_FUNCTION (ssi),SH_PFC_FUNCTION (usb0), SH_PFC_FUNCTION(usb30),
Signature · 1 line
2.7.4
PATCH 4/11 pinctrl: sh-pfc: r8a77990: Add voltage switch operations for SDHI
In reply to Biju DasFrom: Takeshi Kihara <[email protected]>
This patch supports the {get,set}_io_voltage operations of SDHI.
This operates the IOCTRL30 register on the R8A77990 SoC and makes 1.8V/3.3V signal voltage switch possible.
--- drivers/pinctrl/sh-pfc/pfc-r8a77990.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-)
drivers/pinctrl/sh-pfc/pfc-r8a77990.c +33 -2
@@ -23,8 +23,12 @@PORT_GP_CFG_18 (0 , fn, sfx,CFG_FLAGS ), \PORT_GP_CFG_23 (1 , fn, sfx,CFG_FLAGS ), \PORT_GP_CFG_26 (2 , fn, sfx,CFG_FLAGS ), \ -PORT_GP_CFG_16 (3 , fn, sfx,CFG_FLAGS ), \ -PORT_GP_CFG_11 (4 , fn, sfx,CFG_FLAGS ), \ +PORT_GP_CFG_12 (3 , fn, sfx,CFG_FLAGS |SH_PFC_PIN_CFG_IO_VOLTAGE ), \ +PORT_GP_CFG_1 (3 ,12 , fn, sfx,CFG_FLAGS ), \ +PORT_GP_CFG_1 (3 ,13 , fn, sfx,CFG_FLAGS ), \ +PORT_GP_CFG_1 (3 ,14 , fn, sfx,CFG_FLAGS ), \ +PORT_GP_CFG_1 (3 ,15 , fn, sfx,CFG_FLAGS ), \ +PORT_GP_CFG_11 (4 , fn, sfx,CFG_FLAGS |SH_PFC_PIN_CFG_IO_VOLTAGE ), \PORT_GP_CFG_20 (5 , fn, sfx,CFG_FLAGS ), \PORT_GP_CFG_18 (6 , fn, sfx,CFG_FLAGS )/*
@@ -3933,6 +3937,31 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = { { }, }; +enum ioctrl_regs { +IOCTRL30 , +}; + +static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = { + [IOCTRL30 ] = {0xe6060380 , }, + {/* sentinel */ }, +}; + +static int r8a77990_pin_to_pocctrl (struct sh_pfc *pfc,unsigned int pin, +u32 *pocctrl) +{ +int bit = -EINVAL ; + + *pocctrl = pinmux_ioctrl_regs[IOCTRL30 ].reg; + +if (pin >=RCAR_GP_PIN (3 ,0 ) && pin <=RCAR_GP_PIN (3 ,11 )) + bit = pin &0x1f ; + +if (pin >=RCAR_GP_PIN (4 ,0 ) && pin <=RCAR_GP_PIN (4 ,10 )) + bit = (pin &0x1f ) +19 ; + +return bit; +} + static const struct pinmux_bias_reg pinmux_bias_regs[] = { { PINMUX_BIAS_REG("PUEN0", 0xe6060400, "PUD0", 0xe6060440) { [0] = RCAR_GP_PIN(2, 23), /* RD# */
@@ -4183,6 +4212,7 @@ static void r8a77990_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin, }static const struct sh_pfc_soc_operations r8a77990_pinmux_ops = { + .pin_to_pocctrl = r8a77990_pin_to_pocctrl, .get_bias = r8a77990_pinmux_get_bias, .set_bias = r8a77990_pinmux_set_bias, };
@@ -4204,6 +4234,7 @@ const struct sh_pfc_soc_info r8a774c0_pinmux_info = { .cfg_regs = pinmux_config_regs, .bias_regs = pinmux_bias_regs, + .ioctrl_regs = pinmux_ioctrl_regs, .pinmux_data = pinmux_data, .pinmux_data_size = ARRAY_SIZE(pinmux_data),
Signature · 1 line
2.7.4
PATCH 5/11 mmc: renesas_sdhi: Add r8a774a1 support
In reply to Biju DasFrom: Fabrizio Castro <[email protected]>
Document RZ/G2M (R8A774A1) SoC bindings.
--- Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mmc/tmio_mmc.txt +3 -1
@@ -17,6 +17,7 @@ Required properties: "renesas,sdhi-r8a7740" - SDHI IP on R8A7740 SoC "renesas,sdhi-r8a7743" - SDHI IP on R8A7743 SoC "renesas,sdhi-r8a7745" - SDHI IP on R8A7745 SoC + "renesas,sdhi-r8a774a1" - SDHI IP on R8A774A1 SoC "renesas,sdhi-r8a7778" - SDHI IP on R8A7778 SoC "renesas,sdhi-r8a7779" - SDHI IP on R8A7779 SoC "renesas,sdhi-r8a7790" - SDHI IP on R8A7790 SoC
@@ -34,7 +35,8 @@ Required properties: "renesas,rcar-gen1-sdhi" - a generic R-Car Gen1 SDHI controller "renesas,rcar-gen2-sdhi" - a generic R-Car Gen2 or RZ/G1 SDHI controller - "renesas,rcar-gen3-sdhi" - a generic R-Car Gen3 SDHI controller + "renesas,rcar-gen3-sdhi" - a generic R-Car Gen3 or RZ/G2 + SDHI controller When compatible with the generic version, nodes must list
Signature · 1 line
2.7.4
PATCH 6/11 mmc: renesas_sdhi_internal_dmac: Whitelist r8a774a1
In reply to Biju DasFrom: Fabrizio Castro <[email protected]>
We need r8a774a1 to be whitelisted for SDHI to work on the RZ/G2M, but we don't care about the revision of the SoC, so just whitelist the generic part number.
--- drivers/mmc/host/renesas_sdhi_internal_dmac.c | 1 + 1 file changed, 1 insertion(+)
drivers/mmc/host/renesas_sdhi_internal_dmac.c +1 -0
@@ -298,6 +298,7 @@ static const struct soc_device_attribute gen3_soc_whitelist[] = { { .soc_id = "r8a7796", .revision = "ES1.0", .data = (void *)BIT(SDHI_INTERNAL_DMAC_ONE_RX_ONLY) }, /* generic ones */ + { .soc_id = "r8a774a1" }, { .soc_id = "r8a7795" }, { .soc_id = "r8a7796" }, { .soc_id = "r8a77965" },
Signature · 1 line
2.7.4
PATCH 7/11 dt-bindings: mmc: renesas_sdhi: Add r8a77470 support
In reply to Biju DasFrom: Fabrizio Castro <[email protected]>
The RZ/G1C (a.k.a. R8A77470) comes with three SDHI interfaces, SDHI0 and SDHI2 are compatible with R-Car Gen2 SDHIs, and SDHI1 is compatible with R-Car Gen3 SDHIs, as it comes with an internal DMAC, therefore SDHI1 is fully compatible with driver renesas_sdhi_internal_dmac driver. As a result, the compatible strings for the R8A77470 SDHI interfaces are a little bit special. Document SDHI support for the RZ/G1C SoC.
--- Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/mmc/tmio_mmc.txt +4 -2
@@ -18,6 +18,8 @@ Required properties: "renesas,sdhi-r8a7743" - SDHI IP on R8A7743 SoC "renesas,sdhi-r8a7745" - SDHI IP on R8A7745 SoC "renesas,sdhi-r8a774a1" - SDHI IP on R8A774A1 SoC + "renesas,sdhi-r8a77470" - SDHI IP on R8A77470 SoC + "renesas,sdhi-mmc-r8a77470" - SDHI/MMC IP on R8A77470 SoC "renesas,sdhi-r8a7778" - SDHI IP on R8A7778 SoC "renesas,sdhi-r8a7779" - SDHI IP on R8A7779 SoC "renesas,sdhi-r8a7790" - SDHI IP on R8A7790 SoC
@@ -33,8 +35,8 @@ Required properties: "renesas,sdhi-r8a77995" - SDHI IP on R8A77995 SoC "renesas,sdhi-shmobile" - a generic sh-mobile SDHI controller "renesas,rcar-gen1-sdhi" - a generic R-Car Gen1 SDHI controller - "renesas,rcar-gen2-sdhi" - a generic R-Car Gen2 or RZ/G1 - SDHI controller + "renesas,rcar-gen2-sdhi" - a generic R-Car Gen2 and RZ/G1 SDHI + (not SDHI/MMC) controller "renesas,rcar-gen3-sdhi" - a generic R-Car Gen3 or RZ/G2 SDHI controller
Signature · 1 line
2.7.4
PATCH 8/11 dt-bindings: mmc: renesas_sdhi: Add r8a774c0 support
In reply to Biju DasFrom: Fabrizio Castro <[email protected]>
Document RZ/G2E (R8A774C0) SoC bindings.
--- Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/mmc/tmio_mmc.txt +1 -0
@@ -18,6 +18,7 @@ Required properties: "renesas,sdhi-r8a7743" - SDHI IP on R8A7743 SoC "renesas,sdhi-r8a7745" - SDHI IP on R8A7745 SoC "renesas,sdhi-r8a774a1" - SDHI IP on R8A774A1 SoC + "renesas,sdhi-r8a774c0" - SDHI IP on R8A774C0 SoC "renesas,sdhi-r8a77470" - SDHI IP on R8A77470 SoC "renesas,sdhi-mmc-r8a77470" - SDHI/MMC IP on R8A77470 SoC "renesas,sdhi-r8a7778" - SDHI IP on R8A7778 SoC
Signature · 1 line
2.7.4
PATCH 9/11 mmc: renesas_sdhi_internal_dmac: Whitelist r8a774c0
In reply to Biju DasWe need r8a774c0 to be whitelisted for SDHI to work on the RZ/G2E, but we don't care about the revision of the SoC, so just whitelist the generic part number.
--- drivers/mmc/host/renesas_sdhi_internal_dmac.c | 1 + 1 file changed, 1 insertion(+)
drivers/mmc/host/renesas_sdhi_internal_dmac.c +1 -0
@@ -299,6 +299,7 @@ static const struct soc_device_attribute gen3_soc_whitelist[] = { .data = (void *)BIT(SDHI_INTERNAL_DMAC_ONE_RX_ONLY) },/* generic ones */ { .soc_id = "r8a774a1" }, + { .soc_id = "r8a774c0" }, { .soc_id = "r8a7795" }, { .soc_id = "r8a7796" }, { .soc_id = "r8a77965" },
Signature · 1 line
2.7.4
PATCH 10/11 arm64: dts: renesas: r8a774c0: Add SDHI nodes
In reply to Biju DasFrom: Fabrizio Castro <[email protected]>
Add SDHI nodes to the DT of the r8a774c0 SoC.
--- arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+)
arch/arm64/boot/dts/renesas/r8a774c0.dtsi +36 -0
@@ -548,6 +548,42 @@ status = "disabled"; }; + sdhi0: sd at ee100000 { + compatible = "renesas,sdhi-r8a774c0", + "renesas,rcar-gen3-sdhi"; + reg = <0 0xee100000 0 0x2000>; + interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpg CPG_MOD 314>; + max-frequency = <200000000>; + power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>; + resets = <&cpg 314>; + status = "disabled"; + }; + + sdhi1: sd at ee120000 { + compatible = "renesas,sdhi-r8a774c0", + "renesas,rcar-gen3-sdhi"; + reg = <0 0xee120000 0 0x2000>; + interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpg CPG_MOD 313>; + max-frequency = <200000000>; + power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>; + resets = <&cpg 313>; + status = "disabled"; + }; + + sdhi3: sd at ee160000 { + compatible = "renesas,sdhi-r8a774c0", + "renesas,rcar-gen3-sdhi"; + reg = <0 0xee160000 0 0x2000>; + interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cpg CPG_MOD 311>; + max-frequency = <200000000>; + power-domains = <&sysc R8A774C0_PD_ALWAYS_ON>; + resets = <&cpg 311>; + status = "disabled"; + }; + gic: interrupt-controller at f1010000 { compatible = "arm,gic-400"; #interrupt-cells = <3>;
Signature · 1 line
2.7.4
PATCH 11/11 arm64: dts: renesas: r8a774c0-cat874: Add uSD support
In reply to Biju DasThis patch adds uSD card support.
--- arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+)
arch/arm64/boot/dts/renesas/r8a774c0-cat874.dts +50 -0
@@ -7,6 +7,7 @@ /dts-v1/; #include "r8a774c0.dtsi" +#include <dt-bindings/gpio/gpio.h> / { model = "Silicon Linux RZ/G2E 96board platform (CAT874)";
@@ -26,6 +27,29 @@ /* first 128MB is reserved for secure area. */ reg = <0x0 0x48000000 0x0 0x78000000>; }; + + vcc_sdhi0: regulator-vcc-sdhi0 { + compatible = "regulator-fixed"; + + regulator-name = "SDHI0 Vcc"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + }; + + vccq_sdhi0: regulator-vccq-sdhi0 { + compatible = "regulator-gpio"; + + regulator-name = "SDHI0 VccQ"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + + gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>; + gpios-states = <1>; + states = <3300000 1 + 1800000 0>; + }; }; &extal_clk {
@@ -37,6 +61,18 @@ groups = "scif2_data_a"; function = "scif2"; }; + + sdhi0_pins: sd0 { + groups = "sdhi0_data4", "sdhi0_ctrl"; + function = "sdhi0"; + power-source = <3300>; + }; + + sdhi0_pins_uhs: sd0_uhs { + groups = "sdhi0_data4", "sdhi0_ctrl"; + function = "sdhi0"; + power-source = <1800>; + }; }; &scif2 {
@@ -45,3 +81,17 @@ status = "okay"; }; + +&sdhi0 { + pinctrl-0 = <&sdhi0_pins>; + pinctrl-1 = <&sdhi0_pins_uhs>; + pinctrl-names = "default", "state_uhs"; + + vmmc-supply = <&vcc_sdhi0>; + vqmmc-supply = <&vccq_sdhi0>; + cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>; + bus-width = <4>; + sd-uhs-sdr50; + sd-uhs-sdr104; + status = "okay"; +};
Signature · 1 line
2.7.4