public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Peng Fan <van.freenix@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 14/17] engicam: icorem6: Add DM_GPIO, DM_MMC support
Date: Mon, 19 Sep 2016 14:25:02 +0800	[thread overview]
Message-ID: <20160919062501.GF15814@linux-7smt.suse> (raw)
In-Reply-To: <1474058929-17637-15-git-send-email-jagan@amarulasolutions.com>

Hi Jagan,
On Sat, Sep 17, 2016 at 02:18:46AM +0530, Jagan Teki wrote:
>Add DM_GPIO, DM_MMC support for u-boot and disable for SPL.
>
>Cc: Peng Fan <peng.fan@nxp.com>
>Cc: Stefano Babic <sbabic@denx.de>
>Cc: Fabio Estevam <fabio.estevam@nxp.com>
>Cc: Matteo Lisi <matteo.lisi@engicam.com>
>Cc: Michael Trimarchi <michael@amarulasolutions.com>
>Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
>---
> arch/arm/cpu/armv7/mx6/Kconfig  |   2 +
> board/engicam/icorem6/icorem6.c | 142 ++++++++++++++++++++--------------------
> include/configs/imx6qdl_icore.h |   4 ++
> 3 files changed, 78 insertions(+), 70 deletions(-)
>
>diff --git a/arch/arm/cpu/armv7/mx6/Kconfig b/arch/arm/cpu/armv7/mx6/Kconfig
>index e2431a8..762a581 100644
>--- a/arch/arm/cpu/armv7/mx6/Kconfig
>+++ b/arch/arm/cpu/armv7/mx6/Kconfig
>@@ -100,6 +100,8 @@ config TARGET_MX6Q_ICORE
> 	select MX6QDL
> 	select OF_CONTROL
> 	select DM
>+	select DM_GPIO

I do not see MXC_GPIO defined.

