Commit graph

210 commits

Author SHA1 Message Date
bunnie
5c624e7e52 add a flush after every PDDB write
uncommitted data will lead to corruption later on
2022-11-03 21:01:11 +08:00
Sean Cross
779cc61c56 emulation: spinor: implement erasesector4byte
Implement this command, which is used by the system for bulk erases.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-11-03 12:31:22 +08:00
bunnie
05068c5cd0 extract the renode key box as a dump 2022-11-01 13:03:52 +08:00
bunnie
a0dca39fa3 key file for decrypting .System basis on Renode 2022-10-31 22:14:10 +08:00
Wei Tang
38286d8623 RemoveClockEntry -> TryRemoveClockEntry 2022-10-29 10:47:47 +02:00
Sean Cross
46fab8cbc8 renode: remove custom LiteX_Timer_32
When we started this project, all Renode Litex modules were 8-bits, and
we had to custom-make a 32-bit timer module. However, in the interim,
upstream has grown a 32-bit variant of this timer. As of this writing,
this change was made two years ago.

Remove our custom variant and use the upstream version instead.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-10-21 08:40:10 +08:00
Sean Cross
4b3d1503e7 renode: place all peripherals under "Betrusted" ns
Give a "Betrusted" namespace to all of the peripherals. This will enable
us to upstream various modules without breaking compatibility with our
own versions of these peripherals.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-10-20 22:19:40 +08:00
bunnie
006a7cc8a6 make busybox linux image ro so it doesn't modify the JFFS2 image in renode 2022-10-12 01:27:54 +08:00
bunnie
878c822d9f fix renode paths 2022-09-27 18:32:30 +08:00
bunnie
d0dc2e2a9f add renode as a target to utralib 2022-09-27 18:09:33 +08:00
bunnie
ff85e1fc19 add some .gitigore entries that help make my life a little easier
if anyone objects to these feel free to revert them, but it's
nice to have some helper scripts local to my machine in the root
dir that don't always show up in my status.
2022-07-29 15:58:02 +08:00
Sean Cross
3c156f6ae4 emulation: use BackingFile to make spi persistent
Use the `BackingFile` property of the SPI flash block in order to allow
SPI flash writes to persist across runs. This will write out the SPI
flash contents as data is written.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-24 15:55:05 +08:00
Sean Cross
210d0c7fe3 emulation: MX66UM1G45G: add BackingFile property
The `BackingFile` property can be set to a file path in order to make
flash writes persist across runs.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-24 15:39:10 +08:00
Sean Cross
406737ebf3 emulation: i2s: check in current work-in-progress
Signed-off-by: Sean Cross <sean@xobs.io>
2022-06-24 13:54:51 +08:00
bunnie
d752c4e87e fix renode build 2022-06-11 23:37:18 +08:00
bunnie
e589de1665 bump renode SVD file to be compatible with latest SoC changes 2022-06-05 13:35:07 +08:00
bunnie
7720b61451 update renode to latest soc 2022-05-06 13:39:28 +08:00
bunnie
49dcbb0a8a update renode to contain USB device mappings 2022-04-27 01:16:14 +08:00
Daniel Reusche
d94d633b47 Fix jtag peripheral for emulation of xous-release
Closes #146. Jtag.cs was misspelled in betrusted.resc

Signed-off-by: Daniel Reusche <code@degregat.net>
2022-04-23 15:34:13 +02:00
Sean Cross
b829783e7d emulation: wf200: implement "Disconnect" verb
Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-21 12:00:12 +08:00
Sean Cross
a74199829a emulation: add initial TLV320AIC3100
This audio codec lives on I2C and doesn't really do much for us.
However, by adding this device we can now pass `test oqc`.

The next step will be to implement `BetrustedI2S` which is where the
actual audio emulation occurs.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-21 11:42:02 +08:00
Sean Cross
aded1e9800 Merge branch 'main' of github.com:betrusted-io/xous-core 2022-04-21 10:36:55 +08:00
Sean Cross
582be287f4 emulation: add susres to emulation
Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-21 10:20:00 +08:00
Sean Cross
0992b519b5 emulation: load bootloader from ROM
By loading the bootloader from ROM instead of from ELF, we ensure that
.bss and friends aren't overwritten.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-21 10:19:02 +08:00
Sean Cross
2979f4453f emulation: ensure peripherals are reset
Add a `Reset()` call to many more peripherals to ensure they are reset
when the board is reset.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-21 10:18:35 +08:00
Sean Cross
d7c2033273 emulation: keyboard: support "Wake Up" sequence
The hardcoded sequence "F1+F4" will wake a device that is suspended.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-21 10:16:36 +08:00
Sean Cross
b5a858938a emulation: add separate TAP and Linux implementations
Add one script that starts up a TAP connection as well as a second one
that uses a native Linux machine.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-21 10:15:12 +08:00
Sean Cross
86c4a6813d susres: add initial suspend/resume implementation
Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-21 10:14:46 +08:00
Sean Cross
b72b4825f0 emulation: add jtag peripheral
This initial draft of the jtag peripheral is enough to get the test
started.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-20 21:29:09 +08:00
Sean Cross
df03f8c820 emulation: bq27421: correct endianness
Because of the previous commit, endianness was incorrect and we weren't
reading the full range of values.

