[U-Boot] [PATCH v2 9/9] spi, mpc8xx: migrate to DM_SPI
Christophe LEROY
christophe.leroy at c-s.fr
Thu Nov 29 08:23:57 UTC 2018
Le 21/11/2018 à 10:09, Jagan Teki a écrit :
> On Wed, Nov 21, 2018 at 2:21 PM Christophe Leroy
> <christophe.leroy at c-s.fr> wrote:
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy at c-s.fr>
>> ---
>> drivers/spi/mpc8xx_spi.c | 179 ++++++++---------------------------------------
>
> Update Kconfig to move the config definition in DM_SPI area.
You did it already it seems, thanks.
>
>>
>> /* Setting tx bd status and data length */
>> + out_be32(&tbdf->cbd_bufaddr, (ulong)dout);
>> out_be16(&tbdf->cbd_sc, BD_SC_READY | BD_SC_LAST | BD_SC_WRAP);
>> out_be16(&tbdf->cbd_datlen, count);
>>
>> /* Setting rx bd status and data length */
>> + out_be32(&rbdf->cbd_bufaddr, (ulong)din);
>> out_be16(&rbdf->cbd_sc, BD_SC_EMPTY | BD_SC_WRAP);
>> out_be16(&rbdf->cbd_datlen, 0); /* rx length has no significance */
>>
>> @@ -333,3 +197,20 @@ ssize_t spi_xfer(size_t count)
>>
>> return count;
>> }
>> +
>> +static const struct dm_spi_ops mpc8xx_spi_ops = {
>> + .xfer = mpc8xx_spi_xfer,
>> +};
>> +
>> +static const struct udevice_id mpc8xx_spi_ids[] = {
>> + { .compatible = "fsl,mpc8xx-spi" },
>
> Is this binding from Linux?
>
No, on Linux we have a common driver for 8xx and most of 8xxx.
But the Uboot 8xxx SPI driver is too light to easily include 8xx so it
was easier to port the existing 8xx driver to DM at the moment.
When the 8xxx implements QE mode SPI for the 83xx, then I'll be able to
amend it to also support 8xx.
Christophe
More information about the U-Boot
mailing list