소스 검색

projects/boot_stub: Add support for special Vio feature of some board

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Sylvain Munaut 4 년 전
부모
커밋
1d57cbe16f
4개의 변경된 파일25개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 0
      projects/boot_stub/data/top-e1tracer.pcf
  2. 3 0
      projects/boot_stub/data/top-icepick.pcf
  3. 3 1
      projects/boot_stub/rtl/boards.vh
  4. 16 0
      projects/boot_stub/rtl/top.v

+ 3 - 0
projects/boot_stub/data/top-e1tracer.pcf

@@ -10,3 +10,6 @@ set_io -nowarn -pullup yes btn 25
 set_io -nowarn rgb[0] 39
 set_io -nowarn rgb[1] 40
 set_io -nowarn rgb[2] 41
+
+# Vio
+set_io -nowarn vio_pdm 19

+ 3 - 0
projects/boot_stub/data/top-icepick.pcf

@@ -10,3 +10,6 @@ set_io -nowarn -pullup yes btn 25
 set_io -nowarn rgb[0] 39
 set_io -nowarn rgb[1] 40
 set_io -nowarn rgb[2] 41
+
+# Vio
+set_io -nowarn vio_pdm 19

+ 3 - 1
projects/boot_stub/rtl/boards.vh

@@ -55,8 +55,9 @@
 //	`define RGB_MAP 12'h120		// 41=Green, 40=Blue, 39=Red (Hacked v1.0b)
 `elsif BOARD_ICEPICK
 	// iCEpick
-	`define HAS_RGB
+	`define HAS_VIO
 	`define HAS_USB
+	`define HAS_RGB
 	`define RGB_MAP 12'h012		// 41=Red, 40=Green, 39=Blue
 //	`define RGB_MAP 12'h210		// 41=Blue, 40=Green, 39=Red (Alt RGB LED)
 `elsif BOARD_ICE1USB
@@ -66,6 +67,7 @@
 	`define RGB_MAP 12'h012		// 41=Red, 40=Green, 39=Blue
 `elsif BOARD_E1TRACER
 	// osmocom E1 tracer
+	`define HAS_VIO				// Compatibility with icepick proto
 	`define HAS_USB
 	`define HAS_RGB
 	`define RGB_MAP 12'h012		// 41=Red, 40=Green, 39=Blue

+ 16 - 0
projects/boot_stub/rtl/top.v

@@ -35,6 +35,11 @@
 `include "boards.vh"
 
 module top (
+	// Special features
+`ifdef HAS_VIO
+	output reg vio_pdm,
+`endif
+
 	// Button
 	input  wire btn,
 
@@ -275,6 +280,17 @@ module top (
 `endif
 
 
+	// Special features
+	// ----------------
+
+	// Output a 50% duty cycle VIO which should be ~ 1.65v, enough to
+	// read the button state
+`ifdef HAS_VIO
+	always @(posedge clk)
+		vio_pdm <= ~vio_pdm;
+`endif
+
+
 	// Clock / Reset
 	// -------------