[U-Boot] Flag -mno-cache-volatile to bypass the cache

ivanchuklist ivanchu ivanchuklist at gmail.com
Thu Feb 5 21:01:26 CET 2009


Thank you wolfgang.
I see also in cpu/nios an implementation of the spi core, it uses volatiles
variables to access hardware, so it will not work. Nevertheless the
implementation is correct.
I'm adding sd access by spi protocol to u-boot, so i created a new file
called mmc_spi.c in cpu/nios2. I faced many problems. I just want to have
access to the fat partition, then i wrote mmc_get_dev and mmc_read_block but
i need to initialize the card so i implemented mmc_init (which add mmc
command) and i don't want to write mmc_read/write/2info. Should i implement
those functions?. In the other hand, should i use spi_xfer() to do spi
transactions?.
Regards,
Ivan Llopard.

2009/2/5 Wolfgang Denk <wd at denx.de>

> Dear ivanchuklist ivanchu,
>
> In message <51a313240902050730k4f03247etc73ac5579c1f7154 at mail.gmail.com>
> you wrote:
> >
> > I use readl() or writel() to access the hardware but i found a compiler
> flag
> > that bypass the cache for all volatile variables, it uses io versions of
> > load/store functions. So, what should i do, make use of write/read
> functions
> > or insert this flag in the makefile?.
>
> Please continue to use the I/O accessor functions. Your specific
> compiler version may understand such an option, but don't expect that
> any other compiler or architecture provides the same - so better stay
> portable and use what was designed exactly for this purpose.
>
> 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
> Perl itself is  usually  pretty  good  about  telling  you  what  you
> shouldn't do. :-)     - Larry Wall in <11091 at jpl-devvax.JPL.NASA.GOV>
>


More information about the U-Boot mailing list