commit 607a91f06e141f897a51e13a9e4b13199cfbbe88 Author: Sean Cross Date: Wed Dec 18 09:53:11 2019 +0800 initial commit Signed-off-by: Sean Cross diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d1725ed --- /dev/null +++ b/.gitattributes @@ -0,0 +1,18 @@ +*.py text eol=lf +*.dfu binary +*.png binary +*.jpg binary +*.bin binary +*.elf binary +*.h text eol=lf +*.c text eol=lf +*.s text eol=lf +*.S text eol=lf +README.* text eol=lf +LICENSE text eol=lf +Makefile text eol=lf +*.mk text eol=lf +*.sh text eol=lf +*.ps1 text eol=crlf +.gitignore text eol=lf +.gitattributes text eol=lf \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..53eaa21 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +**/*.rs.bk diff --git a/README.md b/README.md new file mode 100644 index 0000000..cb5198e --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Platonic RISC-V Device + +Platonic is an ideal system useful for developing an operating system. It does not represent any sort of real hardware, though differences between platforms is minimal. + +## Usage + +It is recommended to use Renode. \ No newline at end of file diff --git a/boot.resc b/boot.resc new file mode 100644 index 0000000..e51cf4d --- /dev/null +++ b/boot.resc @@ -0,0 +1,7 @@ +using sysbus +mach create +machine LoadPlatformDescription @platonic.repl + +machine StartGdbServer 3333 + +showAnalyzer uart \ No newline at end of file diff --git a/platonic.repl b/platonic.repl new file mode 100644 index 0000000..e99af23 --- /dev/null +++ b/platonic.repl @@ -0,0 +1,54 @@ +uart: UART.LiteX_UART @ { + sysbus 0x60001800; + sysbus 0xE0001800 // shadow + } + +rom: Memory.MappedMemory @ { + sysbus 0x00000000; + sysbus 0x80000000 // shadow + } + size: 0x00002000 + +sram: Memory.MappedMemory @ { + sysbus 0x10000000; + sysbus 0x90000000 // shadow + } + size: 0x00020000 + +cpu: CPU.VexRiscv @ sysbus + timeProvider: cpu_timer + cpuType: "rv32ima" + privilegeArchitecture: PrivilegeArchitecture.Priv1_10 + +cpu_timer: Timers.LiteX_CPUTimer @ sysbus 0xf0000800 + frequency: 66000000 + // IRQ #100 is Machine Timer Interrupt + -> cpu@100 + +timer0: Timers.LiteX_Timer @ { + sysbus 0x60002800; + sysbus 0xE0002800 // shadow + } + frequency: 12000000 + -> cpu@0 + +spi: SPI.PicoRV_SPI @ { + sysbus 0x60005000; + sysbus 0xe0005000 // shadow +} + +flash: SPI.Micron_MT25Q @ spi + underlyingMemory: flash_mem + +flash_mem: Memory.MappedMemory @ { + sysbus 0x20000000; + sysbus 0xA0000000 // shadow + } + size: 0x4000000 + +sysbus: + init: + Tag <0xe0000000 0x800> "CTRL" + Tag <0xE0006000 0x800> "REBOOT" + Tag <0xE0006800 0x800> "RGB" + Tag <0xE0007000 0x800> "VERSION" \ No newline at end of file