Commit graph

1074 commits

Author SHA1 Message Date
bunnie
8f208cac4c
refactor debug-print in bao1x-hal
on dabao targets the duart is unavailable, so, it's convenient to
have a uart-based debug option in the HAL. this patch creates a
flag that can allow either target.
2025-10-19 01:19:30 +08:00
bunnie
fe4ef1bc39
refactor rram API
- add range checking to control access to main array or secure
array. This is purely a software enforced check, but it is in
theory backed by hardware gating that is a back stop in case
an adversary can gain arbitrary code access
- rework the rram primitive to return an error type
- add a `std` implementation stub. It is still missing an IRQ
context handler which ensures that all RRAM writes are atomic,
e.g. you can't take an interrupt in the middle of an RRAM
write because it would screw up the buffer staging.
2025-10-19 01:09:58 +08:00
bunnie
951f088625
add coreuser templates
coreuser is the signal that sets the security level of the system
2025-10-19 01:09:15 +08:00
bunnie
39ceef55f3
Add protected-rram module
this lays the foundation for access control, data slots,
key slots, etc.
2025-10-19 01:07:44 +08:00
bunnie
b59bff2223 cleanup/redefine keyslot regions 2025-10-19 01:06:54 +08:00
bunnie
a40bb7c244 other half of the adjustment 2025-10-18 01:16:16 +08:00
bunnie
3b4e035a4f
revise auth_data handling for key header block
auth_data actually changes with each signing operation (ostensibly
to prevent replay of signatures coming from tokens) so it has
to be presented as data parallel to the signature, instead of
as a static filed baked into the key header.

This commit revises the header record to reflect this organizatio
of data and also revises the signature check to be in-line
with the protocol.
2025-10-06 23:31:02 +08:00
bunnie
7d6630b7ec fix one way counter offset calculations 2025-10-06 23:24:42 +08:00
bunnie
03ea3c9d0c changes to the apis to accommodate the public key record format 2025-10-06 15:20:34 +08:00
bunnie
a1a5ff1592 add public key templates
Beta/developer keys are fully filled out.

Placeholders for production signing keys are also provided.
2025-10-06 15:19:19 +08:00
bunnie
3c68eea714
Merge branch 'main' into signing 2025-10-06 13:45:29 +08:00
bunnie
dbb0a75118 bump versions
have to absorb a version change due to xous-semver change

might as well also update the utra/svd generator dependencies
since that's been held off for a long time now.
2025-10-06 13:23:18 +08:00
bunnie
69d81042b9 upgrade signature check to handle domain separation data
this is needed to handle the fido2/webauthn style signatures
2025-10-06 03:49:11 +08:00
bunnie
95f192ca38 add dabao target 2025-10-05 17:15:05 +08:00
bunnie
01a78e4474 fixup app region start and add freq/voltage configs for board targets
this is the agnostic version of all of the board targets, which
allows the boot1 to lookup based on the current configuration
which configurations to apply.

I think I've talked myself into giving away $0.20 of parts with
every dabao board so that everyone can run at full frequency.
Originally I thought I'd limit to the minimal configuration with
low frequency operation but since this is the main developer
platform all the benchmarks and first impressions will come
through this board. Crippling it with a slower clock frequency
by omitting the supplementary digital regulator seems
short-sighted, even if it means up slightly subsidizing things
with this extra cost.
2025-10-05 17:12:40 +08:00
bunnie
c6fb0565ff add frequency/voltage exports from api into the hal
also cleanup some small debug messages
2025-10-05 17:12:04 +08:00
bunnie
2f5af89547 make the swap header length explicitly controlled
previously it was just "4096" in the image writer
2025-10-04 18:52:30 +08:00
bunnie
c86844a39a make signatureinflash structure data
this cleans up one unsafe step where we have to assume an
alignment of the data at the cost of the structure being copied
to stack. I think this is a fine trade-off.
2025-10-04 18:51:34 +08:00
bunnie
b91d54c5cf add SPIM optional target for signature checking
this allows us to check the signature on stuff in off-chip swap
memory through the SPI interface.
2025-10-04 18:50:49 +08:00
bunnie
7f9b783027 mirror board constants from API; make SPIM channel a const
this implements the API/HAL split on the HAL side, and also
reveals SPIM channel as a constant that can be just read out
so that spim accessors that need to build from raw parts
can do it without having to re-allocate IOs.
2025-10-04 00:53:22 +08:00
bunnie
869da85ef7 add swap descriptors as structures; add offsets for boards
In the API layer, the boards aren't setup with convenience flags.
they are all laid out and the caller needs to know which board
it's trying to resolve. This is because the API layer is agnostic
to board and assumes the tool working with it knows what board
it's working with already.

The HAL layer tries to hide the board-specific stuff, and so
API defines are re-imported there in a board-transparent fashion.

Also add swap descriptors to the API crate, so that the image
generation tools can refer to the exact same structures as
are used inside the code, simplifying image creation maintenance.
2025-10-04 00:51:25 +08:00
bunnie
07e7197517 upgrade the sigcheck boot routine to pass kernel arguments
all other boot modes would get an a0 with the address that the
kernel is "supposed" to be located. this is neither security
sensitive or problematic.
2025-10-01 23:36:14 +08:00
bunnie
ec9aed29dd fix kernel offset so signature doesn't shift the image
the image needs to be page-aligned so it can do direct-map
to memory.
2025-10-01 23:35:24 +08:00
bunnie
e77d412bad extract the peripheral reset line 2025-10-01 14:29:04 +08:00
bunnie
346d7cd4d4 indicate the space for the marquee line on the boot logo 2025-10-01 14:28:45 +08:00
bunnie
03744c2dca ops are no-std stafe 2025-10-01 14:28:13 +08:00
bunnie
2eaaa99f6e fix kernel config conflict
no signature checking is necessary in the kernel so don't
introduce the dependencies
2025-10-01 02:57:55 +08:00
bunnie
cdb60eed0f update the static table definition 2025-09-30 21:52:45 +08:00
bunnie
dec6c1944b add overflow handler to big reads (to fake big disks) 2025-09-30 17:28:42 +08:00
bunnie
cade3980cc fix double-offset error in oneway counter readback 2025-09-30 00:37:57 +08:00
bunnie
15562abf00 add functional code slice
this puts a domain separator in every signature block
a domain separator meaning, even though the same private key
maybe be used to sign multiple blocks, because a functional code
is embedded in the block that is tied to the block's function, you
can't take a pre-signed block and shove it into another block's slot
and expect it to work.
2025-09-29 22:17:56 +08:00
bunnie
e7135d9e80 narrow down functional codes allowed for signature validation 2025-09-29 22:17:09 +08:00
bunnie
f8e124f6f9 limit writeable area to the active data area
the top of memory is reserved for various security structures

the security structures do have some hardware protection

