diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2011-12-02 10:53:35 +0100 |
---|---|---|
committer | Gedare Bloom <gedare@rtems.org> | 2012-03-27 16:29:22 -0400 |
commit | 39671330dc7db16955af7fb240f93d1ae192603f (patch) | |
tree | 58260d6cc5c4cf125366168c9bd54d0b26de507a /c/src/lib/libbsp/sparc/leon3/include/leon.h | |
parent | ARM: PR2042: Provide stub for ARMv6-M (diff) | |
download | rtems-39671330dc7db16955af7fb240f93d1ae192603f.tar.bz2 |
GRETH: added support for non-snooping GRETH 10/100 systems
When data cache snooping is not present the cache needs
flushing, the SPARC LEON CPUs does not have to ability
to flush individual cache rows and flushing all cache is
expensive. Instead the LDA instruction is used to force
cache miss on individual loads during the IP-align copy
operation required anyway.
GRETH GBIT non-snooping systems are still unsupported,
since it use zero-copy (can deal with unaligned DMA).
Let the bsp.h select if the GRETH driver is supported.
Currently only the LEON2/LEON3 platforms BSPs builds the
driver.
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Diffstat (limited to 'c/src/lib/libbsp/sparc/leon3/include/leon.h')
-rw-r--r-- | c/src/lib/libbsp/sparc/leon3/include/leon.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/include/leon.h b/c/src/lib/libbsp/sparc/leon3/include/leon.h index b953e59b40..cd50629176 100644 --- a/c/src/lib/libbsp/sparc/leon3/include/leon.h +++ b/c/src/lib/libbsp/sparc/leon3/include/leon.h @@ -326,6 +326,14 @@ extern int LEON3_Cpu_Index; #define LEON_REG_TIMER_COUNTER_DEFINED_MASK 0x00000003 #define LEON_REG_TIMER_COUNTER_CURRENT_MODE_MASK 0x00000003 +/* Load 32-bit word by forcing a cache-miss */ +static inline unsigned int leon_r32_no_cache(uintptr_t addr) +{ + unsigned int tmp; + asm volatile (" lda [%1] 1, %0\n" : "=r"(tmp) : "r"(addr)); + return tmp; +} + #endif /* !ASM */ #ifdef __cplusplus |