Commit graph

3676 commits

Author SHA1 Message Date
bunnie
857e54c5af move the console to its final location 2025-08-10 01:56:07 +08:00
bunnie
381b7ec90e remove gpio frame-sync 2025-08-10 01:55:25 +08:00
bunnie
e3664738bc remove AES bodges due to broken AES unit in MPW 2025-08-10 01:43:03 +08:00
bunnie
508c38cfdd refer cache flush to hal version 2025-08-05 23:01:03 +08:00
bunnie
0e1018797e implement HW acceleration for AES128. 2025-07-27 03:17:40 +08:00
bunnie
098d326b55 note performance improvements 2025-07-27 03:17:15 +08:00
bunnie
6fd1757a04 optimize AES routines
- change ordering of aes instructions to remove pipeline bubbles
- port the aes-256 encryption routine from assembly
2025-07-27 02:15:05 +08:00
bunnie
bd45919944 add aes test option into the mbox1 test 2025-07-25 18:59:33 +08:00
bunnie
2e8e2e0364 introduce a message passing test before mbox test 2025-07-24 00:30:04 +08:00
bunnie
1f55dd8ab1 add the messaging test into the mbox environment 2025-07-23 01:23:45 +08:00
bunnie
c0735374f0 fix hosted mode 2025-07-22 01:43:58 +08:00
bunnie
815c082153 add breadcrumb for improving the cbo.flush instruction
whenever rust stabilizes "zicbom" in RV we can remove the ugly
.word hard-coding of the flush instruction.
2025-07-21 19:12:37 +08:00
bunnie
6eaf3501bd add cbo.flush support for vexii targets
Spinor is the one location where memory changes out "from underneath
the CPU" in a cacheable region. This happens when we update a block
of FLASH.

Vex-ii has a physically tagged d-cache, but the cbo.flush instruction
needs the *virtual* address to be passed (it then goes through a page
walk or TLB lookup to resolve the tag). The virtual address only
exists and can be correctly resolved to a physical address in the
process space of the owner of the region that maps to the SPINOR
FLASH. Thus, we introduce a flush routine in the lib.rs side that
calls the cbo.flush instruction on every line that has been potentially
modified by the flash write routine.

Note that cbo.flush is not yet natively supported by Rust stable,
so it's coded as a series of hex words fixed to a given register (a0)
to avoid introducing a nightly dependency. Once the cbo.flush
assembly instructions stabilize we can make the assembly read more
nicely, but functionally it should compile to exactly the same code.
2025-07-21 19:09:05 +08:00
bunnie
75556b2321 add feature flags for vexii-test in rootkeys and shellchat 2025-07-21 19:02:21 +08:00
bunnie
a3d350b86f note aes performance on vex-ii; fix typo on aes256soft_test
aes256 soft test was running on hw before by accident.
2025-07-21 17:19:22 +08:00
bunnie
cb7f6d50b1 add vexii-test feature to pddb 2025-07-21 17:14:02 +08:00
bunnie
7dc09bbc73 updated AES library with Vex-II drivers
This will also be the version we'll use for the daric chip once
it's available; the prior software-only version hack for MPW will
be retired soon.