but life is better when we also help programmers avoid triggering
the protections by accident and then just being confused.
2025-09-29 18:41:29 +08:00
bunnie
0d8cf34b18 add docs to sigcheck routine and fetch public keys from the specified source
this fixes the issue where we're asking an untrusted image to
tell us what keys to check it with :P ~~~
2025-09-29 16:22:16 +08:00
bunnie
ba817cc1a9 add uf2 identifier for baochip-1x
just pulled it out of a uuid generator, checked it has no
collisions. At some point, maybe some official repo will allow
us to be "real" but ain't nobody got time for those politics
today.
2025-09-29 16:20:43 +08:00
bunnie
150e46d9c0 restructure the HAL's security primitives
- combohash constants are moved to API: these need to be in a
dependency-free library so that we can refer to these values in
any context without creating circular dependencies

- sigcheck code is now put into the HAL layer, instead of in the
individual bootloaders. This is because the sigcheck code is re-usable
between boot0/boot1.

- sram timing trimming data has been entered from the XLS file
and put into an array for easy access

- more board initialization functions have been adedd, and cleaned
up to adhere to the rule that pin allocations don't change the state
of the pins, allowing pin allocation calls to be idemptoent (e.g.
you can call it several times without negative effects - the reason
being that the pin setups also return the pin maps, which can then
be passed to the functions of interest to manipulate the pin states)
2025-09-29 13:42:23 +08:00
bunnie
c6445c9a9b add an API for accessing one-way counter values
A macro is added, a bit like this one:

```
encode_oneway! {
    #[offset = 80]
    pub enum BootWaitCoding {
        Disable,
        Enable,
    }
}
```

Which encodes possible one-way counter states along with their
offset in the one-way counter array.

The states in the enum correspond to the evolution of the counter,
modulo the number of elements in the enume.

The macro also creates a getter for the states, and an incrementer
to try and make this whole process less error-prone.
2025-09-29 13:40:14 +08:00
bunnie
f8967ebaec fix offsets in one way counter implementation 2025-09-26 22:57:27 +08:00
bunnie
094207fe40 add signatures API
this allows us to generate signatures using the same API
that we use to check 'em.
2025-09-26 22:56:19 +08:00
bunnie
9434bb5383 style_macro is how fonts are added to bao1x
By adding a resolver to a given glyph set, the glyph set is
automatically pulled into the image.

Glyph set is now co-located in the bao-video process, instead
of the loader.

The orignial argument for putting the font data in the loader
is that it's a large, static blob; by putting it in the loader,
updates can be more compact, and fonts don't need to be schlepped
over every time you have an application update.

This came with consequences. It made verifying the loader more
complicated (because its memory space is split between the graphics
manager and root keys). It also means we have to fix the partition
size for the loader at "fairly large" for fonts, even if we don't
need all of them in all of the configs.

With baochip, we have swap memory! Off-chip memory is cheap and
only the fonts actually used by the host get mapped into main memory.
This means we don't have as much of a trade-off in terms of
cost for fonts if we put them in off-chip swap storage. Also,
the updates are split between swap and main memory, and the roadmap
includes an item for swap to be individually loadable programs
so that if the video server doesn't need an update, it won't be
pulled into the update set.
2025-09-25 16:08:36 +08:00
bunnie
7724e38ca1 cleand up fontmap 2025-09-25 16:08:27 +08:00
bunnie
2d5039568c genearted artifacts corresponding to template update 2025-09-25 16:08:06 +08:00
bunnie
f30ab0d98e remove fonts from loader for bao1x: update codegen template 2025-09-25 16:07:31 +08:00
bunnie
26fefa7e5b add modules and bitflags to bitbybit migration todo 2025-09-24 01:03:43 +08:00
bunnie
cd182e9efc remove Drop on no-std
this saves a whole bunch of glue code that never gets called
in no-std
2025-09-24 01:03:09 +08:00
bunnie
d02df71bf1 beginnings of ACRAM support 2025-09-24 01:02:53 +08:00
bunnie
497bb74624 add combohash support 2025-09-24 01:02:39 +08:00
bunnie
a3a7bf9f3a add a format for passing static initialized data to baremetal
a small, 256-byte record is added to the top of baremetal records
that is a "poke table" that incorporates what values to put where
for baremetal targets, as well as a zeroization region.

This is generally more efficient because most values are set to
zero, and the only things that generally have a non-zero value
are 'static' variables, which are used extremely sparingly.
2025-09-21 21:50:48 +08:00
bunnie
5151553028 fix dabao target for lib1x-hal
this is the "effective" traget for simulation: no external
peripherals expected.
2025-09-20 22:16:16 +08:00
bunnie
179e178e96 fix up formatting that changed due to the flag day 2025-09-18 21:31:54 +08:00
bunnie
1255bf12d9 FLAG DAY: fix all names to harmonize around 'bao1x'
The code base had evolved through several code names, interim
names, company names and chip names that alternatively did or did
not exist.

Baochip is the definitive name of the company, and the Baochip1x
(full part number BAO1X2S4F-WA) is the definitivey part number of
the SoC. For convenience, the part number is shortened to 'bao1x'
in most feature flags and variable references.

This commit fixes all of the odd names and removes some unmaintained
early targets.
2025-09-18 21:25:51 +08:00
bunnie
04088d15d9 update TRNG tuning parameters to match NTO tape-out
performance is much better, ~7.9834 bits entropy/byte on the
raw RO now.
2025-09-18 20:18:07 +08:00
bunnie
a65917707b propagate name change to legacy lib 2025-09-14 02:15:04 +08:00
bunnie
e87501f14d move debug lib in bdma so we can gate it on/off more easily 2025-09-14 02:10:10 +08:00
bunnie
0391a6aef5 fix naming for bio api 2025-09-14 02:09:40 +08:00
bunnie
a4d9fc9dc7 add bio bit setting and also add input bit mapping to board file 2025-09-14 02:07:42 +08:00
bunnie
514b27eb18 add pio bit setting to api 2025-09-14 02:07:14 +08:00
bunnie
f094c22eaa add some notes moving toward trng characterization on new chip 2025-09-13 23:29:27 +08:00
bunnie
a077e9c617 fix IRQ mapping on board description 2025-09-13 16:17:47 +08:00
bunnie
e4d230f42e fix plug/unplug not ready error 2025-09-13 15:35:57 +08:00
bunnie
ff499f7c09 bookmark some usb-device debug config 2025-09-13 01:11:41 +08:00
bunnie
bd50819fa0 fix EP0 receive issue in usb-device
usb-device has a limitation for this hardware in that it can't
initiate an ep0-receive. It has a hook for flipping ep0 from
IN to OUT (as a modal thing) but for our stack you need to
explicitly setup EP0 to receive - an exact amount of data based
on what's expected - exactly at the point of the setup packet
arriving saying an OUT transaction is pending.

