Re: [PATCH RESEND v2 2/2] Add support for Realtek RTL838x/RTL839x SoC SPI controllers

2021-01-01 Thread Bert Vermeulen
On 12/31/20 3:23 PM, Lukas Wunner wrote: On Wed, Dec 30, 2020 at 12:19:04AM +0100, Bert Vermeulen wrote: +static inline void wait_ready(struct rtspi *rtspi) +{ + while (!(readl(REG(RTL8380_SPI_SFCSR)) & RTL8380_SPI_SFCSR_RDY)) + ; +} I'd suggest calling cpu_relax() in the

Re: [PATCH RESEND v2 2/2] Add support for Realtek RTL838x/RTL839x SoC SPI controllers

2020-12-31 Thread Lukas Wunner
On Wed, Dec 30, 2020 at 12:19:04AM +0100, Bert Vermeulen wrote: > +static inline void wait_ready(struct rtspi *rtspi) > +{ > + while (!(readl(REG(RTL8380_SPI_SFCSR)) & RTL8380_SPI_SFCSR_RDY)) > + ; > +} I'd suggest calling cpu_relax() in the loop's body. > + err =

[PATCH RESEND v2 2/2] Add support for Realtek RTL838x/RTL839x SoC SPI controllers

2020-12-29 Thread Bert Vermeulen
This driver likely also supports earlier (RTL8196) and later (RTL93xx) SoCs. The SPI hardware in these SoCs is specifically intended for connecting NOR bootflash chips, and only used for that in dozens of examined devices. However boiled down to basics, it's really just a half-duplex SPI