*.o
*.d
*.a
-*.bin
*.elf
+*.bin
+*.fbi
tools/bin2hex
tools/flterm
tools/mkmmimg
RM ?= rm -f
-all: build/top.bit build/top.fpg
+all: build/soc.bit build/soc.fpg
-build/top.bit build/top.bin:
+build/soc.bit build/soc.bin:
./build.py
-build/top.fpg: build/top.bin
+build/soc.fpg: build/soc.bin
$(MAKE) -C tools
tools/byteswap $< $@
-load: build/top.bit
+load: build/soc.bit
jtag -n load.jtag
+flash: build/soc.fpg
+ m1nor-ng build/soc.fpg
+
clean:
$(RM) -r build/*
-.PHONY: all load clean
+.PHONY: all load clean flash
"jtag_tap_spartan6.v", "lm32_itlb.v", "lm32_dtlb.v")
platform.add_sources(os.path.join("verilog", "lm32"), "lm32_config.v")
- platform.build_cmdline(soc)
+ platform.build_cmdline(soc, build_name="soc")
csr_header = cif.get_csr_header(soc.csr_base, soc.csrbankarray, soc.interrupt_map)
write_to_file("software/include/hw/csr.h", csr_header)
cable milkymist
detect
-pld load build/top.bit
+pld load build/soc.bit
$(MAKE) -C $(M2DIR)/software/libnet
flash: bios.bin
- m1nor bios.bin
+ m1nor-ng bios.bin
clean:
$(RM) $(OBJECTS) $(OBJECTS:.o=.d) bios.elf bios.bin .*~ *~
return r;
}
+static const unsigned char macadr[6] = {0x10, 0xe2, 0xd5, 0x00, 0x00, 0x00};
+
void netboot(void)
{
int size;
unsigned int cmdline_adr, initrdstart_adr, initrdend_adr;
unsigned int ip;
- unsigned char *macadr = (unsigned char *)FLASH_OFFSET_MAC_ADDRESS;
printf("Booting from network...\n");
printf("Local IP : %d.%d.%d.%d\n", LOCALIP1, LOCALIP2, LOCALIP3, LOCALIP4);
unsigned int got_crc;
printf("Booting from flash...\n");
- flashbase = (unsigned int *)FLASH_OFFSET_REGULAR_APP;
+ flashbase = (unsigned int *)FLASH_OFFSET_APP;
length = *flashbase++;
crc = *flashbase++;
if((length < 32) || (length > 4*1024*1024)) {
- printf("Error: Invalid flash boot image length\n");
+ printf("Error: Invalid flash boot image length 0x%08x\n", length);
return;
}
__DYNAMIC = 0;
MEMORY {
- rom : ORIGIN = 0x00860000, LENGTH = 0x20000 /* 128K */
+ rom : ORIGIN = 0x00180000, LENGTH = 0x20000 /* 128K */
sram : ORIGIN = 0x10000000, LENGTH = 0x01000 /* 4K */
}
* We also use the address of _edata to know the length
* of our code.
*/
- offset_bios = FLASH_OFFSET_REGULAR_BIOS;
+ offset_bios = FLASH_OFFSET_BIOS;
expected_crc = _edata;
length = (unsigned int)&_edata - offset_bios;
actual_crc = crc32((unsigned char *)offset_bios, length);
}
}
-static void print_mac(void)
-{
- unsigned char *macadr = (unsigned char *)FLASH_OFFSET_MAC_ADDRESS;
-
- printf("MAC address: %02x:%02x:%02x:%02x:%02x:%02x\n", macadr[0], macadr[1], macadr[2], macadr[3], macadr[4], macadr[5]);
-}
-
static const char banner[] =
"\nMILKYMIST(tm) v"VERSION" BIOS http://www.milkymist.org\n"
"(c) Copyright 2007-2013 Sebastien Bourdeauducq\n"
crcbios();
id_print();
ethreset();
- print_mac();
ddr_ok = ddrinit();
if(ddr_ok)
boot_sequence();
#ifndef __HW_MEM_H
#define __HW_MEM_H
-#define FLASH_OFFSET_STANDBY_BITSTREAM 0x00000000 /* 640k */
-
-#define FLASH_OFFSET_RESCUE_BITSTREAM 0x000A0000 /* 1536k */
-#define FLASH_OFFSET_RESCUE_BIOS 0x00220000 /* 128k */
-#define FLASH_OFFSET_RESCUE_APP 0x00240000 /* 4736k */
-
-#define FLASH_OFFSET_REGULAR_BITSTREAM 0x006E0000 /* 1536k */
-#define FLASH_OFFSET_REGULAR_BIOS 0x00860000 /* 128k */
-#define FLASH_OFFSET_REGULAR_APP 0x00880000 /* 4736k */
-
-#define FLASH_OFFSET_FILESYSTEM 0x00D20000 /* 19328k (remaining space) */
-
-#define FLASH_OFFSET_MAC_ADDRESS 0x002200E0 /* within rescue BIOS */
+#define FLASH_OFFSET_BITSTREAM 0x00000000 /* 1536k */
+#define FLASH_OFFSET_BIOS 0x00180000 /* 128k */
+#define FLASH_OFFSET_APP 0x001A0000 /* remaining space */
#define SDRAM_BASE 0x40000000
OBJECTS=crt0.o isr.o time.o dvisampler0.o dvisampler1.o main.o
-all: videomixer.bin
+all: videomixer.bin videomixer.fbi
# pull in dependency info for *existing* .o files
-include $(OBJECTS:.o=.d)
$(OBJCOPY) -O binary $< $@
chmod -x $@
+%.fbi: %.bin
+ $(M2DIR)/tools/mkmmimg $< write $@
+
videomixer.elf: linker.ld $(OBJECTS) libs
%.elf:
$(MAKE) -C $(M2DIR)/tools
$(M2DIR)/tools/flterm --port /dev/ttyUSB0 --kernel videomixer.bin
+flash: videomixer.fbi
+ m1nor-ng videomixer.fbi
+
clean:
- $(RM) $(OBJECTS) $(OBJECTS:.o=.d) videomixer.elf videomixer.bin .*~ *~
+ $(RM) $(OBJECTS) $(OBJECTS:.o=.d) videomixer.elf videomixer.bin videomixer.fbi
+ $(RM) .*~ *~
$(RM) dvisampler0.h dvisampler0.c dvisampler1.h dvisampler1.c
.PHONY: all main.o clean libs load
//
// Base address for exception vectors
-`define CFG_EBA_RESET 32'h00860000
+`define CFG_EBA_RESET 32'h00180000
// Base address for the debug exception vectors. If the DC_RE flag is
// set or the at_debug signal is asserted (see CFG_ALTERNATE_EBA) this