[U-Boot] [PATCH v3 10/16] drivers: mtd: spi: sf_probe: add compatible for spansion spi flash

Mugunthan V N
2015-11-20T06:01:15Z

Jagan

On Thursday 19 November 2015 03:40 PM, Jagan Teki wrote:
> On 19 November 2015 at 12:35, Mugunthan V N <mugunthanvnm@ti.com> wrote:
>> Add compatible for spansion 32MiB spi flash s25fl256s1.
>>
>> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
>> ---
>> drivers/mtd/spi/sf_probe.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
>> index bc05d30..ffbce59 100644
>> --- a/drivers/mtd/spi/sf_probe.c
>> +++ b/drivers/mtd/spi/sf_probe.c
>> @@ -515,6 +515,7 @@ static const struct dm_spi_flash_ops spi_flash_std_ops = {
>>
>> static const struct udevice_id spi_flash_std_ids[] = {
>> { .compatible = "spi-flash" },
>> + { .compatible = "s25fl256s1" },
>> { }
>
> Never compare with spi-flash vs s25fl256s1 here former is driver
> compatible string and later one is probed flash string name. we don't
> need to add them in compatible list, better to add it on dts node
> otherwise no issue the connected flash will detect while 'sf probe'
>

I agree that spi flash will be probed even without addition of compatibles.

If there is no matching compatible between the dtb and driver, the dt
properties like spi-max-frequency, spi clock phase/polarity and spi
bus-width are not parsed from DT as the of_offset of the spi device will
be '-1'. This check and dt parse is done in spi_child_post_bind() in
spi-uclass driver.

Since spi bus-width is not read from DT, by default spi transfers are
done in one wire mode and read throughput drops to 5.3Mbps. With Quad
mode read throughput is 16.6Mbps in DRA74x EVM.

Adding spi-splash to DT is not possible now as it is not documented in
Kernel binding documentation. Even if "spi-flash" compatible is added to
u-boot DT then it will show diff when syncing the dts files from Kernel
to U-boot and it has to be taken care for every sync. Tom Rini also has
agreed to this [1].

[1]: http://patchwork.ozlabs.org/patch/539780/

Regards
Mugunthan V N