summaryrefslogtreecommitdiff
authorNan Li <nan.li@amlogic.com>2018-04-17 11:51:22 (GMT)
committer Xindong Xu <xindong.xu@amlogic.com>2018-04-19 06:00:20 (GMT)
commit483d3e265a34c68a3d499e320c8168cb1d87bbe1 (patch)
tree07ef90045c16f4a8d3bc36c045944cf2c09efaf4
parentb91343a87f417176cb41db0896b21d73f2b8038f (diff)
downloadcommon-483d3e265a34c68a3d499e320c8168cb1d87bbe1.zip
common-483d3e265a34c68a3d499e320c8168cb1d87bbe1.tar.gz
common-483d3e265a34c68a3d499e320c8168cb1d87bbe1.tar.bz2
sd: add port base addr in the matchdata.
PD#163048: add port base addr in the matchdata, for sd & sdio TDMA check. Change-Id: Ib7432ffbf26c749d8799bfa5f60eaaff7735539d Signed-off-by: Nan Li <nan.li@amlogic.com>
Diffstat
-rw-r--r--drivers/amlogic/mmc/aml_sd_emmc.c39
-rw-r--r--drivers/amlogic/mmc/aml_sd_emmc_v3.c6
-rw-r--r--include/linux/amlogic/sd.h3
3 files changed, 40 insertions, 8 deletions
diff --git a/drivers/amlogic/mmc/aml_sd_emmc.c b/drivers/amlogic/mmc/aml_sd_emmc.c
index 90741b1..8c3bddc 100644
--- a/drivers/amlogic/mmc/aml_sd_emmc.c
+++ b/drivers/amlogic/mmc/aml_sd_emmc.c
@@ -1867,7 +1867,7 @@ int meson_mmc_request_done(struct mmc_host *mmc, struct mmc_request *mrq)
aml_sd_emmc_check_sdio_irq(host);
mmc_request_done(host->mmc, mrq);
#ifdef AML_MMC_TDMA
- if ((host->irq == 49)
+ if ((host->mem->start == host->data->port_b_base)
&& (host->data->chip_type == MMC_CHIP_G12A))
complete(&host->drv_completion);
#endif
@@ -2207,14 +2207,14 @@ static void meson_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
pdata = mmc_priv(mmc);
host = pdata->host;
#ifdef AML_MMC_TDMA
- if ((host->irq == 49)
+ if ((host->mem->start == host->data->port_b_base)
&& (host->data->chip_type == MMC_CHIP_G12A))
wait_for_completion(&host->drv_completion);
#endif
if (aml_check_unsupport_cmd(mmc, mrq)) {
#ifdef AML_MMC_TDMA
- if ((host->irq == 49)
+ if ((host->mem->start == host->data->port_b_base)
&& (host->data->chip_type == MMC_CHIP_G12A))
complete(&host->drv_completion);
#endif
@@ -3048,7 +3048,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
}
#ifdef AML_MMC_TDMA
- if ((host->irq == 49)
+ if ((host->mem->start == host->data->port_b_base)
&& (host->data->chip_type == MMC_CHIP_G12A)) {
init_completion(&host->drv_completion);
host->drv_completion.done = 1;
@@ -3218,7 +3218,6 @@ static int meson_mmc_probe(struct platform_device *pdev)
}
#endif /* CONFIG_MESON_CPU_EMULATOR */
#ifdef AML_MMC_TDMA
- mdelay(800);
}
#endif
pr_info("%s() : success!\n", __func__);
@@ -3271,6 +3270,9 @@ static int meson_mmc_remove(struct platform_device *pdev)
static struct meson_mmc_data mmc_data_gxbb = {
.chip_type = MMC_CHIP_GXBB,
+ .port_a_base = 0xd0070000,
+ .port_b_base = 0xd0072000,
+ .port_c_base = 0xd0074000,
.pinmux_base = 0xc8834400,
.clksrc_base = 0xc883c000,
.ds_pin_poll = 0x3c,
@@ -3279,6 +3281,9 @@ static struct meson_mmc_data mmc_data_gxbb = {
};
static struct meson_mmc_data mmc_data_gxtvbb = {
.chip_type = MMC_CHIP_GXTVBB,
+ .port_a_base = 0xd0070000,
+ .port_b_base = 0xd0072000,
+ .port_c_base = 0xd0074000,
.pinmux_base = 0xc8834400,
.clksrc_base = 0xc883c000,
.ds_pin_poll = 0x3c,
@@ -3287,6 +3292,9 @@ static struct meson_mmc_data mmc_data_gxtvbb = {
};
static struct meson_mmc_data mmc_data_gxl = {
.chip_type = MMC_CHIP_GXL,
+ .port_a_base = 0xd0070000,
+ .port_b_base = 0xd0072000,
+ .port_c_base = 0xd0074000,
.pinmux_base = 0xc8834400,
.clksrc_base = 0xc883c000,
.ds_pin_poll = 0x3c,
@@ -3295,6 +3303,9 @@ static struct meson_mmc_data mmc_data_gxl = {
};
static struct meson_mmc_data mmc_data_gxm = {
.chip_type = MMC_CHIP_GXM,
+ .port_a_base = 0xd0070000,
+ .port_b_base = 0xd0072000,
+ .port_c_base = 0xd0074000,
.pinmux_base = 0xc8834400,
.clksrc_base = 0xc883c000,
.ds_pin_poll = 0x3c,
@@ -3303,6 +3314,9 @@ static struct meson_mmc_data mmc_data_gxm = {
};
static struct meson_mmc_data mmc_data_txl = {
.chip_type = MMC_CHIP_TXL,
+ .port_a_base = 0xd0070000,
+ .port_b_base = 0xd0072000,
+ .port_c_base = 0xd0074000,
.pinmux_base = 0xc8834400,
.clksrc_base = 0xc883c000,
.ds_pin_poll = 0x3c,
@@ -3311,6 +3325,9 @@ static struct meson_mmc_data mmc_data_txl = {
};
static struct meson_mmc_data mmc_data_txlx = {
.chip_type = MMC_CHIP_TXLX,
+ .port_a_base = 0xffe03000,
+ .port_b_base = 0xffe05000,
+ .port_c_base = 0xffe07000,
.pinmux_base = 0xff634400,
.clksrc_base = 0xff63c000,
.ds_pin_poll = 0x3c,
@@ -3328,6 +3345,9 @@ static struct meson_mmc_data mmc_data_txlx = {
};
static struct meson_mmc_data mmc_data_axg = {
.chip_type = MMC_CHIP_AXG,
+ .port_a_base = 0xffe03000,
+ .port_b_base = 0xffe05000,
+ .port_c_base = 0xffe07000,
.pinmux_base = 0xff634400,
.clksrc_base = 0xff63c000,
.ds_pin_poll = 0x3e,
@@ -3345,6 +3365,9 @@ static struct meson_mmc_data mmc_data_axg = {
};
static struct meson_mmc_data mmc_data_gxlx = {
.chip_type = MMC_CHIP_GXLX,
+ .port_a_base = 0xd0070000,
+ .port_b_base = 0xd0072000,
+ .port_c_base = 0xd0074000,
.pinmux_base = 0xc8834400,
.clksrc_base = 0xc883c000,
.ds_pin_poll = 0x3c,
@@ -3362,6 +3385,9 @@ static struct meson_mmc_data mmc_data_gxlx = {
};
static struct meson_mmc_data mmc_data_txhd = {
.chip_type = MMC_CHIP_TXHD,
+ .port_a_base = 0xffe03000,
+ .port_b_base = 0xffe05000,
+ .port_c_base = 0xffe07000,
.pinmux_base = 0xff634400,
.clksrc_base = 0xff63c000,
.ds_pin_poll = 0x3c,
@@ -3380,6 +3406,9 @@ static struct meson_mmc_data mmc_data_txhd = {
static struct meson_mmc_data mmc_data_g12a = {
.chip_type = MMC_CHIP_G12A,
+ .port_a_base = 0xffe03000,
+ .port_b_base = 0xffe05000,
+ .port_c_base = 0xffe07000,
.pinmux_base = 0xff634400,
.clksrc_base = 0xff63c000,
.ds_pin_poll = 0x3a,
diff --git a/drivers/amlogic/mmc/aml_sd_emmc_v3.c b/drivers/amlogic/mmc/aml_sd_emmc_v3.c
index 1288f7f..74ac465 100644
--- a/drivers/amlogic/mmc/aml_sd_emmc_v3.c
+++ b/drivers/amlogic/mmc/aml_sd_emmc_v3.c
@@ -308,13 +308,13 @@ void meson_mmc_set_ios_v3(struct mmc_host *mmc,
struct amlsd_host *host = pdata->host;
#ifdef AML_MMC_TDMA
- if ((host->irq == 49)
+ if ((host->mem->start == host->data->port_b_base)
&& (host->data->chip_type == MMC_CHIP_G12A))
wait_for_completion(&host->drv_completion);
#endif
if (!pdata->is_in) {
#ifdef AML_MMC_TDMA
- if ((host->irq == 49)
+ if ((host->mem->start == host->data->port_b_base)
&& (host->data->chip_type == MMC_CHIP_G12A))
complete(&host->drv_completion);
#endif
@@ -343,7 +343,7 @@ void meson_mmc_set_ios_v3(struct mmc_host *mmc,
else if (ios->chip_select == MMC_CS_DONTCARE)
aml_cs_dont_care(mmc);
#ifdef AML_MMC_TDMA
- if ((host->irq == 49)
+ if ((host->mem->start == host->data->port_b_base)
&& (host->data->chip_type == MMC_CHIP_G12A))
complete(&host->drv_completion);
#endif
diff --git a/include/linux/amlogic/sd.h b/include/linux/amlogic/sd.h
index c76c119..ac0d884 100644
--- a/include/linux/amlogic/sd.h
+++ b/include/linux/amlogic/sd.h
@@ -209,6 +209,9 @@ struct para_e {
struct meson_mmc_data {
enum mmc_chip_e chip_type;
+ unsigned int port_a_base;
+ unsigned int port_b_base;
+ unsigned int port_c_base;
unsigned int pinmux_base;
unsigned int clksrc_base;
unsigned int ds_pin_poll;