Commit graph

10340 commits

Author SHA1 Message Date
bunnie
b9630c7056 fix svd2utra bug where instead of merging SVDs we only use the last one in the list 2023-07-17 18:24:32 +08:00
bunnie
2c53eb0508 add cramium targets to utralib 2023-07-17 18:24:10 +08:00
bunnie
e0c8cc1da4 add cramium to loader target 2023-07-17 18:23:17 +08:00
bunnie
069edbc255 support multi-svd file designs
This patch set goes across all the toolchains and brings
in the support for split SVD descriptions of SoCs.

This is helpful for dealing with designs that have multiple
"top" files for the same core IP set. For exmaple, you may have
a SoC that you are developing that targets silicon, but
you have a version that wraps this in additional peripherals
available only in an FPGA emulator that are used for debugging.

In this case, you can have one SVD file be the description of
the SoC itself, and another SVD file describe just the "delta"
introduced by the FPGA wrapper that emulates/controls the SoC.
2023-07-17 16:27:09 +08:00
bunnie
cde56555d4 Pull utralib and svd2utra from local repo; downgrade crates.io check
In order to reduce friction of bringing on new platforms and experimenting
in utralib and svd2utra, xous-core now by default pulls these libraries
from the local repository.

Differences between the local version and the published version for
just these two packages are now downgraded to warnings, instead of
hard errors. This is because a difference does not indicate that
crates.io has had a modification we didn't expect; it simply means
we forgot to publish the package and we should eventually do so
once we have stabilized changes, so that others who rely upon it
can have the updated version.

But, with this patch, at least if we are experimenting with utralib
or svd2utra we don't have to publish a patch to bump revisions on
every major package every single time for a build to succeed.

I think this is an OK trade-off, but happy to roll this decision
back if it affects @eupn / @jeandudey negatively.
2023-07-17 15:14:33 +08:00
bunnie
e6463eaac9 missed converting one interrupt handler -- error came out in CI 2023-07-17 00:53:03 +08:00
bunnie
af982aef30 add a static flag for interrupt hooking of the codec object
the init() function on this object may actually be called several
times within a single boot context because the codec is powered down
as a separate subsystem from the rest. however, the interrupt should
still only be hooked exactly once. This flag tracks that state.
2023-07-16 22:07:09 +08:00
bunnie
6ef684fd8c split reset/init routines apart
this removes the initialized flag and hazard of double-calling
the interrupt hook when you really meant to reset the block.
2023-07-16 22:06:39 +08:00
bunnie
680c8b88c7 fix missing init() methods in hosted mode emulation structures 2023-07-16 18:31:14 +08:00
bunnie
b5e15fd7cc update workflow to target latest toolchain 2023-07-16 18:05:53 +08:00
bunnie
f0b351c2e0 suggested method to preserve intent of drop to fix error
However, I didn't write this library (and I don't have a test
suite for it), so I'm not quite sure if this preserves the
invariants on the fd_mapping() structure. Needs @xobs' review.
2023-07-16 17:58:40 +08:00
bunnie
e2dacdce35
Merge pull request #397 from betrusted-io/rust-1.71.0-fixes
Rust 1.71.0 fixes
2023-07-16 02:56:01 -07:00
bunnie
9932d971c4 clean up the warnings that are deemed safe to clean up
one warning remains, will address this in a future PR.
2023-07-16 17:55:28 +08:00
bunnie
e65398815a documen the deferred-init+Box pattern in release notes 2023-07-16 17:43:25 +08:00
bunnie
11155df21c note naming convention deviation in xous-ticktimer
all other functions have a .init() routine that handles interrupt
binding.

ticktimer rolls that into a routine that also resets the time
of the ticktimer. A comment is added for maintaner sanity down
the road.
2023-07-16 17:37:46 +08:00
bunnie
95239eb05f apply deferred-init + box idiom to susres 2023-07-16 17:37:25 +08:00
bunnie
79ecd62015 trim unused code + note abstraction violation
We're using something normally in the "debug" section as part
of non-debug operations, namely, re-enabling Rx on resume.

This is an abstraction violation and should be cleaned up later on...
2023-07-16 17:36:38 +08:00
bunnie
3508dc44d9 apply deferred-init idiom to usb-test 2023-07-16 17:36:12 +08:00
bunnie
501f7a4d5f appy deferred-init idiom to usb-device. NOTE: box not applied
Box can't be applied to this crate because of interoperability
issues with the USB driver crate when it is applied.

