[U-Boot] [PATCH v2 05/12] spi: add Faraday FTSPI010 SPI controller support

Kuo-Jung Su dantesu at gmail.com
Mon Apr 22 04:52:03 CEST 2013


2013/4/18 Wolfgang Denk <wd at denx.de>:
> Dear Kuo-Jung Su,
>
> In message <1366277139-29728-6-git-send-email-dantesu at gmail.com> you wrote:
> ...
>> +/* Register access macros */
>> +#define SPI_READ(r)                  le32_to_cpu(readl(r))
>> +#define SPI_WRITE(v, r)              writel(cpu_to_le32(v), r)
>> +#define SPI_SETBITS(m, r)    setbits_le32(r, m)
>> +#define SPI_CLRBITS(m, r)    clrbits_le32(r, m)
>
> Ad before: drop these.
>

Got it, thanks

>> +#ifdef CONFIG_FTSSP010_GPIO_BASE
>> +#define SPI_GPIO_READ(p, r)  \
>> +     le32_to_cpu(readl((p)->gpio.iobase + (r)))
>> +#define SPI_GPIO_WRITE(p, v, r)      \
>> +     writel(cpu_to_le32(v), (p)->gpio.iobase + (r))
>> +#define SPI_GPIO_SETBITS(p, m, r)    \
>> +     setbits_le32((p)->gpio.iobase + (r), m)
>> +#define SPI_GPIO_CLRBITS(p, m, r)    \
>> +     clrbits_le32((p)->gpio.iobase + (r), m)
>> +#endif /* #ifdef CONFIG_FTSSP010_GPIO_BASE */
>
> We do not allos I/O accesses throug base addrss plus offset.
> Please use proper C structs instead.
>
>

Got it, thanks

> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> Sorry, but my karma just ran over your dogma.



--
Best wishes,
Kuo-Jung Su


More information about the U-Boot mailing list