Hi, Jaehoon
Thank you for your advice during your busy schedule,
1."Need the patch for adding "hi3660-dw-mshc" compatible
Documentation/devicetree/bindings/k3-dw-mshc.txt"
This "hi3660-dw-mshc" compatible string has been integrated into platform
maintainer's tree together with dts changes. It's now in linux-next [1];need
this one more?
2. And added the minor comments.
Iwill fix them in patch v6.
Thank you very much.
-邮件原件-
发件人: Guodong Xu [mailto:guodong...@linaro.org]
发送时间: 2017年7月6日 14:45
收件人: Jaehoon Chung; liwei (CM)
抄送: Ulf Hansson; adrian.hun...@intel.com; Shawn Lin;
wsa+rene...@sang-engineering.com; hkallwe...@gmail.com;
linux-...@vger.kernel.org; linux-kernel@vger.kernel.org
主题: Re: [PATCH v5] mmc: dw_mmc-k3: add sd support for hi3660
On Thu, Jul 6, 2017 at 1:13 PM, Jaehoon Chung wrote:
> Hi,
>
> To Guodong, if you can forward this to Li Wei, plz do it. Sorry.
>
Sure. Put Li Wei in cc.
And add my response.
> On 07/03/2017 10:06 AM, liwei wrote:
>>
>> Add sd card support for hi3660 soc
>
> Need the patch for adding "hi3660-dw-mshc" compatible
> Documentation/devicetree/bindings/k3-dw-mshc.txt
>
> And added the minor comments.
>
Hi, Jaehoo,
This "hi3660-dw-mshc" compatible string has been integrated into platform
maintainer's tree together with dts changes. It's now in linux-next [1], and in
Linus' master branch [2], will be in mainline v4.13-rc's.
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt?h=next-20170706
[2]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt
-Guodong
>>
>> Major changes in v3:
>> - solve review comments from Heiner Kallweit.
>>*use the GENMASK and FIELD_PREP macros replace the bit shift operation.
>>*use usleep_range() replace udelay() and mdelay().
>>
>> Major changes in v4:
>> - solve review comments from Jaehoon Chung.
>>*move common register for dwmmc controller to dwmmc header file.
>>*modify definitions type of some register variables.
>>*get rid of the magic numbers.
>>
>> Major changes in v5:
>> - further improve coding style.
>> ---
>> drivers/mmc/host/dw_mmc-k3.c | 315
>> +++
>> drivers/mmc/host/dw_mmc.h| 2 +
>> 2 files changed, 317 insertions(+)
>>
>> diff --git a/drivers/mmc/host/dw_mmc-k3.c
>> b/drivers/mmc/host/dw_mmc-k3.c index e38fb0020bb1..a28eb8c7da82
>> 100644
>> --- a/drivers/mmc/host/dw_mmc-k3.c
>> +++ b/drivers/mmc/host/dw_mmc-k3.c
>> @@ -8,6 +8,8 @@
>> * (at your option) any later version.
>> */
>>
>> +#include
>> +#include
>> #include
>> #include
>> #include
>> @@ -28,7 +30,38 @@
>> #define AO_SCTRL_SEL18 BIT(10)
>> #define AO_SCTRL_CTRL3 0x40C
>>
>> +#define DWMMC_SDIO_ID 2
>> +
>> +#define SOC_SCTRL_SCPERCTRL5(0x314)
>> +#define SDCARD_IO_SEL18 BIT(2)
>> +
>> +#define SDCARD_RD_THRESHOLD (512)
>> +
>> +#define GENCLK_DIV (7)
>> +
>> +#define GPIO_CLK_ENABLE BIT(16)
>> +#define GPIO_CLK_DIV_MASK GENMASK(11, 8)
>> +#define GPIO_USE_SAMPLE_DLY_MASK GENMASK(13, 13)
>> +#define UHS_REG_EXT_SAMPLE_PHASE_MASK GENMASK(20, 16)
>> +#define UHS_REG_EXT_SAMPLE_DRVPHASE_MASK GENMASK(25, 21)
>> +#define UHS_REG_EXT_SAMPLE_DLY_MASK GENMASK(30, 26)
>> +
>> +#define TIMING_MODE 3
>> +#define TIMING_CFG_NUM 10
>> +
>> +#define PULL_DOWN BIT(1)
>> +#define PULL_UP BIT(0)
>> +
>> +#define NUM_PHASES (40)
>> +
>> +#define ENABLE_SHIFT_MIN_SMPL (4)
>> +#define ENABLE_SHIFT_MAX_SMPL (12)
>> +#define USE_DLY_MIN_SMPL (11)
>> +#define USE_DLY_MAX_SMPL (14)
>> +
>> struct k3_priv {
>> + int ctrl_id;
>> + u32 cur_speed;
>> struct regmap *reg;
>> };
>>
>> @@ -38,6 +71,41 @@ static unsigned long dw_mci_hi6220_caps[] = {
>> 0
>> };
>>
>> +struct hs_timing {
>> + u32 drv_phase;
>> + u32 smpl_dly;
>> + u32 smpl_phase_max;
>> + u32 smpl_phase_min;
>> +};
>> +
>> +struct hs_timing hs_timing_cfg[TIMING_MODE][TIMING_CFG_NUM] = {
>> + { /* reserved */ },
>> + { /* SD */
>> + {7, 0, 15, 15,}, /* 0: LEGACY 400k */
>> + {6, 0, 4, 4,}, /* 1: MMC_HS */
>> + {6, 0, 3, 3,}, /* 2: SD_HS */
>> + {6, 0, 15, 15,}, /* 3: SDR12 */
>> + {6, 0, 2, 2,}, /* 4: SDR25 */
>> + {4, 0, 11, 0,}, /* 5: SDR50 */
>> + {6, 4, 15, 0,}, /* 6: SDR104 */
>> + {0}, /* 7: DDR50 */
>> + {0}, /* 8: DDR52 */
>> + {0}, /* 9: HS200 */
>> + },
>> + { /* SDIO */
>> + {7, 0, 15, 15,}, /* 0: LEGACY 400k */
>> + {0}, /* 1: MMC_HS */
>> + {6, 0, 15, 15,}, /* 2: SD_HS */
>> + {6, 0, 15, 15,}, /* 3: SDR12 */
>> + {6, 0, 0, 0,}, /* 4: SDR25 */
>> +