[U-Boot] [PATCH 2/6] mx6q: Add support for ECSPI through mxc_spi driver

Eric Nelson eric.nelson at boundarydevices.com
Wed Jan 18 03:02:13 CET 2012


On 01/17/2012 06:47 PM, Marek Vasut wrote:
>> On 01/17/2012 06:27 PM, Marek Vasut wrote:
>>
>> I'll defer to Stefano on this one, since I did this in response
>> to his request:
 >>
>>> Right - and we already discussed in the past how to avoid to put
>>> specific SOC code inside the driver. In fact, the cspi_regs structure
>>> was already moved into the specific SOC header (imx-regs.h) - but the
>>> definitions of the single bits of the registers are still inside the
>>> driver, as well as the base address of the (e)cspi controllers.
>>>
>>> They should also be moved - take into acoount by implementing your
>>> changes for i.mx6
>>
>> The struct cspi_regs is already present in mx31, mx35, and mx51 headers,
>> so I'm not breaking new ground here, only in the bitfield declarations.
 >> <snip>
>>
>> My interpretation of Stefano's intent is to clean up the driver at the
>> expense of extra defines in the arch-specific headers.
>
> But they're all the same, right? So we have now the same structure defined
> thrice?
>

Almost, but not quite: mx31 and mx35 both use the CSPI peripheral and have
one layout. mx5 and mx6 have the ECSPI peripheral, which has an extra
register "cfg" to control the polarity and phase of the signals.

Actually, that comment is wrong. The MX51 and MX53 have **both** CSPI and
ECSPI peripherals, but the existing code in mxc_spi only supports ECSPI.

The bitfields that my patches move into the imx-regs.h files are also
almost identical.


More information about the U-Boot mailing list