The hack to work-around this is to simply intercept those setup
packets in the handle_event_inner() interrupt handler and initiate
the receive. In fact, the data is completely ignored (in our
application it's setting a baud rate which is fictional in our
system). However, clients such as windows will time out and
refuse to communicate if the OUT packet is not ACK'd, even if
it is ignored.
2025-09-13 01:09:11 +08:00
bunnie
82c5b7e970 add per-ep app pointers
this fixes the read/write looping issue
2025-09-12 15:45:10 +08:00
bunnie
faaa1ad4b9 significant code cleanup on the usb driver
- endpoint allocator now handles more edge cases. likely there
are still more weird cases to be considered, but it at least
handles the CDC-ACM case of a lone interrupt endpoint that
can't be mix-and-matched with other devices

- initiate OUT to kick off reads

- remove dead code

- handle bulk and interrupt cases for both read and write

- clean up reset edge cases - still more work to do there,
the stack does not recover on second plugin

- better debug output
2025-09-12 02:46:57 +08:00
bunnie
9609a6d66e point to forked version of usb-device, increase control buffer size
larger control buffer is needed for composite descriptor to
fully write and send
2025-09-12 02:46:16 +08:00
bunnie
659296f672 add support for USB serial in baremetal targets 2025-09-11 00:54:02 +08:00
bunnie
c2df76b59b remove floating point print to reduce code size 2025-09-11 00:53:48 +08:00
bunnie
55f1c805a0 fix EP number to 4 (8 PEI) 2025-09-09 23:57:50 +08:00
bunnie
200f71eba8 settle on the safe config for the USB driver
set to 4 endpoints because that's what we know we have for sure
2025-09-09 22:23:01 +08:00
bunnie
50e3899028 make it so that double-debug alloc doesn't cause insta-failure 2025-09-09 22:22:41 +08:00
bunnie
06ad86a0fc fix ifram allocs for usb so usb+camera can run simultaneously 2025-09-09 22:22:16 +08:00
bunnie
19620d800f some tweaks to accommodate a possibly larger ep_num 2025-09-09 18:40:52 +08:00
bunnie
bcd8120ea3 tighten up the USB memory usage 2025-09-09 18:17:51 +08:00
bunnie
e0ad3e1831 match up EP requests to pending data
previously we had no way to correlate an incoming packet
to an actual read from the USB stack because we didn't store
the EP that originated the request

This fixes that issue and also passes on the pending EP requests
correctly to the rest of the stack
2025-09-09 17:50:45 +08:00
bunnie
8739eb6bf7 cleanup test code 2025-09-08 10:29:42 +08:00
bunnie
00db7d108d upgrade link to high speed 2025-09-08 09:52:20 +08:00
bunnie
1c4ed2944c fix mirror/flip of camera 2025-08-20 03:06:45 +08:00
bunnie
11fb1452c9 cleanup the initialization code some more
move the full mem initailization above the memory load/store
pipe cleaner, and have the memory load/store actually do a load
and not just stores.
2025-08-20 01:49:48 +08:00
bunnie
ffc226b9a8
Merge branch 'main' into nto-bringup 2025-08-19 19:51:16 +08:00
bunnie
53c4485387 more warnings 2025-08-19 19:46:23 +08:00
bunnie
ecbac27e76 fix rustc-1.89 warnings 2025-08-19 19:45:29 +08:00
bunnie
49484bb93d add power management pins to board description 2025-08-19 19:01:26 +08:00
bunnie
bdd8b727a7 add get dcdc routine to axp2101 api 2025-08-19 19:01:03 +08:00
bunnie
cd58323541 fix uart divider commit
needs to disable uart before the new values can take
2025-08-14 14:10:26 +08:00
bunnie
b4ffcfe11a add stack dump as a macro in the lib for cramium-hal
I have a feeling this won't be the last time I want to use a
utility like this during bringup...
2025-08-14 03:28:48 +08:00
bunnie
891489f789 cleanup stack tracing code 2025-08-14 03:28:27 +08:00
Sam Chin
d02970c264 now with read 2025-08-13 18:53:33 +08:00
Sam Chin
7af77a1d10 can now set multiple clocks on multiple fifos 2025-08-13 15:34:39 +08:00
Sam Chin
f9cbf14d19 now the pins can toggle without impacting capsense since I removed reset 2025-08-13 14:52:50 +08:00
Sam Chin
a6643a3314 moving square wave generator over - it does not play nice with other things right now 2025-08-12 21:19:29 +08:00
Sam Chin
ba997be92f working modular gpio with all bio cores 2025-08-12 20:35:02 +08:00
Sam Chin
a5e95c9c6d pin up works for core 0 via lib 2025-08-12 19:39:56 +08:00
Sam Chin
db7690210a pin up in library 2025-08-12 17:06:42 +08:00
bunnie
cb1f82ecc8 add changes to work around BIO code issue
there is either a code bug or a compiler issue that is causing
something on stack to be smashed that is causing trouble for
the code base as a whole. Or it could be improperly initialized
statics? unclear. this needs to be worked through.

however, a series of changes were made that make the code
work. The biggest tell is that the code generally works perfectly
when optimizations are off, but when optimizations are on some
shenanigans have to happen to convince the compiler to not split
constant values across the entire arc of the function. More
diagnostics to follow.
2025-08-11 15:00:09 +08:00
bunnie
c9f1e29907 commit a "magic state" that seems to be able to get BIO core 3
unwedged
2025-08-10 22:32:13 +08:00
bunnie
1a9b4e48ef leave bread crumb about the upgrade to HS usb 2025-08-10 16:08:44 +08:00
bunnie
7dd0ffaadd update board definition to NTO/baosec production pinouts 2025-08-10 01:50:26 +08:00
bunnie
38bd899c9f prep table for changing h/v flip 2025-08-10 01:50:02 +08:00
bunnie
b2ec951774 add SOF_SYNC feature to camera driver - new in NTO 2025-08-10 01:49:18 +08:00
bunnie
a22cf7f58c add more debug feedback in tests 2025-08-08 03:37:43 +08:00
bunnie
ca105f4be8 cleanup some more cache_flush refs 2025-08-05 23:02:54 +08:00
bunnie
4fbae4969b add baremetal RRAM API
this works in baremetal environment. Needs to be modified/augmented
for xous...
2025-08-05 23:00:28 +08:00
bunnie
da623ccd01 harmonize cache_flush in hal and also add rram module 2025-08-05 23:00:09 +08:00
bunnie
77d7094d3b reduce the pddb size for the vexii-test target 2025-07-21 19:03:24 +08:00
bunnie
51c5fc75be add artybio target, remove debug prints that don't map to the target 2025-06-15 01:03:01 +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
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
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
6e0f6e23a1 fix warning from latest rust version 2025-05-25 14:07:58 +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
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
29017766f4 handle no domain separator case in keystore 2025-05-21 18:02:43 +08:00
bunnie
70975fbff3 cleanup dependencies 2025-05-21 10:20:59 +08:00
bunnie
fa3ab1dea1 cleanup dependencies a bit
cramium-soc i think should be deprecated everywhere because
it is redundant with the board targets: anywhere you see a board
target that includes the crossbar soc it should also transitively
pull in the cramium-soc dependency equivalents.

we'll chase this out more later, but for now we're just trying
to get the PDDB to compile
2025-05-20 14:35:42 +08:00
bunnie
7947949589 add constant to precursor board file
this helps with cross-target builds...
2025-05-18 09:24:33 +08:00
bunnie
dff4dded64 remove yield_slice() in std target
This is a bad idea because yield_slice() causes the active
process to hand off to a new one (without an IRQ). However,
the idea of most flash operations is we really want them
atomic - we can't have something else decide to go and muck
with flash while say, we are waiting for a page erase to
complete. So, implement spin locking to block the CPU
during phases where the hardware operation is non-interruptable.
2025-05-18 04:25:37 +08:00
bunnie
3872ae2a1c fix comment typo 2025-05-16 19:03:56 +08:00
bunnie
450c9153f2 fix usage comments on ifram allocation for flash 2025-05-16 19:03:28 +08:00
bunnie
e2379821e6 republish xous-rs to fix cargo test 2025-05-11 15:36:17 +08:00
bunnie
8a4959056b bump version for xous crate update - commit so we can publish crates 2025-05-11 14:45:24 +08:00
bunnie
ad3e4616dd incorporate xous-rs to hal migration into keystore-api 2025-05-11 12:40:56 +08:00
bunnie
f27c78c918 add BOOKEND constants to the hal layer; add MMAP_VIRT range
BOOKEND test sentinels are moved out of xous-rs, and into the
board definitions allowing us more flexibility on configuration
board-specific test configs (before it was a xous-wide constant,
which seems a bad idea because it makes migrating test infra
hard as the manufacturing infra updates)

MMAP_VIRT as a range is also added is this commit
2025-05-11 12:34:48 +08:00
bunnie
d4f2951af5 add a HAL layer for Precursor
this allows us move board-specific parameters out of xous-rs
and into a board library that is consistent with the new board
libraries, reducing special case code for Precursor
2025-05-11 12:32:45 +08:00
bunnie
645846e32e move pddb, spinor params into the board section of the HAL for hosted
this makes code a little cleaner when porting to new targets
2025-05-08 15:59:31 +08:00
bunnie
a399702403 add proposed values for TG28 fusing & testing
include some readback testing and make addresses pub so they
don't throw warnings when not referenced in the crate
2025-05-06 19:06:44 +08:00
bunnie
3faad803d3 add catch-all operand for keystore 2025-05-06 01:47:30 +08:00
bunnie
868a1f280b move SPINOR params into board definition
this makes a lot more sense that defining it at the chip level
2025-05-05 01:47:50 +08:00
bunnie
05720032cf flesh out keystore api 2025-05-05 01:47:17 +08:00
bunnie
87140a2024 cleanup the api a bit more
realized it was dumb to have separate file paths for the
orthogonal implementations
2025-05-04 19:12:51 +08:00
bunnie
c8db01c563 re-org rootkeys-api into common and generation-specific libraries 2025-05-04 19:05:58 +08:00
bunnie
f3fa5f6c68 migrate rootkeys API to a neutral third party crate
this will allow for bridging APIs between generations
2025-05-04 18:30:39 +08:00
bunnie
d985491c7f add block erase routines 2025-05-04 03:32:52 +08:00
bunnie
7ee15b874d cleanup on the gc2145 driver 2025-05-01 16:40:46 +08:00
bunnie
6fdf868b44 make camera pins generic 2025-05-01 04:09:36 +08:00
bunnie
6d1a362735 add gc2145 to cargo file 2025-05-01 04:09:17 +08:00
bunnie
0ca3caf917 add gc2145 module 2025-05-01 04:09:00 +08:00
bunnie
d7aafc6c50 put yuv mode into the ov2640 driver directly 2025-05-01 04:08:37 +08:00
bunnie
2523b0afee gc2145 talking and up
exposure and noise levels need to be fixed, and need
to find a way to rotate/flip the screen? i think.
2025-05-01 04:07:24 +08:00
bunnie
eb7a861def Merge branch 'pddb-feat-down' of github.com:betrusted-io/xous-core into pddb-feat-down 2025-04-29 22:31:40 +08:00
bunnie
18de29f7a7 improve compatibility of api signatures 2025-04-29 22:27:59 +08:00
bunnie
bad5259f43 base64 should be an optional dependency in std
otherwise the loader breaks
2025-04-29 03:32:59 +08:00
bunnie
a5fec5a1d1 fix formatting 2025-04-29 03:19:49 +08:00
bunnie
cb35696200 Merge branch 'main' of github.com:betrusted-io/xous-core into cram-dev 2025-04-29 03:18:57 +08:00
bunnie
26464d4266 fix vertical scrollbar drawing offet bug 2025-04-29 03:10:41 +08:00
bunnie
ae5ff3addd add strings for bip39 entry in small screen mode 2025-04-29 03:02:09 +08:00
bunnie
14740d0cc1 add a numeric-priority mode to the OSK
if the pre-populated field looks numeric, prioritize numbers
over letters for the OSK.
2025-04-29 03:01:29 +08:00
bunnie
0e5410eb36 add more convenience apis 2025-04-29 03:01:10 +08:00
bunnie
9512defd2d add base64 dep for showing bip39 seeds 2025-04-29 03:00:44 +08:00
bunnie
9b5510985f initial take at bip39 entry 2025-04-29 03:00:30 +08:00
bunnie
da7efec6a6 add clone operation for gfx 2025-04-28 19:02:27 +08:00
bunnie
e55630fd57 allow for centering of list items
and make OSK entries centered

