# MINICON
elif ramcon_type == "minicon":
- if self.with_l2:
- raise ValueError("MINICON does not implement L2 cache (Use LASMICON or disable L2 cache (with_l2=False))")
-
self.submodules.controller = controller = minicon.Minicon(phy, sdram_geom, sdram_timing)
self.comb += Record.connect(controller.dfi, self.dfii.slave)
else:
for name, origin, busword, obj in regions:
if isinstance(obj, Memory):
fullname = name + "_" + memory.name_override
- r += "#define "+fullname.upper()+"_BASE "+hex(origin)+"\n"
+ r += "#define CSR_"+fullname.upper()+"_BASE "+hex(origin)+"\n"
else:
r += "\n/* "+name+" */\n"
- r += "#define "+name.upper()+"_BASE "+hex(origin)+"\n"
+ r += "#define CSR_"+name.upper()+"_BASE "+hex(origin)+"\n"
for csr in obj:
nr = (csr.size + busword - 1)//busword
r += _get_rw_functions(name + "_" + csr.name, origin, nr, busword, isinstance(csr, CSRStatus))
}
}
-#ifdef ETHMAC_BASE
+#ifdef CSR_ETHMAC_BASE
#define LOCALIP1 192
#define LOCALIP2 168
puts("rcsr - read processor CSR");
puts("wcsr - write processor CSR");
#endif
-#ifdef ETHMAC_BASE
+#ifdef CSR_ETHMAC_BASE
puts("netboot - boot via TFTP");
#endif
puts("serialboot - boot via SFL");
else if(strcmp(token, "flashboot") == 0) flashboot();
#endif
else if(strcmp(token, "serialboot") == 0) serialboot();
-#ifdef ETHMAC_BASE
+#ifdef CSR_ETHMAC_BASE
else if(strcmp(token, "netboot") == 0) netboot();
#endif
else if(strcmp(token, "wcsr") == 0) wcsr(get_token(&c), get_token(&c));
#endif
-#ifdef SDRAM_BASE
+#ifdef CSR_SDRAM_BASE
else if(strcmp(token, "sdrrow") == 0) sdrrow(get_token(&c));
else if(strcmp(token, "sdrsw") == 0) sdrsw();
else if(strcmp(token, "sdrhw") == 0) sdrhw();
else if(strcmp(token, "sdrrd") == 0) sdrrd(get_token(&c), get_token(&c));
else if(strcmp(token, "sdrrderr") == 0) sdrrderr(get_token(&c));
else if(strcmp(token, "sdrwr") == 0) sdrwr(get_token(&c));
-#ifdef DDRPHY_BASE
+#ifdef CSR_DDRPHY_BASE
else if(strcmp(token, "sdrwlon") == 0) sdrwlon();
else if(strcmp(token, "sdrwloff") == 0) sdrwloff();
else if(strcmp(token, "sdrlevel") == 0) sdrlevel();
printf("Automatic boot in 2 seconds...\n");
printf("Q/ESC: abort boot\n");
printf("F7: boot from serial\n");
-#ifdef ETHMAC_BASE
+#ifdef CSR_ETHMAC_BASE
printf("F8: boot from network\n");
#endif
timer0_en_write(0);
serialboot();
return 0;
}
-#ifdef ETHMAC_BASE
+#ifdef CSR_ETHMAC_BASE
if(c == 0x07) {
netboot();
return 0;
flashboot();
#endif
serialboot();
-#ifdef ETHMAC_BASE
+#ifdef CSR_ETHMAC_BASE
netboot();
#endif
printf("No boot medium found\n");
printf("Revision %08x built "__DATE__" "__TIME__"\n\n", MSC_GIT_ID);
crcbios();
id_print();
-#ifdef ETHMAC_BASE
+#ifdef CSR_ETHMAC_BASE
ethreset();
#endif
-#ifdef SDRAM_BASE
+#ifdef CSR_SDRAM_BASE
sdr_ok = sdrinit();
#else
sdr_ok = 1;
#include <generated/csr.h>
-#ifdef SDRAM_BASE
+#ifdef CSR_SDRAM_BASE
#include <stdio.h>
#include <stdlib.h>
command_pwr(DFII_COMMAND_CAS|DFII_COMMAND_WE|DFII_COMMAND_CS|DFII_COMMAND_WRDATA);
}
-#ifdef DDRPHY_BASE
+#ifdef CSR_DDRPHY_BASE
void sdrwlon(void)
{
return 1;
}
-#endif /* DDRPHY_BASE */
+#endif /* CSR_DDRPHY_BASE */
#define TEST_SIZE (2*1024*1024)
printf("Initializing SDRAM...\n");
init_sequence();
-#ifdef DDRPHY_BASE
+#ifdef CSR_DDRPHY_BASE
if(!sdrlevel())
return 0;
#endif
void sdrrderr(char *count);
void sdrwr(char *startaddr);
-#ifdef DDRPHY_BASE
+#ifdef CSR_DDRPHY_BASE
void sdrwlon(void);
void sdrwloff(void);
int sdrlevel(void);
#include <generated/mem.h>
-#define ETHMAC_RX0_BASE ETHMAC_MEM_BASE
-#define ETHMAC_RX1_BASE (ETHMAC_MEM_BASE+0x0800)
-#define ETHMAC_TX0_BASE (ETHMAC_MEM_BASE+0x1000)
-#define ETHMAC_TX1_BASE (ETHMAC_MEM_BASE+0x1800)
+#define ETHMAC_RX0_BASE ETHMAC_BASE
+#define ETHMAC_RX1_BASE (ETHMAC_BASE+0x0800)
+#define ETHMAC_TX0_BASE (ETHMAC_BASE+0x1000)
+#define ETHMAC_TX1_BASE (ETHMAC_BASE+0x1800)
#endif
#include <spiflash.h>
-#ifdef SPIFLASH_BASE
+#ifdef CSR_SPIFLASH_BASE
#define PAGE_PROGRAM_CMD (0x02)
#define WRDI_CMD (0x04)
spiflash_bitbang_write(0); // ~CS_N ~CLK
for(i = 0; i < 8; i++, b <<= 1) {
-
+
spiflash_bitbang_write((b & 0x80) >> 7);
spiflash_bitbang_write(((b & 0x80) >> 7) | BITBANG_CLK);
}
flash_write_byte(WREN_CMD);
spiflash_bitbang_write(BITBANG_CS_N);
-
+
flash_write_byte(SE_CMD);
flash_write_addr(sector_addr);
spiflash_bitbang_write(BITBANG_CS_N);
#endif
}
-#ifdef WISHBONE2LASMI_BASE
+#ifdef CSR_WISHBONE2LASMI_BASE
void flush_l2_cache(void)
{
unsigned int l2_nwords;
#include <generated/csr.h>
-#ifdef ETHMAC_BASE
+#ifdef CSR_ETHMAC_BASE
#include <stdio.h>
#include <system.h>
self.submodules.ethphy = LiteEthPHYGMII(platform.request("eth_clocks"), platform.request("eth"))
self.submodules.ethmac = LiteEthMAC(phy=self.ethphy, dw=32, interface="wishbone")
self.add_wb_slave(mem_decoder(self.mem_map["ethmac"]), self.ethmac.bus)
- self.add_memory_region("ethmac_mem", self.mem_map["ethmac"]+0x80000000, 0x2000)
+ self.add_memory_region("ethmac", self.mem_map["ethmac"]+0x80000000, 0x2000)
default_subtarget = BaseSoC
self.submodules.ethphy = LiteEthPHYMII(platform.request("eth_clocks"), platform.request("eth"))
self.submodules.ethmac = LiteEthMAC(phy=self.ethphy, dw=32, interface="wishbone")
self.add_wb_slave(mem_decoder(self.mem_map["ethmac"]), self.ethmac.bus)
- self.add_memory_region("ethmac_mem", self.mem_map["ethmac"]+0x80000000, 0x2000)
+ self.add_memory_region("ethmac", self.mem_map["ethmac"]+0x80000000, 0x2000)
def get_vga_dvi(platform):
try: