From 915ffa5213756568f6185d05cda2cb2f6050f974 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Tue, 19 Jul 2016 16:33:36 +0900 Subject: mmc: use the generic error number Use the generic error number instead of specific error number. If use the generic error number, it can debug more easier. Signed-off-by: Jaehoon Chung Reviewed-by: Simon Glass Reviewed-by: Minkyu Kang --- include/mmc.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include') diff --git a/include/mmc.h b/include/mmc.h index dd47f34..aa6d5d1 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -66,12 +66,6 @@ #define MMC_DATA_READ 1 #define MMC_DATA_WRITE 2 -#define NO_CARD_ERR -16 /* No SD/MMC card inserted */ -#define UNUSABLE_ERR -17 /* Unusable Card */ -#define COMM_ERR -18 /* Communications Error */ -#define TIMEOUT -19 -#define SWITCH_ERR -20 /* Card reports failure to switch mode */ - #define MMC_CMD_GO_IDLE_STATE 0 #define MMC_CMD_SEND_OP_COND 1 #define MMC_CMD_ALL_SEND_CID 2 -- cgit v1.1 From 6a879ec8e7ac9905ad10b98e9cd585622c64b17c Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Tue, 26 Jul 2016 19:06:23 +0900 Subject: mmc: sdhci: remove the unused argument for sdhci_setup_cfg buswidth isn't used anywhere in sdhci_setup_cfg. Signed-off-by: Jaehoon Chung Reviewed-by: Minkyu Kang Reviewed-by: Simon Glass --- include/sdhci.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/sdhci.h b/include/sdhci.h index c4d3b55..693ecc1 100644 --- a/include/sdhci.h +++ b/include/sdhci.h @@ -368,7 +368,6 @@ static inline u8 sdhci_readb(struct sdhci_host *host, int reg) * * @cfg: Configuration structure to fill in (generally &plat->mmc) * @name: Device name (normally dev->name) - * @buswidth: Bus width (in bits, such as 4 or 8) * @caps: Host capabilities (MMC_MODE_...) * @max_clk: Maximum supported clock speed in HZ (0 for default) * @min_clk: Minimum supported clock speed in HZ (0 for default) @@ -377,7 +376,7 @@ static inline u8 sdhci_readb(struct sdhci_host *host, int reg) * @quirks: Quick flags (SDHCI_QUIRK_...) * @host_caps: Additional host capabilities (0 if none) */ -int sdhci_setup_cfg(struct mmc_config *cfg, const char *name, int buswidth, +int sdhci_setup_cfg(struct mmc_config *cfg, const char *name, uint caps, u32 max_clk, u32 min_clk, uint version, uint quirks, uint host_caps); -- cgit v1.1 From 14bed52d276afd36b9674ee7aa2c2ad9d2f4e59e Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Tue, 26 Jul 2016 19:06:24 +0900 Subject: mmc: sdhci: remove the unnecessary arguments for sdhci_setup_cfg Some arguments don't need to pass to sdhci_setup_cfg. Generic variable can be used in sdhci_setup_cfg, and some arguments are already included in sdhci_host struct. It's enough that just pass the board specific things to sdhci_setup_cfg(). After removing the unnecessary arguments, it's more simpler than before. It doesn't consider "Version" and "Capabilities" anymore in each SoC driver. Signed-off-by: Jaehoon Chung Reviewed-by: Simon Glass --- include/sdhci.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/sdhci.h b/include/sdhci.h index 693ecc1..fcef4dc 100644 --- a/include/sdhci.h +++ b/include/sdhci.h @@ -367,18 +367,12 @@ static inline u8 sdhci_readb(struct sdhci_host *host, int reg) * See msm_sdhci.c for an example. * * @cfg: Configuration structure to fill in (generally &plat->mmc) - * @name: Device name (normally dev->name) - * @caps: Host capabilities (MMC_MODE_...) + * @host: SDHCI host structure * @max_clk: Maximum supported clock speed in HZ (0 for default) * @min_clk: Minimum supported clock speed in HZ (0 for default) - * @version: Host controller version (generally read from the - * SDHCI_HOST_VERSION register) - * @quirks: Quick flags (SDHCI_QUIRK_...) - * @host_caps: Additional host capabilities (0 if none) */ -int sdhci_setup_cfg(struct mmc_config *cfg, const char *name, - uint caps, u32 max_clk, u32 min_clk, uint version, - uint quirks, uint host_caps); +int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host, + u32 max_clk, u32 min_clk); /** * sdhci_bind() - Set up a new MMC block device -- cgit v1.1 From 4587f53a582c9ab0bd908cff590755bfc03fced4 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Thu, 28 Jul 2016 14:26:24 +0900 Subject: mmc: dw_mmc: fix the wrong Mask bit boundary for fifo_count bit According to DesignWare TRM, FIFO_COUNT is bit[29:17]. If get the correct fifo_count value, it has to use the FIFO_MASK as 0x1FFF, not 0x1FF. Signed-off-by: Jaehoon Chung Reviewed-by: Ziyuan Xu --- include/dwmmc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/dwmmc.h b/include/dwmmc.h index d18ec84..5b9602c 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -105,7 +105,7 @@ /* Status Register */ #define DWMCI_BUSY (1 << 9) -#define DWMCI_FIFO_MASK 0x1ff +#define DWMCI_FIFO_MASK 0x1fff #define DWMCI_FIFO_SHIFT 17 /* FIFOTH Register */ -- cgit v1.1