You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README-opensbi-unmatched.md
+20-10Lines changed: 20 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,25 +2,34 @@
2
2
3
3
This branch captures changes made to support a sifive-unmatched board running opensbi (its default configuration).
4
4
5
-
The code also appears to run unmodified on StarFive Vision 5 2 (v1.30 board). See additional notes on that in
6
-
README-opensbi-vision5-2.md.
5
+
The code can run on StarFive VisionFive 2 (v1.30 board). See additional notes on that in README-opensbi-vision5-2.md and select the desired configuration option in param.h as further described below.
7
6
8
7
The default xv6 release supports machine mode (only) so this would not run on unmatched without replacing its Uboot-SPL
9
8
10
-
While that may be a useful exercise, this approach allows a user to run/debug a stock/unmodified unmatched board
11
-
or (hopefully) any board that runs uboot (with sbi).
9
+
While that may be a useful exercise, this approach allows a user to run xv6 using the platform distributed uboot without change.
12
10
13
11
The other problem with messing with the SPL is it contains all the board (e.g. DDR ram) initialization code. So, effectively,
14
-
what we are doing here is interrupting Linux boot by pressing a key while it is in uboot and loading this image
15
-
instead of Linux. Either run in RISCV supervisor mode and make use of the memory resident sbi that uboot and Linux uses.
12
+
what we are doing here is interrupting Linux boot by pressing a key while it is in uboot and loading this image instead of Linux.
16
13
17
-
The modifications are fairly minor with a define selection in Makefile and a corresponding one in param.h.
14
+
Both xv6 and Linux run in supervisor mode and have no direct access to RISCV machine mode.
18
15
19
-
- RUNTIME_SBI -- enables branch specific changes relating to OpenSBI
16
+
The modifications (from distribution xv6) are fairly minor with a define selection in Makefile and a corresponding one in param.h:
17
+
```
18
+
RUNTIME_SBI -- enables branch specific changes relating to the OpenSBI port
19
+
```
20
20
21
21
# Quick Start
22
22
23
-
Interrupt the Unmatched boot process by pressing a key on the USB UART debug terminal while it is in Uboot. This starts
23
+
Prior to make, in param.h, select BOARD_UNMATCHED and deselect BOARD_VF2 for the Unmatched version.
24
+
```
25
+
#define BOARD_UNMATCHED
26
+
//#define BOARD_VF2
27
+
```
28
+
In param.h, optionally select POLL_UART0_DIRECT to poll UART0 for console receive characters within xv6 (rather than use SBI for console polling). Either option works on the Unmatched board but it does make a difference on the VF2 board depending on its SBI version.
29
+
30
+
For convenience, the v0.2 release contains both "pure SBI" and "Uart0 direct" binaries (and elf files in case using Jtag). See the README file in the release for additional comments.
31
+
32
+
To run, interrupt the Unmatched boot process by pressing a key on the USB UART debug terminal while it is in Uboot. This starts
24
33
the uboot command interface where it is possible to load and run a binary file (the xv6 kernel binary given as a release or
25
34
produced via recompile of the source code).
26
35
@@ -99,7 +108,7 @@ done in this version.
99
108
100
109
Here I list stuff that I have not yet resolved
101
110
102
-
## An oddity with SMP
111
+
## A possible oddity with SMP
103
112
104
113
This version launches all 4 U74 cores (Harts) and they seem functional. But I'm not yet sure if there is a problem. I would have expected
105
114
the cores to be at a "wfi" instruction awaiting an interrupt (keypress or timer) when idle. I believe the initial core
@@ -115,6 +124,7 @@ are cleverly written with expected results (including for faults).
115
124
116
125
I've met my match with the failure of one particular test on unmatched: sbrkmuch() within usertests.c. This test runs fine:
117
126
127
+
- on the VF2 board
118
128
- occasionally (unmodified). Run the test a few times in a row from the command prompt.
119
129
- when run standalone (via command line parameter to just run sbrkmuch).
120
130
- when its moved or called differently from its original version.
Copy file name to clipboardExpand all lines: README-opensbi-vision5-2.md
+17-13Lines changed: 17 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,23 @@
1
1
# Notes about this branch and StarFive Vision 5 (2) or VF2 board
2
2
3
-
The exact same binary as released for the unmatched appears to run on this board. Very little testing has been done so far but I wanted to note the following:
3
+
Prior to make, in param.h, select BOARD_VF2 and deselect BOARD_UNMATCHED for the VF2 version.
4
+
```
5
+
//#define BOARD_UNMATCHED
6
+
#define BOARD_VF2
7
+
```
8
+
In param.h, also select POLL_UART0_DIRECT to poll UART0 for console receive characters within xv6 (rather than use SBI for console polling).
9
+
10
+
Early versions of VF2 firmware supported pure SBI but this option sidesteps the issue by talking directly to the UART for console receive characters.
4
11
5
-
- The usertests issues described in the unmatched README either do not happen or happen with less frequency. In other words, the problem with sbrkmuch() has not yet been observed.
6
-
- Its possible/likely that the interrupt rate is different on this board and therefore an adjustment is needed to 'TIMERINTCNT' in param.h.
7
-
- To date, I've only tried loading the code with Jtag. But I have no reason to believe that the uboot binary load/run will not work. Issue is my VF2 board is not as well controlled as the version on the unmatched board.
12
+
For convenience, the v0.2 release contains both "pure SBI" and "Uart0 direct" binaries (and elf files in case using Jtag). See the README file in the release for additional comments.
13
+
14
+
- The usertests issues described in the unmatched README do not happen on VF2 board.
15
+
- Selecting BOARD_VF2 adjusts the timer interrupt rate to compensate for observed higher timer clock frequency.
8
16
- I'm using a different Jtag adapter for the VF2 board since I didnt want to move the Jlink EDU (old version) off of the unmatched yet. I'm specifically using an FTDI FT2232H-56Q minimodule. I'll include a working Jtag config that I'm using in the Jtag directory.
9
17
10
-
## Errata (hopefully temporary)
18
+
## Errata
11
19
12
-
While trying to verify that the binary (non-Jtag) xv6 kernel.bin file runs, I managed to boot my SD card into Linux, transfer the kernel.bin file to the
13
-
SD card and attempt to boot it from next uboot startup.
20
+
As described above, the 'pure sbi' VF2 configuration does not process console keyboard input correctly with recent board firmare.
14
21
15
22
While it boots, there is something wrong with the keyboard input -- I get an SBI error with each keypress:
16
23
@@ -28,18 +35,15 @@ This one works fine:
28
35
U-Boot SPL 2021.10 (Feb 12 2023 - 18:15:33 +0800)
29
36
```
30
37
31
-
Versus the newer version:
32
-
This one reports the aforementioned error.
38
+
The newer version reports the aforementioned error.
33
39
34
40
```
35
41
U-Boot SPL 2021.10 (Sep 19 2024 - 15:43:53 +0800)
36
42
```
37
43
38
-
I'll try to figure out what is different. Also, the interrupt rate is faster, so in test code I changed TIMERINTCNT to 400000 (not checked in) to reduce the interrupt rate to approximately 10x per second.
39
-
40
-
Finally, the VF2 board has a different DDR memory map from siFive unmatched board but its kernel.bin load address (0x80400000) is still within valid space with plenty of headroom. The code really should be recompiled for something around 0x40xxxxxx where xxxxxx leaves room for SBI that loads at 0x40000000.
44
+
The VF2 board has a different DDR memory map from siFive unmatched board but its kernel.bin load address (0x80400000) is still within valid space with plenty of headroom. The code really should be recompiled for something around 0x40xxxxxx where xxxxxx leaves room for SBI that loads at 0x40000000.
41
45
42
-
I dont know why, but it took a long time to find the memory map published, it was in the JH7110 "Technical Reference Manual"
46
+
I dont know why, but it took a long time to locate the VF2 memory map. It is in the JH7110 "Technical Reference Manual"
0 commit comments