From patchwork Wed Jun 5 08:25:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 2666411 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 63AF1DF264 for ; Wed, 5 Jun 2013 08:27:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752912Ab3FEI1b (ORCPT ); Wed, 5 Jun 2013 04:27:31 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:33805 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752650Ab3FEI1W (ORCPT ); Wed, 5 Jun 2013 04:27:22 -0400 Received: from ayumi.isobedori.kobe.vergenet.net (p5212-ipbfp1903kobeminato.hyogo.ocn.ne.jp [114.172.132.212]) by kirsty.vergenet.net (Postfix) with ESMTP id 9FB3126716B; Wed, 5 Jun 2013 18:27:15 +1000 (EST) Received: by ayumi.isobedori.kobe.vergenet.net (Postfix, from userid 7100) id 563F86CE159; Wed, 5 Jun 2013 17:27:13 +0900 (JST) From: Simon Horman To: Arnd Bergmann , Olof Johansson Cc: linux-sh@vger.kernel.org, arm@kernel.org, linux-arm-kernel@lists.infradead.org, Magnus Damm , Kuninori Morimoto , Simon Horman Subject: [PATCH 022/130] sh-pfc: r8a7778: add SDHI support Date: Wed, 5 Jun 2013 17:25:13 +0900 Message-Id: <1370420821-28420-23-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1370420821-28420-1-git-send-email-horms+renesas@verge.net.au> References: <1370420821-28420-1-git-send-email-horms+renesas@verge.net.au> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Kuninori Morimoto Signed-off-by: Kuninori Morimoto Signed-off-by: Simon Horman --- drivers/pinctrl/sh-pfc/pfc-r8a7778.c | 141 +++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7778.c b/drivers/pinctrl/sh-pfc/pfc-r8a7778.c index 139f9dd..b1925cc 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r8a7778.c +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7778.c @@ -1427,6 +1427,84 @@ SCIF_PFC_DAT(scif5_data_a, TX5_A, RX5_A); SCIF_PFC_PIN(scif5_data_b, RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14)); SCIF_PFC_DAT(scif5_data_b, TX5_B, RX5_B); +/* - SDHI macro ------------------------------------------------------------- */ +#define SDHI_PFC_PINS(name, args...) SH_PFC_PINS(name, args) +#define SDHI_PFC_DAT1(name, d0) SH_PFC_MUX1(name, d0) +#define SDHI_PFC_DAT4(name, d0, d1, d2, d3) SH_PFC_MUX4(name, d0, d1, d2, d3) +#define SDHI_PFC_CTRL(name, clk, cmd) SH_PFC_MUX2(name, clk, cmd) +#define SDHI_PFC_CDPN(name, cd) SH_PFC_MUX1(name, cd) +#define SDHI_PFC_WPPN(name, wp) SH_PFC_MUX1(name, wp) + +/* - SDHI0 ------------------------------------------------------------------ */ +SDHI_PFC_PINS(sdhi0_cd, RCAR_GP_PIN(3, 17)); +SDHI_PFC_CDPN(sdhi0_cd, SD0_CD); +SDHI_PFC_PINS(sdhi0_ctrl, RCAR_GP_PIN(3, 11), RCAR_GP_PIN(3, 12)); +SDHI_PFC_CTRL(sdhi0_ctrl, SD0_CLK, SD0_CMD); +SDHI_PFC_PINS(sdhi0_data1, RCAR_GP_PIN(3, 13)); +SDHI_PFC_DAT1(sdhi0_data1, SD0_DAT0); +SDHI_PFC_PINS(sdhi0_data4, RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 14), + RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16)); +SDHI_PFC_DAT4(sdhi0_data4, SD0_DAT0, SD0_DAT1, + SD0_DAT2, SD0_DAT3); +SDHI_PFC_PINS(sdhi0_wp, RCAR_GP_PIN(3, 18)); +SDHI_PFC_WPPN(sdhi0_wp, SD0_WP); + +/* - SDHI1 ------------------------------------------------------------------ */ +SDHI_PFC_PINS(sdhi1_a_cd, RCAR_GP_PIN(0, 30)); +SDHI_PFC_CDPN(sdhi1_a_cd, SD1_CD_A); +SDHI_PFC_PINS(sdhi1_a_ctrl, RCAR_GP_PIN(1, 5), RCAR_GP_PIN(1, 6)); +SDHI_PFC_CTRL(sdhi1_a_ctrl, SD1_CLK_A, SD1_CMD_A); +SDHI_PFC_PINS(sdhi1_a_data1, RCAR_GP_PIN(1, 7)); +SDHI_PFC_DAT1(sdhi1_a_data1, SD1_DAT0_A); +SDHI_PFC_PINS(sdhi1_a_data4, RCAR_GP_PIN(1, 7), RCAR_GP_PIN(1, 8), + RCAR_GP_PIN(0, 5), RCAR_GP_PIN(0, 6)); +SDHI_PFC_DAT4(sdhi1_a_data4, SD1_DAT0_A, SD1_DAT1_A, + SD1_DAT2_A, SD1_DAT3_A); +SDHI_PFC_PINS(sdhi1_a_wp, RCAR_GP_PIN(0, 31)); +SDHI_PFC_WPPN(sdhi1_a_wp, SD1_WP_A); + +SDHI_PFC_PINS(sdhi1_b_cd, RCAR_GP_PIN(2, 24)); +SDHI_PFC_CDPN(sdhi1_b_cd, SD1_CD_B); +SDHI_PFC_PINS(sdhi1_b_ctrl, RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 16)); +SDHI_PFC_CTRL(sdhi1_b_ctrl, SD1_CLK_B, SD1_CMD_B); +SDHI_PFC_PINS(sdhi1_b_data1, RCAR_GP_PIN(1, 18)); +SDHI_PFC_DAT1(sdhi1_b_data1, SD1_DAT0_B); +SDHI_PFC_PINS(sdhi1_b_data4, RCAR_GP_PIN(1, 18), RCAR_GP_PIN(1, 19), + RCAR_GP_PIN(1, 20), RCAR_GP_PIN(1, 21)); +SDHI_PFC_DAT4(sdhi1_b_data4, SD1_DAT0_B, SD1_DAT1_B, + SD1_DAT2_B, SD1_DAT3_B); +SDHI_PFC_PINS(sdhi1_b_wp, RCAR_GP_PIN(2, 25)); +SDHI_PFC_WPPN(sdhi1_b_wp, SD1_WP_B); + + +/* - SDH2 ------------------------------------------------------------------- */ +SDHI_PFC_PINS(sdhi2_a_cd, RCAR_GP_PIN(4, 23)); +SDHI_PFC_CDPN(sdhi2_a_cd, SD2_CD_A); +SDHI_PFC_PINS(sdhi2_a_ctrl, RCAR_GP_PIN(4, 17), RCAR_GP_PIN(4, 18)); +SDHI_PFC_CTRL(sdhi2_a_ctrl, SD2_CLK_A, SD2_CMD_A); +SDHI_PFC_PINS(sdhi2_a_data1, RCAR_GP_PIN(4, 19)); +SDHI_PFC_DAT1(sdhi2_a_data1, SD2_DAT0_A); +SDHI_PFC_PINS(sdhi2_a_data4, RCAR_GP_PIN(4, 19), RCAR_GP_PIN(4, 20), + RCAR_GP_PIN(4, 21), RCAR_GP_PIN(4, 22)); +SDHI_PFC_DAT4(sdhi2_a_data4, SD2_DAT0_A, SD2_DAT1_A, + SD2_DAT2_A, SD2_DAT3_A); +SDHI_PFC_PINS(sdhi2_a_wp, RCAR_GP_PIN(4, 24)); +SDHI_PFC_WPPN(sdhi2_a_wp, SD2_WP_A); + +SDHI_PFC_PINS(sdhi2_b_cd, RCAR_GP_PIN(3, 27)); +SDHI_PFC_CDPN(sdhi2_b_cd, SD2_CD_B); +SDHI_PFC_PINS(sdhi2_b_ctrl, RCAR_GP_PIN(4, 5), RCAR_GP_PIN(4, 6)); +SDHI_PFC_CTRL(sdhi2_b_ctrl, SD2_CLK_B, SD2_CMD_B); +SDHI_PFC_PINS(sdhi2_b_data1, RCAR_GP_PIN(4, 7)); +SDHI_PFC_DAT1(sdhi2_b_data1, SD2_DAT0_B); +SDHI_PFC_PINS(sdhi2_b_data4, RCAR_GP_PIN(4, 7), RCAR_GP_PIN(4, 8), + RCAR_GP_PIN(3, 25), RCAR_GP_PIN(3, 26)); +SDHI_PFC_DAT4(sdhi2_b_data4, SD2_DAT0_B, SD2_DAT1_B, + SD2_DAT2_B, SD2_DAT3_B); +SDHI_PFC_PINS(sdhi2_b_wp, RCAR_GP_PIN(3, 28)); +SDHI_PFC_WPPN(sdhi2_b_wp, SD2_WP_B); + + static const struct sh_pfc_pin_group pinmux_groups[] = { SH_PFC_PIN_GROUP(hscif0_data_a), SH_PFC_PIN_GROUP(hscif0_data_b), @@ -1471,6 +1549,31 @@ static const struct sh_pfc_pin_group pinmux_groups[] = { SH_PFC_PIN_GROUP(scif4_data_c), SH_PFC_PIN_GROUP(scif5_data_a), SH_PFC_PIN_GROUP(scif5_data_b), + SH_PFC_PIN_GROUP(sdhi0_cd), + SH_PFC_PIN_GROUP(sdhi0_ctrl), + SH_PFC_PIN_GROUP(sdhi0_data1), + SH_PFC_PIN_GROUP(sdhi0_data4), + SH_PFC_PIN_GROUP(sdhi0_wp), + SH_PFC_PIN_GROUP(sdhi1_a_cd), + SH_PFC_PIN_GROUP(sdhi1_a_ctrl), + SH_PFC_PIN_GROUP(sdhi1_a_data1), + SH_PFC_PIN_GROUP(sdhi1_a_data4), + SH_PFC_PIN_GROUP(sdhi1_a_wp), + SH_PFC_PIN_GROUP(sdhi1_b_cd), + SH_PFC_PIN_GROUP(sdhi1_b_ctrl), + SH_PFC_PIN_GROUP(sdhi1_b_data1), + SH_PFC_PIN_GROUP(sdhi1_b_data4), + SH_PFC_PIN_GROUP(sdhi1_b_wp), + SH_PFC_PIN_GROUP(sdhi2_a_cd), + SH_PFC_PIN_GROUP(sdhi2_a_ctrl), + SH_PFC_PIN_GROUP(sdhi2_a_data1), + SH_PFC_PIN_GROUP(sdhi2_a_data4), + SH_PFC_PIN_GROUP(sdhi2_a_wp), + SH_PFC_PIN_GROUP(sdhi2_b_cd), + SH_PFC_PIN_GROUP(sdhi2_b_ctrl), + SH_PFC_PIN_GROUP(sdhi2_b_data1), + SH_PFC_PIN_GROUP(sdhi2_b_data4), + SH_PFC_PIN_GROUP(sdhi2_b_wp), }; static const char * const hscif0_groups[] = { @@ -1543,6 +1646,41 @@ static const char * const scif5_groups[] = { "scif5_data_b", }; + +static const char * const sdhi0_groups[] = { + "sdhi0_cd", + "sdhi0_ctrl", + "sdhi0_data1", + "sdhi0_data4", + "sdhi0_wp", +}; + +static const char * const sdhi1_groups[] = { + "sdhi1_a_cd", + "sdhi1_a_ctrl", + "sdhi1_a_data1", + "sdhi1_a_data4", + "sdhi1_a_wp", + "sdhi1_b_cd", + "sdhi1_b_ctrl", + "sdhi1_b_data1", + "sdhi1_b_data4", + "sdhi1_b_wp", +}; + +static const char * const sdhi2_groups[] = { + "sdhi2_a_cd", + "sdhi2_a_ctrl", + "sdhi2_a_data1", + "sdhi2_a_data4", + "sdhi2_a_wp", + "sdhi2_b_cd", + "sdhi2_b_ctrl", + "sdhi2_b_data1", + "sdhi2_b_data4", + "sdhi2_b_wp", +}; + static const struct sh_pfc_function pinmux_functions[] = { SH_PFC_FUNCTION(hscif0), SH_PFC_FUNCTION(hscif1), @@ -1553,6 +1691,9 @@ static const struct sh_pfc_function pinmux_functions[] = { SH_PFC_FUNCTION(scif3), SH_PFC_FUNCTION(scif4), SH_PFC_FUNCTION(scif5), + SH_PFC_FUNCTION(sdhi0), + SH_PFC_FUNCTION(sdhi1), + SH_PFC_FUNCTION(sdhi2), }; static struct pinmux_cfg_reg pinmux_config_regs[] = {