Commit graph

10340 commits

Author SHA1 Message Date
bunnie
4bc762e9ae
Merge pull request #654 from betrusted-io/i2c-nack
RFC: I2C NACK
2025-06-09 16:35:44 +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
1abf043005 check NACK status in i2c_await routine; update bare metal API
NACK bit is now checked after running the transaction, and if
it is set an appropriate error code is returned.

The trait implementation for i2c baremetal calls is also
updated in this commit
2025-06-07 22:54:52 +08:00
bunnie
09644f435a add CSR bank for I2C error signals 2025-06-07 22:54:10 +08:00
bunnie
34ae2011b2 sidequest - add some accessors to axp2101 object 2025-06-07 22:47:16 +08:00
bunnie
73a1714772 Modify I2C API to accommodate Nack responses specifically 2025-06-07 22:46:14 +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
2c99b32e5a add an API opcode for messaging the cramium_hal_service
in the Xous context, because the IRQ banks are owned by a global
object, not every server can simply refer to the IRQ bits by just
dereferencing a pointer. Instead, it needs to send a message to
the cram_hal_service with an API number which then catches this
and does the dereference on behalf of the caller.
2025-06-07 02:46:42 +08:00
bunnie
c48c97ebdd add the hal-side implementation
this call works either on bare iron or in a xous context
2025-06-07 02:45:59 +08:00
bunnie
c24bb3a450 add irq_status_bits() trait and enum for selecting Irq bank
multiple IRQs related to the UDMA will eventually get mapped into
the global IRQ handler for UDMA. Create an enum type that will
help us differentiate this and add a trait that returns the raw bits
for a given IRQ type.

Probably a fancier wrapper should be made to interptet the IRQ
bits but unfortunately there isn't a uniform pattern to the IRQ
mappings, it's pretty much whatever fit into the IRQ space based
on the underlying function. At the moment not even sure if this
is the right register to be chasing, so we'll use this for probing
that aspect and then get fancy later, maybe.
2025-06-07 02:42:25 +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
a1d3292190 partial progress on implementing more ui functionality
this commit might need to be backed out but i need to abort work
on this due to other more urgent issues
2025-06-07 01:33:13 +08:00
bunnie
10957971bc shuffle around routines to better match original vault code 2025-06-03 00:14:49 +08:00
bunnie
1e680727a8 add in some more of the totp functional frameworks + itemcache
these frameworks are mostly unused at the moment but it lets
us hook more easily into these artifacts once they are populated.

next up...menu behavior in the totp widget
2025-06-02 00:48:50 +08:00
bunnie
79b841142d build a prototype UI for the totp mode 2025-06-01 23:24:23 +08:00
bunnie
c393f590dc build system changes to target minimum ui 2025-06-01 14:39:01 +08:00
bunnie
8edff3de1c convert to a 'minimim viable UI design' template
leave all the complexity of the eventual logic in modules,
but gut the main module and reduce it to a thing i can use
to prototype user interface primitives
2025-06-01 14:38:07 +08:00
bunnie
0b696cf5f8 template for vault2
basically a copy of vault into vault2 to get things started. we'll
cut back from here.
2025-05-29 21:47:29 +08:00
bunnie
3787496016 start mods for vault2 2025-05-29 21:47:17 +08:00
bunnie
69e73ffd61
Merge pull request #650 from betrusted-io/cleanup-bio
fix warning from latest rust version
2025-05-25 14:11:42 +08:00
bunnie
6e0f6e23a1 fix warning from latest rust version 2025-05-25 14:07:58 +08:00
bunnie
9fa69b2898
Merge pull request #649 from betrusted-io/fix-hosted
fix hosted mode config issue
2025-05-23 13:19:46 +08:00
bunnie
6741cba3bd fix hosted mode config issue 2025-05-23 13:18:04 +08:00
bunnie
7619003ad6
Merge pull request #648 from betrusted-io/ui-cleanup
UI cleanup
2025-05-23 13:07:20 +08:00
bunnie
8c02d97081 put the feature into revision controlled source
this will hopefully avoid future instances of mystery feature-itis
2025-05-23 13:05:01 +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
0b07c58336 compactify the slider layout
this saves some empty vertical space allowing for more info
on the screen while sliders happen
2025-05-23 12:56:32 +08:00
bunnie
f8bbf97724 clean up draw list handling
our implementantation of Buffer can't (currently) dynamically grow
the size of the object to serialize things that are bigger than
a page, so we have to enforce Vec-like objects to have a serialized
size of less than the page limit.

This is a bit of a moving target because it depends on implementation
specific details. A conservative bodge was put in to try and
work around this problem for now.
2025-05-23 12:34:55 +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
4c1933414c fix off-by-one error in clip rect definition 2025-05-23 10:54:55 +08:00
bunnie
0f7ad13c08 only set dirty bits for precursor-like targets
This was introducing a mysterious "line" artifact on text rendering
in new systems.

Probably need to do some real on-device testing of this change
because the automated tests won't catch a dirty bit error on
the LCD.
2025-05-23 10:52:55 +08:00
bunnie
73fba43d04 fix emulation mode for baochip target after bringing up metal 2025-05-22 23:48:28 +08:00
bunnie
829f7e5b50
Merge pull request #647 from betrusted-io/pddb-baosec-bringup
Pddb baosec bringup
2025-05-21 18:25:49 +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
1d19076d4b commit test config 2025-05-21 18:06:10 +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
bunnie
8c7edaf107 add a "fake" implementation for the keystore
allows us to test pddb crate before final hardware arrives
2025-05-21 18:03:08 +08:00
bunnie
29017766f4 handle no domain separator case in keystore 2025-05-21 18:02:43 +08:00
bunnie
04c7933c87 handle case of write pages being swapped out upon write release 2025-05-21 18:02:21 +08:00
bunnie
831100a1f0 minor dependency cleanup 2025-05-21 10:24:43 +08:00
bunnie
163d9430ea current debug config
stash it here for now as we are going to roll back to see what's
going on.
2025-05-21 10:24:15 +08:00
bunnie
183916b548 first attempt at layering in a real SPI HAL into PDDB for gen2 targets 2025-05-21 10:23:51 +08:00
bunnie
fe190ea4f1 cleanup warning 2025-05-21 10:23:37 +08:00
bunnie
b63371a56f turn off autotest for now 2025-05-21 10:23:15 +08:00