All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 03/14] imx: ventana: move mmc_init to common
Date: Fri, 17 Mar 2017 12:00:49 +0100	[thread overview]
Message-ID: <1d3b10fd-f43d-ef73-c6da-1f2db3f42ecf@denx.de> (raw)
In-Reply-To: <1489420274-2691-4-git-send-email-tharvey@gateworks.com>

On 13/03/2017 16:51, Tim Harvey wrote:
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> ---
>  board/gateworks/gw_ventana/common.c     | 35 +++++++++++++++++++++++++++++++++
>  board/gateworks/gw_ventana/gw_ventana.c | 33 -------------------------------
>  2 files changed, 35 insertions(+), 33 deletions(-)
> 
> diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
> index 4065c56..eb14cb7 100644
> --- a/board/gateworks/gw_ventana/common.c
> +++ b/board/gateworks/gw_ventana/common.c
> @@ -6,10 +6,12 @@
>   * SPDX-License-Identifier: GPL-2.0+
>   */
>  
> +#include <asm/arch/clock.h>
>  #include <asm/arch/mx6-pins.h>
>  #include <asm/arch/sys_proto.h>
>  #include <asm/gpio.h>
>  #include <asm/imx-common/mxc_i2c.h>
> +#include <fsl_esdhc.h>
>  #include <hwconfig.h>
>  #include <power/pmic.h>
>  #include <power/ltc3676_pmic.h>
> @@ -35,6 +37,17 @@ void setup_iomux_uart(void)
>  	SETUP_IOMUX_PADS(uart2_pads);
>  }
>  
> +/* MMC */
> +static iomux_v3_cfg_t const usdhc3_pads[] = {
> +	IOMUX_PADS(PAD_SD3_CLK__SD3_CLK    | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> +	IOMUX_PADS(PAD_SD3_CMD__SD3_CMD    | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> +	IOMUX_PADS(PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> +	IOMUX_PADS(PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> +	IOMUX_PADS(PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> +	IOMUX_PADS(PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> +	IOMUX_PADS(PAD_SD3_DAT5__GPIO7_IO00  | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> +};
> +
>  /* I2C1: GSC */
>  static struct i2c_pads_info mx6q_i2c_pad_info0 = {
>  	.scl = {
> @@ -964,3 +977,25 @@ void setup_pmic(void)
>  		}
>  	}
>  }
> +
> +#ifdef CONFIG_FSL_ESDHC
> +static struct fsl_esdhc_cfg usdhc_cfg = { USDHC3_BASE_ADDR };
> +
> +int board_mmc_init(bd_t *bis)
> +{
> +	/* Only one USDHC controller on Ventana */
> +	SETUP_IOMUX_PADS(usdhc3_pads);
> +	usdhc_cfg.sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
> +	usdhc_cfg.max_bus_width = 4;
> +
> +	return fsl_esdhc_initialize(bis, &usdhc_cfg);
> +}
> +
> +int board_mmc_getcd(struct mmc *mmc)
> +{
> +	/* Card Detect */
> +	gpio_request(GP_SD3_CD, "sd_cd");
> +	gpio_direction_input(GP_SD3_CD);
> +	return !gpio_get_value(GP_SD3_CD);
> +}
> +#endif /* CONFIG_FSL_ESDHC */
> diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
> index 5d871ce..ba648f5 100644
> --- a/board/gateworks/gw_ventana/gw_ventana.c
> +++ b/board/gateworks/gw_ventana/gw_ventana.c
> @@ -52,17 +52,6 @@ struct ventana_board_info ventana_info;
>  
>  static int board_type;
>  
> -/* MMC */
> -static iomux_v3_cfg_t const usdhc3_pads[] = {
> -	IOMUX_PADS(PAD_SD3_CLK__SD3_CLK    | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> -	IOMUX_PADS(PAD_SD3_CMD__SD3_CMD    | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> -	IOMUX_PADS(PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> -	IOMUX_PADS(PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> -	IOMUX_PADS(PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> -	IOMUX_PADS(PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> -	IOMUX_PADS(PAD_SD3_DAT5__GPIO7_IO00  | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
> -};
> -
>  /* ENET */
>  static iomux_v3_cfg_t const enet_pads[] = {
>  	IOMUX_PADS(PAD_ENET_MDIO__ENET_MDIO  | MUX_PAD_CTRL(ENET_PAD_CTRL)),
> @@ -193,28 +182,6 @@ int board_ehci_power(int port, int on)
>  }
>  #endif /* CONFIG_USB_EHCI_MX6 */
>  
> -#ifdef CONFIG_FSL_ESDHC
> -static struct fsl_esdhc_cfg usdhc_cfg = { USDHC3_BASE_ADDR };
> -
> -int board_mmc_getcd(struct mmc *mmc)
> -{
> -	/* Card Detect */
> -	gpio_request(GP_SD3_CD, "sd_cd");
> -	gpio_direction_input(GP_SD3_CD);
> -	return !gpio_get_value(GP_SD3_CD);
> -}
> -
> -int board_mmc_init(bd_t *bis)
> -{
> -	/* Only one USDHC controller on Ventana */
> -	SETUP_IOMUX_PADS(usdhc3_pads);
> -	usdhc_cfg.sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
> -	usdhc_cfg.max_bus_width = 4;
> -
> -	return fsl_esdhc_initialize(bis, &usdhc_cfg);
> -}
> -#endif /* CONFIG_FSL_ESDHC */
> -
>  #ifdef CONFIG_MXC_SPI
>  iomux_v3_cfg_t const ecspi1_pads[] = {
>  	/* SS1 */
> 

Reviewed-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  reply	other threads:[~2017-03-17 11:00 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13 15:51 [U-Boot] [PATCH 00/14] Gateworks Ventana add support for new boards Tim Harvey
2017-03-13 15:51 ` [U-Boot] [PATCH 01/14] imx: ventana: add additional DRAM configurations Tim Harvey
2017-03-17 11:00   ` Stefano Babic
2017-03-13 15:51 ` [U-Boot] [PATCH 02/14] imx: ventana: config: add gzwrite support Tim Harvey
2017-03-17 11:00   ` Stefano Babic
2017-03-13 15:51 ` [U-Boot] [PATCH 03/14] imx: ventana: move mmc_init to common Tim Harvey
2017-03-17 11:00   ` Stefano Babic [this message]
2017-03-13 15:51 ` [U-Boot] [PATCH 04/14] imx: ventana: use mmc_root in boot scripts Tim Harvey
2017-03-17 11:01   ` Stefano Babic
2017-03-13 15:51 ` [U-Boot] [PATCH 05/14] imx: ventana: change name of rs232_en to indicate polarity Tim Harvey
2017-03-17 11:01   ` Stefano Babic
2017-03-13 15:51 ` [U-Boot] [PATCH 06/14] imx: ventana: fix hwconfig Tim Harvey
2017-03-17 11:02   ` Stefano Babic
2017-03-13 15:51 ` [U-Boot] [PATCH 07/14] imx: ventana: make OTG VBUS power enable board specific Tim Harvey
2017-03-17 11:02   ` Stefano Babic
2017-03-13 15:51 ` [U-Boot] [PATCH 08/14] imx: ventana: make SD3_VSELECT " Tim Harvey
2017-03-17 11:02   ` Stefano Babic
2017-03-13 15:51 ` [U-Boot] [PATCH 09/14] imx: ventana: add EMMC configuration Tim Harvey
2017-03-13 15:51 ` [U-Boot] [PATCH 10/14] drivers: net: add MV88E6xx to Kconfig Tim Harvey
2017-03-17 10:59   ` Stefano Babic
2017-03-17 13:13     ` Tim Harvey
2017-03-17 13:27       ` Stefano Babic
2017-03-17 14:29   ` [U-Boot] [PATCH v2 10/14] drivers: net: phy: add MV88E6xx options " Tim Harvey
2017-03-19 17:05     ` Stefano Babic
2017-03-19 17:47     ` Joe Hershberger
2017-03-17 14:30   ` [U-Boot] [PATCH v2 11/14] imx: ventana: add GW5904 support Tim Harvey
2017-03-17 14:31   ` [U-Boot] [PATCH v2 12/14] imx: ventana: add GW560x support Tim Harvey
2017-03-13 15:51 ` [U-Boot] [PATCH 11/14] imx: ventana: add GW5904 support Tim Harvey
2017-03-17 11:09   ` Stefano Babic
2017-03-13 15:51 ` [U-Boot] [PATCH 12/14] imx: ventana: add GW560x support Tim Harvey
2017-03-17 11:12   ` Stefano Babic
2017-03-13 15:51 ` [U-Boot] [PATCH 13/14] imx: ventana: add GW5903 support Tim Harvey
2017-03-17 11:13   ` Stefano Babic
2017-03-17 14:32   ` [U-Boot] [PATCH v2 " Tim Harvey
2017-03-13 15:51 ` [U-Boot] [PATCH 14/14] imx: ventana: config: add EMMC boot options Tim Harvey
2017-03-17 11:00 ` [U-Boot] [PATCH 00/14] Gateworks Ventana add support for new boards Stefano Babic

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=1d3b10fd-f43d-ef73-c6da-1f2db3f42ecf@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /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.