Still, it seems to "work" because deferred-init pins down the
address of the hardware management structure (for now).
2023-07-16 17:35:24 +08:00
bunnie
17a13f2aff apply deferred init + Box idiom to spinor 2023-07-16 17:35:01 +08:00
bunnie
cdddb59e33 rename setup->init to be consistent with other crates 2023-07-16 17:34:43 +08:00
bunnie
04ca49b1cc apply deferred-init + Box idiom to engine-sha512 2023-07-16 17:34:19 +08:00
bunnie
b275d8f53b apply deferred-init + Box idiom to engine 25519 2023-07-16 17:34:01 +08:00
bunnie
a9542f96de restore Box() around com structure 2023-07-16 17:33:43 +08:00
bunnie
5055f1aad7 restore Box() around codec hardware structure 2023-07-16 17:33:26 +08:00
Sean Cross
1e07d94381 codec: install interrupt handler after ::new()
Signed-off-by: Sean Cross <sean@xobs.io>
2023-07-16 15:33:40 +08:00
Sean Cross
5ff4498112 com: install interrupt handler after ::new()
Signed-off-by: Sean Cross <sean@xobs.io>
2023-07-16 15:33:27 +08:00
Sean Cross
d4f4a100bb keyboard: install interrupt handler after ::new()
Signed-off-by: Sean Cross <sean@xobs.io>
2023-07-16 15:33:08 +08:00
Sean Cross
80ce69e018 llio: don't install interrupt handler in ::new()
Wait until after the struct is created. This will cause it to be placed
in a fixed address, which works around an issue that appeared in 1.71.0.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-07-16 15:32:10 +08:00
Sean Cross
539ca0cb56 xous-ticktimer: delay installing irq handler
Wait until the outside of `new()` in order to install the irq handler.
This is due to a change in the optimizer for 1.71.0 which has exposed
unsoundness.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-07-16 15:31:09 +08:00
Sean Cross
b23f6717ef loader: remove unneeded muts
Rust 1.71.0 reports more cases of unneeded mutability. Remove these from
the loader.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-07-16 15:30:23 +08:00
Sean Cross
e7cb72c478 kernel: services: remove unneeded muts
With Rust 1.71.0, mut detection has changed slightly, and it is more
aggressive about warning when things do not need to be mutable.

Remove these from the `services` file.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-07-16 15:28:21 +08:00
Sean Cross
cb32b31e18 kernel: support debugging interrupt handlers
SUpport debugging when interrupt handlers go awry, such as when they
blow out their own stack.

Do this by creating a dummy sentinal of 255 for interrupt handlers.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-07-16 15:26:15 +08:00
Sean Cross
85055052fd kernel: allow debugging panics in interrupt handlers
When an interrupt handler panics, restore the system and allow it to
continue. This will help to debug IRQ handlers that panic for one reason
or another, such as infinite recursion.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-07-16 15:22:47 +08:00
bunnie
44d5ab1182 fix swapped version numbering in error 2023-07-15 22:36:12 +08:00
bunnie
1434764f08 Support open wifi networks
Mods to allow the EC to support open wifi networks. Requires an
update to the EC as well as Xous for this to function.

Before filing an issue, please check that EC version is v0.9.13-5-g8f7e23f
or greater by running `ver ec` inside shellchat.
2023-07-15 21:03:42 +08:00
nworbnhoj
aab92c2b37 sketch chat UI library
A Chat object provides a generic UI to read a series of Posts in a Dialogue stored in the pddb - and to Author a new Post.

The idea is to provide a solid common Xous Chat interface, so that Chat Apps can specialize in the unique aspects of a chat Platform protocol (Matrix, Signal etc).

A Chat App will typically call `Chat::new()` and then `Chat::dialogue_set()` with a pddb dict and key holding a Dialogue of Posts. The Chat object will fire-up the UI and retrieve the Dialogue from the pddb. The user will be able to peruse the stored Posts in the Dialogue - and potentially Author a new Post. A new User Post will be sent to the Chat App in a `MemoryMessage` via the (optional) `CID` and `Opcode` provided by the Chat App. Conversely, when the Chat App receives a new Post from the Platform, it will call Chat::post_add() to have it saved in the pddb.

