@@ -10,12 +10,13 @@ Hardware
1010--------
1111
1212The target hardware platform is a Lattice UltraPlus 5k FPGA
13- connected to 4 x 64 Mbits HyperRAM chips to provide it with
14- 32 Mbytes of RAM .
13+ with 32 Mbytes of RAM attached, either provided by 4 x 64 Mbits
14+ HyperRAM chips or 4 x 64 Mbits SPI PSRAM chips .
1515
1616* [ iCEBreaker] ( https://1bitsquared.com/products/icebreaker )
1717* [ Quad HyperRAM PMOD] ( https://1bitsquared.com/products/pmod-hyperram )
1818 (Make sure to select the "Quad" variant)
19+ * [ Quad SPI PSRAM PMOD] ( https://machdyne.com/product/qqspi-psram32/ )
1920
2021
2122How it works
@@ -28,7 +29,7 @@ A quick rundown of the involved parts and what they do.
2829This is the HDL logic that uses the FPGA fabric to implement a RISC-V
2930CPU with enough peripherals to run a RV32I Linux kernel. It's mainly
3031composed of a [ VexRiscv] ( https://github.com/SpinalHDL/VexRiscv/ ) CPU
31- connected to an HyperRAM memory controller and associated cache.
32+ connected to a memory controller and associated cache.
3233
3334The set of peripheral is very minimal:
3435
@@ -46,7 +47,7 @@ reset. This program is hard coded directly in the FPGA bitstream.
4647Its role are:
4748
4849 * Initialize UART for boot debug
49- * Initialize the HyperRAM controller
50+ * Initialize the memory controller
5051 * Load the various pieces from flash into RAM
5152 * Jump to the BIOS
5253
@@ -110,6 +111,9 @@ or `BOARD=xxx` to specify another board.
110111
111112The result file is in ` build-tmp/riscv_linux_init.bin `
112113
114+ The default is to build for the HyperRAM option, but if you are
115+ using SPI PSRAM instead, add ` MEM=qpi ` on the ` make ` command line.
116+
113117
114118### BIOS
115119
@@ -203,6 +207,29 @@ make sure to check the following places :
203207 partition layout)
204208
205209
210+ Overclocking
211+ ------------
212+
213+ By default the core is run at 15 MHz which is about the fmax given
214+ by ` nextpnr ` . However there is some margin and I have added an option
215+ to instead run everything at 20 MHz.
216+
217+ To do so, build the gateware with:
218+
219+ ``` bash
220+ cd iCE40linux/gateware/riscv_linux
221+ make clean
222+ make clean-fw
223+ make OVERCLOCK=1 bin-init
224+ ```
225+
226+ This will rebuild the gateware for 20 MHz.
227+
228+ You will also need to update the BIOS and add ` UART_DIV=18 ` on the
229+ ` make ` command. And then edit the ` ice40linux.dts ` to change all
230+ references from ` 15000000 ` to ` 20000000 ` .
231+
232+
206233License
207234-------
208235
0 commit comments