this makes the list a little nicer to navigate
2025-04-28 19:01:59 +08:00
bunnie
8be197a2b5 initial slider implementation 2025-04-28 19:01:31 +08:00
bunnie
3b0543a5f0 add supporting changes for textentry 2025-04-28 18:19:36 +08:00
bunnie
e690da3f77 add textentry implementation
includes a simple on-screen keyboard element
2025-04-28 18:18:57 +08:00
bunnie
87b4b18210 cleanup an api change in gfx visibility 2025-04-28 15:18:54 +08:00
bunnie
500df9714e an initial take at a checkbox implementation 2025-04-28 15:18:38 +08:00
bunnie
0d3563412e add more APIs to scrolling list widget
these facilitate checkbox implementation
2025-04-28 15:18:10 +08:00
bunnie
c90c449d32 make pane height adjustable
this allows for top/bottom text on modals...
2025-04-28 03:18:07 +08:00
bunnie
1ac5a55d25 cleanup height calculations 2025-04-28 03:17:50 +08:00
bunnie
a40279ef1e remove errant clear 2025-04-28 03:17:27 +08:00
bunnie
10044579aa initial take at radiobuttons 2025-04-28 02:27:41 +08:00
bunnie
39b0fb9e12 remove lifetime from builder pattern
this causes integration issues with the enum_dispatch macro
2025-04-28 02:27:16 +08:00
bunnie
c657d4db54 fix typo 2025-04-28 02:03:23 +08:00
bunnie
ac19def8df add scrollbars 2025-04-28 02:01:24 +08:00
bunnie
e56acbd243 first take at a 2-d scrolling widget 2025-04-28 01:18:25 +08:00
bunnie
bb6820419f sanity check AXP2101 e-fuse settings 2025-04-27 15:12:07 +08:00
bunnie
e22997874d add DCDC5 configuration 2025-04-21 02:42:40 +08:00
bunnie
1484453100 add scroll widget stub 2025-04-21 00:38:25 +08:00
bunnie
31dcab40aa add a test target with limited scope
this is for SoC testing with i.e. no peripherals or simulated
peripherals in a simulated environment
2025-04-20 07:48:29 -07:00
bunnie
2f467d6f23 Merge remote-tracking branch 'origin/cram-dev' into cram-dev 2025-04-20 04:06:41 -07:00
bunnie
1bad10fb21 work-arounds for DMA on BIO
- writes need at least a "pipe cleaner" to set the pipe in the correct
state
- may also need a "double-write" to commit the data - this is to be
explored with a smaller test case
- DMA write only works over all corners at 700MHz when
  FCLK=ACLK (i.e. FCLK is at half rate)
2025-04-20 03:28:40 -07:00
bunnie
7bd545e95c minimize character output during tests
this significantly improves runtime in GLS mode
2025-04-20 03:28:40 -07:00
bunnie
66ec140cf3 limit spi debug output 2025-04-20 03:28:40 -07:00
bunnie
b390a824d4 fix slew and drive rating for SPI interface
this is necessary to meet 50MHz timing on NTO
2025-04-20 03:28:40 -07:00
bunnie
72763dc3c7 modify fast dma test for clocking option 2025-04-20 03:28:40 -07:00
bunnie
019f342c98 update bio tests for clkmode option 2025-04-20 03:28:40 -07:00
bunnie
5e7a687c8b found the offending Debug deriver that was causing fp library bloat
this one derive was causing the bootloader to be about 20% bigger.
2025-03-05 22:42:56 +08:00
bunnie
f394ccab42
Merge branch 'main' into cram-dev 2025-03-05 20:56:36 +08:00
bunnie
c49c41699b cleanup warning 2025-03-05 20:54:03 +08:00
bunnie
57a4f24a02 restrict ObjectList to std targets only 2025-03-04 19:11:23 +08:00
bunnie
63a9a2b0a0 implement notification models for small screens 2025-03-04 19:06:41 +08:00
bunnie
1e9e02435b add missing model boilerplate
a lot of routines were left blank in the initial port to get
through the core graphics primitives porting. This commit
fills in those missing bits in a fashion that optimizes the
modals for drawing on small displays.
2025-03-04 19:05:41 +08:00
bunnie
3c5975715d kind of hack to make font rendering work on oled displays
so, there is a fundamental abstraction mismatch in the blitstr
library. In Precursor, I created a rule that you can't draw text
on black backgrounds without some special permissions in highly
trusted contexts.

For baosec, this restriction is removed because the whole OS
can run inside a single chip (i.e. we have eliminated most
easy RAM modification attacks, requires probing/glitching; but
as a trade-off, we don't have as much RAM so we can't afford the
extra abstractions).

The compromise is for OLED-type platforms where inverse drawing
is very common to save power, all text ops are assumed to be XOR
operations (so you're always flipping pixels instead of drawing
at a defined color).
2025-03-04 19:02:45 +08:00
bunnie
15f41a5f5b object list API elements 2025-03-04 19:01:47 +08:00
bunnie
5d4d009e64 add object list draw routine
this can accelerate drawing of complicated objects, such as
QR codes, that are composed of many rectangles.

there are some warts...in theory, this should be able to seralize
arbitrary-sized lists, but there must be some bug somewhere
that is preventing it from happening. For now, the list length
is clipped to the capacity of a page of memory.
2025-03-04 19:00:33 +08:00
bunnie
8602af4d18 add modals adapter code
initial take just lifted directly from the gam version;
layout details needs adapting for small screen still
2025-03-04 02:07:17 +08:00
bunnie
c67cb7666c fixup feature dependencies 2025-03-04 01:26:03 +08:00
bunnie
06d8760209 add routine to set pwm mode on axp2101 2025-03-04 01:24:41 +08:00
bunnie
da5c215477 fix type defaults for trait
part of the i16->isize transition
2025-03-03 02:12:57 +08:00
bunnie
433d632926 add a clear, modals & text bounds api calls
the text bounds api call is needed in v2 because there is no gam
to mediate this call

clear allows for a fast clear operation that may have hardware
dependent consequences

