[U-Boot] [RFC PATCH] mmc: omap_hsmmc: convert to use dm block devies

Grygorii Strashko grygorii.strashko at ti.com
Mon Feb 13 20:41:04 UTC 2017



On 02/10/2017 10:21 AM, Simon Glass wrote:
> Hi,
> 
> On 2 February 2017 at 15:18, Grygorii Strashko <grygorii.strashko at ti.com> wrote:
>>
>> Convert OMAP hsmmc driver to use driver-model block devices.
>>
>> Signed-off-by: Grygorii Strashko <grygorii.strashko at ti.com>
>> ---
>> Hi All,
>>
>> First of all, sorry if my questions/problems are looks dumb, I'm very new with u-boot.
>>
>> This is my attampt to enable CONFIG_BLK on OMAP platforms which is blocked now
>> by omap_hsmmc driver. omap_hsmmc required to be updated to use driver-model block
>> devices at minimum (and max to use dm_mmc_ops). Also, as per my understanding,
>> CONFIG_BLK is blocker for other tasks like enabling driver model for OMAP sata devices.
>>
>> With this patch I can boot from mmc on am335x-evm, but there are
>> two problems I need help with:
>> 1) My changes in Makefiles looks really ugly, but without them SPL build will
>>   fail because undef'ing in include/configs/am335x_evm.h does not take effect
>>   in Makefile (thanks Vignesh for the information [1]) and I, honestly, do not
>>   know how to fix it in better way, so I'd be appreciated for any help.
>>   Comparing to Vignesh's case, files which need to be excluded from build
>>   are generic and I worry that there can be dependecy from CONFIG_SPL_DM.
> 
> It would be great to enable CONFIG_BLK and CONFIG_DM_MMC in SPL.
> Perhaps Tom's message (later in this thread) about the gcc bug might
> help. The size difference is small, but not 0 unfortunately.
> 
>>
>> 2) with this patch I can see error message in log "** Bad device size - mmc 0 **":
>> U-Boot 2017.03-rc1-00020-g1a3b11a-dirty (Feb 02 2017 - 12:04:01 -0600)
>>
>> CPU  : AM335X-GP rev 2.0
>> Model: TI AM335x EVM
>> DRAM:  1 GiB
>> NAND:  256 MiB
>> MMC:   mmc at 48060000mmc@47810000OMAP SD/MMC: 0, OMAP SD/MMC: 1
>> ** Bad device size - mmc 0 **
>> Using default environment
>>
>> this message is triggered from:
>> board_r.c: initr_env()
>> - env_common.c: env_relocate()
>>  - env_fat.c: env_relocate_spec()
>>   - part.c: blk_get_device_part_str()
>> because partitions are not initialized yet, as i understood,
>>
>> Seems there are should be additional call to mmc_init():mmc_startup():part_init(),
>> but I'm not sure where/how to add it correctly.
> 
> Does this help?
> 
> http://patchwork.ozlabs.org/patch/717710/
> 

It seems like issue with "Bad device size..." was fixed
by patch "mmc: init mmc block devices on probe" [1].

This patch (my patch) with your patch [2] cause boot hang on am335x-evm when
mmc1 (mmc3 in DT) is probed (i've tried to revert [1] - result is the same).


[1] https://patchwork.ozlabs.org/patch/719652/
[2] http://patchwork.ozlabs.org/patch/717710/


-- 
regards,
-grygorii


More information about the U-Boot mailing list