[U-Boot] [PATCH v3 0/29] Introduce driver model support for SPI, SPI flash, cros_ec

Simon Glass sjg at chromium.org
Thu Oct 23 06:06:12 CEST 2014


Hi,

On 11 October 2014 12:46, Jagan Teki <jagannadh.teki at gmail.com> wrote:
> On 30 September 2014 01:04, Simon Glass <sjg at chromium.org> wrote:
>> Up until now driver model has not been used for any type of bus. Buses
>> have some unique properties and needs, so we cannot claim that driver
>> model can cover all the common cases unless we have converted a bus over
>> to driver model.
>>
>> SPI is a reasonable choice for this next step. It has a fairly simple
>> API and not too many dependencies. The main one is SPI flash so we may
>> as well convert that also. Since the boards I test with have cros_ec I
>> have also included that, for SPI only.
>>
>> The technique used is make use of driver model's supported data structures
>> to hold information currently kept by each subsystem in a private data
>> structure. Since 'struct spi_slave' relates to the slave device on the bus
>> it is stored in the 'parent' data with each child device of the bus.
>> Since 'struct spi_flash' is a standard interface used for each SPI flash
>> driver, it is stored in the SPI FLash uclass's private data for each
>> device.
>>
>> New defines are created to enable driver model for each subsystem. These
>> are:
>>
>>    CONFIG_DM_SPI
>>    CONFIG_DM_SPI_FLASH
>>    CONFIG_DM_CROS_EC
>>
>> This allows us to move some boards and drivers to driver model, while
>> leaving others behind. A 'big bang' conversion of everything to driver
>> model, even at a subsystem level, is never going to work.
>>
>> There is some cost in changing the uclass interface after it is created,
>> so if you have limited time, please spend it reviewing the uclass
>> interfaces in spi.h and spi_flash.h. These need to be supported by each
>> driver, so changing them later may involve changing multiple drivers.
>>
>> To assist with the conversion of other SPI drivers, a README file is
>> added to walk through the process.
>>
>> So far, sandbox, exynos and tegra drivers are converted over.
>>
>> As always, driver model patches are available at u-boot-dm.git branch
>> 'working'. There is a branch for just this series called 'spi-working'.

It has taken me several months but I've sent a pull request for this
series and it should be in mainline soon. Please let me know of any
problems you find with Tegra and Exynos.

Regards,
Simon


More information about the U-Boot mailing list