[U-Boot] [PATCH v2 18/18] spi: mpc8xxx: Convert to DM

Mario Six mario.six at gdsys.cc
Thu Apr 26 05:55:53 UTC 2018


Hi Jagan,

On Thu, Apr 26, 2018 at 7:49 AM, Jagan Teki <jagan at amarulasolutions.com> wrote:
> On Thu, Apr 26, 2018 at 11:13 AM, Mario Six <mario.six at gdsys.cc> wrote:
>> Hi Jagan,
>>
>> On Thu, Apr 26, 2018 at 7:34 AM, Jagan Teki <jagannadh.teki at gmail.com> wrote:
>>> On Thu, Apr 19, 2018 at 6:06 PM, Mario Six <mario.six at gdsys.cc> wrote:
>>>> Support DM in the MPC8xxx SPI driver, and remove the legacy SPI
>>>> interface.
>>>>
>>>> Signed-off-by: Mario Six <mario.six at gdsys.cc>
>>>> ---
>>>>  drivers/spi/mpc8xxx_spi.c | 144 ++++++++++++++++++++++++++++++++++------------
>>>>  1 file changed, 107 insertions(+), 37 deletions(-)
>>>> ---
>>>>
>>>> Changes v1 -> v2:
>>>> * Removed legacy layer
>>>> * Sorted includes
>>>> * Now return -ETIMEDOUT on timeout during transfer
>>>>
>>>> ---
>>>>
>>>> diff --git a/drivers/spi/mpc8xxx_spi.c b/drivers/spi/mpc8xxx_spi.c
>>>> index 4aa5db8821..9c9dd67ec2 100644
>>>> --- a/drivers/spi/mpc8xxx_spi.c
>>>> +++ b/drivers/spi/mpc8xxx_spi.c
>>>> @@ -6,10 +6,12 @@
>>>>   */
>>>>
>>>>  #include <common.h>
>>>> -
>>>> +#include <dm.h>
>>>> +#include <errno.h>
>>>>  #include <malloc.h>
>>>>  #include <spi.h>
>>>>  #include <asm/mpc8xxx_spi.h>
>>>> +#include <asm-generic/gpio.h>
>>>
>>> [snip]
>>>
>>>> +};
>>>> +
>>>> +static const struct udevice_id mpc8xxx_spi_ids[] = {
>>>> +       { .compatible = "fsl,spi" },
>>>
>>> Look like new binding right? don't we have suitable binding for this
>>> driver? or what is the equivalent driver for this in Linux?
>>>
>>
>> I took that compatible string from the Linux kernel, actually. See for example
>>
>> https://raw.githubusercontent.com/torvalds/linux/master/arch/powerpc/boot/dts/mpc8379_mds.dts
>>
>> There are more specific ones, like "fsl,mpc8610-spi", but "fsl,spi" is
>> the most generic.
>
> So this driver is same as drivers/spi/spi-fsl-spi.c from Linux, is it?
>

Yes, with reduced functionality, of course, but compatible to the same devices.

Best regards,
Mario


More information about the U-Boot mailing list