[U-Boot] [PATCH v3] spi: add new driver for OpenCores tiny_spi

Wolfgang Denk wd at denx.de
Mon Apr 11 21:54:46 CEST 2011


Dear Thomas Chou,

In message <1295323751-12085-1-git-send-email-thomas at wytron.com.tw> you wrote:
> This patch adds support for OpenCores tiny_spi.
> 
> http://opencores.org/project,tiny_spi
> 
> Signed-off-by: Thomas Chou <thomas at wytron.com.tw>
> ---
> for u-boot
> v2, use const and clean up as Mike suggested.
> v3, use struct instead of base+offset as Wolfgang suggested.
> 
>  drivers/spi/Makefile      |    1 +
>  drivers/spi/oc_tiny_spi.c |  248 +++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 249 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/spi/oc_tiny_spi.c

Sorry, but I see only now trhat there is an issue left:

> +struct tiny_spi_regs {
> +	volatile unsigned rxdata;	/* Rx data reg */
> +	volatile unsigned txdata;	/* Tx data reg */
> +	volatile unsigned status;	/* Status reg */
> +	volatile unsigned control;	/* Control reg */
> +	volatile unsigned baud;		/* Baud reg */
> +};

Please drop all these volatiles; see
Documentation/volatile-considered-harmful.txt in the Linux source
tree.

Thanks.

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
Accident: A condition in which presence of mind is good, but  absence
of body is better.


More information about the U-Boot mailing list