acquire/release of modals mode is added to the graphics server
as well to implement a feature previously handled by the gam
2025-03-03 02:11:23 +08:00
bunnie
b1ce74faa0 add handler for unspecified clipping areas in v2 targets 2025-03-03 02:10:50 +08:00
bunnie
2957cce789 add some v2 graphics api adapters and opcodes 2025-03-03 02:10:24 +08:00
bunnie
02bc28be4a
Merge branch 'main' into cram-dev 2025-02-28 17:44:58 +08:00
bunnie
e84daa0179 fixup more emulation issues 2025-02-28 17:42:30 +08:00
bunnie
b6ed2c7398 fix cursor overlay in sh1107 display mode 2025-02-28 17:30:17 +08:00
bunnie
db4d21c54c fix emulation bugs 2025-02-28 17:29:43 +08:00
bunnie
67e501328d mirror code structure from hosted mode 2025-02-28 16:33:31 +08:00
bunnie
317bc6a9fd related to previous commit 2025-02-28 16:33:14 +08:00
bunnie
e0ef852d06 fix routine so we're passing by reference, not by copy
this is just an "old code" problem, written before I fully understood
these subtleties
2025-02-28 16:32:32 +08:00
bunnie
8f48572b9c restrict font choices in baosec target
we have a smaller font map, so don't resolve glyphs to fonts
that we don't have.
2025-02-28 16:32:03 +08:00
bunnie
48009c710a regenerate logo according to new framebuffer layout 2025-02-27 21:35:10 +08:00
bunnie
b29d885000 fix various driver bugs & harmonize wih precursor color "standard" 2025-02-27 21:33:31 +08:00
bunnie
3d0d727094 fix bits vs bytes 2025-02-27 21:33:10 +08:00
bunnie
f3fccf9135 fix unnecessary mutability in trait 2025-02-27 03:12:41 +08:00
bunnie
9abc920bb2 refactor sh1107 driver so pixels in fb line up with bits in u32 2025-02-27 03:12:15 +08:00
bunnie
6e26db411a
Merge branch 'main' into cram-dev 2025-02-26 14:57:55 +08:00
bunnie
f5473868b1 fix return calls to use scalar5 instead of scalar2 2025-02-26 14:37:20 +08:00
bunnie
4096b35fef refactor shared implementation to use reply and receive next api 2025-02-26 14:36:50 +08:00
bunnie
2a97d9a827 fix location of font offsets 2025-02-24 02:28:34 +08:00
bunnie
ffceea0389 fix blit_screen routine 2025-02-24 00:57:53 +08:00
bunnie
a9c9d8d67b commit generated logo 2025-02-24 00:57:03 +08:00
bunnie
d281332b16 fixup conversion to simplify the image blit operation 2025-02-24 00:56:33 +08:00
bunnie
55cbe7a962 add module ref to handlers 2025-02-23 18:06:45 +08:00
bunnie
d50d228984 move baseline graphics handlers to a shared library 2025-02-23 18:06:25 +08:00
bunnie
e1a606f0bb add routines to create a clone of the display itself
this is an unsafe bit of code that is necessary because the
panic handler needs to run in its own thread with a hardware
handle to the frame buffer. this allows panics in the main
graphics thread to not cause the panic handler to fail.
2025-02-23 16:54:04 +08:00
bunnie
b7ef119a04 split pin numbers from pin setting
this allows us to probe pins/clone them without having to re-allocate
them.
2025-02-23 16:53:28 +08:00
bunnie
0d5a4e8e91
Merge branch 'main' into cram-dev 2025-02-23 12:15:37 +08:00
bunnie
9f890d3dbd add camera irq opcode to main graphics handler opcode list 2025-02-23 12:04:17 +08:00
bunnie
f37df2b1cb add hardware primitives missing for graphics layer compatibility 2025-02-23 12:02:37 +08:00
bunnie
35fe7ed73f add bitmaps for logos 2025-02-23 11:56:57 +08:00
bunnie
7e57af5841 add documentation target for library
this helps cargo doc to run
2025-02-22 01:07:12 +08:00
bunnie
56123fea8d fix doc warnings 2025-02-22 01:07:01 +08:00
bunnie
b8b1bfed03 fix doc warnings 2025-02-22 01:06:46 +08:00
bunnie
cc8a0a57a7 fixup apis to use traits 2025-02-21 23:42:01 +08:00
bunnie
8acb9e7521 add platform implementations of the frame buffer trait 2025-02-21 23:41:44 +08:00
bunnie
b352ecb667 remove platform-specific operation and replace with a trait 2025-02-21 23:41:19 +08:00
bunnie
d9d48262ac expand FrameBuffer trait to interop with precursor details 2025-02-21 23:09:45 +08:00
bunnie
efb627bf4f remove slice size specifier from blitstr2
this makes the api portable
2025-02-21 17:46:28 +08:00
bunnie
0770d5437f bring chat lib up to date with new ux-api layer 2025-02-21 17:46:11 +08:00
bunnie
27e4b77792 cleanup compile warning in cramium-api 2025-02-21 17:45:27 +08:00
bunnie
19f3221417 final changes to make ux-api platform-independent 2025-02-21 17:44:54 +08:00
bunnie
30c5876ad4 add missing apis/derives to minigfx to make it precursor-compatible 2025-02-21 17:43:50 +08:00
bunnie
07563c44db add precursor as a platform to ux-api 2025-02-21 17:43:23 +08:00
bunnie
5e258916da migrate graphics library API to a platform-neutral service crate
this kicks off an enormous set of refactoring changes...
2025-02-21 17:42:39 +08:00
bunnie
2ad0a58a56 remove redundant constants 2025-02-20 20:48:00 +08:00
bunnie
385e4198f2 accommodate movement of the opcode api 2025-02-20 20:39:28 +08:00
bunnie
fc8e7060a3 migrate opcodes out to an agnostic platform crate 2025-02-20 20:39:04 +08:00
bunnie
558c61ada7
Merge branch 'main' into cram-dev 2025-02-20 15:10:47 +08:00
bunnie
affe4e6c54 move APIs out of cramium-hal
So the organization of the code is now the following tiers:

libs/cramium-api: contains hardware-abstracted API code to the hardware
layers (traits, some constants, enums, etc.). For example, "here is
an IO trait that lets you configure and set GPIO pins", which could
then be implemented in hardware or emulation. The APIs aren't entirely
generic across all SoCs because they are tweaked to accommodate
quirks of the cramium SoC.

libs/cramium-hal: contains board-specific driver codes that do not
require persistent services to be started. Possibly misnamed because
it also includes not just cramium-chip items, but also e.g. peripherals
to the cramium SoC, such as the PMIC and camera.

services/cramium-hal-service: contains the `main` process that manages
shared resources, such as UDMA, IO pins, IFRAM. These drivers cannot
be delegated to a `lib` crate because there can be only one instance
of these resources, and instead we have to dynamically allocate
access to these through IPC messaging.

services/cramium-emu: hosted mode emulation of things in
cramium-hal-service.

services/bao-video: contains a `main` process that integrates
the camera and OLED driver. This means that all graphic drawing
primitives also interface with this crate. These are condensed
into a single process space to speed up execution, and kept
separate from cramium-hal-services because we want the video
services to not be blocked by, for example, a thread that is
handling I2C things.
2025-02-20 13:54:46 +08:00
bunnie
2235f7a3f1 clean up ux-api to be no-std clean
ux-api can't do rkyv derives and rely on std items in a
no-std environment. This is necessary because some of the
base layer APIs (frame buffers, points, etc.) are relied
upon in a no-std loader environment to render diagnostics
to the screen. Thus ux-api needs to have a baseline of
primitives available without a std flag.
2025-02-20 13:32:52 +08:00
bunnie
b33ca44e3b Complete move of cramium-emu from libs to services
I thought originally cramium-emu would be a library crate, but
actually, it makes more sense as a "services" crate. The APIs
that cramium-emu would live in cramium-api, and cramium-emu
itself is a bit closer to cramium-hal-service, filling in
the executable bits of code that allow emulation to run.
2025-02-20 13:30:55 +08:00
bunnie
9c4e7cabf6 add a "platonic" API crate for cramium
This is a distillation of cramium-hal items into "pure API"
items so that we can have a parallel cramium-emu crate.

