Bläddra i källkod

Cleanup WB addressing.

Signed-off-by: Jakub Duchniewicz <j.duchniewicz@gmail.com>
Jakub Duchniewicz 1 vecka sedan
förälder
incheckning
98f63f9b8c
2 ändrade filer med 9 tillägg och 38 borttagningar
  1. 4 6
      projects/riscv_usb/fw/config.h
  2. 5 32
      projects/riscv_usb/rtl/top.v

+ 4 - 6
projects/riscv_usb/fw/config.h

@@ -23,9 +23,7 @@
 
 #pragma once
 
-#define UART_BASE	0x81000000
-#define SPI_BASE	0x82000000
-#define LED_BASE	0x83000000
-//#define USB_CORE_BASE	0x84000000
-//#define USB_DATA_BASE	0x85000000
-#define MAILBOX_BASE 0x86000000
+#define UART_BASE	 0x81000000
+#define SPI_BASE	 0x82000000
+#define LED_BASE	 0x83000000
+#define MAILBOX_BASE 0x84000000

+ 5 - 32
projects/riscv_usb/rtl/top.v

@@ -50,7 +50,7 @@ module top (
 );
 
 	localparam integer SPRAM_AW = 14; /* 14 => 64k, 15 => 128k */
-	localparam integer WB_N  =  7; // TODO: Reduce
+	localparam integer WB_N  =  5; // TODO: Reduce
 
 	localparam integer WB_DW = 32;
 	localparam integer WB_AW = 16;
@@ -196,34 +196,7 @@ module top (
 		.rst        (rst)
 	);
 
-
-	// USB [4 & 5]
-	// ---
-
-	/*soc_usb #(
-		.DW(WB_DW)
-	) usb_I (
-		.usb_dp   (usb_dp),
-		.usb_dn   (usb_dn),
-		.usb_pu   (usb_pu),
-		.wb_addr  (wb_addr[11:0]),
-		.wb_rdata (wb_rdata[4]),
-		.wb_wdata (wb_wdata),
-		.wb_we    (wb_we),
-		.wb_cyc   (wb_cyc[5:4]),
-		.wb_ack   (wb_ack[5:4]),
-		.clk_sys  (clk_24m),
-		.clk_48m  (clk_48m),
-		.rst      (rst)
-	);*/
-
-
-	assign wb_rdata[4] = 0;
-	assign wb_ack[5:4] = wb_cyc[5:4];
-
-	assign wb_rdata[5] = 0;
-
-	// WB Mailbox [6] TODO: this will move to lower addresses
+	// WB Mailbox [4]
 	// ----------
 	mailbox_wb #(
 		.AW(4),
@@ -233,10 +206,10 @@ module top (
 		.rst(rst),
 		.wb_addr(wb_addr[3:0]),
 		.wb_wdata(wb_wdata),
-		.wb_rdata(wb_rdata[6]),
+		.wb_rdata(wb_rdata[4]),
 		.wb_we(wb_we),
-		.wb_cyc(wb_cyc[6]),
-		.wb_ack(wb_ack[6]),
+		.wb_cyc(wb_cyc[4]),
+		.wb_ack(wb_ack[4]),
 		.registers_flat(mailbox_regs_flat)
 	);