From 0fe15fe9c85b381ea4d68c420ea6622fcc6f3965 Mon Sep 17 00:00:00 2001 From: long yu Date: Wed, 6 Mar 2019 14:21:48 +0800 Subject: [PATCH] storage: emmc: Compatible with G12B revA and revB [1/1] PD#SWPL-5575 Problem: not Compatible with G12B version a and b Solution: add revA match-data Verify: G12B-W400 RevA and RevB Change-Id: Iee09861f7b162ee0660ea12dab60a238a9ae6be5 Signed-off-by: long yu --- arch/arm/boot/dts/amlogic/mesong12b_a.dtsi | 2 +- arch/arm64/boot/dts/amlogic/mesong12b_a.dtsi | 2 +- drivers/amlogic/mmc/aml_sd_emmc.c | 29 ++++++++++++++++++++++++++++ include/linux/amlogic/sd.h | 3 ++- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/amlogic/mesong12b_a.dtsi b/arch/arm/boot/dts/amlogic/mesong12b_a.dtsi index 9e6514f..a397cf8 100644 --- a/arch/arm/boot/dts/amlogic/mesong12b_a.dtsi +++ b/arch/arm/boot/dts/amlogic/mesong12b_a.dtsi @@ -1406,7 +1406,7 @@ sd_emmc_c: emmc@ffe07000 { status = "disabled"; - compatible = "amlogic, meson-mmc-g12b"; + compatible = "amlogic, meson-mmc-g12b-a"; reg = <0xffe07000 0x800>; interrupts = <0 191 1>; pinctrl-names = "emmc_clk_cmd_pins", "emmc_all_pins"; diff --git a/arch/arm64/boot/dts/amlogic/mesong12b_a.dtsi b/arch/arm64/boot/dts/amlogic/mesong12b_a.dtsi index 7b712f3..d76692b 100644 --- a/arch/arm64/boot/dts/amlogic/mesong12b_a.dtsi +++ b/arch/arm64/boot/dts/amlogic/mesong12b_a.dtsi @@ -1406,7 +1406,7 @@ sd_emmc_c: emmc@ffe07000 { status = "disabled"; - compatible = "amlogic, meson-mmc-g12b"; + compatible = "amlogic, meson-mmc-g12b-a"; reg = <0x0 0xffe07000 0x0 0x800>; interrupts = <0 191 1>; pinctrl-names = "emmc_clk_cmd_pins", "emmc_all_pins"; diff --git a/drivers/amlogic/mmc/aml_sd_emmc.c b/drivers/amlogic/mmc/aml_sd_emmc.c index f679829..002833fa 100644 --- a/drivers/amlogic/mmc/aml_sd_emmc.c +++ b/drivers/amlogic/mmc/aml_sd_emmc.c @@ -3546,6 +3546,31 @@ static struct meson_mmc_data mmc_data_g12a = { .sdmmc.sdr104.tx_phase = 0, }; +static struct meson_mmc_data mmc_data_g12b_a = { + .chip_type = MMC_CHIP_G12B_A, + .port_a_base = 0xffe03000, + .port_b_base = 0xffe05000, + .port_c_base = 0xffe07000, + .pinmux_base = 0xff634400, + .clksrc_base = 0xff63c000, + .ds_pin_poll = 0x3a, + .ds_pin_poll_en = 0x48, + .ds_pin_poll_bit = 13, + .sdmmc.init.core_phase = 3, + .sdmmc.init.tx_phase = 0, + .sdmmc.init.rx_phase = 0, + .sdmmc.calc.core_phase = 0, + .sdmmc.calc.tx_phase = 2, + .sdmmc.hs.core_phase = 1, + .sdmmc.ddr.core_phase = 2, + .sdmmc.ddr.tx_phase = 0, + .sdmmc.hs2.core_phase = 2, + .sdmmc.hs2.tx_phase = 0, + .sdmmc.sd_hs.core_phase = 2, + .sdmmc.sdr104.core_phase = 2, + .sdmmc.sdr104.tx_phase = 0, +}; + static struct meson_mmc_data mmc_data_g12b = { .chip_type = MMC_CHIP_G12B, .port_a_base = 0xffe03000, @@ -3645,6 +3670,10 @@ static const struct of_device_id meson_mmc_of_match[] = { .compatible = "amlogic, meson-mmc-tl1", .data = &mmc_data_tl1, }, + { + .compatible = "amlogic, meson-mmc-g12b-a", + .data = &mmc_data_g12b_a, + }, {} }; diff --git a/include/linux/amlogic/sd.h b/include/linux/amlogic/sd.h index c051df4..045f770 100644 --- a/include/linux/amlogic/sd.h +++ b/include/linux/amlogic/sd.h @@ -188,9 +188,10 @@ enum mmc_chip_e { MMC_CHIP_GXLX = 0x26, MMC_CHIP_TXHD = 0x27, MMC_CHIP_G12A = 0x28, - MMC_CHIP_G12B = 0x29, + MMC_CHIP_G12B_A = 0x29, MMC_CHIP_GXLX2 = 0x2a, MMC_CHIP_TL1 = 0X2b, + MMC_CHIP_G12B = 0x29b, }; struct mmc_phase { -- 2.7.4