The Chat UI will also accept (optional) opcodes to forward raw-keystrokes and UI-Events to the Chat App. This allows the Chat App to respond to key UI Events. For example if the User navigates to the `top` of the list of stored Posts, then the Chat App might retrieve older Posts from the Platform to be stored Dialogue with calls to Chat::post_add().
2023-07-12 17:23:41 +10:00
Vihaan Jim
6f46443065 Change feature name in status
You still can't just use the --service flag, but now at least it is consistent
2023-07-09 21:13:35 -04:00
bunnie
cae402fad0 fix case where an idle font selection menu can crash the system while in TOTP mode
when the font menu is raised while in TOTP mode, the "pump"
thread continues to prompt for redraws, which can eventually lead to
an overflow of the server queue on the main thread that leads to
deadlock and eventually a crash.

This patch does two things:

- splits the allow_host variable and the allow_totp_rendering variable
so that the two flags have distinct meanings

- use the allow_totp_rendering variable to control when the
totp thread is allowed to pump the main thread to animate the
timer bar.

Previously the allow_host variable was introduced to control access
to sensitive data, and it incidentally was also used to control
TOTP rendering because when host readout is activated this can
freeze the UI for extended periods of time.

By splitting the flag we can now control both independently of
each other. Rendering still stops when host readout is enabled,
but it also stops when any other blocking dialog boxes are popped up,
hopefully preventing future crashes if a user is distracted in
the middle of a UX flow that can block the main loop.
2023-07-06 16:36:10 +08:00
bunnie
dee4871f91 fix truncated "l" in some cases on wide fonts
minimum width should not be truncated to 0 during layout!
2023-07-06 16:15:49 +08:00
bunnie
ee5168254e fix #396 2023-07-06 00:20:43 +08:00
bunnie
17fb590d9a fix typsetter overflow check
got the axes inverted. oops.
2023-07-05 15:38:49 +08:00
bunnie
ecb42c6a0e Merge branch 'main' of github.com:betrusted-io/xous-core into main 2023-07-05 15:19:13 +08:00
bunnie
b2c64eb61a aesthetic cleanup; change default font for all modals
I decided to go back on the idea of not changing the modals
and now all modals use the new larger font as well.

This creates issue #396, which I will deal with later once
I have the time to do some more testing. I'm pretty sure
some other dialog boxes are broken now too.
2023-07-05 15:13:38 +08:00
bunnie
d19020a9ad cleanup some warnings 2023-07-05 15:13:22 +08:00
bunnie
4454dffe4e generate loader files for the new font
also sort the font files in alphabetical order now,
instead of relying on arbitrary ordering of os.listdir() :P
2023-07-05 14:44:30 +08:00
bunnie
fc9cb5af8c fix dependency in hw mode 2023-07-05 13:54:21 +08:00
bunnie
c5f70d08d2 update release notes with info about the Tall font 2023-07-05 13:51:13 +08:00
bunnie
2f54ae39d4 Merge branch 'fonts' into main 2023-07-05 13:47:26 +08:00
bunnie
dfffa48715 move default system font to gam/src/lib.rs SYSTEM_STYLE
default system font can be statically changed by modifying
the SYSTEM_STYLE constant.

This of course will lead to a request for a dynamically
configurable preference for font size. However, early
on it was decided this is a bad idea. Here's why.

We don't provide for dynamic system-wide font selection
because this adds a lot of complexity to what would otherwise
be static code: this is a deliberate choice to improve code
density and performance. If the system font were dynamically
adjustable, then every character rendered we would potentially
have to query the PDDB for the current system font setting.

The impact of this could be mitigated by caching values but
then what happens when you actually change the font? now
you need a registry to fire messages off to all dependent
crates with cached values to flush their caches and redraw
(or you punt and force a reboot if you change font sizes,
but still, you're creating a dependency on a lot of plumbing
for even the simplest crates).

Plus, with a static font selection, the compiler can take constants
like the font height and compose them with other fitting
parameters into optimized load/stores of borders and spacings
for the static case; if you make it dynamic, all those multiplies,
adds and divides now get pulled into the main rendering loop
and are recomputed all the time. For example, if you have a static
const list of items that need to be rendered, even if the code to
compute the height of the list is written as a for loop, the compiler
will know the list is constant, and the font height is constant,
and it can condense that all into a single number at compile time,
eliminating all the code for the for loop.

If you leave the option open to change that, that entire piece
of code has to be generated and executed even though in practice
nobody changes the parameter.
2023-07-05 13:39:11 +08:00