Browse Source

add riscv_core Repository

pull/1/head
wonderfullook 2 years ago
parent
commit
09f2f1154c
  1. 3
      .gitmodules
  2. 23
      README.md
  3. 2146
      linux/firmware/sipeed_tang_nano_20k.fs
  4. BIN
      linux/image/Image
  5. 5
      linux/image/boot.json
  6. BIN
      linux/image/opensbi.bin.tangnano20k
  7. BIN
      linux/image/sipeed_tang_nano_20k.dtb
  8. 129
      linux/image/sipeed_tang_nano_20k.dts
  9. 20
      linux/readme.md
  10. 1
      riscv_core/SparrowRV

3
.gitmodules vendored

@ -0,0 +1,3 @@
[submodule "riscv_core/SparrowRV"]
path = riscv_core/SparrowRV
url = https://gitee.com/xiaowuzxc/SparrowRV

23
README.md

@ -1,5 +1,13 @@
# TangNano-20K-example # TangNano-20K-example
---
- IDE 基础使用步骤:[点我](https://wiki.sipeed.com/hardware/zh/tang/tang-nano-20k/example/led.html)
- IDE Instructions:[Click me](https://wiki.sipeed.com/hardware/en/tang/tang-nano-20k/example/led.html)
---
- 配置 MS5351:[点我](https://wiki.sipeed.com/hardware/zh/tang/tang-nano-20k/example/unbox.html)
- Config MS5351:[Click me](https://wiki.sipeed.com/hardware/en/tang/tang-nano-20k/example/unbox.html)
---
- [TangNano-20K-example](#tangnano-20k-example) - [TangNano-20K-example](#tangnano-20k-example)
- [audio](#audio) - [audio](#audio)
- [hdmi](#hdmi) - [hdmi](#hdmi)
@ -8,6 +16,9 @@
- [uart](#uart) - [uart](#uart)
- [ws2812](#ws2812) - [ws2812](#ws2812)
- [nestang](#nestang) - [nestang](#nestang)
- [linux](#linux)
- [riscv\_core](#riscv_core)
- [SparrowRV](#sparrowrv)
## audio ## audio
@ -42,4 +53,14 @@ A demo to drive onboard ws2812 rgb led.
## nestang ## nestang
Thanks to [nand2mario](https://github.com/nand2mario) for providing this project, and read [guide](./nestang/README.md) to see how to build this project. Thanks to [nand2mario](https://github.com/nand2mario) for providing this project, and read [guide](./nestang/README.md) to see how to build this project.
## linux
A linux demo based on [Linux-on-LiteX-VexRiscv](https://github.com/litex-hub/linux-on-litex-vexriscv).
## riscv_core
### SparrowRV
A Risc-V architecture open source core. Run `git submodule --init update` to get the code.

2146
linux/firmware/sipeed_tang_nano_20k.fs

File diff suppressed because it is too large Load Diff

BIN
linux/image/Image

Binary file not shown.

5
linux/image/boot.json

@ -0,0 +1,5 @@
{
"Image": "0x40000000",
"sipeed_tang_nano_20k.dtb": "0x40780000",
"opensbi.bin.tangnano20k": "0x407c0000"
}

BIN
linux/image/opensbi.bin.tangnano20k

Binary file not shown.

BIN
linux/image/sipeed_tang_nano_20k.dtb

Binary file not shown.

129
linux/image/sipeed_tang_nano_20k.dts

@ -0,0 +1,129 @@
/dts-v1/;
/ {
#address-cells = <1>;
#size-cells = <1>;
chosen {
bootargs = "console=liteuart earlycon=liteuart,0xf0001000";
};
cpus {
#address-cells = <1>;
#size-cells = <0>;
timebase-frequency = <48000000>;
CPU0: cpu@0 {
device_type = "cpu";
compatible = "riscv";
riscv,isa = "rv32i2p0_ma";
mmu-type = "riscv,sv32";
reg = <0>;
clock-frequency = <48000000>;
status = "okay";
d-cache-size = <4096>;
d-cache-sets = <1>;
d-cache-block-size = <64>;
i-cache-size = <4096>;
i-cache-sets = <1>;
i-cache-block-size = <64>;
d-tlb-size = <4>;
d-tlb-sets = <4>;
i-tlb-size = <4>;
i-tlb-sets = <4>;
L0: interrupt-controller {
#interrupt-cells = <0x00000001>;
interrupt-controller;
compatible = "riscv,cpu-intc";
};
};
};
memory@40000000 {
device_type = "memory";
reg = <0x40000000 0x800000>;
};
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
opensbi@407c0000 {
reg = <0x407c0000 0x20000>;
};
};
clocks {
sys_clk: litex_sys_clk {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <48000000>;
};
};
soc {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
interrupt-parent = <&intc0>;
ranges;
soc_ctrl0: soc_controller@f0000800 {
compatible = "litex,soc-controller";
reg = <0xf0000800 0xc>;
status = "okay";
};
intc0: interrupt-controller@f0c00000 {
compatible = "sifive,fu540-c000-plic", "sifive,plic-1.0.0";
reg = <0xf0c00000 0x400000>;
#address-cells = <0>;
#interrupt-cells = <1>;
interrupt-controller;
interrupts-extended = <
&L0 11 &L0 9>;
riscv,ndev = <32>;
};
liteuart0: serial@f0001000 {
compatible = "litex,liteuart";
reg = <0xf0001000 0x100>;
interrupts = <1>;
status = "okay";
};
leds: gpio@f0002800 {
compatible = "litex,gpio";
reg = <0xf0002800 0x4>;
gpio-controller;
#gpio-cells = <2>;
litex,direction = "out";
status = "disabled";
};
};
aliases {
serial0 = &liteuart0;
};
};
&leds {
litex,ngpio = <4>;
status = "okay";
};

20
linux/readme.md

@ -0,0 +1,20 @@
# Tang Nano 20K Linux
This `readme` tells how to run linux on Tang Nano 20k.
## Environment
OS: Linux
Software: `Python`, `litex` [Click me to know litex](https://github.com/enjoy-digital/litex/wiki).
## Instruction
### Burn FPGA firmware
`openFPGALoader -f -c ft2232 ./firmware/sipeed_tang_nano_20k.fs`
### Load Linux image
This will take a long tims.
`litex_term --speed 3000000 --serial-boot --images ./image/boot.json /dev/ttyUSB1`

1
riscv_core/SparrowRV

@ -0,0 +1 @@
Subproject commit 3ecb22b91147a8d6d2e7c8700f67cb926a15fa12
Loading…
Cancel
Save