Note that only AES-256 is implemented in this commit, AES-128
isn't used on the system and so is provided as a software-only
fallback path.
2025-07-21 16:34:05 +08:00
bunnie
a858c09e53 add vexii-test feature to aes lib 2025-07-21 03:10:04 +08:00
Sam Chin
04bf756b8e theoretically clean version which has been tested with and without the feature 2025-06-11 15:05:59 +08:00
Sam Chin
0412a401d8 no more deadcode 2025-06-10 21:51:55 +08:00
Sam Chin
2659fc0894 wip'
'
2025-06-10 21:51:55 +08:00
Sam Chin
c9116cffd9 adding line back in 2025-06-10 16:00:16 +08:00
bunnie
59db16aa99
remove debug message 2025-06-09 18:49:28 +08:00
Sam Chin
a25f20d045 making console flags happy 2025-06-09 17:47:00 +08:00
Sam Chin
90d88820dd dropped a ; 2025-06-09 17:37:12 +08:00
Sam Chin
d1b5a41e82 fixing help text 2025-06-09 17:37:12 +08:00
Sam Chin
c291b6a11f now passing the linter 2025-06-09 17:37:12 +08:00
Sam Chin
e5cdeaf2ca adding some cute command line arguments 2025-06-09 17:37:12 +08:00
Sam Chin
1b8554b8f2 removing the BMP180 code 2025-06-09 17:37:12 +08:00
Sam Chin
916c93e276 now with SI units 2025-06-09 17:37:12 +08:00
Sam Chin
b35f9cad33 working read 2025-06-09 17:37:12 +08:00
Sam Chin
b0b29f7d78 reestablishing devenv 2025-06-09 17:37:12 +08:00
bunnie
0d0267f0ea scaffolding the i2cdetect command 2025-06-09 17:37:12 +08:00
Sam Chin
526d8353fd hello world exercise 2025-06-09 17:37:12 +08:00
bunnie
ea3b032fbe add build flags to bao-console
two flags are added:

with-pddb - puts the PDDB commands into the console
battery-readout - turns on the periodic battery readout
2025-06-09 17:20:46 +08:00
bunnie
d17f9881b2 modify user mode i2c lib calls to return nacks
Note that a NACK is returned as an Ok(I2cResult::Nack) - this is
because the Err() path is still reserved for "OS failure" errors.
A Nack isn't a terminal failure, it is a recoverable fault, and
so it's handled in the Ok() path.
2025-06-07 22:56:51 +08:00
bunnie
63c1d975b4 modify result interpretation to allow i2c nacks 2025-06-07 22:56:29 +08:00
bunnie
76a45ff47d add code to the server
this is the actual handler inside the Xous service which, when
receiving the opcode, dereferences its exclusive pointer to the
IRQ bank and then returns the result to the caller.
2025-06-07 02:48:58 +08:00
bunnie
f3e7eec6cf add 'lib' side code for sending the API call to cramium_hal_service
this is the code that exists on the caller's side. It creates
a message with the correct opcode and decodes the result.
2025-06-07 02:48:10 +08:00
bunnie
cfe9b3c845 modify base API for GlobalConfig to auto-infer the API address
the switch based on target is now absorbed into the new() function.
This paves the way for us to add more CSR ranges into the global
configuration object, i.e. IRQ csrs for I2C.
2025-06-07 01:52:25 +08:00
bunnie
6741cba3bd fix hosted mode config issue 2025-05-23 13:18:04 +08:00
bunnie
eb379e22ba figured out my "mystery problem"
I had a feature override in the shell script I was using to wrap
the build. :-/ oops
2025-05-23 13:04:31 +08:00
bunnie
dbdc157ccf cleanup unrelated warning that crept in due to Rust version change 2025-05-23 10:56:43 +08:00
bunnie
d12bdf1494 fix the case of trying to retrieve shell history when none exists
fortunately rust handles this with a panic because it has strict
bounds checking, so this cleans up that panic.
2025-05-23 10:55:38 +08:00
bunnie
73fba43d04 fix emulation mode for baochip target after bringing up metal 2025-05-22 23:48:28 +08:00
bunnie
942a64ea3b fix saturation bug in index computation code 2025-05-21 18:22:30 +08:00
bunnie
f6aa07c20f add domain separator for gen2 keys 2025-05-21 18:22:12 +08:00
bunnie
4526e04abc cleanup some debug output in xous-swapper 2025-05-21 18:21:41 +08:00
bunnie
938f808a8a revert debug flag 2025-05-21 18:05:57 +08:00
bunnie
3004c4ab7f work around a weird feature flag not behaving as we expect 2025-05-21 18:04:02 +08:00