The idea is that the API crate sits on top of both implementations;
the HAL goes to hardware, and EMU goes to hosted mode emulations.
2025-02-20 13:27:18 +08:00
bunnie
3afb01b04c add emulation HAL for cramium target
this is where we'll try to aggregate all the shims that allow
the target to work on hosted mode
2025-02-18 23:22:09 +08:00
bunnie
4872bbcee1 remove useless name argument in this version of the api 2025-02-18 23:20:48 +08:00
bunnie
f78d54a834 add configuration for doc build 2025-02-17 22:53:56 +08:00
bunnie
88be6b66ba
Merge branch 'main' into cram-dev 2025-02-17 18:35:38 +08:00
bunnie
73114f8d8d clean up ux-api integration with blitstr2
a bunch of imports were in here that should be in blitstr2
let's test this out and see how well these abstractions hold up
as we configure the rest of the OS around it.
2025-02-17 18:27:55 +08:00
bunnie
b788ed6633 move blitstr2 to its own library
this allows us to share font data between platforms without
replicating the code base
2025-02-17 18:24:39 +08:00
bunnie
e1bc6eac56 remove copy of blitstr2 from ux-api; move blitstr2 to lib location 2025-02-13 17:41:07 +08:00
bunnie
ae856ecc82 start to add in skeletons of trait implementations for ux elements 2025-02-13 17:28:56 +08:00
bunnie
c28c1f989a add hosted option to cramium-hal 2025-02-13 17:27:45 +08:00
bunnie
0bfb864873 add boasec to font feature selection; prepare for moving blitstr crate 2025-02-13 17:26:54 +08:00
bunnie
6e18096247 ux-api needs to have the board specified when cramium features are selected 2025-02-11 16:25:22 +08:00
bunnie
c2c1c8bc91 update top level libs and cargo for all the ported-in files 2025-02-11 16:24:51 +08:00
bunnie
f7193ae29c port in more helper routines 2025-02-11 16:24:30 +08:00
bunnie
3890008af1 make platform directory for graphics
trying to keep it as platform neutral as possible but it seems
we need to be able to know the size of the framebuffer at least
2025-02-11 16:23:45 +08:00
bunnie
5ed3f41bea add blitstr to the minigfx lib 2025-02-11 16:23:26 +08:00
bunnie
2a4d91d9be expand primitives in minigfx library 2025-02-11 16:23:06 +08:00
bunnie
79fae48bd8 add widget scaffolds 2025-02-11 16:22:50 +08:00
buncram
9cdb967741 add widgets to ux-api 2025-02-11 08:33:42 +08:00
buncram
69baf0f6e8 some initial notions of what widgets might look like 2025-02-11 08:33:09 +08:00
bunnie
437a5a2520 modify fast dma test for clocking option 2025-02-08 05:20:25 +08:00
bunnie
dff5bc7fa6 update bio tests for clkmode option 2025-02-08 04:35:02 +08:00
bunnie
e4646013d0 remove minigfx from the HAL aspect of cramium
it was sort of out of place there anyways...
2025-02-02 07:02:07 +08:00
bunnie
19de313067 add ux-api
ux-api is meant to be a platform-independent set of APIs for
elements involving UX interchange in xous. In particular, it
sets up the path for portability of the gfx/minigfx crates and modals.
2025-02-02 07:00:24 +08:00
bunnie
7679dc12d1 formatting changes due to changes in nightly rust
needed to get a clean check on gh
2025-02-01 06:37:38 -08:00
bunnie
4f14a67504 formatting changes due to changes in nightly rust
needed to get a clean check on gh
2025-02-01 22:26:40 +08:00
bunnie
43bc35b26e modify i2c reset condition to have wait states
this is necessary because the cpu can easily outrun the udma
block as the reset is processing, causing the re-initialization
to fail.
2025-01-30 04:17:57 -08:00
bunnie
b02112b05a fix reset conditions and straggler debug statements 2025-01-03 04:05:51 +08:00
bunnie
fa3550a30f add trait for setting IRQ on GPIO 2025-01-03 04:04:45 +08:00
bunnie
7f8f64e1be add routine to set irq pin for PMIC to board description file 2025-01-03 04:03:31 +08:00
bunnie
0953eac2ef cleanup warnings 2025-01-03 04:01:15 +08:00
bunnie
68759073ef configure the IRQ input 2024-12-27 20:01:32 +08:00
bunnie
86afe7ca0a add APIs to configure PMIC IRQs 2024-12-27 20:01:10 +08:00
bunnie
5aac426b0b more deep API cleanup
realizing a bunch of stuff like the stack expects you to enqueue
the OUT receiver with calls to read() that happen to block, fixing
max packet size that can be different for in and out end points,
and handling quirks of the core when sending setup packets longer than
64 bytes.
2024-12-23 01:18:03 +08:00
bunnie
c044b3481d beginning of breaking change to the cramium usb hal implementation
the UsbBus implementation is being totally rewritten for the
inside-out IRQ protected scheme.

we can now get past some preliminaries in the link protocol
(i.e., address setting and the first config descriptor), but
a long way to go still in debugging.
2024-12-22 00:36:57 +08:00
bunnie
9a1a6271c5 add debugging configuration features 2024-12-22 00:36:33 +08:00
bunnie
e8fd388ae9 add support for paged mode debugging
we have to allocate the virtual page in our process space before
we can use the debug UART.
2024-12-22 00:34:16 +08:00
bunnie
6625e45dd2 remove a debug print that causes the uart to be claimed prematurely
the uart in the shared library is claimed by the first process
that touches it, so prints in the shared library at early boot have
to be carefully configured
2024-12-22 00:33:16 +08:00
bunnie
45a8eb2227 stage tomls for version bump: try_send added to xous-ipc 2024-12-16 18:50:11 +08:00
bunnie
f5cae8b975 add visibility for third-party IRQ implementation
Had to promote the visibility of a bunch of event handler
structures so we can put an IRQ handler outside of the core
USB crate.
2024-12-16 18:02:01 +08:00
bunnie
5d35dee4f6 final i2c changes based on sim results 2024-12-11 04:05:24 +08:00
bunnie
4d148c9a55 check only the busy status bit for i2c to confirm command initiation 2024-12-10 18:18:15 +08:00
bunnie
90317b0adb wait for i2c commands to propagate before moving on 2024-12-10 18:06:24 +08:00
bunnie
a3ef478688 more mpw vs nto differences 2024-12-10 17:10:24 +08:00
bunnie
6e1023e5ea update comments 2024-12-10 17:05:59 +08:00
bunnie
f66bd30951 adjust timeouts for simulation 2024-12-10 17:03:52 +08:00
bunnie
5cd21f4330 add an RTL-only i2c test mode
The test is abridged because i2c is a pretty slow protocol, so we
do the bare minimum to exercise a write and a read.
2024-12-10 14:25:14 +08:00
bunnie
785826ca23 modifications to the HAL for DAR-699 2024-12-06 03:32:49 +08:00
bunnie
02b2b86184 add notes for NTO rework 2024-12-04 16:15:44 +08:00
bunnie
93b9ec00bf bump version numbers on all the packages so we can absorb num-derive changes 2024-12-02 19:14:11 +08:00
bunnie
83e26ff4c7 update num-derive dependency
this became mandatory in 1.83 to remove warnings. I think it
should have no impact on functionality.
2024-12-02 18:52:59 +08:00
bunnie
147cfb8c97 remove xous-pio references in cargo files 2024-12-02 01:21:57 +08:00
bunnie
c72607e0bf expand feature flags to be more specific to board types 2024-11-30 02:22:24 +08:00
bunnie
20b0ecd592 add verilator-only modifications to the HAL
verilator doesn't implement the TRNG, so the TRNG is bodged.
A warning is left in to help remind us/alert us if the bodge
is accidentally put into production.

the 'dabao' board type is introduced, which is the breakout board
codename.

camera and display are feature-gated behind their respective board
definitions.
2024-11-30 02:19:55 +08:00
bunnie
2dddae34fc add udma stresstest feature 2024-11-28 18:27:52 +08:00
bunnie
ffb00cf6ad turns out it helps if you put explicit pull-ups on the I/Os
reverting this change
2024-11-28 16:14:14 +08:00
bunnie
a3619618d0 slow down toggle rate on i2c so it is compatible with slow pullups
the strict verilog model has weak pull-ups which model the
"slowness" of the rise with an extended Z-condition that takes
3us to pull up to a solid 1.
2024-11-28 15:53:12 +08:00
bunnie
3738db9f5c fix io-direction issue in testbench 2024-11-28 01:28:39 +08:00
bunnie
13702f2df0 fix unit test to match actual testbench tooling 2024-11-22 15:23:38 +08:00
bunnie
83dbb82500 add routines for programming SPI flash 2024-11-22 00:55:15 +08:00
bunnie
faa8a60843 add ref to mbox module 2024-11-21 18:23:36 +08:00
bunnie
ba87422903 add platform code for mailbox to CM7 2024-11-21 18:23:20 +08:00
bunnie
996b574486 quiet down debug; add a method to expatriate PORTSC 2024-11-20 21:42:02 +08:00
bunnie
5ec5bc29c9 add keyboard pins to board description 2024-11-20 01:42:47 +08:00
bunnie
6829eae73c add a reset method to the UDMA abstraction 2024-11-20 01:42:27 +08:00
bunnie
72685e2c1c improve i2c error recovery 2024-11-20 01:42:06 +08:00
bunnie
289d6879ca fix typo 2024-11-19 22:15:47 +08:00
bunnie
a40d78f3ea add backpressure setting to SPIM; also re-attempt interface clearing
...now that we have the right bit...
2024-11-19 00:00:50 +08:00
bunnie
e8e28702e2 fix position of clear bit; add backpressure feature for NTO 2024-11-19 00:00:18 +08:00
bunnie
fe45f40cb7 increase verbosity of pl230 output for co-debugging 2024-11-18 18:38:41 +08:00
bunnie
d0e638e020 enequeue data before command is issued
it becomes clear on a slower bus configuration that this is
the correct ordering for udma

also add code to debug timeout cases
2024-11-18 18:36:23 +08:00
bunnie
0c5fde7fc2 reformat busy statement for easier debug 2024-11-18 18:35:56 +08:00
bunnie
21e59885e3 add some attempts to debug the SPIM lockup.
for now, filing a bug agaisnt the IP block
2024-11-08 00:17:42 +08:00
bunnie
12f0159fc0 make camera IFRAM de-allocateable
This allows us to use the RAM for USB stack operations.

Will cause panics if camera is operated without re-allocating
the memory.
2024-11-07 16:12:01 +08:00
bunnie
b1e31924a0 add helper routines for qr finding 2024-11-05 01:45:29 +08:00
bunnie
92509c448b some debug cleanup 2024-11-04 22:53:31 +08:00
bunnie
4f85deaecb change api name for resolutions to dimensions 2024-10-27 23:26:45 +08:00
bunnie
d41113fb9a fix operator chaining 2024-10-26 18:42:16 +08:00
bunnie
4dd78b9727 add descriptor chaining helper methods
mass storage is...somewhat stable now, on both linux and windows,
but there are some corrupt packets. need to look into whether
electrical issue, or if we're stomping the transfer buffers because
we've not managed them correctly.

Also need to reflect on how to turn this API into something
safer...the hardware is doing *so much* in this API, the driver
is basically global mutable state with arbitrary slices you can
write over the ends once you hand things off to the driver.
2024-10-26 03:07:00 +08:00
bunnie
9e0bd64195 allocate large swathes of memory to camera
this is for higher resolution QR code scanning

makes it incompatible with simultaneous USB usage

however, when camera is off, the USB stack can be started, and
vice-versa. Basically, you can't both do active USB and camera
at the same time, but you can do one or the other.
2024-10-21 01:22:12 +08:00
bunnie
b5f7c4c490 add minigfx to hal lib 2024-10-21 01:18:51 +08:00
bunnie
407dec86a3 adopt platform & display -agnostic APIs for SH1107 frame buffer 2024-10-21 01:15:48 +08:00
bunnie
0081575e80 fix timer primitive for ov driver 2024-10-21 01:15:09 +08:00
bunnie
d5ba0c4cb7 add a plantform-agnostic graphics API
first step on a long road to improve the graphics API on Xous.
2024-10-21 01:13:40 +08:00
bunnie
f214e9c4d1 add frame slicing to ov2460 driver 2024-10-20 17:04:35 +08:00
bunnie
529c8b18b2 various fixes to driver
- add USB mass storage state tracking for handler-based intervention
- fix some wait loops

need to regression test this againt a xous-mode USB operation
2024-10-19 00:12:38 +08:00
bunnie
2ec562169c modify USB HAL for no-std ops
split the handler out into a function pointer

add callbacks for completion handling of EPs - in-line with
the reference code

improve the pei handling

change visibliity of structures to allow for out of crate
handlers
2024-10-18 04:14:49 +08:00
bunnie
2cb3bbf780 add SE0 pin setup 2024-10-12 00:46:15 +08:00
bunnie
701170e7e7 make device opening fallible 2024-10-12 00:45:53 +08:00
bunnie
37e82f1662 add ticktimer ref to cramium-hal
this is needed for delays in Xous mode - the camera requires
some dead-reckoned delays between i2c writes and reads
2024-10-10 02:07:15 +08:00
bunnie
7bd9e2b86b add camera pins & ifram spec 2024-10-10 02:04:49 +08:00
bunnie
552096d2a0 add prelim ov2640 driver 2024-10-10 02:04:22 +08:00
bunnie
091082dfcc add a clear routine for the sh1107 frame buffer 2024-10-10 02:03:59 +08:00
bunnie
2d8747605c promote visibility of some udma config constants 2024-10-10 02:03:37 +08:00
bunnie
c001b2759e add a method to clone an iox handle
gpios for everyone!
2024-10-10 02:03:11 +08:00
bunnie
30fdc139e5 simplify new methods for spim 2024-10-08 17:59:42 +08:00
bunnie
b99c5544c6 simplify new methods for i2c 2024-10-08 17:59:31 +08:00
bunnie
717ddefb2e add references to new libraries 2024-10-07 22:53:29 +08:00
bunnie
be56097fe4 add axp2101 driver skeleton 2024-10-07 22:52:55 +08:00