[U-Boot] [PATCH v5 2/3] cfi_flash: convert to driver model

Thomas Chou
2015-12-07T09:11:28Z

Hi Jagan,

On 2015?12?06? 23:03, Jagan Teki wrote:
> On 6 December 2015 at 19:05, Thomas Chou <thomas@wytron.com.tw> wrote:
>> Hi Jagan,
>>
>> On 2015?12?06? 21:10, Jagan Teki wrote:
>>>>
>>>> This probing is not specific to CFI flash. It will probe all flash
>>>> variants
>>>> of MTD uclass.
>>>
>>>
>>> This is something I'm unclear, suppose if I need to use MTD uclass in
>>> spi-flash drivers shall I enable CONFIG_CFI_FLASH? If so that depends
>>> on CONFIG_CFI_FLASH_DRIVER as well right? then it is not correct to
>>> enable CFI_FLASH_DRIVER for other flash variants like spi-flash right?
>>
>>
>> There is no need to select CFI_FLASH if there is no CFI flash. The probing
>> here is only because we want to display the size of parallel flash in
>> initr_flash() of board_r.c.
>
> So, this is the way drivers/mtd/altera_qspi.c getting probed?

Yes.

>
>>
>> Normally, devices are probed when they are used. You should be able to use
>> "sf probe" for MTD uclass in the same way you do for SPI_FLASH uclass.
>
> True, suppose if I wanted to probe spi-flash MTD uclass drivers w/o
> using "commands" like sf probe then I need to implement dm_scan node
> logic on mtd-uclass.c correct?

I am not sure whether the dm scan node should be on mtd uclass or
specific drivers. Could you give more details?

Best regards,
Thomas