Correct the endianness and support continuous reads. Also expose various
settings so they may be adjusted.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-20 21:27:51 +08:00
Sean Cross
cd19fcba57 emulation: ec: i2c: allow reading multiple registers
Previously, the code would only allow for reading one register at a
time. This caused that one register to be duplicated repeatedly.

As a result, readings such as Voltage were incorrect.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-04-20 21:26:58 +08:00
Johan Euphrosine
30ff598696
README: add note about renode version 2022-04-06 00:42:46 +09:00
Sean Cross
a70aee7bad loader: move loader into main workspace
Add the loader into the main workspace, removing it from its own
sub-workspace. We can do this now that we can specify the linker script
in `build.rs`.

This improves IDE support, and should shrink disk storage requirements.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-22 02:09:18 +08:00
Sean Cross
84c0896823 linux-server: update versatile system
Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-02 21:08:22 +08:00
Sean Cross
e507c474d6 wf200: add binary file
Signed-off-by: Sean Cross <sean@xobs.io>
2022-03-02 20:51:35 +08:00
Sean Cross
768a7c4b0d emulation: add WF200 ethernet implementation
This adds a working Ethernet implementation based on the WF200. It
currently gets connected to a Linux machine running a udhcpd server,
however it could also get connected to a TUN/TAP connection on Linux or
Mac.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-02-23 21:44:01 +08:00
Sean Cross
9c1255bdd7 emulation: split Com emulation into three files
The COM bus is fundamentally three things: The SoC, the EC, and the glue
that binds the two together.

Now that we have the `EnsureTypeIsLoaded` trick, split the file into
three different groups.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-02-18 09:07:13 +08:00
Sean Cross
317f3136aa emulation: complete initial emulation of spinor/flash
Emulate both the SPINOR block as well as the OSPI flash attached to it.

With this change, the PDDB can now be initialized and resets itself
properly. Additionally, data persists across virtual reboots.

Data does not persist across runs of the emulator. That will follow in
an upcoming patch.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-02-17 18:03:45 +08:00
Sean Cross
88512da693 emulation: keyboard: add key injection functions
It is now possible to inject keys, strings, and lines of text.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-02-14 17:51:56 +08:00
Sean Cross
d44cae2eae xous-release: silence GPIO range
Signed-off-by: Sean Cross <sean@xobs.io>
2022-02-14 16:37:33 +08:00
Sean Cross
ed4dfd4dc1 emulation: com: update HOLD as part of Transmit
Previously, the HOLD signal was updated in a different clock domain from
the transmission signal. This could result in the HOLD bit being set
even if there was no data available.

Update the HOLD bit if it's present as part of the Transmit cycle.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-02-14 13:52:43 +08:00
Sean Cross
11783a050e emulation: i2c: implement Reset bit on I2C
Signed-off-by: Sean Cross <sean@xobs.io>
2022-02-14 13:41:50 +08:00
Sean Cross
c392d8df90 emulation: BQ27421: implement more registers
This gets the gas gauge showing more data.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-02-14 13:41:15 +08:00
Sean Cross
49e1eb19c0 emulation: connect EC
Connect the EC to the SoC. This allows for emulating both the EC and SoC
in tandem. Messages flow via a 16-bit bus. When data is not available,
`0xdddd` is returned.

There is a HOLD line that goes from the EC to the SoC. This is tied to
the inverse of presence of data in the EC FIFO -- when it's empty, HOLD
is `1`, and when there is data it's `0`.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-02-14 12:28:40 +08:00
Sean Cross
fbbb2120ab com: working on getting com functioning
Signed-off-by: Sean Cross <sean@xobs.io>
2022-02-13 10:59:47 +08:00
Piotr Zierhoffer
e21e55807e Update Renode models with new ClockEntry API 2022-02-04 04:04:37 +01:00
Sean Cross
4a44d8d32d emulation: csproj: update targetframework to 2.1
The targetframework tag is now 2.1, in accordance with the upstream C#
code from Microsoft.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-01-26 12:51:19 +08:00
Sean Cross
96d241acfd emulation: memlcd: reduce dirty bit count to 2 bytes
Previously, the memlcd had 22 bytes of dirty bits following a line. This
was reduced to 2 bytes, but the logic checking the dirty bytes had not
been updated.

Reduce the dirty byte count to 2 bytes.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-01-26 12:48:04 +08:00
bunnie
40dcd28b23 move the devboot line 2022-01-25 18:22:02 +08:00
bunnie
0d4ab0eb47 Revert "loader: move loader into main workspace"
This reverts commit 0d72454776.
2022-01-17 22:55:39 +08:00