[U-Boot] [PATCH v4 30/33] rockchip: Add SPI driver
Simon Glass
sjg at chromium.org
Mon Aug 31 00:45:32 CEST 2015
Hi Jagan,
On 27 August 2015 at 22:42, Jagan Teki <jteki at openedev.com> wrote:
> Hi Simon,
>
> On 24 August 2015 at 20:42, Simon Glass <sjg at chromium.org> wrote:
>> Add a SPI driver for the Rockchip RK3288, using driver model. It should work
>> for other Rockchip SoCs also.
>>
>> Signed-off-by: Simon Glass <sjg at chromium.org>
>> ---
>>
>> Changes in v4:
>> - Rename pinctrl.h to dm/pinctrl.h
>>
>> Changes in v3: None
>> Changes in v2: None
>>
>> drivers/spi/Kconfig | 9 ++
>> drivers/spi/Makefile | 1 +
>> drivers/spi/rk_spi.c | 375 +++++++++++++++++++++++++++++++++++++++++++++++++++
>> drivers/spi/rk_spi.h | 121 +++++++++++++++++
>> 4 files changed, 506 insertions(+)
>> create mode 100644 drivers/spi/rk_spi.c
>> create mode 100644 drivers/spi/rk_spi.h
>>
>> diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
>> index c84a7b7..87d6571 100644
>> --- a/drivers/spi/Kconfig
>> +++ b/drivers/spi/Kconfig
>> @@ -58,6 +58,15 @@ config ICH_SPI
>> access the SPI NOR flash on platforms embedding this Intel
>> ICH IP core.
>>
>> +config ROCKCHIP_SPI
>> + bool "Rockchip SPI driver"
>> + depends on DM_SPI
>
> It's already in DM_SPI if this is not required, please check.
Yes this can be dropped.
[snip]
>> +
>> +static int rkspi_wait_till_not_busy(struct rockchip_spi *regs)
>> +{
>> + unsigned int delay = 1000;
>> +
>> + while (delay--) {
>> + if (!(readl(®s->sr) & SR_BUSY))
>> + return 0;
>> +
>> + udelay(1);
>> + }
>> + debug("RK SPI: Status keeps busy for 1000us after a read/write!\n");
>> +
>> + return -ETIMEDOUT;
>> +}
>
> I just made some comments about, this busy loop and debug prints,
> pleas look at [1] it once if you missed.
>
> [1] https://patchwork.ozlabs.org/patch/487873/
>
Sorry, yes I left behind quite a few comments. I've gone back and
tidied these up.
Regards,
Simon
More information about the U-Boot
mailing list