* [U-Boot] [PATCH 1/3] ot1200: add feature pads
@ 2014-10-23 11:46 Christian Gmeiner
2014-10-23 11:46 ` [U-Boot] [PATCH 2/3] ot1200: add support for usdhc4 Christian Gmeiner
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Christian Gmeiner @ 2014-10-23 11:46 UTC (permalink / raw)
To: u-boot
The older 'mr' variant and the generic variant of the
OT1200 differ in some places. As the name suggests the
generic variant supports more boot devices.
In order to be compatible with the 'mr' variant we define
some 'feature' GPIOs. On the 'mr' variant this pads are
not connected so we define their state with the help
of the internal pullups.
On the generic variant this GPIOs are connected and
represent the state of the hardware.
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
---
board/bachmann/ot1200/ot1200.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/board/bachmann/ot1200/ot1200.c b/board/bachmann/ot1200/ot1200.c
index acf95cb..a2fb3cf 100644
--- a/board/bachmann/ot1200/ot1200.c
+++ b/board/bachmann/ot1200/ot1200.c
@@ -104,10 +104,25 @@ int board_spi_cs_gpio(unsigned bus, unsigned cs)
return (bus == 2 && cs == 0) ? (IMX_GPIO_NR(1, 3)) : -1;
}
+static iomux_v3_cfg_t const feature_pads[] = {
+ /* SD card detect */
+ MX6_PAD_GPIO_4__GPIO1_IO04 | MUX_PAD_CTRL(PAD_CTL_PUS_100K_DOWN),
+
+ /* eMMC soldered? */
+ MX6_PAD_GPIO_19__GPIO4_IO05 | MUX_PAD_CTRL(PAD_CTL_PUS_100K_UP),
+};
+
+static void setup_iomux_features(void)
+{
+ imx_iomux_v3_setup_multiple_pads(feature_pads,
+ ARRAY_SIZE(feature_pads));
+}
+
int board_early_init_f(void)
{
setup_iomux_uart();
setup_iomux_spi();
+ setup_iomux_features();
return 0;
}
--
1.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread* [U-Boot] [PATCH 2/3] ot1200: add support for usdhc4 2014-10-23 11:46 [U-Boot] [PATCH 1/3] ot1200: add feature pads Christian Gmeiner @ 2014-10-23 11:46 ` Christian Gmeiner 2014-10-30 9:47 ` Stefano Babic 2014-10-23 11:46 ` [U-Boot] [PATCH 3/3] ot1200: rework card detect for eMMC Christian Gmeiner 2014-10-30 9:47 ` [U-Boot] [PATCH 1/3] ot1200: add feature pads Stefano Babic 2 siblings, 1 reply; 6+ messages in thread From: Christian Gmeiner @ 2014-10-23 11:46 UTC (permalink / raw) To: u-boot On the 'mr' variant switching to 'mmc dev 1' will result in "MMC: no card present". Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> --- board/bachmann/ot1200/ot1200.c | 54 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/board/bachmann/ot1200/ot1200.c b/board/bachmann/ot1200/ot1200.c index a2fb3cf..45d761f 100644 --- a/board/bachmann/ot1200/ot1200.c +++ b/board/bachmann/ot1200/ot1200.c @@ -141,23 +141,67 @@ static iomux_v3_cfg_t const usdhc3_pads[] = { MX6_PAD_SD3_RST__SD3_RESET | MUX_PAD_CTRL(USDHC_PAD_CTRL), }; +iomux_v3_cfg_t const usdhc4_pads[] = { + MX6_PAD_SD4_CLK__SD4_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_CMD__SD4_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_DAT0__SD4_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_DAT1__SD4_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_DAT2__SD4_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL), + MX6_PAD_SD4_DAT3__SD4_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL), +}; + int board_mmc_getcd(struct mmc *mmc) { - return 1; + struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; + int ret; + + if (cfg->esdhc_base == USDHC3_BASE_ADDR) + ret = 1; + else { + gpio_direction_input(IMX_GPIO_NR(1, 4)); + ret = !gpio_get_value(IMX_GPIO_NR(1, 4)); + } + + return ret; } -struct fsl_esdhc_cfg usdhc_cfg[] = { +struct fsl_esdhc_cfg usdhc_cfg[2] = { {USDHC3_BASE_ADDR}, + {USDHC4_BASE_ADDR}, }; int board_mmc_init(bd_t *bis) { + s32 status = 0; + u32 index = 0; + usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); - usdhc_cfg[0].max_bus_width = 8; + usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC4_CLK); - imx_iomux_v3_setup_multiple_pads(usdhc3_pads, ARRAY_SIZE(usdhc3_pads)); + usdhc_cfg[0].max_bus_width = 8; + usdhc_cfg[1].max_bus_width = 4; + + for (index = 0; index < CONFIG_SYS_FSL_USDHC_NUM; ++index) { + switch (index) { + case 0: + imx_iomux_v3_setup_multiple_pads( + usdhc3_pads, ARRAY_SIZE(usdhc3_pads)); + break; + case 1: + imx_iomux_v3_setup_multiple_pads( + usdhc4_pads, ARRAY_SIZE(usdhc4_pads)); + break; + default: + printf("Warning: you configured more USDHC controllers" + "(%d) then supported by the board (%d)\n", + index + 1, CONFIG_SYS_FSL_USDHC_NUM); + return status; + } + + status |= fsl_esdhc_initialize(bis, &usdhc_cfg[index]); + } - return fsl_esdhc_initialize(bis, &usdhc_cfg[0]); + return status; } #define PC MUX_PAD_CTRL(I2C_PAD_CTRL) -- 1.9.3 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 2/3] ot1200: add support for usdhc4 2014-10-23 11:46 ` [U-Boot] [PATCH 2/3] ot1200: add support for usdhc4 Christian Gmeiner @ 2014-10-30 9:47 ` Stefano Babic 0 siblings, 0 replies; 6+ messages in thread From: Stefano Babic @ 2014-10-30 9:47 UTC (permalink / raw) To: u-boot On 23/10/2014 13:46, Christian Gmeiner wrote: > On the 'mr' variant switching to 'mmc dev 1' will result > in "MMC: no card present". > > Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> > --- Applied to u-boot-imx, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel 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 ===================================================================== ^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 3/3] ot1200: rework card detect for eMMC 2014-10-23 11:46 [U-Boot] [PATCH 1/3] ot1200: add feature pads Christian Gmeiner 2014-10-23 11:46 ` [U-Boot] [PATCH 2/3] ot1200: add support for usdhc4 Christian Gmeiner @ 2014-10-23 11:46 ` Christian Gmeiner 2014-10-30 9:47 ` Stefano Babic 2014-10-30 9:47 ` [U-Boot] [PATCH 1/3] ot1200: add feature pads Stefano Babic 2 siblings, 1 reply; 6+ messages in thread From: Christian Gmeiner @ 2014-10-23 11:46 UTC (permalink / raw) To: u-boot Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> --- board/bachmann/ot1200/ot1200.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/board/bachmann/ot1200/ot1200.c b/board/bachmann/ot1200/ot1200.c index 45d761f..2ed8cf7 100644 --- a/board/bachmann/ot1200/ot1200.c +++ b/board/bachmann/ot1200/ot1200.c @@ -155,9 +155,10 @@ int board_mmc_getcd(struct mmc *mmc) struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; int ret; - if (cfg->esdhc_base == USDHC3_BASE_ADDR) - ret = 1; - else { + if (cfg->esdhc_base == USDHC3_BASE_ADDR) { + gpio_direction_input(IMX_GPIO_NR(4, 5)); + ret = gpio_get_value(IMX_GPIO_NR(4, 5)); + } else { gpio_direction_input(IMX_GPIO_NR(1, 4)); ret = !gpio_get_value(IMX_GPIO_NR(1, 4)); } -- 1.9.3 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 3/3] ot1200: rework card detect for eMMC 2014-10-23 11:46 ` [U-Boot] [PATCH 3/3] ot1200: rework card detect for eMMC Christian Gmeiner @ 2014-10-30 9:47 ` Stefano Babic 0 siblings, 0 replies; 6+ messages in thread From: Stefano Babic @ 2014-10-30 9:47 UTC (permalink / raw) To: u-boot On 23/10/2014 13:46, Christian Gmeiner wrote: > Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> > --- Applied to u-boot-imx, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel 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 ===================================================================== ^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH 1/3] ot1200: add feature pads 2014-10-23 11:46 [U-Boot] [PATCH 1/3] ot1200: add feature pads Christian Gmeiner 2014-10-23 11:46 ` [U-Boot] [PATCH 2/3] ot1200: add support for usdhc4 Christian Gmeiner 2014-10-23 11:46 ` [U-Boot] [PATCH 3/3] ot1200: rework card detect for eMMC Christian Gmeiner @ 2014-10-30 9:47 ` Stefano Babic 2 siblings, 0 replies; 6+ messages in thread From: Stefano Babic @ 2014-10-30 9:47 UTC (permalink / raw) To: u-boot On 23/10/2014 13:46, Christian Gmeiner wrote: > The older 'mr' variant and the generic variant of the > OT1200 differ in some places. As the name suggests the > generic variant supports more boot devices. > > In order to be compatible with the 'mr' variant we define > some 'feature' GPIOs. On the 'mr' variant this pads are > not connected so we define their state with the help > of the internal pullups. > > On the generic variant this GPIOs are connected and > represent the state of the hardware. > > Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> > --- Applied to u-boot-imx, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel 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 ===================================================================== ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-10-30 9:47 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-10-23 11:46 [U-Boot] [PATCH 1/3] ot1200: add feature pads Christian Gmeiner 2014-10-23 11:46 ` [U-Boot] [PATCH 2/3] ot1200: add support for usdhc4 Christian Gmeiner 2014-10-30 9:47 ` Stefano Babic 2014-10-23 11:46 ` [U-Boot] [PATCH 3/3] ot1200: rework card detect for eMMC Christian Gmeiner 2014-10-30 9:47 ` Stefano Babic 2014-10-30 9:47 ` [U-Boot] [PATCH 1/3] ot1200: add feature pads Stefano Babic
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox