[U-Boot] [PATCH] mmc: pic32_sdhci: Complete the transition to driver model

Masahiro Yamada yamada.masahiro at socionext.com
Fri Jun 30 05:51:20 UTC 2017


2017-06-30 13:00 GMT+09:00 Jaehoon Chung <jh80.chung at samsung.com>:
> On 06/21/2017 12:23 PM, Alan Ott wrote:
>> Previously this driver appeared to have been half-way converted to the new
>> driver model and did not work at all.
>>
>> Complete the transition to the driver model, adding the necessary
>> connections.
>>
>> Signed-off-by: Alan Ott <alan at softiron.com>
>> ---
>>  configs/pic32mzdask_defconfig |  1 -
>>  drivers/mmc/Kconfig           |  2 +-
>>  drivers/mmc/pic32_sdhci.c     | 31 ++++++++++++++++++++++++++-----
>>  3 files changed, 27 insertions(+), 7 deletions(-)
>>
>> diff --git a/configs/pic32mzdask_defconfig b/configs/pic32mzdask_defconfig
>> index 688b989..afb1bdb 100644
>> --- a/configs/pic32mzdask_defconfig
>> +++ b/configs/pic32mzdask_defconfig
>> @@ -25,7 +25,6 @@ CONFIG_CMD_EXT4_WRITE=y
>>  # CONFIG_EFI_PARTITION is not set
>>  CONFIG_OF_EMBED=y
>>  CONFIG_NET_RANDOM_ETHADDR=y
>> -# CONFIG_BLK is not set
>>  CONFIG_CLK=y
>>  CONFIG_DM_GPIO=y
>>  CONFIG_MMC=y
>> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
>> index 0dd4443..b70775d 100644
>> --- a/drivers/mmc/Kconfig
>> +++ b/drivers/mmc/Kconfig
>> @@ -274,7 +274,7 @@ config MMC_SDHCI_MV
>>
>>  config MMC_SDHCI_PIC32
>>       bool "Microchip PIC32 on-chip SDHCI support"
>> -     depends on DM_MMC && MACH_PIC32
>> +     depends on DM_MMC && BLK && DM_MMC_OPS && MACH_PIC32
>
> If DM_MMC is enabled,,then CONFIG_BLK and CONFIG_DM_MMC_OPS are "y" by default.
> Why do you touch this?
>

I think the point here is CONFIG_BLK and CONFIG_DM_MMC_OPS are configurable
via menuconfig or friends.


The MMC core code is #ifdef's by CONFIG_BLK and CONFIG_DM_MMC_OPS.

It means one single board can not enable two MMC drivers at the same time
if one of them expects BLK/DM_MMC_OPS but the other does not.

Some boards need to use two different MMC drivers for SD card and eMMC.
(Some of my UniPhier boards are the case.)


Without "depends on DM_MMC && BLK && DM_MMC_OPS",
we can cause build error by enabling two MMC drivers with different
support level.



-- 
Best Regards
Masahiro Yamada


More information about the U-Boot mailing list