forked from Imagelibrary/rtems
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>
This commit is contained in:
committed by
Gedare Bloom
parent
f442e6b45c
commit
39671330dc
@@ -73,6 +73,10 @@ extern int rtems_leon_greth_driver_attach(
|
||||
|
||||
#define HAS_SMC91111
|
||||
|
||||
/* Configure GRETH driver */
|
||||
#define GRETH_SUPPORTED
|
||||
#define GRETH_MEM_LOAD(addr) leon_r32_no_cache(addr)
|
||||
|
||||
extern int CPU_SPARC_HAS_SNOOPING;
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user