bunnie
b161b021fe
stop pump updates while we're doing the RTC setting
...
The RTC set dialog box is blocking, the pump will eventually
lock up the system if we don't stop it.
nb: ~200k saved in RAM with the refactor
2022-01-11 16:19:31 +08:00
bunnie
4f638bb49a
massive refactor to eliminate the RTC crate
...
Saves a bit on resources and the RTC crate doesn't need
to be stand-alone now that the modals crate is a thing;
we are able to split the UX routine to manage the RTC out
of the code that actually manages the hardware.
The hardware code ended up in LLIO, and the UX ended up in the status
routine.
2022-01-11 15:45:20 +08:00
bunnie
994e3d7cfb
refactor llio crate (phase 1): organize files into sub-systems
2022-01-11 12:02:27 +08:00
bunnie
c5fe1bc99b
add sequencing to suspend/resume order of operations
...
this is necessary because we want to make sure that the SPINOR
service does not shut down before the PDDB service finishes syncing
its disks.
2022-01-10 13:45:56 +08:00
bunnie
a4a2d12d57
refactoring the order of format events; consolidate fscb init op
...
try to condense ops that we anticipate calling in other places
into helper functions.
add AAD to the fscb.
2021-11-09 04:57:12 +08:00
bunnie
65bad96f52
fix killbounce & formatting
...
sleep killbounce wouldn't work because we started limiting the
number of connections to the LLIO.
This change makes connections to the LLIO unlimited, but perhaps later
on we should split out the I2C bus into a separate security domain,
so that the LLIO's unlimited connection policy doesn't introduce a
risk into a rogue process being able to overwrite the RTC contents.
2021-10-30 02:14:31 +08:00
bunnie
3d1c216706
make interrupt events a try_send type, so they don't cause deadlock
...
this will help mitigate interrupt storms, e.g. if someone tries a
ping flood attack.
2021-10-21 00:03:08 +08:00
bunnie
b93109cad2
cleaning up net event loop, still figuring out APIs and integration
...
currently there is some issue with ARPs not sure where it's breaking,
suspect issue on EC side...
2021-10-11 05:21:01 +08:00
bunnie
74a3c6df44
disastrous first draft of figuring out how to integrate smoltcp using a ping example.
2021-10-10 01:57:31 +08:00
bunnie
b43eb56346
add some skeleton for a net crate; testing COM interrupts
2021-10-08 20:01:13 +08:00
bunnie
f0c33bc99c
tighten up operator flow for factory tests
2021-10-04 17:25:49 +08:00
bunnie
87228ad747
basically working OQC test
2021-09-19 01:06:21 +08:00
bunnie
dfc6444d78
add killkey test to the self test suite
2021-09-14 20:15:03 +08:00
bunnie
dbab3d2b27
adjust L2 cache flush region to 512k
...
although te cache is only 128k, experiments show that the cache
is not reliably flushed until 512k is written. Not sure why...
2021-08-29 18:28:25 +08:00
bunnie
e2ce3cad2c
make sure that the power states get set correctly early in the resume process
2021-08-27 15:47:27 +08:00
bunnie
47fef3c2d0
clean out debug messages and scaffolding
2021-08-24 01:48:30 +08:00
bunnie
387b5d22e5
another fix for issue #75 : llio resume failure
...
Found the following KP on resume. This time it looks like it's
failing in a syscall, during a send_message call. There's no
more visibility into what causes this, so this commit tries to clean
up some loose ends in the resume path that could send messages before
the system is ready. Namely, the console mux call got condensed into
an abridged version that doesn't send log messages (you couldn't see
them anyways...), and the I2C engine now pauses suspend until
the current transaction at hand completes. I suspect it's quite
likely that it's the I2C engine that's causing the issues...
LLIO -> PID 14
Jumping to loader...
PROGRAM HALT: CPU Exception on PID 14: Store page fault of 0x00000000 at 0x0003a02e
Current thread 2:
Thread 2:
PC:0003a02e SP:7ffff170 RA:00036290
GP:00000000 TP:60000000
T0:00000000 T1:000000f0 T2:00000030
T3:00000080 T4:000000f4 T5:ffffffff T6:0000008f
S0:7ffff1d0 S1:7ffff228 S2:00000007 S3:00000007
S4:00000001 S5:00000004 S6:00037996 S7:00010e34
S8:00011548 S9:000101bc S10:7fffff4c S11:0003c000
A0:0000000e A1:00000000 A2:00000004 A3:00000000
A4:00000000 A5:00000000 A6:00000000 A7:00000000
0003a028 <_xous_syscall>:
3a028: 00000073 ecall
3a02c: 4282 lw t0,0(sp)
3a02e: 00a2a023 sw a0,0(t0)
3a032: 00b2a223 sw a1,4(t0)
3a036: 00c2a423 sw a2,8(t0)
3a03a: 00d2a623 sw a3,12(t0)
3a03e: 00e2a823 sw a4,16(t0)
3a042: 00f2aa23 sw a5,20(t0)
3a046: 0102ac23 sw a6,24(t0)
3a04a: 0112ae23 sw a7,28(t0)
3a04e: 8082 ret
0003623c <_ZN4xous7syscall12send_message17h44786a68889a5f1dE>:
pub fn send_message(connection: CID, message: Message) -> core::result::Result<Result, Error> {
3623c: 7175 addi sp,sp,-144
3623e: c706 sw ra,140(sp)
36240: c522 sw s0,136(sp)
36242: c326 sw s1,132(sp)
36244: 84aa mv s1,a0
36246: 4549 li a0,18
crate::arch::syscall(call)
36248: 4214 lw a3,0(a2)
3624a: 4258 lw a4,4(a2)
3624c: 04a10023 sb a0,64(sp)
36250: c2ae sw a1,68(sp)
36252: c4b6 sw a3,72(sp)
36254: c6ba sw a4,76(sp)
36256: 4608 lw a0,8(a2)
36258: 464c lw a1,12(a2)
3625a: 4a14 lw a3,16(a2)
3625c: 4a50 lw a2,20(a2)
3625e: c8aa sw a0,80(sp)
36260: caae sw a1,84(sp)
36262: ccb6 sw a3,88(sp)
36264: ceb2 sw a2,92(sp)
let mut ret = crate::Result::Ok;
36266: d082 sw zero,96(sp)
let args = call.as_args();
36268: 0828 addi a0,sp,24
3626a: 008c addi a1,sp,64
3626c: 00000097 auipc ra,0x0
36270: 8da080e7 jalr -1830(ra) # 35b46 <_ZN4xous7syscall7SysCall7as_args17h7e6c318e8a926fa8E>
args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], &mut ret,
36274: 4562 lw a0,24(sp)
36276: 45f2 lw a1,28(sp)
36278: 5602 lw a2,32(sp)
3627a: 5692 lw a3,36(sp)
3627c: 5722 lw a4,40(sp)
3627e: 57b2 lw a5,44(sp)
36280: 5842 lw a6,48(sp)
36282: 58d2 lw a7,52(sp)
36284: 1080 addi s0,sp,96
_xous_syscall(
36286: c022 sw s0,0(sp)
36288: 00004097 auipc ra,0x4
3628c: da0080e7 jalr -608(ra) # 3a028 <_xous_syscall>
crate::Result::Error(e) => Err(e),
36290: 5586 lw a1,96(sp)
36292: 5516 lw a0,100(sp)
36294: 4605 li a2,1
36296: 00c59563 bne a1,a2,362a0 <_ZN4xous7syscall12send_message17h44786a68889a5f1dE+0x64>
Err(e) => Err(e),
3629a: c0c8 sw a0,4(s1)
2021-08-24 01:39:48 +08:00
bunnie
80cae0d446
intermediate progress on issue #74
...
still not fixed, but things are leaned up.
2021-08-23 05:12:21 +08:00
bunnie
abd8eadfd8
modify the console behavior to better capture panics on resume
...
switches to kernel console on suspend, keeps it in kernel
console on resume for a few hundred ms before switching back
to our original setting
2021-08-22 14:28:06 +08:00
bunnie
799bb6050e
add jtag commands, reboot after burn
2021-08-11 06:15:04 +08:00
bunnie
7921b0216f
try to improve system stability in debug modes
2021-08-04 22:40:53 +08:00
Sean Cross
b86e0a65cd
services: recognize xous as a hardware OS
...
Support `xous` as a valid OS. This allows us to build the entire kernel
under this target.
Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-02 18:11:48 +08:00
bunnie
91fe69ca27
add some real-hardware tests for spinor writes
...
definitely still bugs.
need to sleep on it.
2021-07-18 02:36:31 +08:00
bunnie
a4f8346c34
reflect the latest fixes to the secure boot process
...
also patch up some issues with sha512 reset and loose
ends on docs and updates
2021-07-13 00:46:31 +08:00
bunnie
84a2e9f768
fix status bar so that it redraws out of suspend/resume
...
the bootloader modifies the screen, so all elements must
be redrawn regardless of the pervious state change!
2021-07-11 18:47:19 +08:00
bunnie
6825e2e7e8
reset the i2c machine every new transaction
2021-06-25 03:41:42 +08:00
bunnie
afa55055ea
add serial console mux setting
2021-06-24 13:52:44 +08:00
bunnie
aa967a5a17
quiet up hosted mode build warnings
2021-06-18 22:37:08 +08:00
bunnie
eee9f4e765
refactor xous-names to permit only a fixed number of connections
...
this prevents less trusted processes from connecting to servers
after the kernel initializations are done.
this works so long as we don't have disconnects from the kernel
servers. In order to support disconnects we will also need a
way to re-enumerate the SID to guarantee that we don't have a re-use
problem. But for now, the kernel is not designed with any practical
disconnect mechanism; there is no code that calls the Quit mechanism
on any server.
2021-06-15 17:41:14 +08:00
bunnie
fadc9c29ab
Merge remote-tracking branch 'origin/master' into bunnie-dev
2021-06-02 03:59:25 +08:00
bunnie
b9f3182bb9
mods for hosted mode to work again
2021-06-02 03:45:15 +08:00
bunnie
25e6bced00
add power-on utilization reporting
...
there is now an extra field in the status bar that gives
the %'age of time that the clocks are running.
2021-06-02 01:08:31 +08:00
bunnie
ee2e38be05
add commands to help manage wfi/power debugging
2021-06-01 17:02:30 +08:00
bunnie
52c32cc4d1
auto-powerdown of sha block when not in use
2021-05-30 00:12:18 +08:00
Sean Cross
eb7895d601
xous: add a return code to TerminateProcess
...
As part of this refactor, make `terminate_process()` a divergent call.
Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-20 11:01:00 +08:00
bunnie
b50aa60591
clean up some visibilities and warnings, get rid of the old, bad API
2021-05-06 05:13:23 +08:00
bunnie
bc82dbd157
transition i2c api on codec, finally found the damn race condition
2021-05-06 05:05:17 +08:00
bunnie
b596c40dd6
refactor I2C to have work queue, cleaner (but untested) APIs
2021-05-06 03:40:04 +08:00
bunnie
bb5bc1d212
refactor i2c to break out the i2c machine to a separate server
...
the concurrency issues on I2C are getting hairy, and it was probably a
dubious decision from the start to merge I2C into the LLIO block; but
originally this was motivated by the idea of keeping all the
"miscellaneous slow stuff" in one process to keep the memory footprint
small and make code a bit more readable.
Keeping I2C in the same process space as the LLIO but splitting it
into its own thread and server splits the difference, by giving us
more options to deal with the concurrency, without inflating the size
of the kernel binary and allocating a lot of extra static data.
2021-05-06 00:45:14 +08:00
bunnie
f8979d6341
intermediate progress on audio. doesn't compile.
2021-05-04 02:22:35 +08:00
bunnie
a4ca725c2a
add a reset to an i2c core
2021-05-03 21:24:37 +08:00
bunnie
01e2c7edca
migrate to an interrupt-handler only I2C handler
...
the amount of time it takes to send messages to initiate each
packet is too slow, and causing timeouts. By handling the I2C
directly in an interrupt handler, we accelerate the bus, at
the expense of no visibility via log/trace messages.
2021-05-03 18:53:17 +08:00
bunnie
d65e91f792
refactor i2c to be in the implementation block
2021-05-03 18:14:58 +08:00
bunnie
0e2d57c9fb
retrofit the kernel and loader to handle resume
...
and now the even harder debuggening begins...zomg o_O
2021-04-30 01:55:38 +08:00
bunnie
a55735fb1f
add llio to suspend/resume set
2021-04-29 23:15:47 +08:00
bunnie
6e1e74ed84
a minimal but successful touch-and-go suspend/resume cycle
2021-04-29 16:37:43 +08:00
bunnie
cad9c15849
intermediate save of suspend resume
...
building an awful rube-goldberg contraption of a "clean-suspend"
record.
2021-04-28 19:28:04 +08:00
bunnie
061284ec5f
debugging BOOST mode glitch issue
...
Here's an arcane bug for you:
When powering down, the Spartan 7 3.3V I/O drivers will
output a roughly 800us wide glitch as 3.3V falls below around
1.7V, if the 0.95V core voltage comes down first (which it does
because we have an active discharge on 0.95V, but not on 3.3V).
In this case, it's just wide and high enough to cause the
BOOST mode line to engage, which takes the BOOST output
and ties it to VBUS, which is just enough for the system to
think you're powering it back on again. Which is not what
you want when powering down.
The ultimate fix was to put a heftier pull-down on the BOOST
line so that it can't trip the BOOST output into the VBUS.
Another option could be more active discharge FETs, but that
would require a full board spin and we are already at certification,
so we'll stick with the stronger pull-down on BOOST. It seems to
be a robust fix in the worst corner cases we can find.
The downside is that when powering an external USB device,
you are burning an extra 30mW of power overcoming the pull-down,
but typically, any external USB devices plugged into Precursor
will burn far in excess of that, so the delta should be negligible.
2021-04-23 15:33:14 +08:00
bunnie
f97b61a788
add the killbounce command
2021-04-23 01:49:03 +08:00
bunnie
8dc5bf434b
hosted mode vibration debug message
2021-04-16 19:30:56 +08:00