Split fsl_esdhc driver for i.MX
PATCH v3 4/5 mmc: fsl_esdhc: drop i.MX code
In reply to Lukasz MajewskiQuoted 198 lines
-----Original Message-----
From: Lukasz Majewski <[email protected]>
Sent: 2019年5月29日 14:40
To: Y.b. Lu <[email protected]>
Cc: u-boot at lists.denx.de; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; dl-uboot-imx <[email protected]>; Albert Aribaud <[email protected]>; Eddy Petrișor <[email protected]>; Akshay Bhat <[email protected]>; Ken Lin <[email protected]>; Heiko Schocher <[email protected]>; Christian Gmeiner <[email protected]>; Stefan Roese <[email protected]>; Patrick Bruenn <[email protected]>; Troy Kisky <[email protected]>; Uri Mashiach <[email protected]>; Nikita Kiryanov <[email protected]>; Otavio Salvador <[email protected]>; Andreas Geisreiter <[email protected]>; Ludwig Zenz <[email protected]>; Eric Bénard <[email protected]>; Peng Fan <[email protected]>; Jason Liu <[email protected]>; Ye Li <[email protected]>; Adrian Alonso <[email protected]>; Alison Wang <[email protected]>; tharvey at gateworks.com; Ian Ray <[email protected]>; Marcin Niestroj <[email protected]>; Andrej Rosano <[email protected]>; Marek Vasut <[email protected]>; Adam Ford <[email protected]>; Olaf Mandel <[email protected]>; Martyn Welch <[email protected]>; Ingo Schroeck <[email protected]>; Boris Brezillon <[email protected]>; Soeren Moch <[email protected]>; Richard Hu <[email protected]>; Vanessa Maegima <[email protected]>; Max Krummenacher <[email protected]>; Stefan Agner <[email protected]>; Markus Niebel <[email protected]>; Breno Matheus Lima <[email protected]>; Francesco Montefoschi <[email protected]>; Parthiban Nallathambi <[email protected]>; Albert ARIBAUD <[email protected]>; Jagan Teki <[email protected]>; Raffaele RECALCATI <[email protected]>; Simone CIANNI <[email protected]>; Bhaskar Upadhaya <[email protected]>; Vinitha V Pillai <[email protected]>; Prabhakar Kushwaha <[email protected]>; Rajesh Bhagat <[email protected]>; Antti Mäentausta <[email protected]>; Sébastien Szymanski <[email protected]>; Lucile Quirion <[email protected]>; Alexey Brodkin <[email protected]>; Trevor Woerner <[email protected]>; Anatolij Gustschin <[email protected]>; Denis Zalevskiy <[email protected]>; Fabien Lahoudere <[email protected]>; Joe Hershberger <[email protected]>; Simon Goldschmidt <[email protected]>; James Byrne <[email protected]>; Angelo Dureghello <[email protected]>
Subject: Re: [v3, 4/5] mmc:fsl_esdhc: drop i.MX codeQuoted 34 lines · On Tue, 21 May 2019 08:52:44 +0000 "Y.b. Lu" <[email protected]> wrote:
Dropped i.MX code which couldn't be reused.
Signed-off-by Yangbo Lu <[email protected]>---
Changes for v2:
- Added this patch.
Changes for v3:
- Rebased.--- drivers/mmc/fsl_esdhc.c | 609++--------------------------------------
include/fsl_esdhc.h|
57 ---- 2 files changed, 21 insertions(+), 645 deletions(-)drivers/mmc/fsl_esdhc.c index renamed from drivers/mmc/fsl_esdhc.c +0
-0
1b7de74a72..3f4f75ae4c100644drivers/mmc/fsl_esdhc.c +0
-3@@ -16,14 +16,11 @@#include <hwconfig.h> #include <mmc.h> #include <part.h> -#include <power/regulator.h> #include <malloc.h> #include <fsl_esdhc.h> #include <fdt_support.h> #include <asm/io.h> #include <dm.h> -#include <asm-generic/gpio.h> -#include <dm/pinctrl.h> DECLARE_GLOBAL_DATA_PTR ;@@ -33,8 +30,6 @@ DECLARE_GLOBAL_DATA_PTR; IRQSTATEN_CIE | IRQSTATEN_DTOE |Quoted 1 line
IRQSTATEN_DCE| \IRQSTATEN_DEBE|IRQSTATEN_BRR|IRQSTATEN_BWR| \
Quoted 97 lines
drivers/mmc/fsl_esdhc.c +0
-2IRQSTATEN_DINT) -#define MAX_TUNING_LOOP 40 - struct fsl_esdhc { uint dsaddr; /* SDMA system addressregister */ uint blkattr; /* Block attributes register */
drivers/mmc/fsl_esdhc.c +0
-0@@ -54,37 +49,20 @@ struct fsl_esdhc {uint autoc12err;/* Auto CMD error status register */ uint hostcapblt;/* Host controller capabilities register */ uint wml; /* Watermark level register */
drivers/mmc/fsl_esdhc.c +1
-2-uint mixctrl;/* For USDHC */ -char reserved1[4 ];/* reserved */ +char reserved1[8 ];/* reserved */ uint fevt;/* Force event register */ uint admaes;/* ADMA error status register */ uint adsaddr; /* ADMA system address register */
drivers/mmc/fsl_esdhc.c +1
-13-char reserved2[4 ]; -uint dllctrl; -uint dllstat; -uint clktunectrlstatus; -char reserved3[4 ]; -uint strobe_dllctrl; -uint strobe_dllstat; -char reserved4[72 ]; -uint vendorspec; -uint mmcboot; -uint vendorspec2; -uint tuning_ctrl;/* on i.MX6/7/8 */ -char reserved5[44 ]; +char reserved2[160 ];uint hostver;/* Host controller version register */
drivers/mmc/fsl_esdhc.c +3
-3-char reserved6[4 ];/* reserved */ +char reserved3[4 ];/* reserved */ uint dmaerraddr;/* DMA error address register */ -char reserved7[4 ];/* reserved */ +char reserved4[4 ];/* reserved */ uint dmaerrattr;/* DMA error attribute register */ -char reserved8[4 ];/* reserved */ +char reserved5[4 ];/* reserved */ uint hostcapblt2;/* Host controller capabilities register 2 */
drivers/mmc/fsl_esdhc.c +2
-16-char reserved9[8 ];/* reserved */ -uint tcr;/* Tuning control register */ -char reserved10[28 ];/* reserved */ -uint sddirctl;/* SD direction control register */ -char reserved11[712 ];/* reserved */ -uint scr;/* eSDHC control register */ +char reserved6[756 ];/* reserved */ +uint esdhcctl;/* eSDHC control register */ };struct fsl_esdhc_plat {@@ -92,11 +70,6 @@ struct fsl_esdhc_plat {struct mmc mmc; }; -struct esdhc_soc_data { -u32 flags; -u32 caps; -}; -/** * struct fsl_esdhc_priv * @@ -109,13 +82,6 @@ struct esdhc_soc_data {* @dev: pointer for the device * @non_removable: 0: removable; 1: non-removable * @wp_enable: 1: enable checking wp; 0: no check -* @vs18_enable: 1: use 1.8V voltage; 0: use 3.3V -* @flags: ESDHC_FLAG_xx in include/fsl_esdhc.h -* @caps: controller capabilities -* @tuning_step: tuning step setting in tuning_ctrl register -* @start_tuning_tap: the start point for tuning in tuning_ctrl register
- * @strobe_dll_delay_target: settings instrobe_dllctrl
- * @signal_voltage: indicating the current voltage
* @cd_gpio: gpio for card detection
* @wp_gpio: gpio for write protection
*/drivers/mmc/fsl_esdhc.c +0
-6@@ -124,7 +90,6 @@ struct fsl_esdhc_priv {unsigned int sdhc_clk;struct clk per_clk;unsigned int clock; -unsigned int mode;unsigned int bus_width;#if !CONFIG_IS_ENABLED (BLK )struct mmc *mmc;@@ -132,21 +97,6 @@ struct fsl_esdhc_priv {struct udevice *dev;int non_removable;int wp_enable; -int vs18_enable; -u32 flags; -u32 caps; -u32 tuning_step; -u32 tuning_start_tap;drivers/mmc/fsl_esdhc.c struct fsl_esdhc_priv { · line 149
Quoted 10 lines
drivers/mmc/fsl_esdhc.c +0
-10-u32 strobe_dll_delay_target; -u32 signal_voltage; -#if IS_ENABLED (CONFIG_DM_REGULATOR ) -struct udevice *vqmmc_dev; -struct udevice *vmmc_dev; -#endif -#ifdef CONFIG_DM_GPIO -struct gpio_desc cd_gpio; -struct gpio_desc wp_gpio; -#endif I suppose that _all_ 85xx and layerscape/OorIQ boards are not converted to DM and they are not using card detect and write protect pins?
Quoted 2 lines
IIRC the 85xx gained recently the support for DM/DTS. Maybe it would be worth to re-check if this code would be used?
[Y.b. Lu] All QorIQ platforms were using card detect and write protect pins, whose status could be checked through esdhc_prsstat register. The cd/wp_gpio definitions were only for i.MX. So dropped such code.
For DM, all QorIQ ARM boards had used DM_MMC. QorIQ PowerPC platforms were in progress to convert to use DM_MMC.
Quoted 149 lines
Quoted 15 lines
drivers/mmc/fsl_esdhc.c +0
-1}; /* Return the XFERTYP flags for a given command and data packet */ @@ -258,8 +208,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv*priv, struct mmc *mmc, {
drivers/mmc/fsl_esdhc.c +0
-0int timeout; struct fsl_esdhc *regs = priv->esdhc_regs; -#if
defined(CONFIG_FSL_LAYERSCAPE)||defined(CONFIG_S32V234)|| \drivers/mmc/fsl_esdhc.c +1
-1- defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_FSL_LAYERSCAPE )dma_addr_t addr;#endif uint wml_value;drivers/mmc/fsl_esdhc.c static int esdhc_setup_data(struct fsl_esdhc_priv · line 222
Quoted 2 lines
drivers/mmc/fsl_esdhc.c +0
-0@@ -272,8 +221,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,esdhc_clrsetbits32 (®s->wml,WML_RD_WML_MASK , wml_value);#ifndef
drivers/mmc/fsl_esdhc.c static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
Quoted 7 lines
CONFIG_SYS_FSL_ESDHC_USE_PIO-#ifdefined(CONFIG_FSL_LAYERSCAPE)||defined(CONFIG_S32V234)|| \drivers/mmc/fsl_esdhc.c +1
-1-defined (CONFIG_IMX8 ) ||defined (CONFIG_IMX8M ) +#if defined(CONFIG_FSL_LAYERSCAPE ) addr =virt_to_phys ((void *)(data->dest));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -297,20 +245,12@@
Quoted 14 lines
static int esdhc_setup_data(struct
fsl_esdhc_priv*priv, struct mmc *mmc, printf("\nThe SD card is locked. Can not write to a locked card.\n\n"); return-ETIMEDOUT;drivers/mmc/fsl_esdhc.c +0
-3} - }else { -#ifdef CONFIG_DM_GPIO - if (dm_gpio_is_valid(&priv->wp_gpio) &&
dm_gpio_get_value(&priv->wp_gpio)) {drivers/mmc/fsl_esdhc.c +0
-1- printf("\nThe SD card is locked. Cannot write to a locked card.\n\n");
drivers/mmc/fsl_esdhc.c +0
-3- return -ETIMEDOUT; - } -#endif }drivers/mmc/fsl_esdhc.c static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
Quoted 10 lines
drivers/mmc/fsl_esdhc.c +1
-2esdhc_clrsetbits32 (®s->wml,WML_WR_WML_MASK , wml_value <<16 );#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_FSL_LAYERSCAPE ) addr =virt_to_phys ((void *)(data->src));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -375,8 +315,7@@
Quoted 18 lines
static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc.c +1
-2unsigned end =0 ;unsigned size =roundup (ARCH_DMA_MINALIGN , data->blocks*data->blocksize); -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_FSL_LAYERSCAPE )dma_addr_t addr; addr = virt_to_phys((void *)(data->dest)); @@ -466,14 +405,7 @@static int esdhc_send_cmd_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc,drivers/mmc/fsl_esdhc.c +0
-0/* Send the command */ esdhc_write32(®s->cmdarg, cmd->cmdarg); -#if
defined(CONFIG_FSL_USDHC)drivers/mmc/fsl_esdhc.c +0
-2- esdhc_write32(®s->mixctrl, - (esdhc_read32(®s->mixctrl) & 0xFFFFFF80) | (xfertyp &
0x7F)drivers/mmc/fsl_esdhc.c static int esdhc_send_cmd_common(struct fsl_esdhc_priv *priv, struct mmc *mmc,
Quoted 7 lines
drivers/mmc/fsl_esdhc.c +0
-3- | (mmc->ddr_mode ? XFERTYP_DDREN : 0)); -esdhc_write32 (®s->xfertyp, xfertyp &0xFFFF0000 ); -#else esdhc_write32(®s->xfertyp, xfertyp); -#endifif ((cmd->cmdidx ==MMC_CMD_SEND_TUNING_BLOCK ) || (cmd->cmdidx == MMC_CMD_SEND_TUNING_BLOCK_HS200)) @@-500,15
Quoted 72 lines
+432,6 @@ static int esdhc_send_cmd_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc, goto out;drivers/mmc/fsl_esdhc.c +0
-3} -/* Switch voltage to 1.8V if CMD11 succeeded */ -if (cmd->cmdidx ==SD_CMD_SWITCH_UHS18V ) { - esdhc_setbits32(®s->vendorspec,
ESDHC_VENDORSPEC_VSELECT); -drivers/mmc/fsl_esdhc.c +0
-2-printf ("Run CMD11 1.8V switch\n" ); -/* Sleep for 5 ms - max time for card to switch to 1.8V */
drivers/mmc/fsl_esdhc.c +0
-5-udelay (5000 ); - } -/* Workaround for ESDHC errata ENGcm03648 */ if (!data && (cmd->resp_type &MMC_RSP_BUSY )) {int timeout =6000 ;@@ -596,10 +519,6 @@ out:while ((esdhc_read32 (®s->sysctl) &SYSCTL_RSTD )) ; } - -/* If this was CMD11, then notify that power cycle is needed */
drivers/mmc/fsl_esdhc.c +0
-2-if (cmd->cmdidx ==SD_CMD_SWITCH_UHS18V ) - printf("CMD11 to switch to 1.8V mode failed,card requires power cycle.\n"); }
drivers/mmc/fsl_esdhc.c +1
-10esdhc_write32 (®s->irqstat,-1 );@@ -611,62 +530,32 @@ static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock) {struct fsl_esdhc *regs = priv->esdhc_regs;int div =1 ; -#ifdef ARCH_MXC -#ifdef CONFIG_MX53 -/* For i.MX53 eSDHCv3, SYSCTL.SDCLKFS may not be set to 0. */ -int pre_div = (regs == (struct fsl_esdhc *)MMC_SDHC3_BASE_ADDR) ? 2 : 1; -#else -int pre_div =1 ; -#endif -#else int pre_div =2 ; -#endif +int ddr_pre_div = mmc->ddr_mode ?2 :1 ;int sdhc_clk = priv->sdhc_clk;uint clk; -/* -* For ddr mode, usdhc need to enable DDR mode first, after select
drivers/mmc/fsl_esdhc.c +0
-1-* this DDR mode, usdhc will automatically divide the usdhc clock
drivers/mmc/fsl_esdhc.c +0
-3-*/ -if (mmc->ddr_mode) { - writel(readl(®s->mixctrl) | MIX_CTRL_DDREN,
®s->mixctrl);drivers/mmc/fsl_esdhc.c +1
-9- sdhc_clk >>=1 ; - } -if (clock < mmc->cfg->f_min) clock = mmc->cfg->f_min; -if (sdhc_clk /16 > clock) { -for (; pre_div <256 ; pre_div *=2 ) -if ((sdhc_clk / pre_div) <= (clock *16 )) -break ; - }else - pre_div =1 ; + while (sdhc_clk / (16 * pre_div * ddr_pre_div) > clock &&
pre_div< 256)drivers/mmc/fsl_esdhc.c +1
-0+ pre_div *=2 ;
Quoted 11 lines
drivers/mmc/fsl_esdhc.c static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock) · line 545
Quoted 7 lines
drivers/mmc/fsl_esdhc.c +1
-3-for (div =1 ; div <=16 ; div++) -if ((sdhc_clk / (div * pre_div)) <= clock) -break ; + while (sdhc_clk / (div * pre_div * ddr_pre_div) > clock &&div < 16)
drivers/mmc/fsl_esdhc.c +1
-0+ div++;Have you updated your series to be on top of newest mainline? The above code looks like the one, which has been recently reverted as it breaks i.MX53 devices.
[Y.b. Lu] The code base was latest when I sent out the patches.
e14d9ca491 (origin/master, origin/HEAD) Merge git://git.denx.de/u-boot-x86d3d212b624 Merge branch '2019-05-19-master-imports'
Anyway let me rebase and send new version to address all comments.
Quoted 716 lines
Quoted 386 lines
drivers/mmc/fsl_esdhc.c +0
-5pre_div >>=1 ; div -=1 ; clk = (pre_div <<8 ) | (div <<4 ); -#ifdef CONFIG_FSL_USDHC -esdhc_clrbits32 (®s->vendorspec,VENDORSPEC_CKEN ); -#else esdhc_clrbits32(®s->sysctl, SYSCTL_CKEN); -#endifesdhc_clrsetbits32 (®s->sysctl,SYSCTL_CLOCK_MASK , clk);udelay (10000 ); -#ifdef CONFIG_FSL_USDHC - esdhc_setbits32(®s->vendorspec, VENDORSPEC_PEREN |
VENDORSPEC_CKEN); -#elsedrivers/mmc/fsl_esdhc.c +0
-0esdhc_setbits32(®s->sysctl, SYSCTL_PEREN | SYSCTL_CKEN); -#endif priv->clock = clock; }@@ -700,317 +589,20 @@ static void esdhc_clock_control(struct
fsl_esdhc_priv*priv, bool enable) } #endifdrivers/mmc/fsl_esdhc.c +0
-46-#ifdef MMC_SUPPORTS_TUNING -static int esdhc_change_pinstate(struct udevice *dev) -{ -struct fsl_esdhc_priv *priv =dev_get_priv (dev); -int ret; - -switch (priv->mode) { -case UHS_SDR50 : -case UHS_DDR50 : - ret =pinctrl_select_state (dev,"state_100mhz" ); -break ; -case UHS_SDR104 : -case MMC_HS_200 : -case MMC_HS_400 : - ret =pinctrl_select_state (dev,"state_200mhz" ); -break ; -default : - ret =pinctrl_select_state (dev,"default" ); -break ; - } - -if (ret) -printf ("%s %d error\n" , __func__, priv->mode); - -return ret; -} - -static void esdhc_reset_tuning(struct mmc *mmc) -{ -struct fsl_esdhc_priv *priv =dev_get_priv (mmc->dev); -struct fsl_esdhc *regs = priv->esdhc_regs; - -if (priv->flags &ESDHC_FLAG_USDHC ) { -if (priv->flags &ESDHC_FLAG_STD_TUNING ) { -esdhc_clrbits32 (®s->autoc12err, -MIX_CTRL_SMPCLK_SEL | -MIX_CTRL_EXE_TUNE ); - } - } -} - -static void esdhc_set_strobe_dll(struct mmc *mmc) -{ -struct fsl_esdhc_priv *priv =dev_get_priv (mmc->dev); -struct fsl_esdhc *regs = priv->esdhc_regs; -u32 val; - -if (priv->clock >ESDHC_STROBE_DLL_CLK_FREQ ) { - writel(ESDHC_STROBE_DLL_CTRL_RESET,
®s->strobe_dllctrl); -drivers/mmc/fsl_esdhc.c +0
-9-/* -* enable strobe dll ctrl and adjust the delay target -* for the uSDHC loopback read clock -*/ - val =ESDHC_STROBE_DLL_CTRL_ENABLE | - (priv->strobe_dll_delay_target << -ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_SHIFT ); -writel (val, ®s->strobe_dllctrl); -/* wait 1us to make sure strobe dll status register stable */
drivers/mmc/fsl_esdhc.c +0
-4-mdelay (1 ); - val =readl (®s->strobe_dllstat); -if (!(val &ESDHC_STROBE_DLL_STS_REF_LOCK )) - pr_warn("HS400 strobe DLL status REF notlock!\n");
drivers/mmc/fsl_esdhc.c +0
-2-if (!(val &ESDHC_STROBE_DLL_STS_SLV_LOCK )) - pr_warn("HS400 strobe DLL status SLV notlock!\n");
drivers/mmc/fsl_esdhc.c +0
-60- } -} - -static int esdhc_set_timing(struct mmc *mmc) -{ -struct fsl_esdhc_priv *priv =dev_get_priv (mmc->dev); -struct fsl_esdhc *regs = priv->esdhc_regs; -u32 mixctrl; - - mixctrl =readl (®s->mixctrl); - mixctrl &= ~(MIX_CTRL_DDREN |MIX_CTRL_HS400_EN ); - -switch (mmc->selected_mode) { -case MMC_LEGACY : -case SD_LEGACY : -esdhc_reset_tuning (mmc); -writel (mixctrl, ®s->mixctrl); -break ; -case MMC_HS_400 : - mixctrl |=MIX_CTRL_DDREN |MIX_CTRL_HS400_EN ; -writel (mixctrl, ®s->mixctrl); -esdhc_set_strobe_dll (mmc); -break ; -case MMC_HS : -case MMC_HS_52 : -case MMC_HS_200 : -case SD_HS : -case UHS_SDR12 : -case UHS_SDR25 : -case UHS_SDR50 : -case UHS_SDR104 : -writel (mixctrl, ®s->mixctrl); -break ; -case UHS_DDR50 : -case MMC_DDR_52 : - mixctrl |=MIX_CTRL_DDREN ; -writel (mixctrl, ®s->mixctrl); -break ; -default : -printf ("Not supported %d\n" , mmc->selected_mode); -return -EINVAL ; - } - - priv->mode = mmc->selected_mode; - -return esdhc_change_pinstate (mmc->dev); -} - -static int esdhc_set_voltage(struct mmc *mmc) -{ -struct fsl_esdhc_priv *priv =dev_get_priv (mmc->dev); -struct fsl_esdhc *regs = priv->esdhc_regs; -int ret; - - priv->signal_voltage = mmc->signal_voltage; -switch (mmc->signal_voltage) { -case MMC_SIGNAL_VOLTAGE_330 : -if (priv->vs18_enable) -return -EIO ; -#if CONFIG_IS_ENABLED (DM_REGULATOR ) -if (!IS_ERR_OR_NULL (priv->vqmmc_dev)) { - ret = regulator_set_value(priv->vqmmc_dev,3300000);
drivers/mmc/fsl_esdhc.c +0
-10-if (ret) { -printf ("Setting to 3.3V error" ); -return -EIO ; - } -/* Wait for 5ms */ -mdelay (5 ); - } -#endif - - esdhc_clrbits32(®s->vendorspec,
ESDHC_VENDORSPEC_VSELECT);drivers/mmc/fsl_esdhc.c +0
-9-if (!(esdhc_read32 (®s->vendorspec) & -ESDHC_VENDORSPEC_VSELECT )) -return 0 ; - -return -EAGAIN ; -case MMC_SIGNAL_VOLTAGE_180 : -#if CONFIG_IS_ENABLED (DM_REGULATOR ) -if (!IS_ERR_OR_NULL (priv->vqmmc_dev)) { - ret = regulator_set_value(priv->vqmmc_dev,1800000);
drivers/mmc/fsl_esdhc.c +0
-7-if (ret) { -printf ("Setting to 1.8V error" ); -return -EIO ; - } - } -#endif - esdhc_setbits32(®s->vendorspec,
ESDHC_VENDORSPEC_VSELECT);drivers/mmc/fsl_esdhc.c +0
-1- if (esdhc_read32(®s->vendorspec) &
ESDHC_VENDORSPEC_VSELECT)drivers/mmc/fsl_esdhc.c +0
-21-return 0 ; - -return -EAGAIN ; -case MMC_SIGNAL_VOLTAGE_120 : -return -ENOTSUPP ; -default : -return 0 ; - } -} - -static void esdhc_stop_tuning(struct mmc *mmc) -{ -struct mmc_cmd cmd; - - cmd.cmdidx =MMC_CMD_STOP_TRANSMISSION ; - cmd.cmdarg =0 ; - cmd.resp_type = MMC_RSP_R1b; - -dm_mmc_send_cmd (mmc->dev, &cmd,NULL ); -} - -static int fsl_esdhc_execute_tuning(struct udevice *dev, uint32_topcode) -{
drivers/mmc/fsl_esdhc.c +0
-19-struct fsl_esdhc_plat *plat =dev_get_platdata (dev); -struct fsl_esdhc_priv *priv =dev_get_priv (dev); -struct fsl_esdhc *regs = priv->esdhc_regs; -struct mmc *mmc = &plat->mmc; -u32 irqstaten =readl (®s->irqstaten); -u32 irqsigen =readl (®s->irqsigen); -int i, ret = -ETIMEDOUT ; -u32 val, mixctrl; - -/* clock tuning is not needed for upto 52MHz */ -if (mmc->clock <=52000000 ) -return 0 ; - -/* This is readw/writew SDHCI_HOST_CONTROL2 when tuning */ -if (priv->flags &ESDHC_FLAG_STD_TUNING ) { - val =readl (®s->autoc12err); - mixctrl =readl (®s->mixctrl); - val &= ~MIX_CTRL_SMPCLK_SEL ; - mixctrl &= ~(MIX_CTRL_FBCLK_SEL |
MIX_CTRL_AUTO_TUNE_EN); -drivers/mmc/fsl_esdhc.c +0
-2- val |=MIX_CTRL_EXE_TUNE ; - mixctrl |= MIX_CTRL_FBCLK_SEL |
MIX_CTRL_AUTO_TUNE_EN; -drivers/mmc/fsl_esdhc.c +0
-5-writel (val, ®s->autoc12err); -writel (mixctrl, ®s->mixctrl); - } - -/* sdhci_writew(host, SDHCI_TRNS_READ, SDHCI_TRANSFER_MODE); */
drivers/mmc/fsl_esdhc.c +0
-2- mixctrl =readl (®s->mixctrl); - mixctrl = MIX_CTRL_DTDSEL_READ | (mixctrl &~MIX_CTRL_SDHCI_MASK);
drivers/mmc/fsl_esdhc.c +0
-7-writel (mixctrl, ®s->mixctrl); - -writel (IRQSTATEN_BRR , ®s->irqstaten); -writel (IRQSTATEN_BRR , ®s->irqsigen); - -/* -* Issue opcode repeatedly till Execute Tuning is set to 0 or the number
drivers/mmc/fsl_esdhc.c +0
-15-* of loops reaches 40 times. -*/ -for (i =0 ; i <MAX_TUNING_LOOP ; i++) { -u32 ctrl; - -if (opcode ==MMC_CMD_SEND_TUNING_BLOCK_HS200 ) { -if (mmc->bus_width ==8 ) -writel (0x7080 , ®s->blkattr); -else if (mmc->bus_width ==4 ) -writel (0x7040 , ®s->blkattr); - }else { -writel (0x7040 , ®s->blkattr); - } - -/* sdhci_writew(host, SDHCI_TRNS_READ,
SDHCI_TRANSFER_MODE) */drivers/mmc/fsl_esdhc.c +0
-2- val =readl (®s->mixctrl); - val = MIX_CTRL_DTDSEL_READ | (val &~MIX_CTRL_SDHCI_MASK);
drivers/mmc/fsl_esdhc.c +0
-3-writel (val, ®s->mixctrl); - -/* We are using STD tuning, no need to check return value */
drivers/mmc/fsl_esdhc.c +0
-7-mmc_send_tuning (mmc, opcode,NULL ); - - ctrl =readl (®s->autoc12err); -if ((!(ctrl &MIX_CTRL_EXE_TUNE )) && - (ctrl &MIX_CTRL_SMPCLK_SEL )) { -/* -* need to wait some time, make sure sd/mmc fininsh
drivers/mmc/fsl_esdhc.c +0
-1-* send out tuning data, otherwise, the sd/mmc can't
drivers/mmc/fsl_esdhc.c +0
-1-* response to any command when the card still out
drivers/mmc/fsl_esdhc.c +0
-20-* put the tuning data. -*/ -mdelay (1 ); - ret =0 ; - break; - } - -/* Add 1ms delay for SD and eMMC */ -mdelay (1 ); - } - -writel (irqstaten, ®s->irqstaten); -writel (irqsigen, ®s->irqsigen); - -esdhc_stop_tuning (mmc); - -return ret; -} -#endif - static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, structmmc *mmc) {
drivers/mmc/fsl_esdhc.c +1
-15struct fsl_esdhc *regs = priv->esdhc_regs; -int ret__maybe_unused ;#ifdef CONFIG_FSL_ESDHC_USE_PERIPHERAL_CLK /* Select to use peripheral clock */ esdhc_clock_control (priv, false); -esdhc_setbits32 (®s->scr,ESDHCCTL_PCS ); +esdhc_setbits32 (®s->esdhcctl,ESDHCCTL_PCS );esdhc_clock_control (priv, true);#endif /* Set the clock speed */ if (priv->clock != mmc->clock)set_sysctl (priv, mmc, mmc->clock); -#ifdef MMC_SUPPORTS_TUNING -if (mmc->clk_disable) { -#ifdef CONFIG_FSL_USDHC -esdhc_clrbits32 (®s->vendorspec,VENDORSPEC_CKEN ); -#else -esdhc_clrbits32 (®s->sysctl,SYSCTL_CKEN ); -#endif - }else { -#ifdef CONFIG_FSL_USDHC -esdhc_setbits32 (®s->vendorspec,VENDORSPEC_PEREN | -VENDORSPEC_CKEN ); -#else - esdhc_setbits32(®s->sysctl, SYSCTL_PEREN |
SYSCTL_CKEN); -#endifdrivers/mmc/fsl_esdhc.c +0
-21- } - -if (priv->mode != mmc->selected_mode) { - ret =esdhc_set_timing (mmc); -if (ret) { -printf ("esdhc_set_timing error %d\n" , ret); -return ret; - } - } - -if (priv->signal_voltage != mmc->signal_voltage) { - ret =esdhc_set_voltage (mmc); -if (ret) { -printf ("esdhc_set_voltage error %d\n" , ret); -return ret; - } - } -#endif -/* Set the bus width */ esdhc_clrbits32 (®s->proctl,PROCTL_DTW_4 |PROCTL_DTW_8 );@@ -1037,34 +629,10 @@ static int esdhc_init_common(struct fsl_esdhc_priv *priv, struct mmc *mmc) return -ETIMEDOUT; } -#if defined(CONFIG_FSL_USDHC ) -/* RSTA doesn't reset MMC_BOOT register, so manually reset it */
drivers/mmc/fsl_esdhc.c +1
-21-esdhc_write32 (®s->mmcboot,0x0 ); -/* Reset MIX_CTRL and CLK_TUNE_CTRL_STATUS regs to 0 */ -esdhc_write32 (®s->mixctrl,0x0 ); -esdhc_write32 (®s->clktunectrlstatus,0x0 ); - -/* Put VEND_SPEC to default value */ -if (priv->vs18_enable) -esdhc_write32 (®s->vendorspec, (VENDORSPEC_INIT | -ESDHC_VENDORSPEC_VSELECT )); -else -esdhc_write32 (®s->vendorspec,VENDORSPEC_INIT ); - -/* Disable DLL_CTRL delay line */ -esdhc_write32 (®s->dllctrl,0x0 ); -#endif - -#ifndef ARCH_MXC /* Enable cache snooping */ -esdhc_write32 (®s->scr,0x00000040 ); -#endif +esdhc_write32 (®s->esdhcctl,0x00000040 ); -#ifndef CONFIG_FSL_USDHC esdhc_setbits32(®s->sysctl, SYSCTL_HCKEN | SYSCTL_IPGEN); -#else - esdhc_setbits32(®s->vendorspec, VENDORSPEC_HCKEN |
VENDORSPEC_IPGEN); -#endifdrivers/mmc/fsl_esdhc.c
Quoted 2 lines
drivers/mmc/fsl_esdhc.c +0
-0/* Set the initial clock speed */ mmc_set_clock(mmc, 400000, MMC_CLK_ENABLE); @@ -1098,10+666,6 @@
Quoted 303 lines
static int
esdhc_getcd_common(struct fsl_esdhc_priv *priv)#ifCONFIG_IS_ENABLED(DM_MMC)drivers/mmc/fsl_esdhc.c +0
-5if (priv->non_removable)return 1 ; -#ifdef CONFIG_DM_GPIO -if (dm_gpio_is_valid (&priv->cd_gpio)) -return dm_gpio_get_value (&priv->cd_gpio); -#endif #endif while (!(esdhc_read32(®s->prsstat) & PRSSTAT_CINS) && --timeout) @@ -1190,20 +754,8 @@ static int fsl_esdhc_init(struct
fsl_esdhc_priv*priv,esdhc_write32(®s->proctl, PROCTL_INIT | PROCTL_D3CD); #endifdrivers/mmc/fsl_esdhc.c +0
-10-#ifndef CONFIG_FSL_USDHC -esdhc_setbits32 (®s->sysctl,SYSCTL_PEREN |SYSCTL_HCKEN - |SYSCTL_IPGEN |SYSCTL_CKEN ); -/* Clearing tuning bits in case ROM has set it already */ -esdhc_write32 (®s->mixctrl,0 ); -esdhc_write32 (®s->autoc12err,0 ); -esdhc_write32 (®s->clktunectrlstatus,0 ); -#else - esdhc_setbits32(®s->vendorspec, VENDORSPEC_PEREN | - VENDORSPEC_HCKEN | VENDORSPEC_IPGEN |
VENDORSPEC_CKEN); -#endifdrivers/mmc/fsl_esdhc.c +0
-3- -if (priv->vs18_enable) - esdhc_setbits32(®s->vendorspec,
ESDHC_VENDORSPEC_VSELECT);drivers/mmc/fsl_esdhc.c +2
-59+esdhc_setbits32 (®s->sysctl,SYSCTL_PEREN |SYSCTL_HCKEN | +SYSCTL_IPGEN |SYSCTL_CKEN );writel (SDHCI_IRQ_EN_BITS , ®s->irqstaten); cfg = &plat->cfg;@@ -1279,27 +831,11 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, cfg->host_caps &= ~MMC_MODE_8BIT ;#endif - cfg->host_caps |= priv->caps; - cfg->f_min =400000 ; cfg->f_max =min (priv->sdhc_clk, (u32 )200000000 ); cfg->b_max =CONFIG_SYS_MMC_MAX_BLK_COUNT ; -writel (0 , ®s->dllctrl); -if (priv->flags &ESDHC_FLAG_USDHC ) { -if (priv->flags &ESDHC_FLAG_STD_TUNING ) { -u32 val =readl (®s->tuning_ctrl); - - val |=ESDHC_STD_TUNING_EN ; - val &= ~ESDHC_TUNING_START_TAP_MASK ; - val |= priv->tuning_start_tap; - val &= ~ESDHC_TUNING_STEP_MASK ; - val |= (priv->tuning_step) <<ESDHC_TUNING_STEP_SHIFT ; -writel (val, ®s->tuning_ctrl); - } - } -return 0 ; }@@ -1314,7 +850,6 @@ static int fsl_esdhc_cfg_to_priv(struct fsl_esdhc_cfg *cfg, priv->bus_width = cfg->max_bus_width; priv->sdhc_clk = cfg->sdhc_clk; priv->wp_enable = cfg->wp_enable; - priv->vs18_enable = cfg->vs18_enable;return 0 ; };@@ -1449,22 +984,11 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)#if CONFIG_IS_ENABLED (DM_MMC )#include <asm/arch/clock.h> -__weak void init_clk_usdhc(u32 index) -{ -} -static int fsl_esdhc_probe (struct udevice *dev) {struct mmc_uclass_priv *upriv =dev_get_uclass_priv (dev);struct fsl_esdhc_plat *plat =dev_get_platdata (dev);struct fsl_esdhc_priv *priv =dev_get_priv (dev); -const void *fdt = gd->fdt_blob; -int node =dev_of_offset (dev); -struct esdhc_soc_data *data = - (struct esdhc_soc_data *)dev_get_driver_data (dev); -#if CONFIG_IS_ENABLED (DM_REGULATOR ) -struct udevice *vqmmc_dev; -#endif fdt_addr_t addr;unsigned int val;struct mmc *mmc;@@ -1476,11 +1000,6 @@ static int fsl_esdhc_probe(struct udevice *dev) priv->esdhc_regs = (struct fsl_esdhc *)addr; priv->dev = dev; - priv->mode =-1 ; -if (data) { - priv->flags = data->flags; - priv->caps = data->caps; - } val =dev_read_u32_default (dev,"bus-width" ,-1 );if (val ==8 )@@ -1490,81 +1009,13 @@ static int fsl_esdhc_probe(struct udevice *dev) else priv->bus_width =1 ; - val =fdtdec_get_int (fdt, node,"fsl,tuning-step" ,1 ); - priv->tuning_step = val; - val =fdtdec_get_int (fdt, node,"fsl,tuning-start-tap" , -ESDHC_TUNING_START_TAP_DEFAULT ); - priv->tuning_start_tap = val; - val =fdtdec_get_int (fdt, node,"fsl,strobe-dll-delay-target" , - ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_DEFAULT); - priv->strobe_dll_delay_target = val; -if (dev_read_bool (dev,"non-removable" )) { priv->non_removable =1 ; }else { priv->non_removable =0 ; -#ifdef CONFIG_DM_GPIO -gpio_request_by_name (dev,"cd-gpios" ,0 , &priv->cd_gpio, -GPIOD_IS_IN ); -#endif } -if (dev_read_prop (dev,"fsl,wp-controller" ,NULL )) { - priv->wp_enable =1 ; - }else { - priv->wp_enable =0 ; -#ifdef CONFIG_DM_GPIO -gpio_request_by_name (dev,"wp-gpios" ,0 , &priv->wp_gpio, -GPIOD_IS_IN ); -#endif - } - - priv->vs18_enable =0 ; - -#if CONFIG_IS_ENABLED (DM_REGULATOR ) -/* -* If emmc I/O has a fixed voltage at 1.8V, this must be provided,
drivers/mmc/fsl_esdhc.c +0
-3-* otherwise, emmc will work abnormally. -*/ - ret = device_get_supply_regulator(dev, "vqmmc-supply",
&vqmmc_dev);drivers/mmc/fsl_esdhc.c +0
-6-if (ret) { -dev_dbg (dev,"no vqmmc-supply\n" ); - }else { - ret =regulator_set_enable (vqmmc_dev, true); -if (ret) { - dev_err(dev, "fail to enablevqmmc-supply\n");
drivers/mmc/fsl_esdhc.c +0
-10- return ret; - } - -if (regulator_get_value (vqmmc_dev) ==1800000 ) - priv->vs18_enable =1 ; - } -#endif - -if (fdt_get_property (fdt, node,"no-1-8-v" ,NULL )) - priv->caps &= ~(UHS_CAPS | MMC_MODE_HS200 |
MMC_MODE_HS400); -drivers/mmc/fsl_esdhc.c +1
-21-/* -* TODO: -* Because lack of clk driver, if SDHC clk is not enabled, -* need to enable it first before this driver is invoked. -* -* we use MXC_ESDHC_CLK to get clk freq. -* If one would like to make this function work, -* the aliases should be provided in dts as this: -* -* aliases { -* mmc0 = &usdhc1; -* mmc1 = &usdhc2; -* mmc2 = &usdhc3; -* mmc3 = &usdhc4; -* }; -* Then if your board only supports mmc2 and mmc3, but we can -* correctly get the seq as 2 and 3, then let mxc_get_clock -* work as expected. -*/ - -init_clk_usdhc (dev->seq); + priv->wp_enable =1 ;if (IS_ENABLED (CONFIG_CLK )) { /* Assigned clock already set clock */ @@ -1631,28 +1082,10 @@static const struct
dm_mmc_opsfsl_esdhc_ops
= { .get_cd =fsl_esdhc_get_cd,drivers/mmc/fsl_esdhc.c +0
-17.send_cmd = fsl_esdhc_send_cmd, .set_ios = fsl_esdhc_set_ios, -#ifdef MMC_SUPPORTS_TUNING - .execute_tuning = fsl_esdhc_execute_tuning, -#endif };#endif -static struct esdhc_soc_data usdhc_imx7d_data = { - .flags =ESDHC_FLAG_USDHC |ESDHC_FLAG_STD_TUNING - |ESDHC_FLAG_HAVE_CAP1 |ESDHC_FLAG_HS200 - |ESDHC_FLAG_HS400 , - .caps =UHS_CAPS |MMC_MODE_HS200 | MMC_MODE_DDR_52MHz | - MMC_MODE_HS_52MHz |MMC_MODE_HS , -}; -static const struct udevice_id fsl_esdhc_ids[] = { - { .compatible ="fsl,imx53-esdhc" , }, - { .compatible ="fsl,imx6ul-usdhc" , }, - { .compatible ="fsl,imx6sx-usdhc" , }, - { .compatible ="fsl,imx6sl-usdhc" , }, - { .compatible ="fsl,imx6q-usdhc" , }, - { .compatible = "fsl,imx7d-usdhc", .data =(ulong)&usdhc_imx7d_data,},
drivers/mmc/fsl_esdhc.c +0
-1- { .compatible = "fsl,imx7ulp-usdhc", }, { .compatible = "fsl,esdhc", }, {/* sentinel */ } };include/fsl_esdhc.h index renamed from include/fsl_esdhc.h +0
-0
8dbd5249a7..7d7e946ab3100644include/fsl_esdhc.h +0
-50@@ -9,7 +9,6 @@#ifndef __FSL_ESDHC_H__#define __FSL_ESDHC_H__ -#include <linux/bitops.h> #include <linux/errno.h> #include <asm/byteorder.h> @@ -25,22 +24,14 @@#define SYSCTL_INITA 0x08000000#define SYSCTL_TIMEOUT_MASK 0x000f0000#define SYSCTL_CLOCK_MASK 0x0000fff0 -#if !defined(CONFIG_FSL_USDHC )#define SYSCTL_CKEN 0x00000008#define SYSCTL_PEREN 0x00000004#define SYSCTL_HCKEN 0x00000002#define SYSCTL_IPGEN 0x00000001 -#endif #define SYSCTL_RSTA 0x01000000#define SYSCTL_RSTC 0x02000000#define SYSCTL_RSTD 0x04000000 -#define VENDORSPEC_CKEN 0x00004000 -#define VENDORSPEC_PEREN 0x00002000 -#define VENDORSPEC_HCKEN 0x00001000 -#define VENDORSPEC_IPGEN 0x00000800 -#define VENDORSPEC_INIT 0x20007809 -#define IRQSTAT 0x0002e030#define IRQSTAT_DMAE (0x10000000)#define IRQSTAT_AC12E (0x01000000)@@ -172,54 +163,6 @@#define ESDHC_HOSTCAPBLT_DMAS 0x00400000#define ESDHC_HOSTCAPBLT_HSS 0x00200000 -#define ESDHC_VENDORSPEC_VSELECT 0x00000002/* Use 1.8V */ - -/* Imported from Linux Kernel drivers/mmc/host/sdhci-esdhc-imx.c */ -#define MIX_CTRL_DDREN BIT(3) -#define MIX_CTRL_DTDSEL_READ BIT(4) -#define MIX_CTRL_AC23EN BIT(7) -#define MIX_CTRL_EXE_TUNE BIT(22) -#define MIX_CTRL_SMPCLK_SEL BIT(23) -#define MIX_CTRL_AUTO_TUNE_EN BIT(24) -#define MIX_CTRL_FBCLK_SEL BIT(25) -#define MIX_CTRL_HS400_EN BIT(26) -#define MIX_CTRL_HS400_ES BIT(27) -/* Bits 3 and 6 are not SDHCI standard definitions */ -#define MIX_CTRL_SDHCI_MASK 0xb7 -/* Tuning bits */ -#define MIX_CTRL_TUNING_MASK 0x03c00000 - -/* strobe dll register */ -#define ESDHC_STROBE_DLL_CTRL 0x70 -#define ESDHC_STROBE_DLL_CTRL_ENABLE BIT(0) -#define ESDHC_STROBE_DLL_CTRL_RESET BIT(1) -#define ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_DEFAULT 0x7 -#define ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_SHIFT 3 - -#define ESDHC_STROBE_DLL_STATUS 0x74 -#define ESDHC_STROBE_DLL_STS_REF_LOCK BIT(1) -#define ESDHC_STROBE_DLL_STS_SLV_LOCK 0x1 -#define ESDHC_STROBE_DLL_CLK_FREQ 100000000 - -#define ESDHC_STD_TUNING_EN BIT(24) -/* NOTE: the minimum valid tuning start tap for mx6sl is 1 */ -#define ESDHC_TUNING_START_TAP_DEFAULT 0x1 -#define ESDHC_TUNING_START_TAP_MASK 0xff -#define ESDHC_TUNING_STEP_MASK 0x00070000 -#define ESDHC_TUNING_STEP_SHIFT 16 - -#define ESDHC_FLAG_MULTIBLK_NO_INT BIT(1) -#define ESDHC_FLAG_ENGCM07207 BIT(2) -#define ESDHC_FLAG_USDHC BIT(3) -#define ESDHC_FLAG_MAN_TUNING BIT(4) -#define ESDHC_FLAG_STD_TUNING BIT(5)include/fsl_esdhc.h line 168
Quoted 10 lines
include/fsl_esdhc.h +0
-7-#define ESDHC_FLAG_HAVE_CAP1 BIT(6) -#define ESDHC_FLAG_ERR004536 BIT(7) -#define ESDHC_FLAG_HS200 BIT(8) -#define ESDHC_FLAG_HS400 BIT(9) -#define ESDHC_FLAG_ERR010450 BIT(10) -#define ESDHC_FLAG_HS400_ES BIT(11) -struct fsl_esdhc_cfg {phys_addr_t esdhc_base;u32 sdhc_clk;Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
lukma at denx.de
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
In reply to Y.b. LuDropped useless code for i.MX eSDHC driver.
---
Changes for v2:
- Added this patch.
Changes for v3:
- None.
--- drivers/mmc/fsl_esdhc_imx.c | 96 ++----------------------------------- include/fsl_esdhc_imx.h | 4 -- 2 files changed, 4 insertions(+), 96 deletions(-)
drivers/mmc/fsl_esdhc_imx.c +4 -92
@@ -259,8 +259,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, {int timeout;struct fsl_esdhc *regs = priv->esdhc_regs; -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M )dma_addr_t addr;#endif uint wml_value;
@@ -273,8 +272,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,esdhc_clrsetbits32 (®s->wml,WML_RD_WML_MASK , wml_value);#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->dest));if (upper_32_bits (addr))printf ("Error found for upper 32 bits\n" );
@@ -310,8 +308,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,esdhc_clrsetbits32 (®s->wml,WML_WR_WML_MASK , wml_value <<16 );#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->src));if (upper_32_bits (addr))printf ("Error found for upper 32 bits\n" );
@@ -376,8 +373,7 @@ static void check_and_invalidate_dcache_rangeunsigned end =0 ;unsigned size =roundup (ARCH_DMA_MINALIGN , data->blocks*data->blocksize); -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M )dma_addr_t addr; addr =virt_to_phys ((void *)(data->dest));
@@ -392,25 +388,6 @@ static void check_and_invalidate_dcache_rangeinvalidate_dcache_range (start, end); } -#ifdef CONFIG_MCF5441x -/* -* Swaps 32-bit words to little-endian byte order. -*/ -static inline void sd_swap_dma_buff (struct mmc_data *data) -{ -int i, size = data->blocksize >>2 ; -u32 *buffer = (u32 *)data->dest; -u32 sw; - -while (data->blocks--) { -for (i =0 ; i < size; i++) { - sw =__sw32 (*buffer); - *buffer++ = sw; - } - } -} -#endif -/* * Sends a command out on the bus. Takes the mmc pointer, * a command pointer, and an optional data pointer.
@@ -575,9 +552,6 @@ static int esdhc_send_cmd_common(struct fsl_esdhc_priv *priv, struct mmc *mmc,*/ if (data->flags &MMC_DATA_READ ) {check_and_invalidate_dcache_range (cmd, data); -#ifdef CONFIG_MCF5441x -sd_swap_dma_buff (data); -#endif }#endif }
@@ -1073,12 +1047,8 @@ static int esdhc_init_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)/* Disable the BRR and BWR bits in IRQSTAT */ esdhc_clrbits32 (®s->irqstaten,IRQSTATEN_BRR |IRQSTATEN_BWR ); -#ifdef CONFIG_MCF5441x -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#else /* Put the PROCTL reg back to the default */ esdhc_write32 (®s->proctl,PROCTL_INIT ); -#endif /* Set timout to the maximum value */ esdhc_clrsetbits32 (®s->sysctl,SYSCTL_TIMEOUT_MASK ,14 <<16 );
@@ -1186,11 +1156,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,if (ret)return ret; -#ifdef CONFIG_MCF5441x -/* ColdFire, using SDHC_DATA[3] for card detection */ -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#endif -#ifndef CONFIG_FSL_USDHC esdhc_setbits32 (®s->sysctl,SYSCTL_PEREN |SYSCTL_HCKEN |SYSCTL_IPGEN |SYSCTL_CKEN );
@@ -1215,15 +1180,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, voltage_caps =0 ; caps =esdhc_read32 (®s->hostcapblt); -#ifdef CONFIG_MCF5441x -/* -* MCF5441x RM declares in more points that sdhc clock speed must -* never exceed 25 Mhz. From this, the HS bit needs to be disabled -* from host capabilities. -*/ - caps &= ~ESDHC_HOSTCAPBLT_HSS ; -#endif -#ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC135 caps = caps & ~(ESDHC_HOSTCAPBLT_SRS |ESDHC_HOSTCAPBLT_VS18 |ESDHC_HOSTCAPBLT_VS30 );
@@ -1375,45 +1331,6 @@ int fsl_esdhc_mmc_init(bd_t *bis) }#endif -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -void mmc_adapter_card_type_ident (void ) -{ -u8 card_id; -u8 value; - - card_id =QIXIS_READ (present) &QIXIS_SDID_MASK ; - gd->arch.sdhc_adapter = card_id; - -switch (card_id) { -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC45 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_DAT4 |QIXIS_DAT5_6_7 ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SDMMC_LEGACY : - value =QIXIS_READ (pwr_ctl[1 ]); - value |=QIXIS_EVDD_BY_SDHC_VS ; -QIXIS_WRITE (pwr_ctl[1 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC44 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_SDCLKIN |QIXIS_SDCLKOUT ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_RSV : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_MMC : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SD : -break ; -case QIXIS_ESDHC_NO_ADAPTER : -break ; -default : -break ; - } -} -#endif -#ifdef CONFIG_OF_LIBFDT __weak int esdhc_status_fixup (void *blob,const char *compat) {
@@ -1441,10 +1358,6 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)do_fixup_by_compat_u32 (blob, compat,"clock-frequency" , gd->arch.sdhc_clk,1 ); #endif -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -do_fixup_by_compat_u32 (blob, compat,"adapter-type" , - (u32)(gd->arch.sdhc_adapter),1 ); -#endif }#endif
@@ -1654,7 +1567,6 @@ static const struct udevice_id fsl_esdhc_ids[] = { { .compatible = "fsl,imx6q-usdhc", }, { .compatible = "fsl,imx7d-usdhc", .data = (ulong)&usdhc_imx7d_data,}, { .compatible = "fsl,imx7ulp-usdhc", }, - { .compatible = "fsl,esdhc", }, { /* sentinel */ } };
include/fsl_esdhc_imx.h +0 -4
@@ -17,10 +17,6 @@/* needed for the mmc_cfg definition */ #include <mmc.h> -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -#include "../board/freescale/common/qixis.h" -#endif -/* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c#define SYSCTL_INITA 0x08000000
Signature · 1 line
2.17.1
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
Quoted 16 lines
Subject: [v3, 5/5] mmc:
fsl_esdhc_imx: drop useless codeDropped useless code for i.MX eSDHC driver.
Signed-off-by Yangbo Lu <[email protected]>---
Changes for v2:
- Added this patch.
Changes for v3:
- None.--- drivers/mmc/fsl_esdhc_imx.c | 96 ++----------------------------------- include/fsl_esdhc_imx.h | 4 -- 2 files changed, 4 insertions(+), 96 deletions(-)
[.....]
drivers/mmc/fsl_esdhc_imx.c static const struct udevice_id fsl_esdhc_ids[] = { · line 1657
Quoted 1 line
drivers/mmc/fsl_esdhc_imx.c +0
-1- { .compatible = "fsl,esdhc", },
Please keep this, the following 2 dts using this compatible. ./arch/arm/dts/vf.dtsi ./arch/arm/dts/imx53-ppd.dts
With this addressed, you could have myReviewed-by: Peng Fan <[email protected]>
Quoted 19 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0{/* sentinel */ } };include/fsl_esdhc_imx.h index renamed from include/fsl_esdhc_imx.h +0
-0
e05b24e7e8..8abd28ea50100644include/fsl_esdhc_imx.h +0
-5@@ -17,10 +17,6 @@/* needed for the mmc_cfg definition */ #include <mmc.h> -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -#include "../board/freescale/common/qixis.h" -#endif -/* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c#define SYSCTL_INITA 0x08000000 --2.17.1
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
Quoted 67 lines
-----Original Message-----
From: Peng Fan
Sent: 2019年5月29日 9:53
To: Y.b. Lu <[email protected]>; u-boot at lists.denx.de
Cc: Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; dl-uboot-imx <[email protected]>; Albert Aribaud <[email protected]>; Eddy Petrișor <[email protected]>; Akshay Bhat <[email protected]>; Ken Lin <[email protected]>; Heiko Schocher <[email protected]>; Christian Gmeiner <[email protected]>; Stefan Roese <[email protected]>; Patrick Bruenn <[email protected]>; Troy Kisky <[email protected]>; Uri Mashiach <[email protected]>; Nikita Kiryanov <[email protected]>; Otavio Salvador <[email protected]>; Andreas Geisreiter <[email protected]>; Ludwig Zenz <[email protected]>; Eric Bénard <[email protected]>; Jason Liu <[email protected]>; Ye Li <[email protected]>; Adrian Alonso <[email protected]>; Alison Wang <[email protected]>; tharvey at gateworks.com; Ian Ray <[email protected]>; Marcin Niestroj <[email protected]>; Andrej Rosano <[email protected]>; Marek Vasut <[email protected]>; Lukasz Majewski <[email protected]>; Adam Ford <[email protected]>; Olaf Mandel <[email protected]>; Martyn Welch <[email protected]>; Ingo Schroeck <[email protected]>; Boris Brezillon <[email protected]>; Soeren Moch <[email protected]>; Richard Hu <[email protected]>; Vanessa Maegima <[email protected]>; Max Krummenacher <[email protected]>; Stefan Agner <[email protected]>; Markus Niebel <[email protected]>; Breno Matheus Lima <[email protected]>; Francesco Montefoschi <[email protected]>; Parthiban Nallathambi <[email protected]>; Albert ARIBAUD <[email protected]>; Jagan Teki <[email protected]>; Raffaele RECALCATI <[email protected]>; Simone CIANNI <[email protected]>; Bhaskar Upadhaya <[email protected]>; Vinitha V Pillai <[email protected]>; Prabhakar Kushwaha <[email protected]>; Rajesh Bhagat <[email protected]>; Antti Mäentausta <[email protected]>; Sébastien Szymanski <[email protected]>; Lucile Quirion <[email protected]>; Alexey Brodkin <[email protected]>; Trevor Woerner <[email protected]>; Anatolij Gustschin <[email protected]>; Denis Zalevskiy <[email protected]>; Fabien Lahoudere <[email protected]>; Joe Hershberger <[email protected]>; Simon Goldschmidt <[email protected]>; James Byrne <[email protected]>; Angelo Dureghello <[email protected]>
Subject: RE: [v3, 5/5] mmc:fsl_esdhc_imx: drop useless codeQuoted 15 lines
Subject: [v3, 5/5] mmc:
fsl_esdhc_imx: drop useless codeDropped useless code for i.MX eSDHC driver.
Signed-off-by Yangbo Lu <[email protected]>---
Changes for v2:
- Added this patch.
Changes for v3:
- None.--- drivers/mmc/fsl_esdhc_imx.c | 96 ++----------------------------------- include/fsl_esdhc_imx.h | 4 -- 2 files changed, 4 insertions(+), 96 deletions(-)[.....]
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c static const struct udevice_id fsl_esdhc_ids[] = { · line 1657
Quoted 1 line
drivers/mmc/fsl_esdhc_imx.c +0
-1- { .compatible = "fsl,esdhc", },Please keep this, the following 2 dts using this compatible.
./arch/arm/dts/vf.dtsi./arch/arm/dts/imx53-ppd.dtsWith this addressed, you could have my
Reviewed-by: Peng Fan <[email protected]>
[Y.b. Lu] Ok, thanks Peng.
May I know which u-boot subtree and branch should I use to rebase these patches? Thanks!
Quoted 20 lines
Quoted 20 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0{/* sentinel */ } };include/fsl_esdhc_imx.h index renamed from include/fsl_esdhc_imx.h +0
-0
e05b24e7e8..8abd28ea50100644include/fsl_esdhc_imx.h +0
-1@@ -17,10 +17,6 @@/* needed for the mmc_cfg definition */ #include <mmc.h> -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -#include"
../board/freescale/common/qixis.h"include/fsl_esdhc_imx.h +0
-3-#endif -/* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c#define SYSCTL_INITA 0x08000000 --2.17.1
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
Quoted 25 lines
Quoted 25 lines
Quoted 16 lines
Subject: [v3, 5/5] mmc:
fsl_esdhc_imx: drop useless codeDropped useless code for i.MX eSDHC driver.
Signed-off-by Yangbo Lu <[email protected]>---
Changes for v2:
- Added this patch.
Changes for v3:
- None.--- drivers/mmc/fsl_esdhc_imx.c | 96 ++----------------------------------- include/fsl_esdhc_imx.h | 4 -- 2 files changed, 4 insertions(+), 96 deletions(-)[.....]
drivers/mmc/fsl_esdhc_imx.c static const struct udevice_id fsl_esdhc_ids[] = { · line 1657
Quoted 1 line
drivers/mmc/fsl_esdhc_imx.c +0
-1- { .compatible = "fsl,esdhc", },Please keep this, the following 2 dts using this compatible.
./arch/arm/dts/vf.dtsi./arch/arm/dts/imx53-ppd.dts
Quoted 6 lines
Quoted 2 lines
With this addressed, you could have my
Reviewed-by: Peng Fan <[email protected]>[Y.b. Lu] Ok, thanks Peng.
May I know which u-boot subtree and branch should I use to rebase these patches?
I do not see Stefano update his tree, so use Tom's tree should be fine.
Regards,
Peng.
Quoted 22 lines
Thanks!
Quoted 20 lines
Quoted 20 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0{/* sentinel */ } };include/fsl_esdhc_imx.h index renamed from include/fsl_esdhc_imx.h +0
-0
e05b24e7e8..8abd28ea50100644include/fsl_esdhc_imx.h +0
-1@@ -17,10 +17,6 @@/* needed for the mmc_cfg definition */ #include <mmc.h> -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -#include"
../board/freescale/common/qixis.h"include/fsl_esdhc_imx.h +0
-3-#endif -/* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c#define SYSCTL_INITA 0x08000000 --2.17.1
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
In reply to Y.b. LuQuoted 194 lines · On Tue, 21 May 2019 08:53:04 +0000 "Y.b. Lu" <[email protected]> wrote:
Dropped useless code for i.MX eSDHC driver.
Signed-off-by Yangbo Lu <[email protected]>---
Changes for v2:
- Added this patch.
Changes for v3:
- None.--- drivers/mmc/fsl_esdhc_imx.c | 96++-----------------------------------
include/fsl_esdhc_imx.h|
4 -- 2 files changed, 4 insertions(+), 96 deletions(-)drivers/mmc/fsl_esdhc_imx.c +1
-2@@ -259,8 +259,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, {int timeout;struct fsl_esdhc *regs = priv->esdhc_regs; -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) dma_addr_t addr;#endif uint wml_value;@@ -273,8 +272,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, esdhc_clrsetbits32(®s->wml, WML_RD_WML_MASK,
wml_value); #ifndefCONFIG_SYS_FSL_ESDHC_USE_PIOdrivers/mmc/fsl_esdhc_imx.c +1
-2-#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) ||
defined(CONFIG_IMX8M)addr =virt_to_phys((void *)(data->dest));drivers/mmc/fsl_esdhc_imx.c +2
-23if (upper_32_bits (addr))printf ("Error found for upper 32 bits\n" );@@ -310,8 +308,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, esdhc_clrsetbits32(®s->wml,WML_WR_WML_MASK , wml_value <<16 );#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M) addr = virt_to_phys((void *)(data->src)); if (upper_32_bits(addr))printf ("Error found for upper 32 bits\n" );@@ -376,8 +373,7 @@ static void check_and_invalidate_dcache_rangeunsigned end =0 ;unsigned size =roundup (ARCH_DMA_MINALIGN , data->blocks*data->blocksize); -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) dma_addr_t addr; addr =virt_to_phys ((void *)(data->dest));@@ -392,25 +388,6 @@ static void check_and_invalidate_dcache_rangeinvalidate_dcache_range (start, end); } -#ifdef CONFIG_MCF5441x -/* -* Swaps 32-bit words to little-endian byte order. -*/ -static inline void sd_swap_dma_buff (struct mmc_data *data) -{ -int i, size = data->blocksize >>2 ; -u32 *buffer = (u32 *)data->dest; -u32 sw; - -while (data->blocks--) { -for (i =0 ; i < size; i++) { - sw =__sw32 (*buffer); - *buffer++ = sw; - } - } -} -#endif -/* * Sends a command out on the bus. Takes the mmc pointer, * a command pointer, and an optional data pointer. @@ -575,9 +552,6 @@ static int esdhc_send_cmd_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc, */drivers/mmc/fsl_esdhc_imx.c +0
-3if (data->flags &MMC_DATA_READ ) {check_and_invalidate_dcache_range (cmd, data); -#ifdef CONFIG_MCF5441x -sd_swap_dma_buff (data); -#endif }#endif }@@ -1073,12 +1047,8 @@ static int esdhc_init_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc) /* Disable the BRR and BWR bits in IRQSTAT */esdhc_clrbits32(®s->irqstaten, IRQSTATEN_BRR | IRQSTATEN_BWR);drivers/mmc/fsl_esdhc_imx.c +0
-4-#ifdef CONFIG_MCF5441x -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#else /* Put the PROCTL reg back to the default */ esdhc_write32 (®s->proctl,PROCTL_INIT ); -#endif /* Set timout to the maximum value */ esdhc_clrsetbits32(®s->sysctl, SYSCTL_TIMEOUT_MASK, 14 <<16); @@ -1186,11 +1156,6 @@ static int fsl_esdhc_init(struct
fsl_esdhc_priv*priv, if (ret)drivers/mmc/fsl_esdhc_imx.c +0
-8return ret; -#ifdef CONFIG_MCF5441x -/* ColdFire, using SDHC_DATA[3] for card detection */ -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#endif -#ifndef CONFIG_FSL_USDHC esdhc_setbits32 (®s->sysctl,SYSCTL_PEREN |SYSCTL_HCKEN |SYSCTL_IPGEN |SYSCTL_CKEN );@@ -1215,15 +1180,6 @@ static int fsl_esdhc_init(structfsl_esdhc_priv *priv, voltage_caps =0 ; caps =esdhc_read32 (®s->hostcapblt); -#ifdef CONFIG_MCF5441x -/* -* MCF5441x RM declares in more points that sdhc clock speed must
drivers/mmc/fsl_esdhc_imx.c +0
-1-* never exceed 25 Mhz. From this, the HS bit needs to be disabled
drivers/mmc/fsl_esdhc_imx.c +0
-5-* from host capabilities. -*/ - caps &= ~ESDHC_HOSTCAPBLT_HSS ; -#endif -#ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC135 caps = caps & ~(ESDHC_HOSTCAPBLT_SRS | ESDHC_HOSTCAPBLT_VS18 |
ESDHC_HOSTCAPBLT_VS30); @@ -1375,45 +1331,6 @@ intfsl_esdhc_mmc_init(bd_t *bis)}
#endifdrivers/mmc/fsl_esdhc_imx.c +0
-43-#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -void mmc_adapter_card_type_ident (void ) -{ -u8 card_id; -u8 value; - - card_id =QIXIS_READ (present) &QIXIS_SDID_MASK ; - gd->arch.sdhc_adapter = card_id; - -switch (card_id) { -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC45 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_DAT4 |QIXIS_DAT5_6_7 ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SDMMC_LEGACY : - value =QIXIS_READ (pwr_ctl[1 ]); - value |=QIXIS_EVDD_BY_SDHC_VS ; -QIXIS_WRITE (pwr_ctl[1 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC44 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_SDCLKIN |QIXIS_SDCLKOUT ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_RSV : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_MMC : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SD : -break ; -case QIXIS_ESDHC_NO_ADAPTER : -break ; -default : -break ; - } -} -#endif -#ifdef CONFIG_OF_LIBFDT __weak int esdhc_status_fixup (void *blob,const char *compat) {@@ -1441,10 +1358,6 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)do_fixup_by_compat_u32 (blob, compat,"clock-frequency" , gd->arch.sdhc_clk,1 ); #endif -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -do_fixup_by_compat_u32 (blob, compat,"adapter-type" , - (u32)(gd->arch.sdhc_adapter),1 ); -#endif }#endif
drivers/mmc/fsl_esdhc_imx.c static const struct udevice_id fsl_esdhc_ids[] · line 1657
Quoted 4 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1@@ -1654,7 +1567,6 @@ static const struct udevice_id fsl_esdhc_ids[] = { { .compatible = "fsl,imx6q-usdhc", }, { .compatible = "fsl,imx7d-usdhc", .data = (ulong)&usdhc_imx7d_data,}, { .compatible = "fsl,imx7ulp-usdhc", }, - { .compatible = "fsl,esdhc", },
Please keep the above line (as Peng mentioned) - it allows re-using this driver on VF610 and i.MX53 devices.
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0{/* sentinel */ } };include/fsl_esdhc_imx.h +0
-0
include/fsl_esdhc_imx.h line 22
Quoted 10 lines
include/fsl_esdhc_imx.h +0
-4@@ -17,10 +17,6 @@/* needed for the mmc_cfg definition */ #include <mmc.h> -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -#include "../board/freescale/common/qixis.h" -#endif -/* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c#define SYSCTL_INITA 0x08000000
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190529/b69d339b/attachment.sig>
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
Quoted 240 lines
-----Original Message-----
From: Lukasz Majewski <[email protected]>
Sent: 2019年5月29日 14:43
To: Y.b. Lu <[email protected]>
Cc: u-boot at lists.denx.de; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; dl-uboot-imx <[email protected]>; Albert Aribaud <[email protected]>; Eddy Petrișor <[email protected]>; Akshay Bhat <[email protected]>; Ken Lin <[email protected]>; Heiko Schocher <[email protected]>; Christian Gmeiner <[email protected]>; Stefan Roese <[email protected]>; Patrick Bruenn <[email protected]>; Troy Kisky <[email protected]>; Uri Mashiach <[email protected]>; Nikita Kiryanov <[email protected]>; Otavio Salvador <[email protected]>; Andreas Geisreiter <[email protected]>; Ludwig Zenz <[email protected]>; Eric Bénard <[email protected]>; Peng Fan <[email protected]>; Jason Liu <[email protected]>; Ye Li <[email protected]>; Adrian Alonso <[email protected]>; Alison Wang <[email protected]>; tharvey at gateworks.com; Ian Ray <[email protected]>; Marcin Niestroj <[email protected]>; Andrej Rosano <[email protected]>; Marek Vasut <[email protected]>; Adam Ford <[email protected]>; Olaf Mandel <[email protected]>; Martyn Welch <[email protected]>; Ingo Schroeck <[email protected]>; Boris Brezillon <[email protected]>; Soeren Moch <[email protected]>; Richard Hu <[email protected]>; Vanessa Maegima <[email protected]>; Max Krummenacher <[email protected]>; Stefan Agner <[email protected]>; Markus Niebel <[email protected]>; Breno Matheus Lima <[email protected]>; Francesco Montefoschi <[email protected]>; Parthiban Nallathambi <[email protected]>; Albert ARIBAUD <[email protected]>; Jagan Teki <[email protected]>; Raffaele RECALCATI <[email protected]>; Simone CIANNI <[email protected]>; Bhaskar Upadhaya <[email protected]>; Vinitha V Pillai <[email protected]>; Prabhakar Kushwaha <[email protected]>; Rajesh Bhagat <[email protected]>; Antti Mäentausta <[email protected]>; Sébastien Szymanski <[email protected]>; Lucile Quirion <[email protected]>; Alexey Brodkin <[email protected]>; Trevor Woerner <[email protected]>; Anatolij Gustschin <[email protected]>; Denis Zalevskiy <[email protected]>; Fabien Lahoudere <[email protected]>; Joe Hershberger <[email protected]>; Simon Goldschmidt <[email protected]>; James Byrne <[email protected]>; Angelo Dureghello <[email protected]>
Subject: Re: [v3, 5/5] mmc:fsl_esdhc_imx: drop useless codeQuoted 27 lines · On Tue, 21 May 2019 08:53:04 +0000 "Y.b. Lu" <[email protected]> wrote:
Dropped useless code for i.MX eSDHC driver.
Signed-off-by Yangbo Lu <[email protected]>---
Changes for v2:
- Added this patch.
Changes for v3:
- None.--- drivers/mmc/fsl_esdhc_imx.c | 96++-----------------------------------
include/fsl_esdhc_imx.h|
4 -- 2 files changed, 4 insertions(+), 96 deletions(-)drivers/mmc/fsl_esdhc_imx.c +1
-1@@ -259,8 +259,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, {int timeout; struct fsl_esdhc *regs = priv->esdhc_regs; -#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) ||
defined(CONFIG_IMX8M)dma_addr_taddr; #endifdrivers/mmc/fsl_esdhc_imx.c +0
-0uint wml_value;drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct fsl_esdhc_priv · line 273
Quoted 2 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0@@ -273,8 +272,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,esdhc_clrsetbits32 (®s->wml,WML_RD_WML_MASK , wml_value);#ifndef
drivers/mmc/fsl_esdhc_imx.c
Quoted 7 lines
CONFIG_SYS_FSL_ESDHC_USE_PIO-#ifdefined(CONFIG_FSL_LAYERSCAPE)||defined(CONFIG_S32V234)|| \drivers/mmc/fsl_esdhc_imx.c +1
-1-defined (CONFIG_IMX8 ) ||defined (CONFIG_IMX8M ) +#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) ||
defined(CONFIG_IMX8M)addr =virt_to_phys((void *)(data->dest));drivers/mmc/fsl_esdhc_imx.c +0
-0if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -310,8 +308,7@@
Quoted 2 lines
static int esdhc_setup_data(struct
fsl_esdhc_priv*priv, struct mmc *mmc, esdhc_clrsetbits32(®s->wml,WML_WR_WML_MASK,wml_value<<
drivers/mmc/fsl_esdhc_imx.c
Quoted 7 lines
16); #ifndef
CONFIG_SYS_FSL_ESDHC_USE_PIO-#ifdefined(CONFIG_FSL_LAYERSCAPE)||defined(CONFIG_S32V234)|| \drivers/mmc/fsl_esdhc_imx.c +1
-1-defined (CONFIG_IMX8 ) ||defined (CONFIG_IMX8M ) +#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) ||
defined(CONFIG_IMX8M)addr =virt_to_phys((void *)(data->src));drivers/mmc/fsl_esdhc_imx.c +0
-0if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -376,8 +373,7@@
Quoted 48 lines
static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +1
-2unsigned end =0 ;unsigned size =roundup (ARCH_DMA_MINALIGN , data->blocks*data->blocksize); -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234) || defined(CONFIG_IMX8) ||
defined(CONFIG_IMX8M)dma_addr_taddr;addr =
virt_to_phys((void *)(data->dest)); @@ -392,25 +388,6 @@
static voidcheck_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +0
-18invalidate_dcache_range (start, end); } -#ifdef CONFIG_MCF5441x -/* -* Swaps 32-bit words to little-endian byte order. -*/ -static inline void sd_swap_dma_buff(struct mmc_data *data) -{ -int i, size = data->blocksize >>2 ; -u32 *buffer = (u32 *)data->dest; -u32 sw; - -while (data->blocks--) { -for (i =0 ; i < size; i++) { - sw =__sw32 (*buffer); - *buffer++ = sw; - } - } -} -#endif -/* * Sends a command out on the bus. Takes the mmc pointer, * a command pointer, and an optional data pointer. @@ -575,9 +552,6 @@ static int esdhc_send_cmd_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc, */drivers/mmc/fsl_esdhc_imx.c +0
-0if (data->flags &MMC_DATA_READ ) { check_and_invalidate_dcache_range(cmd, data); -#ifdef
CONFIG_MCF5441xdrivers/mmc/fsl_esdhc_imx.c +0
-2-sd_swap_dma_buff (data); -#endif }#endif }@@ -1073,12 +1047,8 @@ static int esdhc_init_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc) /* Disable the BRR and BWR bits in IRQSTAT */esdhc_clrbits32(®s->irqstaten, IRQSTATEN_BRR | IRQSTATEN_BWR); -#ifdefCONFIG_MCF5441xdrivers/mmc/fsl_esdhc_imx.c static int esdhc_init_common(struct fsl_esdhc_priv *priv, struct mmc *mmc) · line 1054
Quoted 7 lines
drivers/mmc/fsl_esdhc_imx.c +0
-2-esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#else /* Put the PROCTL reg back to the default */ esdhc_write32(®s->proctl, PROCTL_INIT); -#endif/* Set timout to the maximum value */ esdhc_clrsetbits32 (®s->sysctl,SYSCTL_TIMEOUT_MASK ,14 <<16 );@@
Quoted 84 lines
-1186,11 +1156,6 @@ static int fsl_esdhc_init(struct
fsl_esdhc_priv*priv, if (ret)drivers/mmc/fsl_esdhc_imx.c +0
-8return ret; -#ifdef CONFIG_MCF5441x -/* ColdFire, using SDHC_DATA[3] for card detection */ -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#endif -#ifndef CONFIG_FSL_USDHC esdhc_setbits32 (®s->sysctl,SYSCTL_PEREN |SYSCTL_HCKEN |SYSCTL_IPGEN |SYSCTL_CKEN );@@ -1215,15 +1180,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, voltage_caps =0 ; caps =esdhc_read32 (®s->hostcapblt); -#ifdef CONFIG_MCF5441x -/* -* MCF5441x RM declares in more points that sdhc clock speed must
drivers/mmc/fsl_esdhc_imx.c +0
-1-* never exceed 25 Mhz. From this, the HS bit needs to be disabled
drivers/mmc/fsl_esdhc_imx.c +0
-5-* from host capabilities. -*/ - caps &= ~ESDHC_HOSTCAPBLT_HSS ; -#endif -#ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC135 caps = caps & ~(ESDHC_HOSTCAPBLT_SRS | ESDHC_HOSTCAPBLT_VS18 |
ESDHC_HOSTCAPBLT_VS30); @@ -1375,45 +1331,6 @@ intfsl_esdhc_mmc_init(bd_t *bis)} #endif-#ifdef
CONFIG_FSL_ESDHC_ADAPTER_IDENT-voidmmc_adapter_card_type_ident(void)-{drivers/mmc/fsl_esdhc_imx.c +0
-41-u8 card_id; -u8 value; - - card_id =QIXIS_READ (present) &QIXIS_SDID_MASK ; - gd->arch.sdhc_adapter = card_id; - -switch (card_id) { -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC45 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_DAT4 |QIXIS_DAT5_6_7 ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SDMMC_LEGACY : - value =QIXIS_READ (pwr_ctl[1 ]); - value |=QIXIS_EVDD_BY_SDHC_VS ; -QIXIS_WRITE (pwr_ctl[1 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC44 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_SDCLKIN |QIXIS_SDCLKOUT ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_RSV : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_MMC : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SD : -break ; -case QIXIS_ESDHC_NO_ADAPTER : -break ; -default : -break ; - } -} -#endif -#ifdef CONFIG_OF_LIBFDT __weak int esdhc_status_fixup(void *blob, const char *compat) { @@ -1441,10 +1358,6 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)do_fixup_by_compat_u32 (blob, compat,"clock-frequency" , gd->arch.sdhc_clk,1 );#endif -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -do_fixup_by_compat_u32 (blob, compat,"adapter-type" , - (u32)(gd->arch.sdhc_adapter),1 ); -#endif }#endif
Quoted 9 lines
drivers/mmc/fsl_esdhc_imx.c static const struct udevice_id fsl_esdhc_ids[] = · line 1657
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1@@ -1654,7 +1567,6 @@ static const struct udevice_id fsl_esdhc_ids[] = { { .compatible = "fsl,imx6q-usdhc", }, { .compatible = "fsl,imx7d-usdhc", .data = (ulong)&usdhc_imx7d_data,}, { .compatible = "fsl,imx7ulp-usdhc", }, - { .compatible = "fsl,esdhc", },Please keep the above line (as Peng mentioned) - it allows re-using this driver on VF610 and i.MX53 devices.
[Y.b. Lu] Thanks. Will do that.
Quoted 31 lines
Quoted 12 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0{/* sentinel */ } };include/fsl_esdhc_imx.h index renamed from include/fsl_esdhc_imx.h +0
-0
e05b24e7e8..8abd28ea50100644include/fsl_esdhc_imx.h +0
-1@@ -17,10 +17,6 @@/* needed for the mmc_cfg definition */ #include <mmc.h> -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -#include"
../board/freescale/common/qixis.h"include/fsl_esdhc_imx.h line 22
Quoted 5 lines
include/fsl_esdhc_imx.h +0
-2-#endif -/* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c#define SYSCTL_INITA 0x08000000Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
lukma at denx.de
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
In reply to Y.b. LuHi Lu,
Quoted 70 lines · Y.b. Lu
Dropped useless code for i.MX eSDHC driver.
Signed-off-by Yangbo Lu <[email protected]>---
Changes for v2:
- Added this patch.
Changes for v3:
- None.--- drivers/mmc/fsl_esdhc_imx.c | 96 ++----------------------------------- include/fsl_esdhc_imx.h | 4 -- 2 files changed, 4 insertions(+), 96 deletions(-)drivers/mmc/fsl_esdhc_imx.c +4
-17@@ -259,8 +259,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, {int timeout;struct fsl_esdhc *regs = priv->esdhc_regs; -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M )dma_addr_t addr;#endif uint wml_value;@@ -273,8 +272,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,esdhc_clrsetbits32 (®s->wml,WML_RD_WML_MASK , wml_value);#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->dest));if (upper_32_bits (addr))printf ("Error found for upper 32 bits\n" );@@ -310,8 +308,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,esdhc_clrsetbits32 (®s->wml,WML_WR_WML_MASK , wml_value <<16 );#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->src));if (upper_32_bits (addr))printf ("Error found for upper 32 bits\n" );@@ -376,8 +373,7 @@ static void check_and_invalidate_dcache_rangeunsigned end =0 ;unsigned size =roundup (ARCH_DMA_MINALIGN , data->blocks*data->blocksize); -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M )dma_addr_t addr; addr =virt_to_phys ((void *)(data->dest));@@ -392,25 +388,6 @@ static void check_and_invalidate_dcache_rangeinvalidate_dcache_range (start, end); } -#ifdef CONFIG_MCF5441x -/* -* Swaps 32-bit words to little-endian byte order. -*/ -static inline void sd_swap_dma_buff (struct mmc_data *data) -{ -int i, size = data->blocksize >>2 ; -u32 *buffer = (u32 *)data->dest; -u32 sw;
drivers/mmc/fsl_esdhc_imx.c static void check_and_invalidate_dcache_range · line 413
Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c +0
-10- -while (data->blocks--) { -for (i =0 ; i < size; i++) { - sw =__sw32 (*buffer); - *buffer++ = sw; - } - } -} -#endif -
Doing so you remove the ColdFire family code (mcf5441x) i just added recently. Since they are big-endian, and dma hw has no options to swap, swap is needed.
Please don't remove it.
drivers/mmc/fsl_esdhc_imx.c static int esdhc_send_cmd_common(struct fsl_esdhc_priv *priv, struct mmc *mmc, · line 579
Quoted 9 lines
drivers/mmc/fsl_esdhc_imx.c +0
-2/* * Sends a command out on the bus. Takes the mmc pointer, * a command pointer, and an optional data pointer. @@ -575,9 +552,6 @@ static int esdhc_send_cmd_common(struct fsl_esdhc_priv *priv, struct mmc *mmc,*/ if (data->flags &MMC_DATA_READ ) {check_and_invalidate_dcache_range (cmd, data); -#ifdef CONFIG_MCF5441x -sd_swap_dma_buff (data);
Same here.
Quoted 31 lines
drivers/mmc/fsl_esdhc_imx.c +0
-10-#endif }#endif }@@ -1073,12 +1047,8 @@ static int esdhc_init_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)/* Disable the BRR and BWR bits in IRQSTAT */ esdhc_clrbits32 (®s->irqstaten,IRQSTATEN_BRR |IRQSTATEN_BWR ); -#ifdef CONFIG_MCF5441x -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#else /* Put the PROCTL reg back to the default */ esdhc_write32 (®s->proctl,PROCTL_INIT ); -#endif /* Set timout to the maximum value */ esdhc_clrsetbits32 (®s->sysctl,SYSCTL_TIMEOUT_MASK ,14 <<16 );@@ -1186,11 +1156,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,if (ret)return ret; -#ifdef CONFIG_MCF5441x -/* ColdFire, using SDHC_DATA[3] for card detection */ -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#endif -#ifndef CONFIG_FSL_USDHC esdhc_setbits32 (®s->sysctl,SYSCTL_PEREN |SYSCTL_HCKEN |SYSCTL_IPGEN |SYSCTL_CKEN );@@ -1215,15 +1180,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, voltage_caps =0 ;
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, · line 1225
Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c +0
-8caps =esdhc_read32 (®s->hostcapblt); -#ifdef CONFIG_MCF5441x -/* -* MCF5441x RM declares in more points that sdhc clock speed must -* never exceed 25 Mhz. From this, the HS bit needs to be disabled -* from host capabilities. -*/ - caps &= ~ESDHC_HOSTCAPBLT_HSS ; -#endif
Same here.
Quoted 87 lines
drivers/mmc/fsl_esdhc_imx.c +0
-45-#ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC135 caps = caps & ~(ESDHC_HOSTCAPBLT_SRS |ESDHC_HOSTCAPBLT_VS18 |ESDHC_HOSTCAPBLT_VS30 );@@ -1375,45 +1331,6 @@ int fsl_esdhc_mmc_init(bd_t *bis) }#endif -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -void mmc_adapter_card_type_ident (void ) -{ -u8 card_id; -u8 value; - - card_id =QIXIS_READ (present) &QIXIS_SDID_MASK ; - gd->arch.sdhc_adapter = card_id; - -switch (card_id) { -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC45 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_DAT4 |QIXIS_DAT5_6_7 ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SDMMC_LEGACY : - value =QIXIS_READ (pwr_ctl[1 ]); - value |=QIXIS_EVDD_BY_SDHC_VS ; -QIXIS_WRITE (pwr_ctl[1 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC44 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_SDCLKIN |QIXIS_SDCLKOUT ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_RSV : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_MMC : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SD : -break ; -case QIXIS_ESDHC_NO_ADAPTER : -break ; -default : -break ; - } -} -#endif -#ifdef CONFIG_OF_LIBFDT __weak int esdhc_status_fixup (void *blob,const char *compat) {@@ -1441,10 +1358,6 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)do_fixup_by_compat_u32 (blob, compat,"clock-frequency" , gd->arch.sdhc_clk,1 ); #endif -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -do_fixup_by_compat_u32 (blob, compat,"adapter-type" , - (u32)(gd->arch.sdhc_adapter),1 ); -#endif }#endif @@ -1654,7 +1567,6 @@ static const struct udevice_id fsl_esdhc_ids[] = { { .compatible = "fsl,imx6q-usdhc", }, { .compatible = "fsl,imx7d-usdhc", .data = (ulong)&usdhc_imx7d_data,}, { .compatible = "fsl,imx7ulp-usdhc", }, - { .compatible = "fsl,esdhc", }, { /* sentinel */ } };include/fsl_esdhc_imx.h +0
-4@@ -17,10 +17,6 @@/* needed for the mmc_cfg definition */ #include <mmc.h> -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -#include "../board/freescale/common/qixis.h" -#endif -/* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c#define SYSCTL_INITA 0x08000000Signature · 1 line
2.17.1
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
Hi,
Quoted 96 lines
Subject: Re: [v3, 5/5] mmc:
fsl_esdhc_imx: drop useless codeHi Lu,
Quoted 29 lines · Y.b. Lu
Dropped useless code for i.MX eSDHC driver.
Signed-off-by Yangbo Lu <[email protected]>---
Changes for v2:
- Added this patch.
Changes for v3:
- None.--- drivers/mmc/fsl_esdhc_imx.c | 96 ++----------------------------------- include/fsl_esdhc_imx.h | 4 -- 2 files changed, 4 insertions(+), 96 deletions(-)drivers/mmc/fsl_esdhc_imx.c +2
-1@@ -259,8 +259,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, {int timeout; struct fsl_esdhc *regs = priv->esdhc_regs; -#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \ - defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M )dma_addr_t addr;#endif uint wml_value;drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct fsl_esdhc_priv · line 274
Quoted 3 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0@@ -273,8 +272,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, esdhc_clrsetbits32(®s->wml, WML_RD_WML_MASK,
wml_value);drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct fsl_esdhc_priv
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c +2
-1#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->dest));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -310,8 +308,7@@
drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
Quoted 11 lines
static int esdhc_setup_data(struct
fsl_esdhc_priv*priv, struct mmc *mmc,drivers/mmc/fsl_esdhc_imx.c +2
-2esdhc_clrsetbits32 (®s->wml,WML_WR_WML_MASK , wml_value <<16 );#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->src));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -376,8 +373,7@@
Quoted 22 lines
static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +2
-2unsigned end =0 ;unsigned size =roundup (ARCH_DMA_MINALIGN , data->blocks*data->blocksize); -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M )dma_addr_t addr; addr = virt_to_phys((void *)(data->dest)); @@ -392,25 +388,6 @@static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +0
-8invalidate_dcache_range (start, end); } -#ifdef CONFIG_MCF5441x -/* -* Swaps 32-bit words to little-endian byte order. -*/ -static inline void sd_swap_dma_buff(struct mmc_data *data) -{ -int i, size = data->blocksize >>2 ; -u32 *buffer = (u32 *)data->dest; -u32 sw;drivers/mmc/fsl_esdhc_imx.c static void check_and_invalidate_dcache_range · line 413
Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c +0
-10- -while (data->blocks--) { -for (i =0 ; i < size; i++) { - sw =__sw32 (*buffer); - *buffer++ = sw; - } - } -} -#endif -Doing so you remove the ColdFire family code (mcf5441x) i just added recently. Since they are big-endian, and dma hw has no options to swap, swap is needed.
Quoted 1 line
Please don't remove it.
The mcf code is still in fsl_esdhc.c, this patch is to modify fsl_esdhc_imx.c.
Regards,
Peng.
Quoted 144 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_send_cmd_common(struct
Quoted 5 lines
/*
* Sends a command out on the bus. Takes the mmc pointer,
* a command pointer, and an optional data pointer.drivers/mmc/fsl_esdhc_imx.c +0
-0@@ -575,9 +552,6 @@ static int esdhc_send_cmd_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc,drivers/mmc/fsl_esdhc_imx.c static int esdhc_send_cmd_common(struct fsl_esdhc_priv *priv, struct mmc *mmc, · line 579
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0*/ if (data->flags &MMC_DATA_READ ) { check_and_invalidate_dcache_range(cmd, data); -#ifdef
CONFIG_MCF5441xdrivers/mmc/fsl_esdhc_imx.c +0
-1-sd_swap_dma_buff (data);Same here.
drivers/mmc/fsl_esdhc_imx.c static int esdhc_init_common(struct
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-#endif }#endif }@@ -1073,12 +1047,8 @@ static int esdhc_init_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc)drivers/mmc/fsl_esdhc_imx.c static int esdhc_init_common(struct fsl_esdhc_priv *priv, struct mmc *mmc) · line 1054
Quoted 11 lines
drivers/mmc/fsl_esdhc_imx.c +0
-3/* Disable the BRR and BWR bits in IRQSTAT */ esdhc_clrbits32 (®s->irqstaten,IRQSTATEN_BRR |IRQSTATEN_BWR ); -#ifdef CONFIG_MCF5441x -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#else /* Put the PROCTL reg back to the default */ esdhc_write32(®s->proctl, PROCTL_INIT); -#endif/* Set timout to the maximum value */ esdhc_clrsetbits32 (®s->sysctl,SYSCTL_TIMEOUT_MASK ,14 <<16 );@@
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv
Quoted 13 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-1186,11 +1156,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,drivers/mmc/fsl_esdhc_imx.c +0
-5if (ret)return ret; -#ifdef CONFIG_MCF5441x -/* ColdFire, using SDHC_DATA[3] for card detection */ -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#endif -#ifndef CONFIG_FSL_USDHC esdhc_setbits32 (®s->sysctl,SYSCTL_PEREN |SYSCTL_HCKEN |SYSCTL_IPGEN |SYSCTL_CKEN );@@ -1215,15 +1180,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv*priv,
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, · line 1225
Quoted 11 lines
drivers/mmc/fsl_esdhc_imx.c +0
-8voltage_caps =0 ; caps =esdhc_read32 (®s->hostcapblt); -#ifdef CONFIG_MCF5441x -/* -* MCF5441x RM declares in more points that sdhc clock speed must -* never exceed 25 Mhz. From this, the HS bit needs to be disabled -* from host capabilities. -*/ - caps &= ~ESDHC_HOSTCAPBLT_HSS ; -#endif Same here.
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
Quoted 4 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-#ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC135 caps = caps & ~(ESDHC_HOSTCAPBLT_SRS | ESDHC_HOSTCAPBLT_VS18 | ESDHC_HOSTCAPBLT_VS30); @@-1375,45
Quoted 78 lines
+1331,6 @@ int
fsl_esdhc_mmc_init(bd_t *bis)} #endif-#ifdef
CONFIG_FSL_ESDHC_ADAPTER_IDENT-voidmmc_adapter_card_type_ident(void)-{drivers/mmc/fsl_esdhc_imx.c +0
-42-u8 card_id; -u8 value; - - card_id =QIXIS_READ (present) &QIXIS_SDID_MASK ; - gd->arch.sdhc_adapter = card_id; - -switch (card_id) { -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC45 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_DAT4 |QIXIS_DAT5_6_7 ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SDMMC_LEGACY : - value =QIXIS_READ (pwr_ctl[1 ]); - value |=QIXIS_EVDD_BY_SDHC_VS ; -QIXIS_WRITE (pwr_ctl[1 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC44 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_SDCLKIN |QIXIS_SDCLKOUT ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_RSV : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_MMC : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SD : -break ; -case QIXIS_ESDHC_NO_ADAPTER : -break ; -default : -break ; - } -} -#endif -#ifdef CONFIG_OF_LIBFDT __weak int esdhc_status_fixup(void *blob, const char *compat) { @@ -1441,10 +1358,6 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)do_fixup_by_compat_u32 (blob, compat,"clock-frequency" , gd->arch.sdhc_clk,1 );#endif -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -do_fixup_by_compat_u32 (blob, compat,"adapter-type" , - (u32)(gd->arch.sdhc_adapter),1 ); -#endif }#endif @@ -1654,7 +1567,6 @@ static const struct udevice_id fsl_esdhc_ids[] = { { .compatible = "fsl,imx6q-usdhc", }, { .compatible = "fsl,imx7d-usdhc", .data = (ulong)&usdhc_imx7d_data,}, { .compatible = "fsl,imx7ulp-usdhc", }, - { .compatible = "fsl,esdhc", }, { /* sentinel */ } };include/fsl_esdhc_imx.h index renamed from include/fsl_esdhc_imx.h +0
-0
e05b24e7e8..8abd28ea50100644include/fsl_esdhc_imx.h +0
-1@@ -17,10 +17,6 @@/* needed for the mmc_cfg definition */ #include <mmc.h> -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -#include"
../board/freescale/common/qixis.h"include/fsl_esdhc_imx.h +0
-3-#endif -/* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c#define SYSCTL_INITA 0x08000000 --2.17.1
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
In reply to Angelo DureghelloHi Angelo,
Quoted 142 lines
-----Original Message-----
From: Angelo Dureghello <[email protected]>
Sent: 2019年5月31日 2:23
To: Y.b. Lu <[email protected]>
Cc: u-boot at lists.denx.de; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; dl-uboot-imx <[email protected]>; Albert Aribaud <[email protected]>; Eddy Petrișor <[email protected]>; Akshay Bhat <[email protected]>; Ken Lin <[email protected]>; Heiko Schocher <[email protected]>; Christian Gmeiner <[email protected]>; Stefan Roese <[email protected]>; Patrick Bruenn <[email protected]>; Troy Kisky <[email protected]>; Uri Mashiach <[email protected]>; Nikita Kiryanov <[email protected]>; Otavio Salvador <[email protected]>; Andreas Geisreiter <[email protected]>; Ludwig Zenz <[email protected]>; Eric Bénard <[email protected]>; Peng Fan <[email protected]>; Jason Liu <[email protected]>; Ye Li <[email protected]>; Adrian Alonso <[email protected]>; Alison Wang <[email protected]>; tharvey at gateworks.com; Ian Ray <[email protected]>; Marcin Niestroj <[email protected]>; Andrej Rosano <[email protected]>; Marek Vasut <[email protected]>; Lukasz Majewski <[email protected]>; Adam Ford <[email protected]>; Olaf Mandel <[email protected]>; Martyn Welch <[email protected]>; Ingo Schroeck <[email protected]>; Boris Brezillon <[email protected]>; Soeren Moch <[email protected]>; Richard Hu <[email protected]>; Vanessa Maegima <[email protected]>; Max Krummenacher <[email protected]>; Stefan Agner <[email protected]>; Markus Niebel <[email protected]>; Breno Matheus Lima <[email protected]>; Francesco Montefoschi <[email protected]>; Parthiban Nallathambi <[email protected]>; Albert ARIBAUD <[email protected]>; Jagan Teki <[email protected]>; Raffaele RECALCATI <[email protected]>; Simone CIANNI <[email protected]>; Bhaskar Upadhaya <[email protected]>; Vinitha V Pillai <[email protected]>; Prabhakar Kushwaha <[email protected]>; Rajesh Bhagat <[email protected]>; Antti Mäentausta <[email protected]>; Sébastien Szymanski <[email protected]>; Lucile Quirion <[email protected]>; Alexey Brodkin <[email protected]>; Trevor Woerner <[email protected]>; Anatolij Gustschin <[email protected]>; Denis Zalevskiy <[email protected]>; Fabien Lahoudere <[email protected]>; Joe Hershberger <[email protected]>; Simon Goldschmidt <[email protected]>; James Byrne <[email protected]>
Subject: Re: [v3, 5/5] mmc:fsl_esdhc_imx: drop useless codeHi Lu,
Quoted 30 lines · Y.b. Lu
Dropped useless code for i.MX eSDHC driver.
Signed-off-by Yangbo Lu <[email protected]>---
Changes for v2:
- Added this patch.
Changes for v3:
- None.--- drivers/mmc/fsl_esdhc_imx.c | 96 ++----------------------------------- include/fsl_esdhc_imx.h | 4 -- 2 files changed, 4 insertions(+), 96 deletions(-)drivers/mmc/fsl_esdhc_imx.c +2
-1@@ -259,8 +259,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, {int timeout; struct fsl_esdhc *regs = priv->esdhc_regs; -#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \ - defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M )dma_addr_t addr;#endif uint wml_value;@@ -273,8 +272,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct fsl_esdhc_priv
Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c +2
-1esdhc_clrsetbits32 (®s->wml,WML_RD_WML_MASK , wml_value); #ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->dest));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -310,8 +308,7@@
drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
Quoted 11 lines
static int esdhc_setup_data(struct
fsl_esdhc_priv*priv, struct mmc *mmc,drivers/mmc/fsl_esdhc_imx.c +2
-2esdhc_clrsetbits32 (®s->wml,WML_WR_WML_MASK , wml_value <<16 );#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->src));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -376,8 +373,7@@
Quoted 22 lines
static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +2
-2unsigned end =0 ;unsigned size =roundup (ARCH_DMA_MINALIGN , data->blocks*data->blocksize); -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M )dma_addr_t addr; addr = virt_to_phys((void *)(data->dest)); @@ -392,25 +388,6 @@static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +0
-8invalidate_dcache_range (start, end); } -#ifdef CONFIG_MCF5441x -/* -* Swaps 32-bit words to little-endian byte order. -*/ -static inline void sd_swap_dma_buff(struct mmc_data *data) -{ -int i, size = data->blocksize >>2 ; -u32 *buffer = (u32 *)data->dest; -u32 sw;drivers/mmc/fsl_esdhc_imx.c static void check_and_invalidate_dcache_range · line 413
Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c +0
-10- -while (data->blocks--) { -for (i =0 ; i < size; i++) { - sw =__sw32 (*buffer); - *buffer++ = sw; - } - } -} -#endif -Doing so you remove the ColdFire family code (mcf5441x) i just added recently. Since they are big-endian, and dma hw has no options to swap, swap is needed.
Quoted 1 line
Please don't remove it.
[Y.b. Lu] I didn’t remove mcf5441x support. The code is still in fsl_esdhc.c, but dropped in fsl_esdhc_imx.c. I'm surprised there was other platforms using eSDHC besides QorIQ and i.MX, because eSDHC is an IP of Freescale/NXP. Since I didn't know whether mcf5441x eSDHC is same with QorIQ or i.MX, I just left it in fsl_esdhc.c So, which driver should apply to mcf5441x eSDHC?
Thanks.
Quoted 144 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_send_cmd_common(struct
Quoted 5 lines
/*
* Sends a command out on the bus. Takes the mmc pointer,
* a command pointer, and an optional data pointer.drivers/mmc/fsl_esdhc_imx.c +0
-0@@ -575,9 +552,6 @@ static int esdhc_send_cmd_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc,drivers/mmc/fsl_esdhc_imx.c static int esdhc_send_cmd_common(struct fsl_esdhc_priv *priv, struct mmc *mmc, · line 579
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0*/ if (data->flags &MMC_DATA_READ ) { check_and_invalidate_dcache_range(cmd, data); -#ifdef
CONFIG_MCF5441xdrivers/mmc/fsl_esdhc_imx.c +0
-1-sd_swap_dma_buff (data);Same here.
drivers/mmc/fsl_esdhc_imx.c static int esdhc_init_common(struct
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-#endif }#endif }@@ -1073,12 +1047,8 @@ static int esdhc_init_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc)drivers/mmc/fsl_esdhc_imx.c static int esdhc_init_common(struct fsl_esdhc_priv *priv, struct mmc *mmc) · line 1054
Quoted 11 lines
drivers/mmc/fsl_esdhc_imx.c +0
-3/* Disable the BRR and BWR bits in IRQSTAT */ esdhc_clrbits32 (®s->irqstaten,IRQSTATEN_BRR |IRQSTATEN_BWR ); -#ifdef CONFIG_MCF5441x -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#else /* Put the PROCTL reg back to the default */ esdhc_write32(®s->proctl, PROCTL_INIT); -#endif/* Set timout to the maximum value */ esdhc_clrsetbits32 (®s->sysctl,SYSCTL_TIMEOUT_MASK ,14 <<16 );@@
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv
Quoted 13 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-1186,11 +1156,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,drivers/mmc/fsl_esdhc_imx.c +0
-5if (ret)return ret; -#ifdef CONFIG_MCF5441x -/* ColdFire, using SDHC_DATA[3] for card detection */ -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#endif -#ifndef CONFIG_FSL_USDHC esdhc_setbits32 (®s->sysctl,SYSCTL_PEREN |SYSCTL_HCKEN |SYSCTL_IPGEN |SYSCTL_CKEN );@@ -1215,15 +1180,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv*priv,
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, · line 1225
Quoted 11 lines
drivers/mmc/fsl_esdhc_imx.c +0
-8voltage_caps =0 ; caps =esdhc_read32 (®s->hostcapblt); -#ifdef CONFIG_MCF5441x -/* -* MCF5441x RM declares in more points that sdhc clock speed must -* never exceed 25 Mhz. From this, the HS bit needs to be disabled -* from host capabilities. -*/ - caps &= ~ESDHC_HOSTCAPBLT_HSS ; -#endif Same here.
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
Quoted 4 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-#ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC135 caps = caps & ~(ESDHC_HOSTCAPBLT_SRS | ESDHC_HOSTCAPBLT_VS18 | ESDHC_HOSTCAPBLT_VS30); @@-1375,45
Quoted 78 lines
+1331,6 @@ int
fsl_esdhc_mmc_init(bd_t *bis)} #endif-#ifdef
CONFIG_FSL_ESDHC_ADAPTER_IDENT-voidmmc_adapter_card_type_ident(void)-{drivers/mmc/fsl_esdhc_imx.c +0
-42-u8 card_id; -u8 value; - - card_id =QIXIS_READ (present) &QIXIS_SDID_MASK ; - gd->arch.sdhc_adapter = card_id; - -switch (card_id) { -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC45 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_DAT4 |QIXIS_DAT5_6_7 ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SDMMC_LEGACY : - value =QIXIS_READ (pwr_ctl[1 ]); - value |=QIXIS_EVDD_BY_SDHC_VS ; -QIXIS_WRITE (pwr_ctl[1 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC44 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_SDCLKIN |QIXIS_SDCLKOUT ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_RSV : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_MMC : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SD : -break ; -case QIXIS_ESDHC_NO_ADAPTER : -break ; -default : -break ; - } -} -#endif -#ifdef CONFIG_OF_LIBFDT __weak int esdhc_status_fixup(void *blob, const char *compat) { @@ -1441,10 +1358,6 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)do_fixup_by_compat_u32 (blob, compat,"clock-frequency" , gd->arch.sdhc_clk,1 );#endif -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -do_fixup_by_compat_u32 (blob, compat,"adapter-type" , - (u32)(gd->arch.sdhc_adapter),1 ); -#endif }#endif @@ -1654,7 +1567,6 @@ static const struct udevice_id fsl_esdhc_ids[] = { { .compatible = "fsl,imx6q-usdhc", }, { .compatible = "fsl,imx7d-usdhc", .data = (ulong)&usdhc_imx7d_data,}, { .compatible = "fsl,imx7ulp-usdhc", }, - { .compatible = "fsl,esdhc", }, { /* sentinel */ } };include/fsl_esdhc_imx.h index renamed from include/fsl_esdhc_imx.h +0
-0
e05b24e7e8..8abd28ea50100644include/fsl_esdhc_imx.h +0
-1@@ -17,10 +17,6 @@/* needed for the mmc_cfg definition */ #include <mmc.h> -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -#include"
../board/freescale/common/qixis.h"include/fsl_esdhc_imx.h +0
-3-#endif -/* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c#define SYSCTL_INITA 0x08000000 --2.17.1
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
Hi Lu,
Quoted 144 lines · Y.b. Lu
Hi Angelo,
Quoted 142 lines
-----Original Message-----
From: Angelo Dureghello <[email protected]>
Sent: 2019年5月31日 2:23
To: Y.b. Lu <[email protected]>
Cc: u-boot at lists.denx.de; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; dl-uboot-imx <[email protected]>; Albert Aribaud <[email protected]>; Eddy Petrișor <[email protected]>; Akshay Bhat <[email protected]>; Ken Lin <[email protected]>; Heiko Schocher <[email protected]>; Christian Gmeiner <[email protected]>; Stefan Roese <[email protected]>; Patrick Bruenn <[email protected]>; Troy Kisky <[email protected]>; Uri Mashiach <[email protected]>; Nikita Kiryanov <[email protected]>; Otavio Salvador <[email protected]>; Andreas Geisreiter <[email protected]>; Ludwig Zenz <[email protected]>; Eric Bénard <[email protected]>; Peng Fan <[email protected]>; Jason Liu <[email protected]>; Ye Li <[email protected]>; Adrian Alonso <[email protected]>; Alison Wang <[email protected]>; tharvey at gateworks.com; Ian Ray <[email protected]>; Marcin Niestroj <[email protected]>; Andrej Rosano <[email protected]>; Marek Vasut <[email protected]>; Lukasz Majewski <[email protected]>; Adam Ford <[email protected]>; Olaf Mandel <[email protected]>; Martyn Welch <[email protected]>; Ingo Schroeck <[email protected]>; Boris Brezillon <[email protected]>; Soeren Moch <[email protected]>; Richard Hu <[email protected]>; Vanessa Maegima <[email protected]>; Max Krummenacher <[email protected]>; Stefan Agner <[email protected]>; Markus Niebel <[email protected]>; Breno Matheus Lima <[email protected]>; Francesco Montefoschi <[email protected]>; Parthiban Nallathambi <[email protected]>; Albert ARIBAUD <[email protected]>; Jagan Teki <[email protected]>; Raffaele RECALCATI <[email protected]>; Simone CIANNI <[email protected]>; Bhaskar Upadhaya <[email protected]>; Vinitha V Pillai <[email protected]>; Prabhakar Kushwaha <[email protected]>; Rajesh Bhagat <[email protected]>; Antti Mäentausta <[email protected]>; Sébastien Szymanski <[email protected]>; Lucile Quirion <[email protected]>; Alexey Brodkin <[email protected]>; Trevor Woerner <[email protected]>; Anatolij Gustschin <[email protected]>; Denis Zalevskiy <[email protected]>; Fabien Lahoudere <[email protected]>; Joe Hershberger <[email protected]>; Simon Goldschmidt <[email protected]>; James Byrne <[email protected]>
Subject: Re: [v3, 5/5] mmc:fsl_esdhc_imx: drop useless codeHi Lu,
Quoted 30 lines · Y.b. Lu
Dropped useless code for i.MX eSDHC driver.
Signed-off-by Yangbo Lu <[email protected]>---
Changes for v2:
- Added this patch.
Changes for v3:
- None.--- drivers/mmc/fsl_esdhc_imx.c | 96 ++----------------------------------- include/fsl_esdhc_imx.h | 4 -- 2 files changed, 4 insertions(+), 96 deletions(-)drivers/mmc/fsl_esdhc_imx.c +2
-1@@ -259,8 +259,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, {int timeout; struct fsl_esdhc *regs = priv->esdhc_regs; -#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \ - defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M )dma_addr_t addr;#endif uint wml_value;@@ -273,8 +272,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct fsl_esdhc_priv
Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c +2
-1esdhc_clrsetbits32 (®s->wml,WML_RD_WML_MASK , wml_value); #ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->dest));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -310,8 +308,7@@
drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
Quoted 11 lines
static int esdhc_setup_data(struct
fsl_esdhc_priv*priv, struct mmc *mmc,drivers/mmc/fsl_esdhc_imx.c +2
-2esdhc_clrsetbits32 (®s->wml,WML_WR_WML_MASK , wml_value <<16 );#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->src));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -376,8 +373,7@@
Quoted 22 lines
static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +2
-2unsigned end =0 ;unsigned size =roundup (ARCH_DMA_MINALIGN , data->blocks*data->blocksize); -#if defined(CONFIG_FSL_LAYERSCAPE ) || defined(CONFIG_S32V234 ) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M )dma_addr_t addr; addr = virt_to_phys((void *)(data->dest)); @@ -392,25 +388,6 @@static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +0
-8invalidate_dcache_range (start, end); } -#ifdef CONFIG_MCF5441x -/* -* Swaps 32-bit words to little-endian byte order. -*/ -static inline void sd_swap_dma_buff(struct mmc_data *data) -{ -int i, size = data->blocksize >>2 ; -u32 *buffer = (u32 *)data->dest; -u32 sw;drivers/mmc/fsl_esdhc_imx.c static void check_and_invalidate_dcache_range · line 413
Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c +0
-10- -while (data->blocks--) { -for (i =0 ; i < size; i++) { - sw =__sw32 (*buffer); - *buffer++ = sw; - } - } -} -#endif -Doing so you remove the ColdFire family code (mcf5441x) i just added recently. Since they are big-endian, and dma hw has no options to swap, swap is needed.
Quoted 9 lines
Quoted 1 line
Please don't remove it.
[Y.b. Lu] I didn’t remove mcf5441x support. The code is still in
fsl_esdhc.c, but dropped infsl_esdhc_imx.c. I'm surprised there was other platforms using eSDHC besides QorIQ and i.MX, because eSDHC is an IP of Freescale/NXP. Since I didn't know whether mcf5441x eSDHC is same with QorIQ or i.MX, I just left it infsl_esdhc.cSo, which driver should apply to mcf5441x eSDHC?Thanks.
Quoted 1 line
Many thanks for clarifications, looks like i lost some detail of the patch, sorry.
Well, Freescale did some HW modules that has re-used built-in into i.MX, ColdFire and also sometimes ppc families. They are nearly the same (same register set) but with some minimal differences on some bit field. Those are i2c, dspi, edma, and as for this case, the eSDHC. You can apply ColdFire code for the i.MX driver, should be fine. Then i should be able to test that it works properly. Just see the CONFIG_MCF5441x for the needed ColdFire code. Thanks for the cleanup.
Quoted 133 lines
Quoted 133 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_send_cmd_common(struct
Quoted 4 lines
/*
* Sends a command out on the bus. Takes the mmc pointer,
* a command pointer, and an optional data pointer.drivers/mmc/fsl_esdhc_imx.c +0
-0@@ -575,9 +552,6 @@ static int esdhc_send_cmd_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc,drivers/mmc/fsl_esdhc_imx.c static int esdhc_send_cmd_common(struct fsl_esdhc_priv *priv, struct mmc *mmc, · line 579
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0*/ if (data->flags &MMC_DATA_READ ) { check_and_invalidate_dcache_range(cmd, data); -#ifdef
CONFIG_MCF5441xdrivers/mmc/fsl_esdhc_imx.c +0
-1-sd_swap_dma_buff (data);Same here.
drivers/mmc/fsl_esdhc_imx.c static int esdhc_init_common(struct
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-#endif }#endif }@@ -1073,12 +1047,8 @@ static int esdhc_init_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc)drivers/mmc/fsl_esdhc_imx.c static int esdhc_init_common(struct fsl_esdhc_priv *priv, struct mmc *mmc) · line 1054
Quoted 11 lines
drivers/mmc/fsl_esdhc_imx.c +0
-3/* Disable the BRR and BWR bits in IRQSTAT */ esdhc_clrbits32 (®s->irqstaten,IRQSTATEN_BRR |IRQSTATEN_BWR ); -#ifdef CONFIG_MCF5441x -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#else /* Put the PROCTL reg back to the default */ esdhc_write32(®s->proctl, PROCTL_INIT); -#endif/* Set timout to the maximum value */ esdhc_clrsetbits32 (®s->sysctl,SYSCTL_TIMEOUT_MASK ,14 <<16 );@@
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv
Quoted 13 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-1186,11 +1156,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,drivers/mmc/fsl_esdhc_imx.c +0
-5if (ret)return ret; -#ifdef CONFIG_MCF5441x -/* ColdFire, using SDHC_DATA[3] for card detection */ -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#endif -#ifndef CONFIG_FSL_USDHC esdhc_setbits32 (®s->sysctl,SYSCTL_PEREN |SYSCTL_HCKEN |SYSCTL_IPGEN |SYSCTL_CKEN );@@ -1215,15 +1180,6 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv*priv,
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, · line 1225
Quoted 11 lines
drivers/mmc/fsl_esdhc_imx.c +0
-8voltage_caps =0 ; caps =esdhc_read32 (®s->hostcapblt); -#ifdef CONFIG_MCF5441x -/* -* MCF5441x RM declares in more points that sdhc clock speed must -* never exceed 25 Mhz. From this, the HS bit needs to be disabled -* from host capabilities. -*/ - caps &= ~ESDHC_HOSTCAPBLT_HSS ; -#endif Same here.
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
Quoted 4 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-#ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC135 caps = caps & ~(ESDHC_HOSTCAPBLT_SRS | ESDHC_HOSTCAPBLT_VS18 | ESDHC_HOSTCAPBLT_VS30); @@-1375,45
Quoted 68 lines
+1331,6 @@ int
fsl_esdhc_mmc_init(bd_t *bis)} #endif-#ifdef
CONFIG_FSL_ESDHC_ADAPTER_IDENT-voidmmc_adapter_card_type_ident(void)-{drivers/mmc/fsl_esdhc_imx.c +0
-42-u8 card_id; -u8 value; - - card_id =QIXIS_READ (present) &QIXIS_SDID_MASK ; - gd->arch.sdhc_adapter = card_id; - -switch (card_id) { -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC45 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_DAT4 |QIXIS_DAT5_6_7 ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SDMMC_LEGACY : - value =QIXIS_READ (pwr_ctl[1 ]); - value |=QIXIS_EVDD_BY_SDHC_VS ; -QIXIS_WRITE (pwr_ctl[1 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC44 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_SDCLKIN |QIXIS_SDCLKOUT ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_RSV : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_MMC : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SD : -break ; -case QIXIS_ESDHC_NO_ADAPTER : -break ; -default : -break ; - } -} -#endif -#ifdef CONFIG_OF_LIBFDT __weak int esdhc_status_fixup(void *blob, const char *compat) { @@ -1441,10 +1358,6 @@ void fdt_fixup_esdhc(void *blob, bd_t *bd)do_fixup_by_compat_u32 (blob, compat,"clock-frequency" , gd->arch.sdhc_clk,1 );#endif -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -do_fixup_by_compat_u32 (blob, compat,"adapter-type" , - (u32)(gd->arch.sdhc_adapter),1 ); -#endif }#endif @@ -1654,7 +1567,6 @@ static const struct udevice_id fsl_esdhc_ids[] = { { .compatible = "fsl,imx6q-usdhc", }, { .compatible = "fsl,imx7d-usdhc", .data = (ulong)&usdhc_imx7d_data,}, { .compatible = "fsl,imx7ulp-usdhc", }, - { .compatible = "fsl,esdhc", }, { /* sentinel */ } };include/fsl_esdhc_imx.h index renamed from include/fsl_esdhc_imx.h +0
-0
e05b24e7e8..8abd28ea50100644include/fsl_esdhc_imx.h +0
-0@@ -17,10 +17,6 @@/* needed for the mmc_cfg definition */ #include <mmc.h>
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
include/fsl_esdhc_imx.h +0
-1-#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -#include"
../board/freescale/common/qixis.h"include/fsl_esdhc_imx.h +0
-3-#endif -/* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c#define SYSCTL_INITA 0x08000000 --2.17.1
Regards,
Angelo Dureghello
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
Hi,
Quoted 177 lines
-----Original Message-----
From: Angelo Dureghello <[email protected]>
Sent: 2019年5月31日 15:15
To: Y.b. Lu <[email protected]>
Cc: u-boot at lists.denx.de
Subject: Re: [v3, 5/5] mmc:fsl_esdhc_imx: drop useless codeHi Lu,
Quoted 10 lines · Y.b. Lu
Hi Angelo,
Quoted 8 lines
-----Original Message-----
From: Angelo Dureghello <[email protected]>
Sent: 2019年5月31日 2:23
To: Y.b. Lu <[email protected]>
Cc: u-boot at lists.denx.de; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; dl-uboot-imx <[email protected]>; Albert Aribaud <[email protected]>; Eddy Petrișor <[email protected]>; Akshay Bhat <[email protected]>;Ken
Quoted 5 lines
Quoted 5 lines
Lin <[email protected]>; Heiko Schocher <[email protected]>; Christian Gmeiner <[email protected]>; Stefan Roese <[email protected]>; Patrick Bruenn <[email protected]>; Troy Kisky <[email protected]>; Uri Mashiach <[email protected]>; Nikita Kiryanov
Quoted 8 lines
Quoted 8 lines
<[email protected]>; Otavio Salvador <[email protected]>; Andreas Geisreiter <[email protected]>; Ludwig Zenz <[email protected]>; Eric Bénard <[email protected]>; Peng Fan <[email protected]>; Jason Liu <[email protected]>; Ye Li <[email protected]>; Adrian Alonso <[email protected]>; Alison Wang <[email protected]>; tharvey at gateworks.com; Ian Ray <[email protected]>; Marcin Niestroj <[email protected]>; Andrej Rosano <[email protected]>; Marek Vasut
Quoted 3 lines
Quoted 3 lines
Lukasz Majewski <[email protected]>; Adam Ford <[email protected]>; Olaf Mandel <[email protected]>; Martyn Welch <[email protected]>; Ingo Schroeck
Quoted 7 lines
Quoted 7 lines
Boris Brezillon <[email protected]>; Soeren Moch <[email protected]>; Richard Hu <[email protected]>; Vanessa Maegima <[email protected]>; Max Krummenacher <[email protected]>; Stefan Agner <[email protected]>; Markus Niebel <[email protected]>; Breno Matheus Lima <[email protected]>; Francesco Montefoschi
Quoted 8 lines
Quoted 8 lines
<[email protected]>; Parthiban Nallathambi <[email protected]>; Albert ARIBAUD <[email protected]>; Jagan Teki <[email protected]>; Raffaele RECALCATI <[email protected]>; Simone CIANNI <[email protected]>; Bhaskar Upadhaya <[email protected]>; Vinitha V Pillai <[email protected]>; Prabhakar Kushwaha <[email protected]>; Rajesh Bhagat
Quoted 46 lines
Quoted 46 lines
Antti Mäentausta <[email protected]>; Sébastien Szymanski <[email protected]>; Lucile Quirion <[email protected]>; Alexey Brodkin <[email protected]>; Trevor Woerner <[email protected]>; Anatolij Gustschin <[email protected]>; Denis Zalevskiy <[email protected]>; Fabien Lahoudere <[email protected]>; Joe Hershberger <[email protected]>; Simon Goldschmidt <[email protected]>; James Byrne <[email protected]>
Subject: Re: [v3, 5/5] mmc:fsl_esdhc_imx: drop useless codeHi Lu,
Quoted 31 lines · Y.b. Lu
Dropped useless code for i.MX eSDHC driver.
Signed-off-by Yangbo Lu <[email protected]>---
Changes for v2:
- Added this patch.
Changes for v3:
- None.--- drivers/mmc/fsl_esdhc_imx.c | 96 ++----------------------------------- include/fsl_esdhc_imx.h | 4 -- 2 files changed, 4 insertions(+), 96 deletions(-)(quoted diff) +0
-0
b/drivers/mmc/fsl_esdhc_imx.cindexfaf133390f..1c02e0eef1100644drivers/mmc/fsl_esdhc_imx.c +2
-1@@ -259,8 +259,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, { int timeout; struct fsl_esdhc *regs = priv->esdhc_regs; -#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \ - defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M )dma_addr_t addr;#endif uint wml_value;@@ -273,8 +272,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,Quoted 1 line
Quoted 1 line
drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct · line 274
Quoted 1 line
drivers/mmc/fsl_esdhc_imx.c +0
-0esdhc_clrsetbits32(®s->wml, WML_RD_WML_MASK,
wml_value);Quoted 8 lines
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c +2
-1#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->dest));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -310,8+308,7
Quoted 2 lines
Quoted 2 lines
@@
Quoted 1 line
static int esdhc_setup_data(struct
fsl_esdhc_priv*priv, struct mmc*mmc,
Quoted 10 lines
Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0esdhc_clrsetbits32 (®s->wml,WML_WR_WML_MASK , wml_value <<16 ); #ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if
defined(CONFIG_FSL_LAYERSCAPE)||defined(CONFIG_S32V234)|| \drivers/mmc/fsl_esdhc_imx.c +2
-1-defined (CONFIG_IMX8 ) ||defined (CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->src));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -376,8+373,7
Quoted 27 lines
Quoted 27 lines
@@
Quoted 26 lines
static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +0
-0unsigned end =0 ;unsigned size =roundup (ARCH_DMA_MINALIGN , data->blocks*data->blocksize); -#if
defined(CONFIG_FSL_LAYERSCAPE)||defined(CONFIG_S32V234)|| \drivers/mmc/fsl_esdhc_imx.c +2
-1- defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M )dma_addr_t addr; addr = virt_to_phys((void *)(data->dest)); @@ -392,25 +388,6 @@static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +0
-12invalidate_dcache_range (start, end); } -#ifdef CONFIG_MCF5441x -/* -* Swaps 32-bit words to little-endian byte order. -*/ -static inline void sd_swap_dma_buff(struct mmc_data *data) -{ -int i, size = data->blocksize >>2 ; -u32 *buffer = (u32 *)data->dest; -u32 sw; - -while (data->blocks--) { -for (i =0 ; i < size; i++) { - sw =__sw32 (*buffer);Quoted 8 lines
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c static void check_and_invalidate_dcache_range · line 413
Quoted 6 lines
drivers/mmc/fsl_esdhc_imx.c +0
-6- *buffer++ = sw; - } - } -} -#endif -Doing so you remove the ColdFire family code (mcf5441x) i just added
recently.
Quoted 6 lines
Quoted 4 lines
Since they are big-endian, and dma hw has no options to swap, swap is needed.
Please don't remove it.
[Y.b. Lu] I didn’t remove mcf5441x support. The code is still in
fsl_esdhc.c,but dropped in
fsl_esdhc_imx.c.Quoted 1 line
I'm surprised there was other platforms using eSDHC besides QorIQ and i.MX,
because eSDHC is an IP of Freescale/NXP.
Quoted 5 lines
Since I didn't know whether mcf5441x eSDHC is same with QorIQ or i.MX, I just left it in
fsl_esdhc.cSo, which driver should apply to mcf5441x eSDHC?Thanks.
Quoted 1 line
Quoted 9 lines
Many thanks for clarifications, looks like i lost some detail of the patch, sorry. Well, Freescale did some HW modules that has re-used built-in into i.MX, ColdFire and also sometimes ppc families. They are nearly the same (same register set) but with some minimal differences on some bit field. Those are i2c, dspi, edma, and as for this case, the eSDHC. You can apply ColdFire code for the i.MX driver, should be fine. Then i should be able to test that it works properly. Just see the
CONFIG_MCF5441xfor the needed ColdFire code. Thanks for the cleanup.
[Y.b. Lu] I have sent out v5 patch-set with changes applying esdhc imx driver to mcf5441x. Please help to verify your platforms.
Travis-CI link for build test:
https://travis-ci.org/yangbolu1991/u-boot-test/builds/540574527
Thanks.
Quoted 156 lines
Quoted 29 lines
Quoted 29 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_send_cmd_common(struct
Quoted 4 lines
/*
* Sends a command out on the bus. Takes the mmc pointer,
* a command pointer, and an optional data pointer.drivers/mmc/fsl_esdhc_imx.c +0
-0@@ -575,9 +552,6 @@ static int esdhc_send_cmd_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc,drivers/mmc/fsl_esdhc_imx.c static int esdhc_send_cmd_common(struct fsl_esdhc_priv *priv, struct mmc *mmc, · line 579
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0*/ if (data->flags &MMC_DATA_READ ) { check_and_invalidate_dcache_range(cmd, data); -#ifdef
CONFIG_MCF5441xdrivers/mmc/fsl_esdhc_imx.c +0
-1-sd_swap_dma_buff (data);Same here.
drivers/mmc/fsl_esdhc_imx.c static int esdhc_init_common(struct
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-#endif }#endif }@@ -1073,12 +1047,8 @@ static int esdhc_init_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc)Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c +0
-3/* Disable the BRR and BWR bits in IRQSTAT */ esdhc_clrbits32 (®s->irqstaten,IRQSTATEN_BRR |IRQSTATEN_BWR ); -#ifdef CONFIG_MCF5441x -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#else /* Put the PROCTL reg back to the default */ esdhc_write32(®s->proctl, PROCTL_INIT); -#endifQuoted 5 lines
Quoted 5 lines
Quoted 3 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0/* Set timout to the maximum value */ esdhc_clrsetbits32(®s->sysctl, SYSCTL_TIMEOUT_MASK, 14 <<16);
@@
Quoted 1 line
-1186,11 +1156,6 @@ static int fsl_esdhc_init(struct
fsl_esdhc_priv*priv,
Quoted 11 lines
Quoted 11 lines
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
Quoted 11 lines
drivers/mmc/fsl_esdhc_imx.c +0
-5if (ret)return ret; -#ifdef CONFIG_MCF5441x -/* ColdFire, using SDHC_DATA[3] for card detection */ -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#endif -#ifndef CONFIG_FSL_USDHC esdhc_setbits32 (®s->sysctl,SYSCTL_PEREN |SYSCTL_HCKEN | SYSCTL_IPGEN | SYSCTL_CKEN); @@ -1215,15+1180,6 @@ static
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
int fsl_esdhc_init(struct
fsl_esdhc_priv*priv,
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
Quoted 6 lines
drivers/mmc/fsl_esdhc_imx.c +0
-3voltage_caps =0 ; caps =esdhc_read32 (®s->hostcapblt); -#ifdef CONFIG_MCF5441x -/* -* MCF5441x RM declares in more points that sdhc clock speed must
Quoted 9 lines
Quoted 9 lines
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, · line 1225
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-5-* never exceed 25 Mhz. From this, the HS bit needs to be disabled -* from host capabilities. -*/ - caps &= ~ESDHC_HOSTCAPBLT_HSS ; -#endif Same here.
Quoted 4 lines
Quoted 4 lines
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, · line 1185
Quoted 4 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-#ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC135 caps = caps & ~(ESDHC_HOSTCAPBLT_SRS |ESDHC_HOSTCAPBLT_VS18 |ESDHC_HOSTCAPBLT_VS30 );@@
Quoted 55 lines
Quoted 55 lines
-1375,45
Quoted 54 lines
+1331,6 @@ int
fsl_esdhc_mmc_init(bd_t *bis)} #endif-#ifdef
CONFIG_FSL_ESDHC_ADAPTER_IDENT-voidmmc_adapter_card_type_ident(void)-{drivers/mmc/fsl_esdhc_imx.c +0
-36-u8 card_id; -u8 value; - - card_id =QIXIS_READ (present) &QIXIS_SDID_MASK ; - gd->arch.sdhc_adapter = card_id; - -switch (card_id) { -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC45 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_DAT4 |QIXIS_DAT5_6_7 ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SDMMC_LEGACY : - value =QIXIS_READ (pwr_ctl[1 ]); - value |=QIXIS_EVDD_BY_SDHC_VS ; -QIXIS_WRITE (pwr_ctl[1 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC44 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_SDCLKIN |QIXIS_SDCLKOUT ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_RSV : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_MMC : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SD : -break ; -case QIXIS_ESDHC_NO_ADAPTER : -break ; -default : -break ; - } -} -#endif -#ifdef CONFIG_OF_LIBFDT __weak int esdhc_status_fixup (void *blob,const char *compat) {@@
-1441,10 +1358,6 @@ voidfdt_fixup_esdhc(void *blob, bd_t *bd)drivers/mmc/fsl_esdhc_imx.c +0
-4do_fixup_by_compat_u32 (blob, compat,"clock-frequency" , gd->arch.sdhc_clk,1 ); #endif -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -do_fixup_by_compat_u32 (blob, compat,"adapter-type" , - (u32)(gd->arch.sdhc_adapter),1 ); -#endif }#endif Quoted 1 line
Quoted 1 line
drivers/mmc/fsl_esdhc_imx.c static const struct udevice_id fsl_esdhc_ids[] =
Quoted 1 line
drivers/mmc/fsl_esdhc_imx.c +0
-0@@ -1654,7 +1567,6 @@ static const struct udevice_id fsl_esdhc_ids[] ={
Quoted 2 lines
Quoted 2 lines
drivers/mmc/fsl_esdhc_imx.c static const struct udevice_id fsl_esdhc_ids[] = · line 1568
Quoted 2 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0{ .compatible = "fsl,imx6q-usdhc", }, { .compatible = "fsl,imx7d-usdhc", .data =(ulong)&usdhc_imx7d_data,},
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1{ .compatible = "fsl,imx7ulp-usdhc", }, - { .compatible = "fsl,esdhc", }, {/* sentinel */ } };include/fsl_esdhc_imx.h +0
-0index
e05b24e7e8..8abd28ea50100644include/fsl_esdhc_imx.h +0
-0@@ -17,10 +17,6 @@/* needed for the mmc_cfg definition */ #include <mmc.h> Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
include/fsl_esdhc_imx.h +0
-1-#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -#include"
../board/freescale/common/qixis.h"include/fsl_esdhc_imx.h +0
-3-#endif -/* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c#define SYSCTL_INITA 0x08000000 --2.17.1
Regards,
Angelo Dureghello
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
Hi Lu,
Quoted 189 lines · Y.b. Lu
Hi,
Quoted 177 lines
-----Original Message-----
From: Angelo Dureghello <[email protected]>
Sent: 2019年5月31日 15:15
To: Y.b. Lu <[email protected]>
Cc: u-boot at lists.denx.de
Subject: Re: [v3, 5/5] mmc:fsl_esdhc_imx: drop useless codeHi Lu,
Quoted 10 lines · Y.b. Lu
Hi Angelo,
Quoted 8 lines
-----Original Message-----
From: Angelo Dureghello <[email protected]>
Sent: 2019年5月31日 2:23
To: Y.b. Lu <[email protected]>
Cc: u-boot at lists.denx.de; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; dl-uboot-imx <[email protected]>; Albert Aribaud <[email protected]>; Eddy Petrișor <[email protected]>; Akshay Bhat <[email protected]>;Ken
Quoted 5 lines
Quoted 5 lines
Lin <[email protected]>; Heiko Schocher <[email protected]>; Christian Gmeiner <[email protected]>; Stefan Roese <[email protected]>; Patrick Bruenn <[email protected]>; Troy Kisky <[email protected]>; Uri Mashiach <[email protected]>; Nikita Kiryanov
Quoted 8 lines
Quoted 8 lines
<[email protected]>; Otavio Salvador <[email protected]>; Andreas Geisreiter <[email protected]>; Ludwig Zenz <[email protected]>; Eric Bénard <[email protected]>; Peng Fan <[email protected]>; Jason Liu <[email protected]>; Ye Li <[email protected]>; Adrian Alonso <[email protected]>; Alison Wang <[email protected]>; tharvey at gateworks.com; Ian Ray <[email protected]>; Marcin Niestroj <[email protected]>; Andrej Rosano <[email protected]>; Marek Vasut
Quoted 3 lines
Quoted 3 lines
Lukasz Majewski <[email protected]>; Adam Ford <[email protected]>; Olaf Mandel <[email protected]>; Martyn Welch <[email protected]>; Ingo Schroeck
Quoted 7 lines
Quoted 7 lines
Boris Brezillon <[email protected]>; Soeren Moch <[email protected]>; Richard Hu <[email protected]>; Vanessa Maegima <[email protected]>; Max Krummenacher <[email protected]>; Stefan Agner <[email protected]>; Markus Niebel <[email protected]>; Breno Matheus Lima <[email protected]>; Francesco Montefoschi
Quoted 8 lines
Quoted 8 lines
<[email protected]>; Parthiban Nallathambi <[email protected]>; Albert ARIBAUD <[email protected]>; Jagan Teki <[email protected]>; Raffaele RECALCATI <[email protected]>; Simone CIANNI <[email protected]>; Bhaskar Upadhaya <[email protected]>; Vinitha V Pillai <[email protected]>; Prabhakar Kushwaha <[email protected]>; Rajesh Bhagat
Quoted 46 lines
Quoted 46 lines
Antti Mäentausta <[email protected]>; Sébastien Szymanski <[email protected]>; Lucile Quirion <[email protected]>; Alexey Brodkin <[email protected]>; Trevor Woerner <[email protected]>; Anatolij Gustschin <[email protected]>; Denis Zalevskiy <[email protected]>; Fabien Lahoudere <[email protected]>; Joe Hershberger <[email protected]>; Simon Goldschmidt <[email protected]>; James Byrne <[email protected]>
Subject: Re: [v3, 5/5] mmc:fsl_esdhc_imx: drop useless codeHi Lu,
Quoted 31 lines · Y.b. Lu
Dropped useless code for i.MX eSDHC driver.
Signed-off-by Yangbo Lu <[email protected]>---
Changes for v2:
- Added this patch.
Changes for v3:
- None.--- drivers/mmc/fsl_esdhc_imx.c | 96 ++----------------------------------- include/fsl_esdhc_imx.h | 4 -- 2 files changed, 4 insertions(+), 96 deletions(-)(quoted diff) +0
-0
b/drivers/mmc/fsl_esdhc_imx.cindexfaf133390f..1c02e0eef1100644drivers/mmc/fsl_esdhc_imx.c +2
-1@@ -259,8 +259,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, { int timeout; struct fsl_esdhc *regs = priv->esdhc_regs; -#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \ - defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M )dma_addr_t addr;#endif uint wml_value;@@ -273,8 +272,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,Quoted 1 line
Quoted 1 line
drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct · line 274
Quoted 1 line
drivers/mmc/fsl_esdhc_imx.c +0
-0esdhc_clrsetbits32(®s->wml, WML_RD_WML_MASK,
wml_value);Quoted 8 lines
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c +2
-1#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->dest));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -310,8+308,7
Quoted 2 lines
Quoted 2 lines
@@
Quoted 1 line
static int esdhc_setup_data(struct
fsl_esdhc_priv*priv, struct mmc*mmc,
Quoted 10 lines
Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0esdhc_clrsetbits32 (®s->wml,WML_WR_WML_MASK , wml_value <<16 ); #ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if
defined(CONFIG_FSL_LAYERSCAPE)||defined(CONFIG_S32V234)|| \drivers/mmc/fsl_esdhc_imx.c +2
-1-defined (CONFIG_IMX8 ) ||defined (CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->src));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -376,8+373,7
Quoted 27 lines
Quoted 27 lines
@@
Quoted 26 lines
static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +0
-0unsigned end =0 ;unsigned size =roundup (ARCH_DMA_MINALIGN , data->blocks*data->blocksize); -#if
defined(CONFIG_FSL_LAYERSCAPE)||defined(CONFIG_S32V234)|| \drivers/mmc/fsl_esdhc_imx.c +2
-1- defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M )dma_addr_t addr; addr = virt_to_phys((void *)(data->dest)); @@ -392,25 +388,6 @@static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +0
-12invalidate_dcache_range (start, end); } -#ifdef CONFIG_MCF5441x -/* -* Swaps 32-bit words to little-endian byte order. -*/ -static inline void sd_swap_dma_buff(struct mmc_data *data) -{ -int i, size = data->blocksize >>2 ; -u32 *buffer = (u32 *)data->dest; -u32 sw; - -while (data->blocks--) { -for (i =0 ; i < size; i++) { - sw =__sw32 (*buffer);Quoted 8 lines
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c static void check_and_invalidate_dcache_range · line 413
Quoted 6 lines
drivers/mmc/fsl_esdhc_imx.c +0
-6- *buffer++ = sw; - } - } -} -#endif -Doing so you remove the ColdFire family code (mcf5441x) i just added
recently.
Quoted 6 lines
Quoted 4 lines
Since they are big-endian, and dma hw has no options to swap, swap is needed.
Please don't remove it.
[Y.b. Lu] I didn’t remove mcf5441x support. The code is still in
fsl_esdhc.c,but dropped in
fsl_esdhc_imx.c.Quoted 1 line
I'm surprised there was other platforms using eSDHC besides QorIQ and i.MX,
because eSDHC is an IP of Freescale/NXP.
Quoted 5 lines
Since I didn't know whether mcf5441x eSDHC is same with QorIQ or i.MX, I just left it in
fsl_esdhc.cSo, which driver should apply to mcf5441x eSDHC?Thanks.
Quoted 1 line
Quoted 9 lines
Many thanks for clarifications, looks like i lost some detail of the patch, sorry. Well, Freescale did some HW modules that has re-used built-in into i.MX, ColdFire and also sometimes ppc families. They are nearly the same (same register set) but with some minimal differences on some bit field. Those are i2c, dspi, edma, and as for this case, the eSDHC. You can apply ColdFire code for the i.MX driver, should be fine. Then i should be able to test that it works properly. Just see the
CONFIG_MCF5441xfor the needed ColdFire code. Thanks for the cleanup.
Quoted 161 lines
[Y.b. Lu] I have sent out v5 patch-set with changes applying esdhc imx driver to mcf5441x. Please help to verify your platforms.
Travis-CI link for build test:
https://travis-ci.org/yangbolu1991/u-boot-test/builds/540574527Thanks.
Quoted 154 lines
Quoted 29 lines
Quoted 29 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_send_cmd_common(struct
Quoted 4 lines
/*
* Sends a command out on the bus. Takes the mmc pointer,
* a command pointer, and an optional data pointer.drivers/mmc/fsl_esdhc_imx.c +0
-0@@ -575,9 +552,6 @@ static int esdhc_send_cmd_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc,drivers/mmc/fsl_esdhc_imx.c static int esdhc_send_cmd_common(struct fsl_esdhc_priv *priv, struct mmc *mmc, · line 579
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0*/ if (data->flags &MMC_DATA_READ ) { check_and_invalidate_dcache_range(cmd, data); -#ifdef
CONFIG_MCF5441xdrivers/mmc/fsl_esdhc_imx.c +0
-1-sd_swap_dma_buff (data);Same here.
drivers/mmc/fsl_esdhc_imx.c static int esdhc_init_common(struct
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-#endif }#endif }@@ -1073,12 +1047,8 @@ static int esdhc_init_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc)Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c +0
-3/* Disable the BRR and BWR bits in IRQSTAT */ esdhc_clrbits32 (®s->irqstaten,IRQSTATEN_BRR |IRQSTATEN_BWR ); -#ifdef CONFIG_MCF5441x -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#else /* Put the PROCTL reg back to the default */ esdhc_write32(®s->proctl, PROCTL_INIT); -#endifQuoted 5 lines
Quoted 5 lines
Quoted 3 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0/* Set timout to the maximum value */ esdhc_clrsetbits32(®s->sysctl, SYSCTL_TIMEOUT_MASK, 14 <<16);
@@
Quoted 1 line
-1186,11 +1156,6 @@ static int fsl_esdhc_init(struct
fsl_esdhc_priv*priv,
Quoted 11 lines
Quoted 11 lines
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
Quoted 11 lines
drivers/mmc/fsl_esdhc_imx.c +0
-5if (ret)return ret; -#ifdef CONFIG_MCF5441x -/* ColdFire, using SDHC_DATA[3] for card detection */ -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#endif -#ifndef CONFIG_FSL_USDHC esdhc_setbits32 (®s->sysctl,SYSCTL_PEREN |SYSCTL_HCKEN | SYSCTL_IPGEN | SYSCTL_CKEN); @@ -1215,15+1180,6 @@ static
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
int fsl_esdhc_init(struct
fsl_esdhc_priv*priv,
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
Quoted 6 lines
drivers/mmc/fsl_esdhc_imx.c +0
-3voltage_caps =0 ; caps =esdhc_read32 (®s->hostcapblt); -#ifdef CONFIG_MCF5441x -/* -* MCF5441x RM declares in more points that sdhc clock speed must
Quoted 9 lines
Quoted 9 lines
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, · line 1225
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-5-* never exceed 25 Mhz. From this, the HS bit needs to be disabled -* from host capabilities. -*/ - caps &= ~ESDHC_HOSTCAPBLT_HSS ; -#endif Same here.
Quoted 4 lines
Quoted 4 lines
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, · line 1185
Quoted 4 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-#ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC135 caps = caps & ~(ESDHC_HOSTCAPBLT_SRS |ESDHC_HOSTCAPBLT_VS18 |ESDHC_HOSTCAPBLT_VS30 );@@
Quoted 55 lines
Quoted 55 lines
-1375,45
Quoted 54 lines
+1331,6 @@ int
fsl_esdhc_mmc_init(bd_t *bis)} #endif-#ifdef
CONFIG_FSL_ESDHC_ADAPTER_IDENT-voidmmc_adapter_card_type_ident(void)-{drivers/mmc/fsl_esdhc_imx.c +0
-36-u8 card_id; -u8 value; - - card_id =QIXIS_READ (present) &QIXIS_SDID_MASK ; - gd->arch.sdhc_adapter = card_id; - -switch (card_id) { -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC45 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_DAT4 |QIXIS_DAT5_6_7 ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SDMMC_LEGACY : - value =QIXIS_READ (pwr_ctl[1 ]); - value |=QIXIS_EVDD_BY_SDHC_VS ; -QIXIS_WRITE (pwr_ctl[1 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC44 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_SDCLKIN |QIXIS_SDCLKOUT ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_RSV : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_MMC : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SD : -break ; -case QIXIS_ESDHC_NO_ADAPTER : -break ; -default : -break ; - } -} -#endif -#ifdef CONFIG_OF_LIBFDT __weak int esdhc_status_fixup (void *blob,const char *compat) {@@
-1441,10 +1358,6 @@ voidfdt_fixup_esdhc(void *blob, bd_t *bd)drivers/mmc/fsl_esdhc_imx.c +0
-4do_fixup_by_compat_u32 (blob, compat,"clock-frequency" , gd->arch.sdhc_clk,1 ); #endif -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -do_fixup_by_compat_u32 (blob, compat,"adapter-type" , - (u32)(gd->arch.sdhc_adapter),1 ); -#endif }#endif Quoted 1 line
Quoted 1 line
drivers/mmc/fsl_esdhc_imx.c static const struct udevice_id fsl_esdhc_ids[] =
Quoted 1 line
drivers/mmc/fsl_esdhc_imx.c +0
-0@@ -1654,7 +1567,6 @@ static const struct udevice_id fsl_esdhc_ids[] ={
Quoted 2 lines
Quoted 2 lines
drivers/mmc/fsl_esdhc_imx.c static const struct udevice_id fsl_esdhc_ids[] = · line 1568
Quoted 2 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0{ .compatible = "fsl,imx6q-usdhc", }, { .compatible = "fsl,imx7d-usdhc", .data =(ulong)&usdhc_imx7d_data,},
Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1{ .compatible = "fsl,imx7ulp-usdhc", }, - { .compatible = "fsl,esdhc", }, {/* sentinel */ } };include/fsl_esdhc_imx.h +0
-0index
e05b24e7e8..8abd28ea50100644include/fsl_esdhc_imx.h +0
-1@@ -17,10 +17,6 @@/* needed for the mmc_cfg definition */ #include <mmc.h> -#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -#include"
../board/freescale/common/qixis.h"include/fsl_esdhc_imx.h +0
-3-#endif -/* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c#define SYSCTL_INITA 0x08000000 --2.17.1
Sorry for the late testing.
Tested, it works on ColdFire mcf54415. But please add if possible the _IMX (CONFIG_FSL_ESDHC_IMX) for the sysam/stmark2 board too.
Quoted 2 lines
Quoted 2 lines
Regards,
Angelo Dureghello
Thanks,
Regards
Angelo Dureghello
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
Hi Angelo,
Quoted 389 lines
-----Original Message-----
From: Angelo Dureghello <[email protected]>
Sent: 2019年6月23日 5:43
To: Y.b. Lu <[email protected]>
Cc: u-boot at lists.denx.de
Subject: Re: [v3, 5/5] mmc:fsl_esdhc_imx: drop useless codeHi Lu,
Quoted 20 lines · Y.b. Lu
Hi,
Quoted 18 lines
-----Original Message-----
From: Angelo Dureghello <[email protected]>
Sent: 2019年5月31日 15:15
To: Y.b. Lu <[email protected]>
Cc: u-boot at lists.denx.de
Subject: Re: [v3, 5/5] mmc:fsl_esdhc_imx: drop useless codeHi Lu,
Quoted 8 lines · Y.b. Lu
Hi Angelo,
Quoted 6 lines
-----Original Message-----
From: Angelo Dureghello <[email protected]>
Sent: 2019年5月31日 2:23
To: Y.b. Lu <[email protected]>
Cc: u-boot at lists.denx.de; Stefano Babic <[email protected]>; Fabio Estevam <[email protected]>; dl-uboot-imxQuoted 17 lines
Quoted 17 lines
Quoted 2 lines
Quoted 2 lines
Albert Aribaud <[email protected]>; Eddy Petrișor <[email protected]>; Akshay Bhat <[email protected]>;
Ken
Quoted 14 lines
Quoted 14 lines
Lin <[email protected]>; Heiko Schocher <[email protected]>; Christian Gmeiner <[email protected]>; Stefan Roese <[email protected]>; Patrick Bruenn <[email protected]>; Troy Kisky <[email protected]>; Uri Mashiach <[email protected]>; Nikita Kiryanov <[email protected]>; Otavio Salvador <[email protected]>; Andreas Geisreiter <[email protected]>; Ludwig Zenz <[email protected]>; Eric Bénard <[email protected]>; Peng Fan <[email protected]>; Jason Liu <[email protected]>; Ye Li <[email protected]>; Adrian Alonso <[email protected]>; Alison Wang <[email protected]>; tharvey at gateworks.com; Ian Ray <[email protected]>; Marcin Niestroj <[email protected]>; Andrej Rosano <[email protected]>; Marek Vasut
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Lukasz Majewski <[email protected]>; Adam Ford
Quoted 134 lines
Quoted 134 lines
Quoted 2 lines
Quoted 2 lines
Olaf Mandel <[email protected]>; Martyn Welch <[email protected]>; Ingo Schroeck
Quoted 7 lines
Quoted 7 lines
Boris Brezillon <[email protected]>; Soeren Moch <[email protected]>; Richard Hu <[email protected]>; Vanessa Maegima <[email protected]>; Max Krummenacher <[email protected]>; Stefan Agner <[email protected]>; Markus Niebel <[email protected]>; Breno Matheus Lima <[email protected]>; Francesco Montefoschi
Quoted 8 lines
Quoted 8 lines
<[email protected]>; Parthiban Nallathambi <[email protected]>; Albert ARIBAUD <[email protected]>; Jagan Teki <[email protected]>; Raffaele RECALCATI <[email protected]>; Simone CIANNI <[email protected]>; Bhaskar Upadhaya <[email protected]>; Vinitha V Pillai <[email protected]>; Prabhakar Kushwaha <[email protected]>; Rajesh Bhagat
Quoted 47 lines
Quoted 47 lines
Antti Mäentausta <[email protected]>; Sébastien Szymanski <[email protected]>; Lucile Quirion <[email protected]>; Alexey Brodkin <[email protected]>; Trevor Woerner <[email protected]>; Anatolij Gustschin <[email protected]>; Denis Zalevskiy <[email protected]>; Fabien Lahoudere <[email protected]>; Joe Hershberger <[email protected]>; Simon Goldschmidt <[email protected]>; James Byrne <[email protected]>
Subject: Re: [v3, 5/5] mmc:fsl_esdhc_imx: drop useless codeHi Lu,
Quoted 32 lines · Y.b. Lu
Dropped useless code for i.MX eSDHC driver.
Signed-off-by Yangbo Lu <[email protected]>---
Changes for v2:
- Added this patch.
Changes for v3:
- None.--- drivers/mmc/fsl_esdhc_imx.c | 96 ++----------------------------------- include/fsl_esdhc_imx.h | 4 -- 2 files changed, 4 insertions(+), 96 deletions(-)(quoted diff) +0
-0
b/drivers/mmc/fsl_esdhc_imx.cindexfaf133390f..1c02e0eef1100644drivers/mmc/fsl_esdhc_imx.c +2
-1@@ -259,8 +259,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, { int timeout; struct fsl_esdhc *regs = priv->esdhc_regs; -#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \ - defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M )dma_addr_t addr;#endif uint wml_value;@@ -273,8 +272,7 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,Quoted 1 line
Quoted 1 line
drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct · line 274
Quoted 1 line
drivers/mmc/fsl_esdhc_imx.c +0
-0esdhc_clrsetbits32(®s->wml, WML_RD_WML_MASK,
wml_value);Quoted 8 lines
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c +2
-1#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if defined(CONFIG_FSL_LAYERSCAPE) || defined(CONFIG_S32V234) || \ - defined(CONFIG_IMX8 ) || defined(CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->dest));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -310,8+308,7
Quoted 3 lines
Quoted 3 lines
@@
Quoted 2 lines
static int esdhc_setup_data(struct
fsl_esdhc_priv*priv, struct mmc*mmc,
Quoted 10 lines
Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
Quoted 10 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0esdhc_clrsetbits32 (®s->wml,WML_WR_WML_MASK , wml_value <<16 ); #ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO -#if
defined(CONFIG_FSL_LAYERSCAPE)||defined(CONFIG_S32V234)|| \drivers/mmc/fsl_esdhc_imx.c +2
-1-defined (CONFIG_IMX8 ) ||defined (CONFIG_IMX8M ) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M ) addr =virt_to_phys ((void *)(data->src));if (upper_32_bits (addr)) printf("Error found for upper 32 bits\n"); @@ -376,8+373,7
Quoted 28 lines
Quoted 28 lines
@@
Quoted 27 lines
static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +0
-0unsigned end =0 ;unsigned size =roundup (ARCH_DMA_MINALIGN , data->blocks*data->blocksize); -#if
defined(CONFIG_FSL_LAYERSCAPE)||defined(CONFIG_S32V234)|| \drivers/mmc/fsl_esdhc_imx.c +2
-1- defined(CONFIG_IMX8) || defined(CONFIG_IMX8M) +#if defined(CONFIG_S32V234 ) || defined(CONFIG_IMX8 ) || +defined(CONFIG_IMX8M )dma_addr_t addr; addr = virt_to_phys((void *)(data->dest)); @@ -392,25 +388,6@@ static void
check_and_invalidate_dcache_rangedrivers/mmc/fsl_esdhc_imx.c +0
-13invalidate_dcache_range (start, end); } -#ifdef CONFIG_MCF5441x -/* -* Swaps 32-bit words to little-endian byte order. -*/ -static inline void sd_swap_dma_buff(struct mmc_data *data) -{ -int i, size = data->blocksize >>2 ; -u32 *buffer = (u32 *)data->dest; -u32 sw; - -while (data->blocks--) { -for (i =0 ; i < size; i++) { - sw =__sw32 (*buffer); - *buffer++ = sw;Quoted 8 lines
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c static void check_and_invalidate_dcache_range · line 413
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-5- } - } -} -#endif -Doing so you remove the ColdFire family code (mcf5441x) i just added
recently.
Quoted 5 lines
Quoted 4 lines
Since they are big-endian, and dma hw has no options to swap, swap is needed.
Please don't remove it.
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
[Y.b. Lu] I didn’t remove mcf5441x support. The code is still in
fsl_esdhc.c,but dropped in
fsl_esdhc_imx.c.Quoted 2 lines
I'm surprised there was other platforms using eSDHC besides QorIQ and i.MX,
because eSDHC is an IP of Freescale/NXP.
Quoted 2 lines
Since I didn't know whether mcf5441x eSDHC is same with QorIQ or i.MX, I just left it in
fsl_esdhc.cSo, which driver should apply to mcf5441xeSDHC?
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Thanks.
Quoted 1 line
Many thanks for clarifications, looks like i lost some detail of the patch,
sorry.
Quoted 3 lines
Quoted 3 lines
Well, Freescale did some HW modules that has re-used built-in into i.MX, ColdFire and also sometimes ppc families. They are nearly the same (same register set) but with some minimal differences on some bit
field.
Quoted 7 lines
Quoted 5 lines
Those are i2c, dspi, edma, and as for this case, the eSDHC. You can apply ColdFire code for the i.MX driver, should be fine. Then i should be able to test that it works properly. Just see the
CONFIG_MCF5441xfor the needed ColdFire code. Thanks for the cleanup.[Y.b. Lu] I have sent out v5 patch-set with changes applying esdhc imx driver
to mcf5441x.
Quoted 4 lines
Please help to verify your platforms.
Travis-CI link for build test:
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftravis-ci.org%2Fyangbolu1991%2Fu-boot-test%2Fbuilds%2F540574527&dat a=0
Quoted 1 line
2%7C01%7Cyangbo.lu%40nxp.com%7Cc1ccc4bbbeb14f275f2208d6f75a8cf4% 7C686e
Quoted 1 line
a1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636968365631078109&am p;sdata=1W
Quoted 1 line
lanMwum7TfEzNHJwIKifUnYU%2Fw9%2FOeNNKI39TGRuU%3D&reserve d=0
Quoted 11 lines
Thanks.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_send_cmd_common(struct
Quoted 4 lines
/*
* Sends a command out on the bus. Takes the mmc pointer,
* a command pointer, and an optional data pointer.drivers/mmc/fsl_esdhc_imx.c +0
-0@@ -575,9 +552,6 @@ static int esdhc_send_cmd_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc,Quoted 3 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0*/ if (data->flags &MMC_DATA_READ ) {check_and_invalidate_dcache_range (cmd, data);-#ifdef
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_send_cmd_common(struct fsl_esdhc_priv *priv, struct mmc *mmc, · line 579
Quoted 2 lines
CONFIG_MCF5441xdrivers/mmc/fsl_esdhc_imx.c +0
-1-sd_swap_dma_buff (data);Same here.
drivers/mmc/fsl_esdhc_imx.c static int esdhc_init_common(struct
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-#endif }#endif }@@ -1073,12 +1047,8 @@ static int esdhc_init_common(struct
fsl_esdhc_priv*priv, struct mmc *mmc)Quoted 4 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0/* Disable the BRR and BWR bits in IRQSTAT */ esdhc_clrbits32 (®s->irqstaten,IRQSTATEN_BRR |IRQSTATEN_BWR );Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c static int esdhc_init_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)
Quoted 8 lines
drivers/mmc/fsl_esdhc_imx.c +0
-3-#ifdef CONFIG_MCF5441x -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#else /* Put the PROCTL reg back to the default */ esdhc_write32(®s->proctl, PROCTL_INIT); -#endif/* Set timout to the maximum value */ esdhc_clrsetbits32(®s->sysctl, SYSCTL_TIMEOUT_MASK, 14<<
Quoted 35 lines
Quoted 35 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
16);
@@
Quoted 2 lines
-1186,11 +1156,6 @@ static int fsl_esdhc_init(struct
fsl_esdhc_priv*priv,
Quoted 11 lines
Quoted 11 lines
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
Quoted 11 lines
drivers/mmc/fsl_esdhc_imx.c +0
-5if (ret)return ret; -#ifdef CONFIG_MCF5441x -/* ColdFire, using SDHC_DATA[3] for card detection */ -esdhc_write32 (®s->proctl,PROCTL_INIT |PROCTL_D3CD ); -#endif -#ifndef CONFIG_FSL_USDHC esdhc_setbits32 (®s->sysctl,SYSCTL_PEREN |SYSCTL_HCKEN | SYSCTL_IPGEN | SYSCTL_CKEN); @@ -1215,15+1180,6 @@ static
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
int fsl_esdhc_init(struct
fsl_esdhc_priv*priv,
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
Quoted 6 lines
drivers/mmc/fsl_esdhc_imx.c +0
-3voltage_caps =0 ; caps =esdhc_read32 (®s->hostcapblt); -#ifdef CONFIG_MCF5441x -/* -* MCF5441x RM declares in more points that sdhc clock speed must
Quoted 9 lines
Quoted 9 lines
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, · line 1225
Quoted 5 lines
drivers/mmc/fsl_esdhc_imx.c +0
-5-* never exceed 25 Mhz. From this, the HS bit needs to be disabled -* from host capabilities. -*/ - caps &= ~ESDHC_HOSTCAPBLT_HSS ; -#endif Same here.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
drivers/mmc/fsl_esdhc_imx.c static int fsl_esdhc_init(struct fsl_esdhc_priv *priv,
Quoted 4 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1-#ifdef CONFIG_SYS_FSL_ERRATUM_ESDHC135 caps = caps & ~(ESDHC_HOSTCAPBLT_SRS | ESDHC_HOSTCAPBLT_VS18 |
ESDHC_HOSTCAPBLT_VS30);Quoted 74 lines
Quoted 74 lines
@@
Quoted 54 lines
Quoted 54 lines
-1375,45
Quoted 53 lines
+1331,6 @@ int
fsl_esdhc_mmc_init(bd_t *bis)} #endif-#ifdef
CONFIG_FSL_ESDHC_ADAPTER_IDENT-voidmmc_adapter_card_type_ident(void)-{drivers/mmc/fsl_esdhc_imx.c +0
-36-u8 card_id; -u8 value; - - card_id =QIXIS_READ (present) &QIXIS_SDID_MASK ; - gd->arch.sdhc_adapter = card_id; - -switch (card_id) { -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC45 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_DAT4 |QIXIS_DAT5_6_7 ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SDMMC_LEGACY : - value =QIXIS_READ (pwr_ctl[1 ]); - value |=QIXIS_EVDD_BY_SDHC_VS ; -QIXIS_WRITE (pwr_ctl[1 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_EMMC44 : - value =QIXIS_READ (brdcfg[5 ]); - value |= (QIXIS_SDCLKIN |QIXIS_SDCLKOUT ); -QIXIS_WRITE (brdcfg[5 ], value); -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_RSV : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_MMC : -break ; -case QIXIS_ESDHC_ADAPTER_TYPE_SD : -break ; -case QIXIS_ESDHC_NO_ADAPTER : -break ; -default : -break ; - } -} -#endif -#ifdef CONFIG_OF_LIBFDT __weak int esdhc_status_fixup (void *blob,const char *compat){ @@
-1441,10 +1358,6 @@ voidfdt_fixup_esdhc(void *blob, bd_t *bd)drivers/mmc/fsl_esdhc_imx.c +0
-0do_fixup_by_compat_u32 (blob, compat,"clock-frequency" , gd->arch.sdhc_clk,1 );#endif -#ifdef
CONFIG_FSL_ESDHC_ADAPTER_IDENTdrivers/mmc/fsl_esdhc_imx.c +0
-3-do_fixup_by_compat_u32 (blob, compat,"adapter-type" , - (u32)(gd->arch.sdhc_adapter),1 ); -#endif }#endif Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0@@ -1654,7 +1567,6 @@ static const struct udevice_idfsl_esdhc_ids[] =
{
Quoted 2 lines
Quoted 2 lines
drivers/mmc/fsl_esdhc_imx.c
Quoted 2 lines
drivers/mmc/fsl_esdhc_imx.c +0
-0{ .compatible = "fsl,imx6q-usdhc", }, { .compatible = "fsl,imx7d-usdhc", .data =(ulong)&usdhc_imx7d_data,},
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
drivers/mmc/fsl_esdhc_imx.c +0
-1{ .compatible = "fsl,imx7ulp-usdhc", }, - { .compatible = "fsl,esdhc", }, {/* sentinel */ } };include/fsl_esdhc_imx.h +0
-0index
e05b24e7e8..8abd28ea50100644include/fsl_esdhc_imx.h +0
-0@@ -17,10 +17,6 @@/* needed for the mmc_cfg definition */ #include <mmc.h> Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
include/fsl_esdhc_imx.h +0
-1-#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT -#include"
../board/freescale/common/qixis.h"include/fsl_esdhc_imx.h +0
-3-#endif -/* FSL eSDHC-specific constants */ #define SYSCTL 0x0002e02c#define SYSCTL_INITA 0x08000000 --2.17.1
Quoted 4 lines
Sorry for the late testing.
Tested, it works on ColdFire mcf54415. But please add if possible the
_IMX(CONFIG_FSL_ESDHC_IMX) for the sysam/stmark2 board too.
[Y.b. Lu] Thanks a lot for your testing.
In default, CONFIG_FSL_ESDHC wasn't enabled. We can send another patch to enable CONFIG_FSL_ESDHC_IMX for ColdFire mcf54415 after this patch-set was applied.
Quoted 11 lines
Tested-by Angelo Dureghello <[email protected]>Quoted 2 lines
Quoted 2 lines
Regards,
Angelo DureghelloThanks,
Regards
Angelo Dureghello
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
Hi Lu,
-snip-
Quoted 10 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Sorry for the late testing.
Tested, it works on ColdFire mcf54415. But please add if possible the
_IMX(CONFIG_FSL_ESDHC_IMX) for the sysam/stmark2 board too.[Y.b. Lu] Thanks a lot for your testing.
In default,CONFIG_FSL_ESDHCwasn't enabled. We can send another patch to enableCONFIG_FSL_ESDHC_IMXfor ColdFire mcf54415 after this patch-set was applied.
Sorry, realized CONFIG_FSL_ESDHC was enabled only here locally. Don't worry about, sent a patch for it, in case i'll refix it later on to CONFIG_FSL_ESDHC_IMX.
Quoted 11 lines
Quoted 11 lines
Tested-by Angelo Dureghello <[email protected]>Quoted 2 lines
Quoted 2 lines
Regards,
Angelo DureghelloThanks,
Regards
Angelo Dureghello
Thanks,
Regards,
Angelo Dureghello
PATCH v3 5/5 mmc: fsl_esdhc_imx: drop useless code
In reply to Y.b. LuQuoted 7 lines · Y.b. Lu
Hi Angelo,
Quoted 5 lines
-----Original Message-----
From: Angelo Dureghello <...>
Sent: 2019年5月31日 2:23
To: Y.b. Lu <[email protected]>
Cc: ; Stefano Babic <...>; Fabio Estevam <...>
[...]
Can you please fix your mailer and stop quoting everyone's email in the body of your reply ? It only feeds the spambots and has no value. In fact, this whole "-- Original Message --" stuff quoting the headers is useless, quote only the message body.
Signature · 2 lines
Best regards, Marek Vasut
v3 cover Split fsl_esdhc driver for i.MX
In reply to Y.b. LuHi
Quoted 15 lines · Y.b. Lu
The
fsl_esdhcdriver was for Freescale eSDHC on MPC83XX/MPC85XX initially. The later QoriQ series PowerPC processors (which were evolutions of MPC83XX/MPC85XX), QorIQ series ARM processors, and i.MX series processors were using this driver for their eSDHCs too.For the two series processors, the eSDHCs are becoming more and more different. We should have split it into two drivers, like them (
sdhci-of-esdhc.c/sdhci-esdhc-imx.c) in linux kernel.It's ideal to keep common part for reusing. However, it's hard to find out a little which could be reused. The truth is there will be more and more different registers, bits and operatiing processes. Even some code is common now, it may have to be split in the future. So let's just split is as two drivers.
Quoted 11 lines
Patch #2 just created a
fsl_esdhc_imxdriver which was a copy offsl_esdhcdriver for i.MX processors.
Patch #3 converted i.MX platforms to usefsl_esdhc_imx. Patch #4 and #5 just dropped useless code for the two driver. There are still many cleaning up works needed to be done in the future,
because the eSDHC driver is mess for a long time.
Since I'm only owner for QorIQ eSDHC driver, I dropped only a little things which I'm sure forfsl_esdhc_imx. Let i.MX eSDHC owner do futhur
cleaning up.
I've tested this on the beckhoff/mx53cx9020 board. It still boots from sd after the changes. When rebasing to master this board only needs the defconfig change as we've recently removed the unused mmc code in "mx53cx9020.c".
Regards,
Steffen Dirkwinkel
Quoted 257 lines
Yangbo Lu (5):
MoveCONFIG_FSL_ESDHCto defconfig
mmc: splitfsl_esdhcdriver for i.MX
Convert to usefsl_esdhc_imxfor i.MX platforms
mmc:fsl_esdhc: drop i.MX code
mmc:fsl_esdhc_imx: drop useless codearch/arm/cpu/arm1136/mx35/generic.c | 10 +- arch/arm/cpu/arm926ejs/mx25/generic.c | 8 +- arch/arm/cpu/armv7/vf610/generic.c | 10 +- arch/arm/cpu/armv8/s32v234/generic.c | 2 +- arch/arm/include/asm/global_data.h | 2 +- arch/arm/mach-imx/cpu.c | 6 +- arch/arm/mach-imx/mx6/litesom.c | 4 +- arch/arm/mach-imx/mx7/clock.c | 4 +- arch/arm/mach-imx/mx7ulp/clock.c | 2 +- arch/arm/mach-imx/speed.c | 4 +- board/advantech/dms-ba16/dms-ba16.c | 4 +- board/aristainetos/aristainetos-v1.c | 2 +- board/aristainetos/aristainetos-v2.c | 2 +- board/aristainetos/aristainetos.c | 4 +- board/bachmann/ot1200/ot1200.c | 2 +- board/barco/platinum/platinum.c | 2 +- board/barco/titanium/titanium.c | 4 +- board/beckhoff/mx53cx9020/mx53cx9020.c | 4 +- board/boundary/nitrogen6x/nitrogen6x.c | 4 +- board/ccv/xpress/xpress.c | 2 +- board/compulab/cl-som-imx7/cl-som-imx7.c | 6 +- board/compulab/cl-som-imx7/common.c | 6 +- board/compulab/cl-som-imx7/common.h | 8 +- board/compulab/cl-som-imx7/mux.c | 8 +- board/compulab/cl-som-imx7/spl.c | 6 +- board/compulab/cm_fx6/cm_fx6.c | 4 +- board/compulab/cm_fx6/common.c | 4 +- board/compulab/cm_fx6/spl.c | 2 +- board/congatec/cgtqmx6eval/cgtqmx6eval.c | 4 +- board/dhelectronics/dh_imx6/dh_imx6.c | 4 +- board/dhelectronics/dh_imx6/dh_imx6_spl.c | 2 +- board/el/el6x/el6x.c | 4 +- board/embest/mx6boards/mx6boards.c | 4 +- board/freescale/imx8mq_evk/imx8mq_evk.c | 2 +- board/freescale/imx8mq_evk/spl.c | 2 +- board/freescale/imx8qxp_mek/imx8qxp_mek.c | 2 +- board/freescale/mx25pdk/mx25pdk.c | 6 +- board/freescale/mx35pdk/mx35pdk.c | 4 +- board/freescale/mx51evk/mx51evk.c | 6 +- board/freescale/mx53ard/mx53ard.c | 4 +- board/freescale/mx53evk/mx53evk.c | 4 +- board/freescale/mx53loco/mx53loco.c | 4 +- board/freescale/mx53smd/mx53smd.c | 4 +- board/freescale/mx6qarm2/mx6qarm2.c | 4 +- board/freescale/mx6sabreauto/mx6sabreauto.c | 4 +- board/freescale/mx6sabresd/mx6sabresd.c | 4 +- board/freescale/mx6slevk/mx6slevk.c | 2 +- .../freescale/mx6sxsabreauto/mx6sxsabreauto.c | 2 +- board/freescale/mx6sxsabresd/mx6sxsabresd.c | 2 +- .../mx6ul_14x14_evk/mx6ul_14x14_evk.c | 4 +- board/freescale/mx6ullevk/mx6ullevk.c | 2 +- board/freescale/mx7dsabresd/mx7dsabresd.c | 2 +- board/freescale/s32v234evb/s32v234evb.c | 4 +- board/freescale/vf610twr/vf610twr.c | 4 +- board/gateworks/gw_ventana/common.c | 6 +- board/gateworks/gw_ventana/gw_ventana.c | 2 +- board/ge/bx50v3/bx50v3.c | 2 +- board/ge/mx53ppd/mx53ppd.c | 2 +- board/grinn/liteboard/board.c | 4 +- board/inversepath/usbarmory/usbarmory.c | 2 +- board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c | 4 +- board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c | 2 +- board/kosagi/novena/novena.c | 4 +- board/kosagi/novena/novena_spl.c | 6 +- board/liebherr/display5/common.c | 2 +- board/liebherr/display5/display5.c | 6 +- board/liebherr/display5/spl.c | 2 +- board/liebherr/mccmon6/mccmon6.c | 2 +- board/liebherr/mccmon6/spl.c | 2 +- board/logicpd/imx6/imx6logic.c | 4 +- board/menlo/m53menlo/m53menlo.c | 4 +- board/phytec/pcl063/pcl063.c | 2 +- board/phytec/pcl063/spl.c | 6 +- board/phytec/pcm058/pcm058.c | 2 +- board/phytec/pfla02/pfla02.c | 2 +- board/samtec/vining_2000/vining_2000.c | 2 +- board/seco/common/mx6.c | 2 +- board/seco/mx6quq7/mx6quq7.c | 2 +- board/sks-kinkel/sksimx6/sksimx6.c | 2 +- board/solidrun/mx6cuboxi/mx6cuboxi.c | 2 +- board/tbs/tbs2910/tbs2910.c | 6 +- board/technexion/pico-imx6ul/spl.c | 2 +- board/technexion/pico-imx7d/spl.c | 2 +- board/technologic/ts4800/ts4800.c | 6 +- board/toradex/apalis_imx6/apalis_imx6.c | 6 +- board/toradex/colibri_imx6/colibri_imx6.c | 6 +- board/toradex/colibri_imx7/colibri_imx7.c | 2 +- board/tqc/tqma6/tqma6.c | 2 +- board/tqc/tqma6/tqma6_mba6.c | 2 +- board/tqc/tqma6/tqma6_wru4.c | 2 +- board/udoo/neo/neo.c | 2 +- board/udoo/udoo.c | 2 +- board/udoo/udoo_spl.c | 2 +- board/variscite/dart_6ul/dart_6ul.c | 2 +- board/variscite/dart_6ul/spl.c | 2 +- board/wandboard/spl.c | 2 +- board/warp/warp.c | 2 +- board/woodburn/woodburn.c | 4 +- configs/apalis_imx6_defconfig | 2 +- configs/aristainetos2_defconfig | 2 +- configs/aristainetos2b_defconfig | 2 +- configs/aristainetos_defconfig | 2 +- configs/bk4r1_defconfig | 2 +- configs/cgtqmx6eval_defconfig | 2 +- configs/cl-som-imx7_defconfig | 2 +- configs/cm_fx6_defconfig | 2 +- configs/colibri-imx6ull_defconfig | 2 +- configs/colibri_imx6_defconfig | 2 +- configs/colibri_imx7_defconfig | 2 +- configs/colibri_imx7_emmc_defconfig | 2 +- configs/colibri_vf_defconfig | 2 +- configs/dh_imx6_defconfig | 2 +- configs/display5_defconfig | 2 +- configs/display5_factory_defconfig | 2 +- configs/dms-ba16-1g_defconfig | 2 +- configs/dms-ba16_defconfig | 2 +- configs/ge_bx50v3_defconfig | 2 +- configs/gwventana_emmc_defconfig | 2 +- configs/gwventana_gw5904_defconfig | 2 +- configs/gwventana_nand_defconfig | 2 +- configs/imx6dl_icore_nand_defconfig | 2 +- configs/imx6dl_mamoj_defconfig | 2 +- configs/imx6q_icore_nand_defconfig | 2 +- configs/imx6q_logic_defconfig | 2 +- configs/imx6qdl_icore_mipi_defconfig | 2 +- configs/imx6qdl_icore_mmc_defconfig | 2 +- configs/imx6qdl_icore_nand_defconfig | 2 +- configs/imx6qdl_icore_rqs_defconfig | 2 +- configs/imx6ul_geam_mmc_defconfig | 2 +- configs/imx6ul_geam_nand_defconfig | 2 +- configs/imx6ul_isiot_emmc_defconfig | 2 +- configs/imx6ul_isiot_nand_defconfig | 2 +- configs/imx8mq_evk_defconfig | 1 + configs/imx8qm_mek_defconfig | 1 + configs/imx8qxp_mek_defconfig | 1 + configs/kp_imx53_defconfig | 2 +- configs/kp_imx6q_tpc_defconfig | 1 + configs/liteboard_defconfig | 2 +- .../ls1012afrwy_qspi_SECURE_BOOT_defconfig | 1 + configs/ls1012afrwy_qspi_defconfig | 1 + configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig | 1 + configs/ls1012afrwy_tfa_defconfig | 1 + configs/m53menlo_defconfig | 2 +- configs/marsboard_defconfig | 2 +- configs/mccmon6_nor_defconfig | 2 +- configs/mccmon6_sd_defconfig | 2 +- configs/mx25pdk_defconfig | 2 +- configs/mx35pdk_defconfig | 2 +- configs/mx51evk_defconfig | 2 +- configs/mx53ard_defconfig | 2 +- configs/mx53cx9020_defconfig | 2 +- configs/mx53evk_defconfig | 2 +- configs/mx53loco_defconfig | 2 +- configs/mx53ppd_defconfig | 2 +- configs/mx53smd_defconfig | 2 +- configs/mx6cuboxi_defconfig | 2 +- configs/mx6dlarm2_defconfig | 2 +- configs/mx6dlarm2_lpddr2_defconfig | 2 +- configs/mx6qarm2_defconfig | 2 +- configs/mx6qarm2_lpddr2_defconfig | 2 +- configs/mx6qsabrelite_defconfig | 2 +- configs/mx6sabreauto_defconfig | 2 +- configs/mx6sabresd_defconfig | 2 +- configs/mx6slevk_defconfig | 2 +- configs/mx6slevk_spinor_defconfig | 2 +- configs/mx6slevk_spl_defconfig | 2 +- configs/mx6sllevk_defconfig | 2 +- configs/mx6sllevk_plugin_defconfig | 2 +- configs/mx6sxsabreauto_defconfig | 2 +- configs/mx6sxsabresd_defconfig | 2 +- configs/mx6sxsabresd_spl_defconfig | 2 +- configs/mx6ul_14x14_evk_defconfig | 2 +- configs/mx6ul_9x9_evk_defconfig | 2 +- configs/mx6ull_14x14_evk_defconfig | 2 +- configs/mx6ull_14x14_evk_plugin_defconfig | 2 +- configs/mx7dsabresd_defconfig | 2 +- configs/mx7dsabresd_qspi_defconfig | 2 +- configs/mx7ulp_evk_defconfig | 2 +- configs/mx7ulp_evk_plugin_defconfig | 2 +- configs/nitrogen6dl2g_defconfig | 2 +- configs/nitrogen6dl_defconfig | 2 +- configs/nitrogen6q2g_defconfig | 2 +- configs/nitrogen6q_defconfig | 2 +- configs/nitrogen6s1g_defconfig | 2 +- configs/nitrogen6s_defconfig | 2 +- configs/novena_defconfig | 2 +- configs/opos6uldev_defconfig | 2 +- configs/ot1200_defconfig | 2 +- configs/ot1200_spl_defconfig | 2 +- configs/pcm052_defconfig | 2 +- configs/pcm058_defconfig | 2 +- configs/pfla02_defconfig | 2 +- configs/phycore_pcl063_defconfig | 2 +- configs/pico-hobbit-imx6ul_defconfig | 2 +- configs/pico-hobbit-imx7d_defconfig | 2 +- configs/pico-imx6ul_defconfig | 2 +- configs/pico-imx7d_defconfig | 2 +- configs/pico-pi-imx6ul_defconfig | 2 +- configs/pico-pi-imx7d_defconfig | 2 +- configs/platinum_picon_defconfig | 2 +- configs/platinum_titanium_defconfig | 2 +- configs/riotboard_defconfig | 2 +- configs/riotboard_spl_defconfig | 2 +- configs/s32v234evb_defconfig | 2 +- configs/secomx6quq7_defconfig | 2 +- configs/sksimx6_defconfig | 2 +- configs/tbs2910_defconfig | 2 +- configs/titanium_defconfig | 2 +- configs/tqma6dl_mba6_mmc_defconfig | 2 +- configs/tqma6dl_mba6_spi_defconfig | 2 +- configs/tqma6q_mba6_mmc_defconfig | 2 +- configs/tqma6q_mba6_spi_defconfig | 2 +- configs/tqma6s_mba6_mmc_defconfig | 2 +- configs/tqma6s_mba6_spi_defconfig | 2 +- configs/tqma6s_wru4_mmc_defconfig | 2 +- configs/ts4800_defconfig | 2 +- configs/udoo_defconfig | 2 +- configs/udoo_neo_defconfig | 2 +- configs/usbarmory_defconfig | 2 +- configs/variscite_dart6ul_defconfig | 2 +- configs/vf610twr_defconfig | 2 +- configs/vf610twr_nand_defconfig | 2 +- configs/vining_2000_defconfig | 2 +- configs/wandboard_defconfig | 2 +- configs/warp7_bl33_defconfig | 2 +- configs/warp7_defconfig | 2 +- configs/warp_defconfig | 2 +- configs/woodburn_defconfig | 2 +- configs/woodburn_sd_defconfig | 2 +- configs/xpress_defconfig | 2 +- configs/xpress_spl_defconfig | 2 +- configs/zc5202_defconfig | 2 +- configs/zc5601_defconfig | 2 +- drivers/mmc/Kconfig | 6 + drivers/mmc/Makefile | 1 + drivers/mmc/fsl_esdhc.c | 609 +--------------- -- drivers/mmc/{fsl_esdhc.c => fsl_esdhc_imx.c} | 101 +-- include/configs/imx8mq_evk.h | 1 - include/configs/imx8qm_mek.h | 1 - include/configs/imx8qxp_mek.h | 1 - include/configs/kp_imx6q_tpc.h | 1 - include/configs/ls1012afrwy.h | 1 - include/fsl_esdhc.h | 57 -- include/{fsl_esdhc.h => fsl_esdhc_imx.h} | 15 +- 244 files changed, 350 insertions(+), 1054 deletions(-) copy drivers/mmc/{fsl_esdhc.c => fsl_esdhc_imx.c} (94%) copy include/{fsl_esdhc.h => fsl_esdhc_imx.h} (97%)
v3 cover Split fsl_esdhc driver for i.MX
Hi
Quoted 30 lines
Hi
Quoted 15 lines · Y.b. Lu
The
fsl_esdhcdriver was for Freescale eSDHC on MPC83XX/MPC85XX initially. The later QoriQ series PowerPC processors (which were evolutions of MPC83XX/MPC85XX), QorIQ series ARM processors, and i.MX series processors were using this driver for their eSDHCs too.For the two series processors, the eSDHCs are becoming more and more different. We should have split it into two drivers, like them (
sdhci-of-esdhc.c/sdhci-esdhc-imx.c) in linux kernel.It's ideal to keep common part for reusing. However, it's hard to find out a little which could be reused. The truth is there will be more and more different registers, bits and operatiing processes. Even some code is common now, it may have to be split in the future. So let's just split is as two drivers.
Quoted 11 lines
Patch #2 just created a
fsl_esdhc_imxdriver which was a copy offsl_esdhcdriver for i.MX processors.
Patch #3 converted i.MX platforms to usefsl_esdhc_imx. Patch #4 and #5 just dropped useless code for the two driver. There are still many cleaning up works needed to be done in the future,
because the eSDHC driver is mess for a long time.
Since I'm only owner for QorIQ eSDHC driver, I dropped only a little things which I'm sure forfsl_esdhc_imx. Let i.MX eSDHC owner do futhur
cleaning up.
Quoted 7 lines
Tested-by Steffen Dirkwinkel s.dirkwinkel at beckhoff.comI've tested this on the beckhoff/mx53cx9020 board. It still boots from sd after the changes. When rebasing to master this board only needs the defconfig change as we've recently removed the unused mmc code in "
mx53cx9020.c".
Thanks for testing. I will strive to provide review soon.
Quoted 260 lines
Regards,
Steffen DirkwinkelQuoted 248 lines
Yangbo Lu (5):
MoveCONFIG_FSL_ESDHCto defconfig
mmc: splitfsl_esdhcdriver for i.MX
Convert to usefsl_esdhc_imxfor i.MX platforms
mmc:fsl_esdhc: drop i.MX code
mmc:fsl_esdhc_imx: drop useless codearch/arm/cpu/arm1136/mx35/generic.c | 10 +- arch/arm/cpu/arm926ejs/mx25/generic.c | 8 +- arch/arm/cpu/armv7/vf610/generic.c | 10 +- arch/arm/cpu/armv8/s32v234/generic.c | 2 +- arch/arm/include/asm/global_data.h | 2 +- arch/arm/mach-imx/cpu.c | 6 +- arch/arm/mach-imx/mx6/litesom.c | 4 +- arch/arm/mach-imx/mx7/clock.c | 4 +- arch/arm/mach-imx/mx7ulp/clock.c | 2 +- arch/arm/mach-imx/speed.c | 4 +- board/advantech/dms-ba16/dms-ba16.c | 4 +- board/aristainetos/aristainetos-v1.c | 2 +- board/aristainetos/aristainetos-v2.c | 2 +- board/aristainetos/aristainetos.c | 4 +- board/bachmann/ot1200/ot1200.c | 2 +- board/barco/platinum/platinum.c | 2 +- board/barco/titanium/titanium.c | 4 +- board/beckhoff/mx53cx9020/mx53cx9020.c | 4 +- board/boundary/nitrogen6x/nitrogen6x.c | 4 +- board/ccv/xpress/xpress.c | 2 +- board/compulab/cl-som-imx7/cl-som-imx7.c | 6 +- board/compulab/cl-som-imx7/common.c | 6 +- board/compulab/cl-som-imx7/common.h | 8 +- board/compulab/cl-som-imx7/mux.c | 8 +- board/compulab/cl-som-imx7/spl.c | 6 +- board/compulab/cm_fx6/cm_fx6.c | 4 +- board/compulab/cm_fx6/common.c | 4 +- board/compulab/cm_fx6/spl.c | 2 +- board/congatec/cgtqmx6eval/cgtqmx6eval.c | 4 +- board/dhelectronics/dh_imx6/dh_imx6.c | 4 +- board/dhelectronics/dh_imx6/dh_imx6_spl.c | 2 +- board/el/el6x/el6x.c | 4 +- board/embest/mx6boards/mx6boards.c | 4 +- board/freescale/imx8mq_evk/imx8mq_evk.c | 2 +- board/freescale/imx8mq_evk/spl.c | 2 +- board/freescale/imx8qxp_mek/imx8qxp_mek.c | 2 +- board/freescale/mx25pdk/mx25pdk.c | 6 +- board/freescale/mx35pdk/mx35pdk.c | 4 +- board/freescale/mx51evk/mx51evk.c | 6 +- board/freescale/mx53ard/mx53ard.c | 4 +- board/freescale/mx53evk/mx53evk.c | 4 +- board/freescale/mx53loco/mx53loco.c | 4 +- board/freescale/mx53smd/mx53smd.c | 4 +- board/freescale/mx6qarm2/mx6qarm2.c | 4 +- board/freescale/mx6sabreauto/mx6sabreauto.c | 4 +- board/freescale/mx6sabresd/mx6sabresd.c | 4 +- board/freescale/mx6slevk/mx6slevk.c | 2 +- .../freescale/mx6sxsabreauto/mx6sxsabreauto.c | 2 +- board/freescale/mx6sxsabresd/mx6sxsabresd.c | 2 +- .../mx6ul_14x14_evk/mx6ul_14x14_evk.c | 4 +- board/freescale/mx6ullevk/mx6ullevk.c | 2 +- board/freescale/mx7dsabresd/mx7dsabresd.c | 2 +- board/freescale/s32v234evb/s32v234evb.c | 4 +- board/freescale/vf610twr/vf610twr.c | 4 +- board/gateworks/gw_ventana/common.c | 6 +- board/gateworks/gw_ventana/gw_ventana.c | 2 +- board/ge/bx50v3/bx50v3.c | 2 +- board/ge/mx53ppd/mx53ppd.c | 2 +- board/grinn/liteboard/board.c | 4 +- board/inversepath/usbarmory/usbarmory.c | 2 +- board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c | 4 +- board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c | 2 +- board/kosagi/novena/novena.c | 4 +- board/kosagi/novena/novena_spl.c | 6 +- board/liebherr/display5/common.c | 2 +- board/liebherr/display5/display5.c | 6 +- board/liebherr/display5/spl.c | 2 +- board/liebherr/mccmon6/mccmon6.c | 2 +- board/liebherr/mccmon6/spl.c | 2 +- board/logicpd/imx6/imx6logic.c | 4 +- board/menlo/m53menlo/m53menlo.c | 4 +- board/phytec/pcl063/pcl063.c | 2 +- board/phytec/pcl063/spl.c | 6 +- board/phytec/pcm058/pcm058.c | 2 +- board/phytec/pfla02/pfla02.c | 2 +- board/samtec/vining_2000/vining_2000.c | 2 +- board/seco/common/mx6.c | 2 +- board/seco/mx6quq7/mx6quq7.c | 2 +- board/sks-kinkel/sksimx6/sksimx6.c | 2 +- board/solidrun/mx6cuboxi/mx6cuboxi.c | 2 +- board/tbs/tbs2910/tbs2910.c | 6 +- board/technexion/pico-imx6ul/spl.c | 2 +- board/technexion/pico-imx7d/spl.c | 2 +- board/technologic/ts4800/ts4800.c | 6 +- board/toradex/apalis_imx6/apalis_imx6.c | 6 +- board/toradex/colibri_imx6/colibri_imx6.c | 6 +- board/toradex/colibri_imx7/colibri_imx7.c | 2 +- board/tqc/tqma6/tqma6.c | 2 +- board/tqc/tqma6/tqma6_mba6.c | 2 +- board/tqc/tqma6/tqma6_wru4.c | 2 +- board/udoo/neo/neo.c | 2 +- board/udoo/udoo.c | 2 +- board/udoo/udoo_spl.c | 2 +- board/variscite/dart_6ul/dart_6ul.c | 2 +- board/variscite/dart_6ul/spl.c | 2 +- board/wandboard/spl.c | 2 +- board/warp/warp.c | 2 +- board/woodburn/woodburn.c | 4 +- configs/apalis_imx6_defconfig | 2 +- configs/aristainetos2_defconfig | 2 +- configs/aristainetos2b_defconfig | 2 +- configs/aristainetos_defconfig | 2 +- configs/bk4r1_defconfig | 2 +- configs/cgtqmx6eval_defconfig | 2 +- configs/cl-som-imx7_defconfig | 2 +- configs/cm_fx6_defconfig | 2 +- configs/colibri-imx6ull_defconfig | 2 +- configs/colibri_imx6_defconfig | 2 +- configs/colibri_imx7_defconfig | 2 +- configs/colibri_imx7_emmc_defconfig | 2 +- configs/colibri_vf_defconfig | 2 +- configs/dh_imx6_defconfig | 2 +- configs/display5_defconfig | 2 +- configs/display5_factory_defconfig | 2 +- configs/dms-ba16-1g_defconfig | 2 +- configs/dms-ba16_defconfig | 2 +- configs/ge_bx50v3_defconfig | 2 +- configs/gwventana_emmc_defconfig | 2 +- configs/gwventana_gw5904_defconfig | 2 +- configs/gwventana_nand_defconfig | 2 +- configs/imx6dl_icore_nand_defconfig | 2 +- configs/imx6dl_mamoj_defconfig | 2 +- configs/imx6q_icore_nand_defconfig | 2 +- configs/imx6q_logic_defconfig | 2 +- configs/imx6qdl_icore_mipi_defconfig | 2 +- configs/imx6qdl_icore_mmc_defconfig | 2 +- configs/imx6qdl_icore_nand_defconfig | 2 +- configs/imx6qdl_icore_rqs_defconfig | 2 +- configs/imx6ul_geam_mmc_defconfig | 2 +- configs/imx6ul_geam_nand_defconfig | 2 +- configs/imx6ul_isiot_emmc_defconfig | 2 +- configs/imx6ul_isiot_nand_defconfig | 2 +- configs/imx8mq_evk_defconfig | 1 + configs/imx8qm_mek_defconfig | 1 + configs/imx8qxp_mek_defconfig | 1 + configs/kp_imx53_defconfig | 2 +- configs/kp_imx6q_tpc_defconfig | 1 + configs/liteboard_defconfig | 2 +- .../ls1012afrwy_qspi_SECURE_BOOT_defconfig | 1 + configs/ls1012afrwy_qspi_defconfig | 1 + configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig | 1 + configs/ls1012afrwy_tfa_defconfig | 1 + configs/m53menlo_defconfig | 2 +- configs/marsboard_defconfig | 2 +- configs/mccmon6_nor_defconfig | 2 +- configs/mccmon6_sd_defconfig | 2 +- configs/mx25pdk_defconfig | 2 +- configs/mx35pdk_defconfig | 2 +- configs/mx51evk_defconfig | 2 +- configs/mx53ard_defconfig | 2 +- configs/mx53cx9020_defconfig | 2 +- configs/mx53evk_defconfig | 2 +- configs/mx53loco_defconfig | 2 +- configs/mx53ppd_defconfig | 2 +- configs/mx53smd_defconfig | 2 +- configs/mx6cuboxi_defconfig | 2 +- configs/mx6dlarm2_defconfig | 2 +- configs/mx6dlarm2_lpddr2_defconfig | 2 +- configs/mx6qarm2_defconfig | 2 +- configs/mx6qarm2_lpddr2_defconfig | 2 +- configs/mx6qsabrelite_defconfig | 2 +- configs/mx6sabreauto_defconfig | 2 +- configs/mx6sabresd_defconfig | 2 +- configs/mx6slevk_defconfig | 2 +- configs/mx6slevk_spinor_defconfig | 2 +- configs/mx6slevk_spl_defconfig | 2 +- configs/mx6sllevk_defconfig | 2 +- configs/mx6sllevk_plugin_defconfig | 2 +- configs/mx6sxsabreauto_defconfig | 2 +- configs/mx6sxsabresd_defconfig | 2 +- configs/mx6sxsabresd_spl_defconfig | 2 +- configs/mx6ul_14x14_evk_defconfig | 2 +- configs/mx6ul_9x9_evk_defconfig | 2 +- configs/mx6ull_14x14_evk_defconfig | 2 +- configs/mx6ull_14x14_evk_plugin_defconfig | 2 +- configs/mx7dsabresd_defconfig | 2 +- configs/mx7dsabresd_qspi_defconfig | 2 +- configs/mx7ulp_evk_defconfig | 2 +- configs/mx7ulp_evk_plugin_defconfig | 2 +- configs/nitrogen6dl2g_defconfig | 2 +- configs/nitrogen6dl_defconfig | 2 +- configs/nitrogen6q2g_defconfig | 2 +- configs/nitrogen6q_defconfig | 2 +- configs/nitrogen6s1g_defconfig | 2 +- configs/nitrogen6s_defconfig | 2 +- configs/novena_defconfig | 2 +- configs/opos6uldev_defconfig | 2 +- configs/ot1200_defconfig | 2 +- configs/ot1200_spl_defconfig | 2 +- configs/pcm052_defconfig | 2 +- configs/pcm058_defconfig | 2 +- configs/pfla02_defconfig | 2 +- configs/phycore_pcl063_defconfig | 2 +- configs/pico-hobbit-imx6ul_defconfig | 2 +- configs/pico-hobbit-imx7d_defconfig | 2 +- configs/pico-imx6ul_defconfig | 2 +- configs/pico-imx7d_defconfig | 2 +- configs/pico-pi-imx6ul_defconfig | 2 +- configs/pico-pi-imx7d_defconfig | 2 +- configs/platinum_picon_defconfig | 2 +- configs/platinum_titanium_defconfig | 2 +- configs/riotboard_defconfig | 2 +- configs/riotboard_spl_defconfig | 2 +- configs/s32v234evb_defconfig | 2 +- configs/secomx6quq7_defconfig | 2 +- configs/sksimx6_defconfig | 2 +- configs/tbs2910_defconfig | 2 +- configs/titanium_defconfig | 2 +- configs/tqma6dl_mba6_mmc_defconfig | 2 +- configs/tqma6dl_mba6_spi_defconfig | 2 +- configs/tqma6q_mba6_mmc_defconfig | 2 +- configs/tqma6q_mba6_spi_defconfig | 2 +- configs/tqma6s_mba6_mmc_defconfig | 2 +- configs/tqma6s_mba6_spi_defconfig | 2 +- configs/tqma6s_wru4_mmc_defconfig | 2 +- configs/ts4800_defconfig | 2 +- configs/udoo_defconfig | 2 +- configs/udoo_neo_defconfig | 2 +- configs/usbarmory_defconfig | 2 +- configs/variscite_dart6ul_defconfig | 2 +- configs/vf610twr_defconfig | 2 +- configs/vf610twr_nand_defconfig | 2 +- configs/vining_2000_defconfig | 2 +- configs/wandboard_defconfig | 2 +- configs/warp7_bl33_defconfig | 2 +- configs/warp7_defconfig | 2 +- configs/warp_defconfig | 2 +- configs/woodburn_defconfig | 2 +- configs/woodburn_sd_defconfig | 2 +- configs/xpress_defconfig | 2 +- configs/xpress_spl_defconfig | 2 +- configs/zc5202_defconfig | 2 +- configs/zc5601_defconfig | 2 +- drivers/mmc/Kconfig | 6 + drivers/mmc/Makefile | 1 + drivers/mmc/fsl_esdhc.c | 609 +--------------- -- drivers/mmc/{fsl_esdhc.c => fsl_esdhc_imx.c} | 101 +-- include/configs/imx8mq_evk.h | 1 - include/configs/imx8qm_mek.h | 1 -Quoted 9 lines
include/configs/imx8qxp_mek.h | 1 - include/configs/kp_imx6q_tpc.h | 1 - include/configs/ls1012afrwy.h | 1 - include/fsl_esdhc.h | 57 -- include/{fsl_esdhc.h => fsl_esdhc_imx.h} | 15 +- 244 files changed, 350 insertions(+), 1054 deletions(-) copy drivers/mmc/{fsl_esdhc.c => fsl_esdhc_imx.c} (94%) copy include/{fsl_esdhc.h => fsl_esdhc_imx.h} (97%)
Quoted 4 lines
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190523/8838d0ca/attachment.sig>
v3 cover Split fsl_esdhc driver for i.MX
In reply to Y.b. LuHi Y.b,
Quoted 15 lines
The
fsl_esdhcdriver was for Freescale eSDHC on MPC83XX/MPC85XX initially. The later QoriQ series PowerPC processors (which were evolutions of MPC83XX/MPC85XX), QorIQ series ARM processors, and i.MX series processors were using this driver for their eSDHCs too.For the two series processors, the eSDHCs are becoming more and more different. We should have split it into two drivers, like them (
sdhci-of-esdhc.c/sdhci-esdhc-imx.c) in linux kernel.It's ideal to keep common part for reusing. However, it's hard to find out a little which could be reused. The truth is there will be more and more different registers, bits and operatiing processes. Even some code is common now, it may have to be split in the future. So let's just split is as two drivers.
Quoted 9 lines
Patch #2 just created a
fsl_esdhc_imxdriver which was a copy offsl_esdhcdriver for i.MX processors.
Patch #3 converted i.MX platforms to usefsl_esdhc_imx. Patch #4 and #5 just dropped useless code for the two driver. There are still many cleaning up works needed to be done in the future, because the eSDHC driver is mess for a long time. Since I'm only owner for QorIQ eSDHC driver, I dropped only a little things which I'm sure forfsl_esdhc_imx. Let i.MX eSDHC owner do futhur cleaning up.
Thank you for very detailed description (cover letter).
Quoted 247 lines
Yangbo Lu (5):
MoveCONFIG_FSL_ESDHCto defconfig
mmc: splitfsl_esdhcdriver for i.MX
Convert to usefsl_esdhc_imxfor i.MX platforms
mmc:fsl_esdhc: drop i.MX code
mmc:fsl_esdhc_imx: drop useless codearch/arm/cpu/arm1136/mx35/generic.c | 10 +- arch/arm/cpu/arm926ejs/mx25/generic.c | 8 +- arch/arm/cpu/armv7/vf610/generic.c | 10 +- arch/arm/cpu/armv8/s32v234/generic.c | 2 +- arch/arm/include/asm/global_data.h | 2 +- arch/arm/mach-imx/cpu.c | 6 +- arch/arm/mach-imx/mx6/litesom.c | 4 +- arch/arm/mach-imx/mx7/clock.c | 4 +- arch/arm/mach-imx/mx7ulp/clock.c | 2 +- arch/arm/mach-imx/speed.c | 4 +- board/advantech/dms-ba16/dms-ba16.c | 4 +- board/aristainetos/aristainetos-v1.c | 2 +- board/aristainetos/aristainetos-v2.c | 2 +- board/aristainetos/aristainetos.c | 4 +- board/bachmann/ot1200/ot1200.c | 2 +- board/barco/platinum/platinum.c | 2 +- board/barco/titanium/titanium.c | 4 +- board/beckhoff/mx53cx9020/mx53cx9020.c | 4 +- board/boundary/nitrogen6x/nitrogen6x.c | 4 +- board/ccv/xpress/xpress.c | 2 +- board/compulab/cl-som-imx7/cl-som-imx7.c | 6 +- board/compulab/cl-som-imx7/common.c | 6 +- board/compulab/cl-som-imx7/common.h | 8 +- board/compulab/cl-som-imx7/mux.c | 8 +- board/compulab/cl-som-imx7/spl.c | 6 +- board/compulab/cm_fx6/cm_fx6.c | 4 +- board/compulab/cm_fx6/common.c | 4 +- board/compulab/cm_fx6/spl.c | 2 +- board/congatec/cgtqmx6eval/cgtqmx6eval.c | 4 +- board/dhelectronics/dh_imx6/dh_imx6.c | 4 +- board/dhelectronics/dh_imx6/dh_imx6_spl.c | 2 +- board/el/el6x/el6x.c | 4 +- board/embest/mx6boards/mx6boards.c | 4 +- board/freescale/imx8mq_evk/imx8mq_evk.c | 2 +- board/freescale/imx8mq_evk/spl.c | 2 +- board/freescale/imx8qxp_mek/imx8qxp_mek.c | 2 +- board/freescale/mx25pdk/mx25pdk.c | 6 +- board/freescale/mx35pdk/mx35pdk.c | 4 +- board/freescale/mx51evk/mx51evk.c | 6 +- board/freescale/mx53ard/mx53ard.c | 4 +- board/freescale/mx53evk/mx53evk.c | 4 +- board/freescale/mx53loco/mx53loco.c | 4 +- board/freescale/mx53smd/mx53smd.c | 4 +- board/freescale/mx6qarm2/mx6qarm2.c | 4 +- board/freescale/mx6sabreauto/mx6sabreauto.c | 4 +- board/freescale/mx6sabresd/mx6sabresd.c | 4 +- board/freescale/mx6slevk/mx6slevk.c | 2 +- .../freescale/mx6sxsabreauto/mx6sxsabreauto.c | 2 +- board/freescale/mx6sxsabresd/mx6sxsabresd.c | 2 +- .../mx6ul_14x14_evk/mx6ul_14x14_evk.c | 4 +- board/freescale/mx6ullevk/mx6ullevk.c | 2 +- board/freescale/mx7dsabresd/mx7dsabresd.c | 2 +- board/freescale/s32v234evb/s32v234evb.c | 4 +- board/freescale/vf610twr/vf610twr.c | 4 +- board/gateworks/gw_ventana/common.c | 6 +- board/gateworks/gw_ventana/gw_ventana.c | 2 +- board/ge/bx50v3/bx50v3.c | 2 +- board/ge/mx53ppd/mx53ppd.c | 2 +- board/grinn/liteboard/board.c | 4 +- board/inversepath/usbarmory/usbarmory.c | 2 +- board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c | 4 +- board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c | 2 +- board/kosagi/novena/novena.c | 4 +- board/kosagi/novena/novena_spl.c | 6 +- board/liebherr/display5/common.c | 2 +- board/liebherr/display5/display5.c | 6 +- board/liebherr/display5/spl.c | 2 +- board/liebherr/mccmon6/mccmon6.c | 2 +- board/liebherr/mccmon6/spl.c | 2 +- board/logicpd/imx6/imx6logic.c | 4 +- board/menlo/m53menlo/m53menlo.c | 4 +- board/phytec/pcl063/pcl063.c | 2 +- board/phytec/pcl063/spl.c | 6 +- board/phytec/pcm058/pcm058.c | 2 +- board/phytec/pfla02/pfla02.c | 2 +- board/samtec/vining_2000/vining_2000.c | 2 +- board/seco/common/mx6.c | 2 +- board/seco/mx6quq7/mx6quq7.c | 2 +- board/sks-kinkel/sksimx6/sksimx6.c | 2 +- board/solidrun/mx6cuboxi/mx6cuboxi.c | 2 +- board/tbs/tbs2910/tbs2910.c | 6 +- board/technexion/pico-imx6ul/spl.c | 2 +- board/technexion/pico-imx7d/spl.c | 2 +- board/technologic/ts4800/ts4800.c | 6 +- board/toradex/apalis_imx6/apalis_imx6.c | 6 +- board/toradex/colibri_imx6/colibri_imx6.c | 6 +- board/toradex/colibri_imx7/colibri_imx7.c | 2 +- board/tqc/tqma6/tqma6.c | 2 +- board/tqc/tqma6/tqma6_mba6.c | 2 +- board/tqc/tqma6/tqma6_wru4.c | 2 +- board/udoo/neo/neo.c | 2 +- board/udoo/udoo.c | 2 +- board/udoo/udoo_spl.c | 2 +- board/variscite/dart_6ul/dart_6ul.c | 2 +- board/variscite/dart_6ul/spl.c | 2 +- board/wandboard/spl.c | 2 +- board/warp/warp.c | 2 +- board/woodburn/woodburn.c | 4 +- configs/apalis_imx6_defconfig | 2 +- configs/aristainetos2_defconfig | 2 +- configs/aristainetos2b_defconfig | 2 +- configs/aristainetos_defconfig | 2 +- configs/bk4r1_defconfig | 2 +- configs/cgtqmx6eval_defconfig | 2 +- configs/cl-som-imx7_defconfig | 2 +- configs/cm_fx6_defconfig | 2 +- configs/colibri-imx6ull_defconfig | 2 +- configs/colibri_imx6_defconfig | 2 +- configs/colibri_imx7_defconfig | 2 +- configs/colibri_imx7_emmc_defconfig | 2 +- configs/colibri_vf_defconfig | 2 +- configs/dh_imx6_defconfig | 2 +- configs/display5_defconfig | 2 +- configs/display5_factory_defconfig | 2 +- configs/dms-ba16-1g_defconfig | 2 +- configs/dms-ba16_defconfig | 2 +- configs/ge_bx50v3_defconfig | 2 +- configs/gwventana_emmc_defconfig | 2 +- configs/gwventana_gw5904_defconfig | 2 +- configs/gwventana_nand_defconfig | 2 +- configs/imx6dl_icore_nand_defconfig | 2 +- configs/imx6dl_mamoj_defconfig | 2 +- configs/imx6q_icore_nand_defconfig | 2 +- configs/imx6q_logic_defconfig | 2 +- configs/imx6qdl_icore_mipi_defconfig | 2 +- configs/imx6qdl_icore_mmc_defconfig | 2 +- configs/imx6qdl_icore_nand_defconfig | 2 +- configs/imx6qdl_icore_rqs_defconfig | 2 +- configs/imx6ul_geam_mmc_defconfig | 2 +- configs/imx6ul_geam_nand_defconfig | 2 +- configs/imx6ul_isiot_emmc_defconfig | 2 +- configs/imx6ul_isiot_nand_defconfig | 2 +- configs/imx8mq_evk_defconfig | 1 + configs/imx8qm_mek_defconfig | 1 + configs/imx8qxp_mek_defconfig | 1 + configs/kp_imx53_defconfig | 2 +- configs/kp_imx6q_tpc_defconfig | 1 + configs/liteboard_defconfig | 2 +- .../ls1012afrwy_qspi_SECURE_BOOT_defconfig | 1 + configs/ls1012afrwy_qspi_defconfig | 1 + configs/ls1012afrwy_tfa_SECURE_BOOT_defconfig | 1 + configs/ls1012afrwy_tfa_defconfig | 1 + configs/m53menlo_defconfig | 2 +- configs/marsboard_defconfig | 2 +- configs/mccmon6_nor_defconfig | 2 +- configs/mccmon6_sd_defconfig | 2 +- configs/mx25pdk_defconfig | 2 +- configs/mx35pdk_defconfig | 2 +- configs/mx51evk_defconfig | 2 +- configs/mx53ard_defconfig | 2 +- configs/mx53cx9020_defconfig | 2 +- configs/mx53evk_defconfig | 2 +- configs/mx53loco_defconfig | 2 +- configs/mx53ppd_defconfig | 2 +- configs/mx53smd_defconfig | 2 +- configs/mx6cuboxi_defconfig | 2 +- configs/mx6dlarm2_defconfig | 2 +- configs/mx6dlarm2_lpddr2_defconfig | 2 +- configs/mx6qarm2_defconfig | 2 +- configs/mx6qarm2_lpddr2_defconfig | 2 +- configs/mx6qsabrelite_defconfig | 2 +- configs/mx6sabreauto_defconfig | 2 +- configs/mx6sabresd_defconfig | 2 +- configs/mx6slevk_defconfig | 2 +- configs/mx6slevk_spinor_defconfig | 2 +- configs/mx6slevk_spl_defconfig | 2 +- configs/mx6sllevk_defconfig | 2 +- configs/mx6sllevk_plugin_defconfig | 2 +- configs/mx6sxsabreauto_defconfig | 2 +- configs/mx6sxsabresd_defconfig | 2 +- configs/mx6sxsabresd_spl_defconfig | 2 +- configs/mx6ul_14x14_evk_defconfig | 2 +- configs/mx6ul_9x9_evk_defconfig | 2 +- configs/mx6ull_14x14_evk_defconfig | 2 +- configs/mx6ull_14x14_evk_plugin_defconfig | 2 +- configs/mx7dsabresd_defconfig | 2 +- configs/mx7dsabresd_qspi_defconfig | 2 +- configs/mx7ulp_evk_defconfig | 2 +- configs/mx7ulp_evk_plugin_defconfig | 2 +- configs/nitrogen6dl2g_defconfig | 2 +- configs/nitrogen6dl_defconfig | 2 +- configs/nitrogen6q2g_defconfig | 2 +- configs/nitrogen6q_defconfig | 2 +- configs/nitrogen6s1g_defconfig | 2 +- configs/nitrogen6s_defconfig | 2 +- configs/novena_defconfig | 2 +- configs/opos6uldev_defconfig | 2 +- configs/ot1200_defconfig | 2 +- configs/ot1200_spl_defconfig | 2 +- configs/pcm052_defconfig | 2 +- configs/pcm058_defconfig | 2 +- configs/pfla02_defconfig | 2 +- configs/phycore_pcl063_defconfig | 2 +- configs/pico-hobbit-imx6ul_defconfig | 2 +- configs/pico-hobbit-imx7d_defconfig | 2 +- configs/pico-imx6ul_defconfig | 2 +- configs/pico-imx7d_defconfig | 2 +- configs/pico-pi-imx6ul_defconfig | 2 +- configs/pico-pi-imx7d_defconfig | 2 +- configs/platinum_picon_defconfig | 2 +- configs/platinum_titanium_defconfig | 2 +- configs/riotboard_defconfig | 2 +- configs/riotboard_spl_defconfig | 2 +- configs/s32v234evb_defconfig | 2 +- configs/secomx6quq7_defconfig | 2 +- configs/sksimx6_defconfig | 2 +- configs/tbs2910_defconfig | 2 +- configs/titanium_defconfig | 2 +- configs/tqma6dl_mba6_mmc_defconfig | 2 +- configs/tqma6dl_mba6_spi_defconfig | 2 +- configs/tqma6q_mba6_mmc_defconfig | 2 +- configs/tqma6q_mba6_spi_defconfig | 2 +- configs/tqma6s_mba6_mmc_defconfig | 2 +- configs/tqma6s_mba6_spi_defconfig | 2 +- configs/tqma6s_wru4_mmc_defconfig | 2 +- configs/ts4800_defconfig | 2 +- configs/udoo_defconfig | 2 +- configs/udoo_neo_defconfig | 2 +- configs/usbarmory_defconfig | 2 +- configs/variscite_dart6ul_defconfig | 2 +- configs/vf610twr_defconfig | 2 +- configs/vf610twr_nand_defconfig | 2 +- configs/vining_2000_defconfig | 2 +- configs/wandboard_defconfig | 2 +- configs/warp7_bl33_defconfig | 2 +- configs/warp7_defconfig | 2 +- configs/warp_defconfig | 2 +- configs/woodburn_defconfig | 2 +- configs/woodburn_sd_defconfig | 2 +- configs/xpress_defconfig | 2 +- configs/xpress_spl_defconfig | 2 +- configs/zc5202_defconfig | 2 +- configs/zc5601_defconfig | 2 +- drivers/mmc/Kconfig | 6 + drivers/mmc/Makefile | 1 + drivers/mmc/fsl_esdhc.c | 609 +----------------- drivers/mmc/{fsl_esdhc.c => fsl_esdhc_imx.c} | 101 +-- include/configs/imx8mq_evk.h | 1 - include/configs/imx8qm_mek.h | 1 -
Quoted 9 lines
include/configs/imx8qxp_mek.h | 1 -
include/configs/kp_imx6q_tpc.h | 1 -
include/configs/ls1012afrwy.h | 1 -
include/fsl_esdhc.h | 57 --
include/{fsl_esdhc.h => fsl_esdhc_imx.h} | 15 +-
244 files changed, 350 insertions(+), 1054 deletions(-)
copy drivers/mmc/{fsl_esdhc.c => fsl_esdhc_imx.c} (94%)
copy include/{fsl_esdhc.h => fsl_esdhc_imx.h} (97%)Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190529/66b55333/attachment-0001.sig>