1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-02-06 08:15:03 +00:00
Files
antonblanchard.microwatt/litedram/gen-src/sdram_init/include/system.h
Benjamin Herrenschmidt a3857aac94 litedram: Add an L2 cache with store queue
This adds a cache between the wishbone and litedram with the following
features (at this point, it's still evolving)

  - 128 bytes line width in order to have a reasonable amount of
litedram pipelining on the 128-bit wide data port.

  - Configurable geometry otherwise

  - Stores are acked immediately on wishbone whether hit or miss
(minus a 2 cycles delay if there's a previous load response in the
way) and sent to LiteDRAM via 8 entries (configurable) store queue

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2020-06-05 10:33:27 +10:00

47 lines
1.0 KiB
C

#ifndef __SYSTEM_H
#define __SYSTEM_H
#include "microwatt_soc.h"
#include "io.h"
#define CSR_ACCESSORS_DEFINED
#define CSR_BASE DRAM_CTRL_BASE
#define CONFIG_CPU_NOP "nop"
#ifdef __SIM__
#define MEMTEST_BUS_SIZE 512//16
#define MEMTEST_DATA_SIZE 1024//16
#define MEMTEST_ADDR_SIZE 128//16
#define CONFIG_SIM_DISABLE_DELAYS
#endif
extern void flush_cpu_dcache(void);
extern void flush_cpu_icache(void);
static inline void flush_l2_cache(void) { }
/* Fake timer stuff. LiteX should abstract this */
static inline void timer0_en_write(int e) { }
static inline void timer0_reload_write(int r) { }
static inline void timer0_load_write(int l) { }
static inline void timer0_update_value_write(int v) { }
static inline uint64_t timer0_value_read(void)
{
uint64_t val;
__asm__ volatile ("mfdec %0" : "=r" (val));
return val;
}
static inline void csr_write_simple(unsigned long v, unsigned long a)
{
return writel(v, a);
}
static inline unsigned long csr_read_simple(unsigned long a)
{
return readl(a);
}
#endif /* __SYSTEM_H */