Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 4 commits
  • 9 files changed
  • 0 comments
  • 1 contributor
2  milkymist/dvisampler/chansync.py
@@ -21,6 +21,7 @@ def __init__(self, width, depth):
21 21
 		self.specials += storage
22 22
 
23 23
 		wrport = storage.get_port(write_capable=True)
  24
+		self.specials += wrport
24 25
 		self.comb += [
25 26
 			wrport.adr.eq(produce),
26 27
 			wrport.dat_w.eq(self.din),
@@ -29,6 +30,7 @@ def __init__(self, width, depth):
29 30
 		self.sync += _inc(produce, depth)
30 31
 
31 32
 		rdport = storage.get_port(async_read=True)
  33
+		self.specials += rdport
32 34
 		self.comb += [
33 35
 			rdport.adr.eq(consume),
34 36
 			self.dout.eq(rdport.dat_r)
1  milkymist/dvisampler/edid.py
@@ -89,6 +89,7 @@ def __init__(self, pads, default=_default_edid):
89 89
 			)
90 90
 		]
91 91
 		rdport = self.mem.get_port()
  92
+		self.specials += rdport
92 93
 		self.comb += rdport.adr.eq(offset_counter)
93 94
 		data_bit = Signal()
94 95
 
3  software/bios/Makefile
@@ -15,7 +15,6 @@ all: bios.bin
15 15
 	$(M2DIR)/tools/mkmmimg $@ write
16 16
 
17 17
 bios.elf: linker.ld $(OBJECTS) libs
18  
-bios-rescue.elf: linker-rescue.ld $(OBJECTS) libs
19 18
 
20 19
 %.elf:
21 20
 	$(LD) $(LDFLAGS) -T $< -N -o $@ $(OBJECTS) \
@@ -43,6 +42,6 @@ flash: bios.bin
43 42
 	m1nor bios.bin
44 43
 
45 44
 clean:
46  
-	$(RM) $(OBJECTS) $(OBJECTS:.o=.d) bios.elf bios.bin bios-rescue.elf bios-rescue.bin .*~ *~
  45
+	$(RM) $(OBJECTS) $(OBJECTS:.o=.d) bios.elf bios.bin .*~ *~
47 46
 
48 47
 .PHONY: all main.o clean libs flash
2  software/bios/boot-helper.S
@@ -7,4 +7,4 @@ boot_helper:
7 7
 	nop
8 8
 	nop
9 9
 	nop
10  
-	call r5
  10
+	call r4
18  software/bios/boot.c
@@ -14,16 +14,15 @@
14 14
 #include <net/tftp.h>
15 15
 #include "boot.h"
16 16
 
17  
-extern int rescue;
18  
-extern void boot_helper(unsigned int r1, unsigned int r2, unsigned int r3, unsigned int r4, unsigned int addr);
  17
+extern void boot_helper(unsigned int r1, unsigned int r2, unsigned int r3, unsigned int addr);
19 18
 
20  
-static void __attribute__((noreturn)) boot(unsigned int r1, unsigned int r2, unsigned int r3, unsigned int r4, unsigned int addr)
  19
+static void __attribute__((noreturn)) boot(unsigned int r1, unsigned int r2, unsigned int r3, unsigned int addr)
21 20
 {
22 21
 	printf("Executing booted program.\n");
23 22
 	uart_sync();
24 23
 	irq_setmask(0);
25 24
 	irq_setie(0);
26  
-	boot_helper(r1, r2, r3, r4, addr);
  25
+	boot_helper(r1, r2, r3, addr);
27 26
 	while(1);
28 27
 }
29 28
 
@@ -137,7 +136,7 @@ void serialboot(void)
137 136
 					|((unsigned int)frame.payload[2] << 8)
138 137
 					|((unsigned int)frame.payload[3] << 0);
139 138
 				uart_write(SFL_ACK_SUCCESS);
140  
-				boot(cmdline_adr, initrdstart_adr, initrdend_adr, rescue, addr);
  139
+				boot(cmdline_adr, initrdstart_adr, initrdend_adr, addr);
141 140
 				break;
142 141
 			}
143 142
 			case SFL_CMD_CMDLINE:
@@ -234,7 +233,7 @@ void netboot(void)
234 233
 	} else
235 234
 		initrdend_adr = initrdstart_adr + size;
236 235
 
237  
-	boot(cmdline_adr, initrdstart_adr, initrdend_adr, rescue, SDRAM_BASE);
  236
+	boot(cmdline_adr, initrdstart_adr, initrdend_adr, SDRAM_BASE);
238 237
 }
239 238
 
240 239
 void flashboot(void)
@@ -245,10 +244,7 @@ void flashboot(void)
245 244
 	unsigned int got_crc;
246 245
 
247 246
 	printf("Booting from flash...\n");
248  
-	if(rescue)
249  
-		flashbase = (unsigned int *)FLASH_OFFSET_RESCUE_APP;
250  
-	else
251  
-		flashbase = (unsigned int *)FLASH_OFFSET_REGULAR_APP;
  247
+	flashbase = (unsigned int *)FLASH_OFFSET_REGULAR_APP;
252 248
 	length = *flashbase++;
253 249
 	crc = *flashbase++;