>+	select DM_MMC
> 	select DM_THERMAL
> 	select SUPPORT_SPL
> 
>diff --git a/board/engicam/icorem6/icorem6.c b/board/engicam/icorem6/icorem6.c
>index 4331ad3..2aa8a4e 100644
>--- a/board/engicam/icorem6/icorem6.c
>+++ b/board/engicam/icorem6/icorem6.c
>@@ -7,8 +7,6 @@
>  */
> 
> #include <common.h>
>-#include <fsl_esdhc.h>
>-#include <mmc.h>
> #include <miiphy.h>
> #include <netdev.h>
> 
>@@ -29,10 +27,6 @@ DECLARE_GLOBAL_DATA_PTR;
> 	PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED |		\
> 	PAD_CTL_DSE_40ohm   | PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
> 
>-#define USDHC_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE |             \
>-	PAD_CTL_PUS_22K_UP  | PAD_CTL_SPEED_LOW |               \
>-	PAD_CTL_DSE_80ohm   | PAD_CTL_SRE_FAST  | PAD_CTL_HYS)
>-
> #define ENET_PAD_CTRL  (PAD_CTL_PKE | PAD_CTL_PUE |		\
> 	PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED   |		\
> 	PAD_CTL_DSE_40ohm   | PAD_CTL_HYS)
>@@ -55,70 +49,6 @@ static iomux_v3_cfg_t const enet_pads[] = {
> 	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | MUX_PAD_CTRL(NO_PAD_CTRL)),
> };
> 
>-static iomux_v3_cfg_t const usdhc1_pads[] = {
>-	IOMUX_PADS(PAD_SD1_CLK__SD1_CLK	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
>-	IOMUX_PADS(PAD_SD1_CMD__SD1_CMD	| MUX_PAD_CTRL(USDHC_PAD_CTRL)),
>-	IOMUX_PADS(PAD_SD1_DAT0__SD1_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
>-	IOMUX_PADS(PAD_SD1_DAT1__SD1_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
>-	IOMUX_PADS(PAD_SD1_DAT2__SD1_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
>-	IOMUX_PADS(PAD_SD1_DAT3__SD1_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)),
>-	IOMUX_PADS(PAD_GPIO_1__GPIO1_IO01 | MUX_PAD_CTRL(NO_PAD_CTRL)),/* CD */
>-};
>-
>-#ifdef CONFIG_FSL_ESDHC
>-#define USDHC1_CD_GPIO	IMX_GPIO_NR(1, 1)
>-
>-struct fsl_esdhc_cfg usdhc_cfg[1] = {
>-	{USDHC1_BASE_ADDR, 0, 4},
>-};
>-
>-int board_mmc_getcd(struct mmc *mmc)
>-{
>-	struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
>-	int ret = 0;
>-
>-	switch (cfg->esdhc_base) {
>-	case USDHC1_BASE_ADDR:
>-		ret = !gpio_get_value(USDHC1_CD_GPIO);
>-		break;
>-	}
>-
>-	return ret;
>-}
>-
>-int board_mmc_init(bd_t *bis)
>-{
>-	int i, ret;
>-
>-	/*
>-	* According to the board_mmc_init() the following map is done:
>-	* (U-boot device node)    (Physical Port)
>-	* mmc0				USDHC1
>-	*/
>-	for (i = 0; i < CONFIG_SYS_FSL_USDHC_NUM; i++) {
>-		switch (i) {
>-		case 0:
>-			SETUP_IOMUX_PADS(usdhc1_pads);
>-			gpio_direction_input(USDHC1_CD_GPIO);
>-			usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC_CLK);
>-			break;
>-		default:
>-			printf("Warning - USDHC%d controller not supporting\n",
>-			       i + 1);
>-			return 0;
>-		}
>-
>-		ret = fsl_esdhc_initialize(bis, &usdhc_cfg[i]);
>-		if (ret) {
>-			printf("Warning: failed to initialize mmc dev %d\n", i);
>-			return ret;
>-		}
>-	}
>-
>-	return 0;
>-}
>-#endif
>-
> #ifdef CONFIG_FEC_MXC
> #define ENET_PHY_RST		IMX_GPIO_NR(7, 12)
> static int setup_fec(void)
>@@ -200,6 +130,78 @@ int dram_init(void)
> #include <asm/arch/crm_regs.h>
> #include <asm/arch/mx6-ddr.h>
> 
>+/* MMC board initialization is needed till adding DM support in SPL */
>+#if defined(CONFIG_FSL_ESDHC) && !defined(CONFIG_DM_MMC)

You could use "#ifdef CONFIG_SPL_BUILD" if this is only for SPL


Regards,
Peng.

  reply	other threads:[~2016-09-19  6:25 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-16 20:48 [U-Boot] [PATCH v2 00/17] imx6: Add Engicam i.CoreM6 QDL modules support Jagan Teki
2016-09-16 20:48 ` [U-Boot] [PATCH v2 01/17] imx: iomux-v3: Fix build error with snvs base Jagan Teki
2016-09-18  7:03   ` Peng Fan
2016-09-18  8:28     ` Jagan Teki
2016-09-16 20:48 ` [U-Boot] [PATCH v2 02/17] serial: Kconfig: Add MXC_UART entry Jagan Teki
2016-09-19  5:53   ` Peng Fan
2016-09-19  7:16     ` Jagan Teki
2016-09-16 20:48 ` [U-Boot] [PATCH v2 03/17] thermal: Kconfig: Add IMX_THERMAL entry Jagan Teki
2016-09-19  5:55   ` Peng Fan
2016-09-16 20:48 ` [U-Boot] [PATCH v2 04/17] Kconfig: Add DEFAULT_FDT_FILE entry Jagan Teki
2016-09-18 18:15   ` Tom Rini
2016-09-16 20:48 ` [U-Boot] [PATCH v2 05/17] arm: imx: Add Engicam i.CoreM6 QDL Starter Kit initial support Jagan Teki
2016-09-19  6:06   ` Peng Fan
2016-09-19  7:42     ` Jagan Teki
2016-09-16 20:48 ` [U-Boot] [PATCH v2 06/17] imx6: icorem6: Add ENET support Jagan Teki
2016-09-16 20:48 ` [U-Boot] [PATCH v2 07/17] imx: s/docs\/README.imximage/doc\/README.imximage/g Jagan Teki
2016-09-19  6:14   ` Peng Fan
2016-09-16 20:48 ` [U-Boot] [PATCH v2 08/17] arm: dts: Add devicetree for i.MX6DL Jagan Teki
2016-09-19  6:17   ` Peng Fan
2016-09-16 20:48 ` [U-Boot] [PATCH v2 09/17] arm: dts: Add devicetree for i.MX6DQL Jagan Teki
2016-09-16 20:48 ` [U-Boot] [PATCH v2 10/17] arm: dts: imx6dl: Add pinctrl defines Jagan Teki
2016-09-16 20:48 ` [U-Boot] [PATCH v2 11/17] dt-bindings: clock: imx6qdl: Add clock defines Jagan Teki
2016-09-16 20:48 ` [U-Boot] [PATCH v2 12/17] arm: imx6q: Add devicetree support for Engicam i.CoreM6 DualLite/Solo Jagan Teki
2016-09-16 20:48 ` [U-Boot] [PATCH v2 13/17] imx6q: icorem6: Enable pinctrl driver Jagan Teki
2016-09-16 20:48 ` [U-Boot] [PATCH v2 14/17] engicam: icorem6: Add DM_GPIO, DM_MMC support Jagan Teki
2016-09-19  6:25   ` Peng Fan [this message]
2016-09-19  7:23     ` Jagan Teki
2016-09-16 20:48 ` [U-Boot] [PATCH v2 15/17] arm: dts: Add devicetree for i.MX6Q Jagan Teki
2016-09-19  6:28   ` Peng Fan
2016-09-20 13:18     ` Jagan Teki
2016-09-16 20:48 ` [U-Boot] [PATCH v2 16/17] arm: dts: imx6q: Add pinctrl defines Jagan Teki
2016-09-16 20:48 ` [U-Boot] [PATCH v2 17/17] arm: imx6q: Add devicetree support for Engicam i.CoreM6 Quad/Dual Jagan Teki

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=20160919062501.GF15814@linux-7smt.suse \
    --to=van.freenix@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox