Commit graph

122 commits

Author SHA1 Message Date
bunnie
b4c98528e8 add notes around names that are baked into libstd 2022-03-22 22:30:43 +08:00
bunnie
02ab71f195 quiet a warning from tts mode 2022-03-18 19:39:00 +08:00
bunnie
0f9ea0473a add sleep/resume indicator for the blind 2022-03-17 17:56:42 +08:00
bunnie
960745ca61 eliminate static mut unsafe pattern in callback function storage
since xous 0.9.5, we've had a Box and we've had threads, so now we
can put the callback in a Box and pass it to a thread, instead
of relying on an `unsafe` work-around to get the callback function
pointer into the thread's environment.
2022-02-19 01:38:20 +08:00
bunnie
e4db83e59e add a "public" RTC get command to the LLIO
This implemnetation takes advantage of the fact that the LLIO
owns the RTC device, and bypasses a layer of indirection in the
call chain.
2022-02-19 01:16:20 +08:00
bunnie
95b857feea refactor i2c interface to eliminate static mut unsafes
also remove async write callbacks: in practice, these aren't used

Downside of this refactor is that threads for handling the
callbacks are not spawned on demand, they are spawned at boot,
leading to about an extra 68k of RAM used (most of it being
consumed in the codec block, actually). Some of this is also
probably extra object code because we're using more of the stdlib
primitives, which carry some weight.
2022-02-19 00:31:25 +08:00
bunnie
0bd8a97f63 fix refcount implementation i2c block 2022-02-18 19:04:04 +08:00
bunnie
c86df3d095 fix logic bug in usb lock status update 2022-02-06 01:31:08 +08:00
bunnie
06b9f88926 improve test oqc interface with new API 2022-02-04 17:11:42 +08:00
bunnie
827888ccbb fix up the REFCOUNT on connections
Was doing disjoint loads and stores on an Atomic, really, should
be using the fetch_add, fetch_sub variants to be proper.

Didn't seem to impact anything but maybe there's a future version
of me that high fives me for doing this.
2022-01-31 23:13:10 +08:00
bunnie
5a1139a367 move cache flush on susres to just before the suspend event
- also nail down the interrupt handlers from firing from the COM
during suspend
- ensure that connects don't happen while scanning
2022-01-27 22:05:38 +08:00
bunnie
0cafd10e28 refactor status bar to take advantage of the new fonts 2022-01-22 18:25:39 +08:00
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
489a26dd11 fix an issue where we don't decrement the connection counter on drop 2022-01-05 20:01:54 +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
6f522b0844 tag Rust issue onto a wart in the LLIO API crate for better tracking 2021-11-01 04:18:53 +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
7de925d3f1 add maintenance notes around the fix for https://github.com/rust-lang/rust/issues/90195 2021-10-23 17:50:33 +08:00
bunnie
c245e78255 Merge remote-tracking branch 'origin/main' into bunnie-dev 2021-10-23 17:45:24 +08:00
Sean Cross
adccb61e43 services: llio: work around rkyv bug in rust 1.56
A bug in the type system appeared that prevents using constants in rkyv
arrays. Hardcode the value instead.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-10-23 17:25:41 +08:00
bunnie
ec538025a8 changes to bring us up to date with rust 1.56. still not building. 2021-10-23 17:08:48 +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
35e7cfe89e jtag server now reporting ID 2021-08-10 22:46:00 +08:00
bunnie
bdd70f9502 stash to figure out build issue 2021-08-10 22:41:22 +08:00
bunnie
7921b0216f try to improve system stability in debug modes 2021-08-04 22:40:53 +08:00
bunnie
8b83fb7c65 remove heapless, go to libstd for all collections!!!!
*fistpump*
2021-08-04 01:25:32 +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
75dca6bd4c checkin for a rollback to sanity check some things 2021-06-25 02:09: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