mmc: fsl_esdhc: Add CMD11 support to switch to 1.8V
Subsystems (2)
PATCH v2 1/4 mmc: fsl_esdhc: Add CMD11 support to switch to 1.8V
This adds support to switch to 1.8V in case CMD11 succeeds.
---
Changes in v2:
- Fixed split string (Marek)
drivers/mmc/fsl_esdhc.c | 29 ++++++++++++++++++++++------- include/fsl_esdhc.h | 2 ++ include/mmc.h | 1 + 3 files changed, 25 insertions(+), 7 deletions(-)
drivers/mmc/fsl_esdhc.c +22 -7
@@ -54,19 +54,21 @@ struct fsl_esdhc {uint fevt;/* Force event register */ uint admaes;/* ADMA error status register */ uint adsaddr;/* ADMA system address register */ -char reserved2[160 ];/* reserved */ +char reserved2[100 ];/* reserved */ +uint vendorspec;/* Vendor Specific register */ +char reserved3[59 ];/* reserved */ uint hostver;/* Host controller version register */ -char reserved3[4 ];/* reserved */ -uint dmaerraddr;/* DMA error address register */ char reserved4[4 ];/* reserved */ -uint dmaerrattr;/* DMA error attribute register */ +uint dmaerraddr;/* DMA error address register */ char reserved5[4 ];/* reserved */ +uint dmaerrattr;/* DMA error attribute register */ +char reserved6[4 ];/* reserved */ uint hostcapblt2;/* Host controller capabilities register 2 */ -char reserved6[8 ];/* reserved */ +char reserved7[8 ];/* reserved */ uint tcr;/* Tuning control register */ -char reserved7[28 ];/* reserved */ +char reserved8[28 ];/* reserved */ uint sddirctl;/* SD direction control register */ -char reserved8[712 ];/* reserved */ +char reserved9[712 ];/* reserved */ uint scr;/* eSDHC control register */ };
@@ -341,6 +343,15 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) goto out; } +/* Switch voltage to 1.8V if CMD11 succeeded */ +if (cmd->cmdidx ==SD_CMD_SWITCH_UHS18V ) { +esdhc_setbits32 (®s->vendorspec,ESDHC_VENDORSPEC_VSELECT ); + +printf ("Run CMD11 1.8V switch\n" ); +/* Sleep for 5 ms - max time for card to switch to 1.8V */ +udelay (5000 ); + } +/* Workaround for ESDHC errata ENGcm03648 */ if (!data && (cmd->resp_type &MMC_RSP_BUSY )) {int timeout =2500 ;
@@ -413,6 +424,10 @@ out:while ((esdhc_read32 (®s->sysctl) &SYSCTL_RSTD )) ; } + +/* If this was CMD11, then notify that power cycle is needed */ +if (cmd->cmdidx ==SD_CMD_SWITCH_UHS18V ) +printf ("CMD11 to switch to 1.8V mode failed, card requires power cycle.\n" ); }esdhc_write32 (®s->irqstat,-1 );
include/fsl_esdhc.h +2 -0
@@ -154,6 +154,8 @@#define ESDHC_HOSTCAPBLT_DMAS 0x00400000#define ESDHC_HOSTCAPBLT_HSS 0x00200000 +#define ESDHC_VENDORSPEC_VSELECT 0x00000002/* Use 1.8V */ +struct fsl_esdhc_cfg {u32 esdhc_base;u32 sdhc_clk;
include/mmc.h +1 -0
@@ -88,6 +88,7 @@#define SD_CMD_SEND_RELATIVE_ADDR 3#define SD_CMD_SWITCH_FUNC 6#define SD_CMD_SEND_IF_COND 8 +#define SD_CMD_SWITCH_UHS18V 11#define SD_CMD_APP_SET_BUS_WIDTH 6#define SD_CMD_ERASE_WR_BLK_START 32
Signature · 1 line
2.1.4
PATCH v2 2/4 mmc: fsl_esdhc: Add support to force VSELECT set
Some boards cannot do voltage negotiation but need to set the VSELECT bit forcely to ensure it to work at 1.8V.
This commit adds CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT flag for this use.
---
Changes in v2: None
doc/README.fsl-esdhc | 1 + drivers/mmc/fsl_esdhc.c | 4 ++++ 2 files changed, 5 insertions(+)
doc/README.fsl-esdhc +1 -0
@@ -1,5 +1,6 @@ CONFIG_SYS_FSL_ESDHC_LE means ESDHC IP is in little-endian mode. CONFIG_SYS_FSL_ESDHC_BE means ESDHC IP is in big-endian mode. +CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT forces to run at 1.8V. Accessing ESDHC registers can be determined by ESDHC IP's endian mode or processor's endian mode.
drivers/mmc/fsl_esdhc.c +4 -0
@@ -523,6 +523,10 @@ static int esdhc_init(struct mmc *mmc)/* Set timout to the maximum value */ esdhc_clrsetbits32 (®s->sysctl,SYSCTL_TIMEOUT_MASK ,14 <<16 ); +#ifdef CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT +esdhc_setbits32 (®s->vendorspec,ESDHC_VENDORSPEC_VSELECT ); +#endif +return 0 ; }
Signature · 1 line
2.1.4
PATCH v2 2/4 mmc: fsl_esdhc: Add support to force VSELECT set
Quoted 8 lines · Otavio Salvador
Some boards cannot do voltage negotiation but need to set the VSELECT bit forcely to ensure it to work at 1.8V.
This commit adds
CONFIG_SYS_FSL_ESDHC_FORCE_VSELECTflag for this use.Signed-off-by Otavio Salvador <[email protected]>---
Applied to u-boot-imx, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== 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 =====================================================================
PATCH v2 3/4 imx: mx6sl: Extend USDHC SD2 pins to support 8-wire use
In reply to Otavio SalvadorThis adds the DATA[4-7] and RST pin definitions.
---
Changes in v2: None
arch/arm/include/asm/arch-mx6/mx6sl_pins.h | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/include/asm/arch-mx6/mx6sl_pins.h +5 -0
@@ -31,7 +31,12 @@ enum {MX6_PAD_SD2_DAT1__USDHC2_DAT1 =IOMUX_PAD (0x0568 ,0x0260 ,0 ,0x0000 ,0 ,0 ),MX6_PAD_SD2_DAT2__USDHC2_DAT2 =IOMUX_PAD (0x056C ,0x0264 ,0 ,0x0000 ,0 ,0 ),MX6_PAD_SD2_DAT3__USDHC2_DAT3 =IOMUX_PAD (0x0570 ,0x0268 ,0 ,0x0000 ,0 ,0 ), +MX6_PAD_SD2_DAT4__USDHC2_DAT4 =IOMUX_PAD (0X0574 ,0X026C ,0 ,0X0000 ,0 ,0 ), +MX6_PAD_SD2_DAT5__USDHC2_DAT5 =IOMUX_PAD (0X0578 ,0X0270 ,0 ,0X0000 ,0 ,0 ), +MX6_PAD_SD2_DAT6__USDHC2_DAT6 =IOMUX_PAD (0X057C ,0X0274 ,0 ,0X0000 ,0 ,0 ), +MX6_PAD_SD2_DAT7__USDHC2_DAT7 =IOMUX_PAD (0X0580 ,0X0278 ,0 ,0X0000 ,0 ,0 ),MX6_PAD_SD2_DAT7__GPIO_5_0 =IOMUX_PAD (0x0580 ,0x0278 ,5 ,0x0000 ,0 ,0 ), +MX6_PAD_SD2_RST__USDHC2_RST =IOMUX_PAD (0x0584 ,0x027C ,0 ,0x0000 ,0 ,0 ),MX6_PAD_SD3_CLK__USDHC3_CLK =IOMUX_PAD (0x0588 ,0x0280 ,0 ,0x0000 ,0 ,0 ),MX6_PAD_SD3_CMD__USDHC3_CMD =IOMUX_PAD (0x058C ,0x0284 ,0 ,0x0000 ,0 ,0 ), MX6_PAD_SD3_DAT0__USDHC3_DAT0 = IOMUX_PAD(0x0590, 0x0288, 0, 0x0000, 0, 0),
Signature · 1 line
2.1.4
PATCH v2 3/4 imx: mx6sl: Extend USDHC SD2 pins to support 8-wire use
Quoted 4 lines · Otavio Salvador
This adds the DATA[4-7] and RST pin definitions.
Signed-off-by Otavio Salvador <[email protected]>---
Applied to u-boot-imx, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== 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 =====================================================================
PATCH v2 4/4 warp: Add initial WaRP Board support
In reply to Otavio SalvadorThe WaRP Board is a Wearable Reference Plaform. The board features:
- Freescale i.MX6 SoloLite processor with 512MB of RAM
- Freescale FXOS8700CQ 6-axis Xtrinsic sensor
- Freescale Kinetis KL16 MCU
- Freescale Xtrinsic MMA955xL intelligent motion sensing platform
The board implements a hybrid architecture to address the evolving needs of the wearables market. The platform consists of a main board and an example daughtercard with the ability to add additional daughtercards for different usage models.
For more information about the project, visit:
---
Changes in v2: None
arch/arm/Kconfig | 5 ++ board/warp/Kconfig | 12 +++ board/warp/MAINTAINERS | 6 ++ board/warp/Makefile | 8 ++ board/warp/warp.c | 113 ++++++++++++++++++++++++++++ configs/warp_defconfig | 3 + include/configs/warp.h | 198 +++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 345 insertions(+) create mode 100644 board/warp/Kconfig create mode 100644 board/warp/MAINTAINERS create mode 100644 board/warp/Makefile create mode 100644 board/warp/warp.c create mode 100644 configs/warp_defconfig create mode 100644 include/configs/warp.h
arch/arm/Kconfig +5 -0
@@ -608,6 +608,10 @@ config TARGET_WANDBOARD bool "Support wandboard" select CPU_V7 +config TARGET_WARP + bool "Support WaRP" + select CPU_V7 + config TARGET_TITANIUM bool "Support titanium" select CPU_V7
@@ -1013,6 +1017,7 @@ source "board/ttcontrol/vision2/Kconfig" source "board/udoo/Kconfig" source "board/vpac270/Kconfig" source "board/wandboard/Kconfig" +source "board/warp/Kconfig" source "board/woodburn/Kconfig" source "board/xaeniax/Kconfig" source "board/zipitz2/Kconfig"
board/warp/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if TARGET_WARP + +config SYS_BOARD + default "warp" + +config SYS_SOC + default "mx6" + +config SYS_CONFIG_NAME + default "warp" + +endif
board/warp/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +WaRP BOARD +M: Otavio Salvador <[email protected]> +S: Maintained +F: board/warp/ +F: include/configs/warp.h +F: configs/warp_defconfig
board/warp/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# Copyright (C) 2014 O.S. Systems Software LTDA. +# Copyright (C) 2014 Kynetics LLC. +# Copyright (C) 2014 Revolution Robotics, Inc. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := warp.o
board/warp/warp.c new file +113 -0
113 lines not on this page · raw message
configs/warp_defconfig new file +3 -0
@@ -0,0 +1,3 @@ +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL" +CONFIG_ARM=y +CONFIG_TARGET_WARP=y
include/configs/warp.h new file +198 -0
198 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v2 4/4 warp: Add initial WaRP Board support
Quoted 12 lines · Otavio Salvador
The WaRP Board is a Wearable Reference Plaform. The board features:
- Freescale i.MX6 SoloLite processor with 512MB of RAM
- Freescale FXOS8700CQ 6-axis Xtrinsic sensor
- Freescale Kinetis KL16 MCU
- Freescale Xtrinsic MMA955xL intelligent motion sensing platformThe board implements a hybrid architecture to address the evolving needs of the wearables market. The platform consists of a main board and an example daughtercard with the ability to add additional daughtercards for different usage models.
Quoted 8 lines
For more information about the project, visit:
Signed-off-by Otavio Salvador <[email protected]>Reviewed-by Marek Vasut <[email protected]>Acked-by Stefano Babic <[email protected]>---
Applied to u-boot-imx, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== 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 =====================================================================
PATCH v2 1/4 mmc: fsl_esdhc: Add CMD11 support to switch to 1.8V
In reply to Otavio SalvadorQuoted 63 lines · Otavio Salvador
This adds support to switch to 1.8V in case CMD11 succeeds.
Signed-off-by Otavio Salvador <[email protected]>---
Changes in v2:
- Fixed split string (Marek)drivers/mmc/fsl_esdhc.c | 29 ++++++++++++++++++++++------- include/fsl_esdhc.h | 2 ++ include/mmc.h | 1 + 3 files changed, 25 insertions(+), 7 deletions(-)drivers/mmc/fsl_esdhc.c +18
-7@@ -54,19 +54,21 @@ struct fsl_esdhc {uint fevt;/* Force event register */ uint admaes;/* ADMA error status register */ uint adsaddr;/* ADMA system address register */ -char reserved2[160 ];/* reserved */ +char reserved2[100 ];/* reserved */ +uint vendorspec;/* Vendor Specific register */ +char reserved3[59 ];/* reserved */ uint hostver;/* Host controller version register */ -char reserved3[4 ];/* reserved */ -uint dmaerraddr;/* DMA error address register */ char reserved4[4 ];/* reserved */ -uint dmaerrattr;/* DMA error attribute register */ +uint dmaerraddr;/* DMA error address register */ char reserved5[4 ];/* reserved */ +uint dmaerrattr;/* DMA error attribute register */ +char reserved6[4 ];/* reserved */ uint hostcapblt2;/* Host controller capabilities register 2 */ -char reserved6[8 ];/* reserved */ +char reserved7[8 ];/* reserved */ uint tcr;/* Tuning control register */ -char reserved7[28 ];/* reserved */ +char reserved8[28 ];/* reserved */ uint sddirctl;/* SD direction control register */ -char reserved8[712 ];/* reserved */ +char reserved9[712 ];/* reserved */ uint scr;/* eSDHC control register */ };@@ -341,6 +343,15 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) goto out; } +/* Switch voltage to 1.8V if CMD11 succeeded */ +if (cmd->cmdidx ==SD_CMD_SWITCH_UHS18V ) { +esdhc_setbits32 (®s->vendorspec,ESDHC_VENDORSPEC_VSELECT ); + +printf ("Run CMD11 1.8V switch\n" ); +/* Sleep for 5 ms - max time for card to switch to 1.8V */ +udelay (5000 ); + } +/* Workaround for ESDHC errata ENGcm03648 */ if (!data && (cmd->resp_type &MMC_RSP_BUSY )) {int timeout =2500 ;
drivers/mmc/fsl_esdhc.c out: · line 425
Quoted 2 lines
drivers/mmc/fsl_esdhc.c +0
-0@@ -413,6 +424,10 @@ out:while ((esdhc_read32 (®s->sysctl) &SYSCTL_RSTD )) ;
This endless loop could use fixing ... anyone ?
drivers/mmc/fsl_esdhc.c out:
Quoted 5 lines
drivers/mmc/fsl_esdhc.c +4
-0} + +/* If this was CMD11, then notify that power cycle is needed */ +if (cmd->cmdidx ==SD_CMD_SWITCH_UHS18V ) + printf("CMD11 to switch to 1.8V mode failed, card
requires power
drivers/mmc/fsl_esdhc.c out: · line 433
Quoted 3 lines
drivers/mmc/fsl_esdhc.c +0
-0cycle.\n"); }esdhc_write32 (®s->irqstat,-1 );
PATCH v2 1/4 mmc: fsl_esdhc: Add CMD11 support to switch to 1.8V
In reply to Otavio SalvadorQuoted 4 lines · Otavio Salvador
This adds support to switch to 1.8V in case CMD11 succeeds.
Signed-off-by Otavio Salvador <[email protected]>---
Applied to u-boot-imx, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== 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 =====================================================================