254 250
 	if((length < 32) || (length > 4*1024*1024)) {
@@ -263,5 +259,5 @@ void flashboot(void)
263 259
 		printf("CRC failed (expected %08x, got %08x)\n", crc, got_crc);
264 260
 		return;
265 261
 	}
266  
-	boot(0, 0, 0, rescue, SDRAM_BASE);
  262
+	boot(0, 0, 0, SDRAM_BASE);
267 263
 }
10  software/bios/linker.ld
@@ -4,8 +4,8 @@ ENTRY(_start)
4 4
 __DYNAMIC = 0;
5 5
 
6 6
 MEMORY {
7  
-	flash : ORIGIN = 0x00860000, LENGTH = 0x20000 /* 128K */
8  
-	sram  : ORIGIN = 0x10000000, LENGTH = 0x01000 /* 4K */
  7
+	rom  : ORIGIN = 0x00860000, LENGTH = 0x20000 /* 128K */
  8
+	sram : ORIGIN = 0x10000000, LENGTH = 0x01000 /* 4K */
9 9
 }
10 10
 
11 11
 SECTIONS
@@ -15,7 +15,7 @@ SECTIONS
15 15
 		_ftext = .;
16 16
 		*(.text .stub .text.* .gnu.linkonce.t.*)
17 17
 		_etext = .;
18  
-	} > flash
  18
+	} > rom
19 19
 
20 20
 	.rodata :
21 21
 	{
@@ -24,7 +24,7 @@ SECTIONS
24 24
 		*(.rodata .rodata.* .gnu.linkonce.r.*)
25 25
 		*(.rodata1)
26 26
 		_erodata = .;
27  
-	} > flash
  27
+	} > rom
28 28
 
29 29
 	/* We shouldn't have a .data section, but the GNU crapchain whines if we don't */
30 30
 	.data :
@@ -36,7 +36,7 @@ SECTIONS
36 36
 		_gp = ALIGN(16);
37 37
 		*(.sdata .sdata.* .gnu.linkonce.s.*)
38 38
 		_edata = .;
39  
-	} > flash
  39
+	} > rom
40 40
 
41 41
 	.bss :
42 42
 	{
19  software/bios/main.c
@@ -375,7 +375,6 @@ static void do_command(char *c)
375 375
 		printf("Command not found\n");
376 376
 }
377 377
 
378  
-int rescue;
379 378
 extern unsigned int _edata;
380 379
 
381 380
 static void crcbios(void)
@@ -391,7 +390,7 @@ static void crcbios(void)
391 390
 	 * We also use the address of _edata to know the length
392 391
 	 * of our code.
393 392
 	 */
394  
-	offset_bios = rescue ? FLASH_OFFSET_RESCUE_BIOS : FLASH_OFFSET_REGULAR_BIOS;
  393
+	offset_bios = FLASH_OFFSET_REGULAR_BIOS;
395 394
 	expected_crc = _edata;
396 395
 	length = (unsigned int)&_edata - offset_bios;
397 396
 	actual_crc = crc32((unsigned char *)offset_bios, length);
@@ -488,15 +487,9 @@ static int test_user_abort(void)
488 487
 static void boot_sequence(void)
489 488
 {
490 489
 	if(test_user_abort()) {
491  
-		if(rescue) {
492  
-			serialboot();
493  
-			netboot();
494  
-			flashboot();
495  
-		} else {
496  
-			flashboot();
497  
-			serialboot();
498  
-			netboot();
499  
-		}
  490
+		flashboot();
  491
+		serialboot();
  492
+		netboot();
500 493
 		printf("No boot medium found\n");
501 494
 	}
502 495
 }
@@ -506,15 +499,11 @@ int main(int i, char **c)
506 499
 	char buffer[64];
507 500
 	int ddr_ok;
508 501
 
509  
-	rescue = !((unsigned int)main > FLASH_OFFSET_REGULAR_BIOS);
510  
-
511 502
 	irq_setmask(0);
512 503
 	irq_setie(1);
513 504
 	uart_init();
514 505
 	puts(banner);
515 506
 	crcbios();
516  
-	if(rescue)
517  
-		printf("Rescue mode\n");
518 507
 	id_print();
519 508
 	ethreset();
520 509
 	print_mac();
2  software/videomixer/dvisamplerX.c
@@ -167,7 +167,7 @@ void dvisamplerX_service(void)
167 167
 
168 168
 	if(dvisamplerX_locked) {
169 169
 		if(dvisamplerX_clocking_locked_read()) {
170  
-			if(elapsed(&dvisamplerX_last_event, identifier_frequency_read())) {
  170
+			if(elapsed(&dvisamplerX_last_event, identifier_frequency_read()/2)) {
171 171
 				dvisamplerX_adjust_phase();
172 172
 				dvisamplerX_print_status();
173 173
 			}
4  top.py
@@ -86,8 +86,8 @@ class SoC(Module):
86 86
 		"uart":			0,
87 87
 		"timer0":		1,
88 88
 		"minimac":		2,
89  
-		"dvisampler0":  3,
90  
-		"dvisampler1":  4,
  89
+		"dvisampler0":	3,
  90
+		"dvisampler1":	4,
91 91
 	}
92 92
 
93 93
 	def __init__(self, platform):

No commit comments for this range

Something went wrong with that request. Please try again.