2.Resolve conflicts pin used to wifi-sdio-det.
3.Resolve the clock conflict between sd and sdio.
num-slots = <1>;
supports-highspeed;
+ supports-emmc;
+ bootpart-no-access;
fifo-depth = <0x80>;
pinctrl-1 = <&sd0_cd_gpio>; //for int gpio?
clocks = <&clk_gates2 11>;
clock-frequency = <50000000>;
- clock-freq-min-max = <200000 50000000>;
+ clock-freq-min-max = <400000 50000000>;
num-slots = <1>;
supports-highspeed;
+ supports-sd;
broken-cd;
card-detect-delay = <200>;
pwr-gpios = <&gpio3 GPIO_A1 GPIO_ACTIVE_LOW>; /*pwr_en = GPIO3_A1*/
num-slots = <1>;
supports-highspeed;
+ supports-sdio;
fifo-depth = <0x100>;
mmc,caps = <(MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ |MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED)>;
obj-$(CONFIG_EFI_PARTITION) += efi.o
obj-$(CONFIG_KARMA_PARTITION) += karma.o
obj-$(CONFIG_SYSV68_PARTITION) += sysv68.o
+
+#added for emmc in Rockchip project.
+obj-$(CONFIG_MMC_DW_ROCKCHIP) += mtdpart.o
#include <linux/genhd.h>
#include "check.h"
+#include "mtdpart.h"
#include "acorn.h"
#include "amiga.h"
#ifdef CONFIG_SYSV68_PARTITION
sysv68_partition,
#endif
+
+#if CONFIG_MMC_DW_ROCKCHIP
+ mtdpart_partition,
+#endif
+
NULL
};
* There are two boot regions of equal size, defined in
* multiples of 128K.
*/
- #if 0
- //emmc: We do NOT alloc boot partition now. noted by xbw, at 2014-03-09
- card->ext_csd.boot_size = 0;
- #else
if (ext_csd[EXT_CSD_BOOT_MULT] && mmc_boot_partition_access(card->host)) {
for (idx = 0; idx < MMC_NUM_BOOT_PARTITION; idx++) {
part_size = ext_csd[EXT_CSD_BOOT_MULT] << 17;
MMC_BLK_DATA_AREA_BOOT);
}
}
- #endif
}
card->ext_csd.raw_hc_erase_gap_size =
* RPMB regions are defined in multiples of 128K.
*/
card->ext_csd.raw_rpmb_size_mult = ext_csd[EXT_CSD_RPMB_MULT];
+ #if 0 //noted by xbw,2014-03-11
if (ext_csd[EXT_CSD_RPMB_MULT] && mmc_host_cmd23(card->host)) {
mmc_part_add(card, ext_csd[EXT_CSD_RPMB_MULT] << 17,
EXT_CSD_PART_CONFIG_ACC_RPMB,
"rpmb", 0, false,
MMC_BLK_DATA_AREA_RPMB);
}
+ #endif
}
card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT];
struct dw_mci_board *brd = slot->host->pdata;
struct dw_mci *host = slot->host;
int gpio_cd = mmc_gpio_get_cd(mmc);
+
+ if (mmc->cardtype_restrict & RESTRICT_CARD_TYPE_SDIO){
+ spin_lock_bh(&host->lock);
+ set_bit(DW_MMC_CARD_PRESENT, &slot->flags);
+ spin_unlock_bh(&host->lock);
+
+ return 1;
+ }
/* Use platform get_cd function, else try onboard card detect */
if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
dw_mci_request_end(host, host->mrq);
goto unlock;
- printk("%d..%s: ===test===\n", __LINE__, __FUNCTION__);
case STATE_DATA_ERROR:
if (!test_and_clear_bit(EVENT_XFER_COMPLETE,
&host->pending_events))
break;
- printk("%d..%s: ===test===\n", __LINE__, __FUNCTION__);
state = STATE_DATA_BUSY;
break;
printk("%d..%s: fmin=%d, fmax=%d \n", __LINE__,__FUNCTION__,mmc->f_min, mmc->f_max);
}
#endif
+
+ if (of_find_property(host->dev->of_node, "supports-sd", NULL))
+ mmc->cardtype_restrict |= RESTRICT_CARD_TYPE_SD;
+ if (of_find_property(host->dev->of_node, "supports-sdio", NULL))
+ mmc->cardtype_restrict |= RESTRICT_CARD_TYPE_SDIO;
+ if (of_find_property(host->dev->of_node, "supports-emmc", NULL))
+ mmc->cardtype_restrict |= RESTRICT_CARD_TYPE_EMMC;
+
if (host->pdata->get_ocr)
mmc->ocr_avail = host->pdata->get_ocr(id);
else
if (of_find_property(np, "keep-power-in-suspend", NULL))
pdata->pm_caps |= MMC_PM_KEEP_POWER;
+
+
if (of_find_property(np, "enable-sdio-wakeup", NULL))
pdata->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
if (of_get_property(np, "cd-inverted", NULL))
pdata->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH;
+ if (of_get_property(np, "bootpart-no-access", NULL))
+ pdata->caps2 |= MMC_CAP2_BOOTPART_NOACC;
return pdata;
}
struct regulator *vqmmc; /* Optional Vccq supply */
};
-#define HOST_IS_EMMC(host) (host->unused)
-#define SDMMC_SUPPORT_EMMC(host) (host->rk_sdmmc_emmc_used)
-
-
struct mmc_host {
struct device *parent;
struct device class_dev;
#define MMC_CAP2_SANITIZE (1 << 15) /* Support Sanitize */
mmc_pm_flag_t pm_caps; /* supported pm features */
+
+ u32 cardtype_restrict; /*restrict the SDMMC controller to support card type;1--SD card; 2--sdio; 4--eMMC */
+#define RESTRICT_CARD_TYPE_SD (1 << 0) /*noted by XBW, Rockchip Co.Ld*/
+#define RESTRICT_CARD_TYPE_SDIO (1 << 1)
+#define RESTRICT_CARD_TYPE_EMMC (1 << 2)
#ifdef CONFIG_MMC_CLKGATE
int clk_requests; /* internal reference counter */
unsigned int max_blk_size; /* maximum size of one mmc block */
unsigned int max_blk_count; /* maximum number of blocks in one req */
unsigned int max_discard_to; /* max. discard timeout in ms */
- unsigned short rk_sdmmc_emmc_used; //rk29_sdmmc driver support emmc
- int host_dev_id;
/* private data */
spinlock_t lock; /* lock for claim and bus ops */
#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */
#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */
-#define FOD_FREQ (300000) // in the identify stage, unit: hz, max is 400Khz, // the least frequency is FREQ_HCLK_MAX/8
-#define SD_FPP_FREQ (24000000) // normal sd freq, 25Mhz
-#define SDHC_FPP_FREQ (49500000) // SDHC in the highspeed. unit is hz, max is 50Mhz.
-#define MMC_FPP_FREQ (19000000) // MMC freq, unit is hz, max is 20MHz
-#define MMCHS_26_FPP_FREQ (24500000) // highspeed mode support 26M HS-MMC, unit is hz, max is 26Mhz,
-#define MMCHS_52_FPP_FREQ (51500000) // highspeed support 52M HS-MMC, unit is hz, max is 52Mhz,
-
-
#endif /* LINUX_MMC_MMC_H */
u32 caps; /* Capabilities */
u32 caps2; /* More capabilities */
u32 pm_caps; /* PM capabilities */
+ u32 cardtype_restrict; /*restrict the SDMMC controller to support card type;1--SD card; 2--sdio; 4--eMMC */
/*
* Override fifo depth. If 0, autodetect it from the FIFOTH register,
* but note that this may not be reliable after a bootloader has used