Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 3 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
View
6 misoclib/identifier/__init__.py
@@ -4,10 +4,11 @@
from misoclib.identifier import git
class Identifier(Module, AutoCSR):
- def __init__(self, sysid, frequency, revision=None):
+ def __init__(self, sysid, frequency, l2_size, revision=None):
self._r_sysid = CSRStatus(16)
self._r_revision = CSRStatus(32)
self._r_frequency = CSRStatus(32)
+ self._r_l2_size = CSRStatus(8)
###
@@ -17,5 +18,6 @@ def __init__(self, sysid, frequency, revision=None):
self.comb += [
self._r_sysid.status.eq(sysid),
self._r_revision.status.eq(revision),
- self._r_frequency.status.eq(frequency)
+ self._r_frequency.status.eq(frequency),
+ self._r_l2_size.status.eq(l2_size)
]
View
1  software/bios/main.c
@@ -347,6 +347,7 @@ static void do_command(char *c)
else if(strcmp(token, "mw") == 0) mw(get_token(&c), get_token(&c), get_token(&c));
else if(strcmp(token, "mc") == 0) mc(get_token(&c), get_token(&c), get_token(&c));
else if(strcmp(token, "crc") == 0) crc(get_token(&c), get_token(&c));
+ else if(strcmp(token, "flushl2") == 0) flush_l2_cache();
else if(strcmp(token, "flashboot") == 0) flashboot();
else if(strcmp(token, "serialboot") == 0) serialboot();
View
1  software/include/base/system.h
@@ -7,6 +7,7 @@ extern "C" {
void flush_cpu_icache(void);
void flush_cpu_dcache(void);
+void flush_l2_cache(void);
#ifdef __cplusplus
}
View
16 software/libbase/system.c
@@ -2,6 +2,8 @@
#include <uart.h>
#include <system.h>
+#include <hw/mem.h>
+#include <hw/csr.h>
void flush_cpu_icache(void)
{
@@ -21,3 +23,17 @@ void flush_cpu_dcache(void)
"nop\n"
);
}
+
+void flush_l2_cache(void)
+{
+ unsigned int l2_nwords;
+ unsigned int i;
+ register unsigned int addr;
+ register unsigned int dummy;
+
+ l2_nwords = 1 << (identifier_l2_size_read() - 2);
+ for(i=0;i<2*l2_nwords;i++) {
+ addr = SDRAM_BASE + i*4;
+ __asm__ volatile("lw %0, (%1+0)\n":"=r"(dummy):"r"(addr));
+ }
+}
View
3  software/videomixer/dvisamplerX.c
@@ -5,6 +5,7 @@
#include <irq.h>
#include <uart.h>
#include <time.h>
+#include <system.h>
#include <hw/csr.h>
#include <hw/flags.h>
@@ -122,7 +123,7 @@ void dvisamplerX_disable(void)
void dvisamplerX_clear_framebuffers(void)
{
memset(&dvisamplerX_framebuffers, 0, sizeof(dvisamplerX_framebuffers));
- // TODO: empty bridge cache
+ flush_l2_cache();
}
static int dvisamplerX_d0, dvisamplerX_d1, dvisamplerX_d2;
View
3  top.py
@@ -158,7 +158,8 @@ def __init__(self, platform, platform_name, with_memtest):
#
self.submodules.crg = mxcrg.MXCRG(MXClockPads(platform), clk_freq)
self.submodules.uart = uart.UART(platform.request("serial"), clk_freq, baud=115200)
- self.submodules.identifier = identifier.Identifier(self.known_platform_id[platform_name], int(clk_freq))
+ self.submodules.identifier = identifier.Identifier(self.known_platform_id[platform_name], int(clk_freq),
+ log2_int(l2_size))
self.submodules.timer0 = timer.Timer()
if platform_name == "mixxeo":
self.submodules.leds = gpio.GPIOOut(platform.request("user_led"))

No commit comments for this range

Something went wrong with that request. Please try again.