Skip to content

Commit

Permalink
treewide: Add Saxon SoC USB 1.1 (OHCI) controller
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSmolBoi authored and paulsc96 committed Mar 5, 2024
1 parent de5b793 commit 31c0e99
Show file tree
Hide file tree
Showing 10 changed files with 19,316 additions and 9 deletions.
1 change: 1 addition & 0 deletions Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ sources:
- hw/regs/cheshire_reg_top.sv
- hw/cheshire_pkg.sv
- hw/cheshire_soc.sv
- hw/future/UsbOhciAxi4.v

- target: any(simulation, test)
files:
Expand Down
27 changes: 27 additions & 0 deletions hw/cheshire_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ package cheshire_pkg;
bit I2c;
bit SpiHost;
bit Gpio;
bit Usb;
bit Dma;
bit SerialLink;
bit Vga;
Expand Down Expand Up @@ -170,6 +171,16 @@ package cheshire_pkg;
doub_bt SlinkTxAddrMask;
doub_bt SlinkTxAddrDomain;
dw_bt SlinkUserAmoBit;
// Parameters for USB
dw_bt UsbConfMaxReadTxns;
dw_bt UsbConfMaxWriteTxns;
aw_bt UsbConfAmoNumCuts;
bit UsbConfAmoPostCut;
bit UsbConfEnableTwoD;
dw_bt UsbNumAxInFlight;
dw_bt UsbMemSysDepth;
aw_bt UsbJobFifoDepth;
bit UsbRAWCouplingAvail;
// Parameters for DMA
dw_bt DmaConfMaxReadTxns;
dw_bt DmaConfMaxWriteTxns;
Expand Down Expand Up @@ -210,6 +221,7 @@ package cheshire_pkg;
typedef struct packed {
cheshire_bus_err_intr_t bus_err;
logic [31:0] gpio;
logic usb;
logic spih_spi_event;
logic spih_error;
logic i2c_host_timeout;
Expand Down Expand Up @@ -287,6 +299,7 @@ package cheshire_pkg;
aw_bt [2**MaxCoresWidth-1:0] cores;
aw_bt dbg;
aw_bt dma;
aw_bt usb;
aw_bt slink;
aw_bt vga;
aw_bt ext_base;
Expand All @@ -298,6 +311,7 @@ package cheshire_pkg;
int unsigned i = 0;
for (int j = 0; j < cfg.NumCores; j++) begin ret.cores[i] = i; i++; end
ret.dbg = i;
if (cfg.Usb) begin i++; ret.usb = i; end
if (cfg.Dma) begin i++; ret.dma = i; end
if (cfg.SerialLink) begin i++; ret.slink = i; end
if (cfg.Vga) begin i++; ret.vga = i; end
Expand All @@ -320,6 +334,7 @@ package cheshire_pkg;
aw_bt reg_demux;
aw_bt llc;
aw_bt spm;
aw_bt usb;
aw_bt dma;
aw_bt slink;
aw_bt ext_base;
Expand All @@ -346,6 +361,7 @@ package cheshire_pkg;
r++; ret.map[r] = '{i, AmSpm, AmSpm + SizeSpm};
r++; ret.map[r] = '{i, AmSpm + 'h0400_0000, AmSpm + 'h0400_0000 + SizeSpm};
end
if (cfg.Usb) begin i++; r++; ret.usb = i; ret.map[r] = '{i, 'h0100_1000, 'h0100_2000}; end
if (cfg.Dma) begin i++; r++; ret.dma = i; ret.map[r] = '{i, 'h0100_0000, 'h0100_1000}; end
if (cfg.SerialLink) begin i++; r++; ret.slink = i;
ret.map[r] = '{i, cfg.SlinkRegionStart, cfg.SlinkRegionEnd}; end
Expand Down Expand Up @@ -589,6 +605,7 @@ package cheshire_pkg;
I2c : 1,
SpiHost : 1,
Gpio : 1,
Usb : 1,
Dma : 1,
SerialLink : 1,
Vga : 1,
Expand Down Expand Up @@ -630,6 +647,16 @@ package cheshire_pkg;
SlinkTxAddrMask : 'hFFFF_FFFF,
SlinkTxAddrDomain : 'h0000_0000,
SlinkUserAmoBit : 1, // Convention: lower AMO bits for cores, MSB for serial link
// USB config ( for now it's just a copy of the DMA config)
UsbConfMaxReadTxns : 16,
UsbConfMaxWriteTxns : 16,
UsbConfAmoNumCuts : 1,
UsbConfAmoPostCut : 1,
UsbConfEnableTwoD : 1,
UsbNumAxInFlight : 16,
UsbMemSysDepth : 8,
UsbJobFifoDepth : 2,
UsbRAWCouplingAvail : 1,
// DMA config
DmaConfMaxReadTxns : 4,
DmaConfMaxWriteTxns : 4,
Expand Down
Loading

0 comments on commit 31c0e99

Please sign in to comment.