[U-Boot] [PATCH v3] drivers: spi: migrate cf_spi to DM
Simon Glass
sjg at chromium.org
Fri Sep 14 10:17:56 UTC 2018
Hi Angelo,
On 28 June 2018 at 21:48, Angelo Dureghello <angelo at sysam.it> wrote:
> Hi Jagan,
>
> On Wed, Jun 27, 2018 at 02:54:42PM +0530, Jagan Teki wrote:
>> On Wed, Jun 27, 2018 at 2:27 PM, Angelo Dureghello <angelo at sysam.it> wrote:
>> > Hi Jagan,
>> >
>> > On Wed, Jun 27, 2018 at 12:08:26PM +0530, Jagan Teki wrote:
>> >> On Tue, Jun 26, 2018 at 10:28 PM, Angelo Dureghello <angelo at sysam.it> wrote:
>> >> > This patch adds DM support to cf_spi.c.
>> >> >
>> >> > How to use/test it:
>> >> >
>> >> > 1) enable the following options,
>> >> >
>> >> > CONFIG_DM_SPI
>> >> > CONFIG_DM_SPI_FLASH
>> >> >
>> >> > 2) add similar code into your board.c file
>> >> >
>> >> > U_BOOT_DEVICE(coldfire_spi) = {
>> >> > .name = "spi_coldfire",
>> >> > .platdata = &mcf_spi_plat,
>> >> > };
>> >> >
>> >> > ---
>> >> > Changes from v1:
>> >> > - split into 2 patches
>> >> >
>> >> > Changes from v2:
>> >> > - back in a single patch, no need to add fdt support or special
>> >> > config options
>> >> > - doc/driver-model/spi-howto.txt has been re-checked and followed,
>> >> > the driver now builds as is.
>> >>
>> >> Nice, How about full dm conversion. I have seen few boards using this
>> >> driver and its quite manageble for full switching. what do you think?
>> >
>> > Sorry, what do you mean exactly for full switching ?
>> > My understanding is, to remove the non-dm part of the driver and add to
>> > each board proper device struct and config options, correct ?
>>
>> yes.
>>
>> > In this case, i can only test it on my stmark2 board, but i think could
>> > be enough.
>>
>> yes, for untested ones will ask other board maintainers.
>
> I verified right now, for a full switch i should enable CONFIG_DM for
> the architecture, and then select CONFIG_DM_SPI, moving as his child
> the CONFIG_CF_SPI.
>
> To enable CONFIG_DM for m68k means to add device tree, or there are
> of_xxx functions unresolved externals errors then.
>
> For this small architecture, i am not that happy to add the devicetree
> support. I should add a fixed 30 KB of binary size and several diffent
> families/dtsi, with the benefit to configure mainly uart and spi.
Are you worried about the size of SPL when using device tree?
How about converting m68k to DT in U-Boot proper as a first step?
>
> If the devicetree become mandatory/forced, would be nice if you could accept
> the migration as is (as from doc/driver-model/spi-howto.txt), and i could
> then work on devicetree in a later step.
Regards,
Simon
More information about the U-Boot
mailing list