Commit graph

180 commits

Author SHA1 Message Date
bunnie
2437712b7b add some basic image integrity checking code
this doesn't protect against malicious tampering (because
the public key is the developer key) but it will at least
catch correctness errors in USB upload and filesystem
behavior.
2024-11-21 02:20:40 +08:00
bunnie
3bf8598509 make slice cursor peekable 2024-11-21 02:19:45 +08:00
bunnie
fb0efbce3b add helper type for pre-hash digests 2024-11-21 02:19:21 +08:00
bunnie
ed085f2c83 UX improvements for loader update interface 2024-11-20 21:41:41 +08:00
bunnie
9c1186022f quiet debug 2024-11-20 21:41:23 +08:00
bunnie
8b571561f8 cleanup warning 2024-11-20 21:41:08 +08:00
bunnie
60dcd906ed include slice_cursor in mod list 2024-11-20 21:40:50 +08:00
bunnie
3b567fb3e2 modularize SliceCursor 2024-11-20 21:40:25 +08:00
bunnie
b68abf1d2b change volume label 2024-11-20 20:43:39 +08:00
bunnie
6d3a58ccea cleanup warnings 2024-11-20 20:41:10 +08:00
bunnie
9a839e3fe6 add keypress handling and no_std Cursor implementation 2024-11-20 20:40:48 +08:00
bunnie
d9709997fb add template disk image
this is a pre-initialized, FAT12 image that is compatible with
Windows (which is the harder of the OSes to please)
2024-11-20 20:40:05 +08:00
bunnie
e181c0d460 use global allocator for simple-fatfs
also initialize the disk image with some default data
2024-11-20 20:39:27 +08:00
bunnie
8cc80741ac cleanup warning 2024-11-20 20:39:06 +08:00
bunnie
6c79441ee1 add boot option to loader 2024-11-20 01:45:56 +08:00
bunnie
bb594a5c40 try to improve the pmic detection code
we can now recover from an I2C timeout and get the PMIC data
out, but mysteriously, when we leave the routine, the CPU hangs.

I think fundamentally the I2C instability is due to something
very wonky inside the chip itself, so the recovery only papers
over an issue that is only fixed with a reboot...
2024-11-20 01:44:58 +08:00
bunnie
f14cf1948c gfx is now used as part of the update routine 2024-11-20 01:44:28 +08:00
bunnie
626d997868 move pl230 test to an easier place for checking 2024-11-18 18:37:33 +08:00
bunnie
aba5d25e36 cleanup warnings when boardbringup is not selected 2024-11-05 19:41:12 +08:00
bunnie
0463629a0a cleanup warnings when board-bringup target is not selected 2024-11-05 19:40:28 +08:00
bunnie
dc20c84785 refer to new modules 2024-11-05 01:45:13 +08:00
bunnie
08f7252791 integrate new qr finding code 2024-11-05 01:44:53 +08:00
bunnie
16c9b2c7e2 insert refactored qr code
code alignment and finding now works *great*. Near real-time
performance!
2024-11-05 01:44:12 +08:00
bunnie
f6d6db566a add homography searching routines 2024-11-05 01:43:59 +08:00
bunnie
6c4cd3bc67 add qr option 2024-10-27 23:28:08 +08:00
bunnie
8625dae0db add more swap sram support and change resolution api name 2024-10-27 23:27:26 +08:00
bunnie
4f85deaecb change api name for resolutions to dimensions 2024-10-27 23:26:45 +08:00
bunnie
bceb08afb8 recognize 8MiB swap chip 2024-10-27 23:24:42 +08:00
bunnie
38ad0363ce fix capacity units 2024-10-26 18:45:36 +08:00
bunnie
1a90df9d53 add descriptor chaining for large bulk transfers 2024-10-26 03:06:37 +08:00
bunnie
2a92932850 cleanup some debug 2024-10-26 03:06:10 +08:00
bunnie
9647202366 cleanup testing code for QR code
now it will overlay crosshairs on finder patterns and do affine
correction when the finders are found.
2024-10-21 01:18:12 +08:00
bunnie
5d49d2dbb7 add libraries for math and make usb a feature 2024-10-21 01:17:41 +08:00
bunnie
2fd59a1f87 tweaks for platform agnostic API 2024-10-21 01:16:59 +08:00
bunnie
b3f038ca06 add affine skew correction step 2024-10-21 01:16:37 +08:00
bunnie
c0b942b801 platform-specific implementations for graphics 2024-10-21 01:14:04 +08:00
bunnie
5c6be58056 revise camera code - capture 256x240 frames
this improves decoding for e.g. type 5 codes, which is
a bit too tight with a 128x120 frame.
2024-10-20 17:05:45 +08:00
bunnie
f16e3721be add some QR code debugging stuffs 2024-10-20 17:03:50 +08:00
bunnie
b6fbc4ef36 clean up some gross static mut state stuff
still have to resolve the static mut issue of getting the USB
controller state into the interrupt controller.

I'm not sure there *is* a good way to do it - this might actually
be "the" use case for static mut's - but the point of this
exercise was to just diff out the driver in machine mode versus
OS mode to try and figure out if there's a hardware problem
causing instability or if it's a driver issue

the conclusion so far is that the USB stack requires extremely
tight interrupt handling timing, and so, for better stability
we may have to mirgate away from the heavily user-space dependent
implementation currently in use.
2024-10-19 00:15:12 +08:00
bunnie
37ceefef21 add usb mass storage command handlers
disk enumerates now, and initiates r/w transactions but
the reference driver does not match the implementation in that
the USB stack can't access all of RAM, so we have to add
an intermediate stage that splits the command requests into
smaller chunks
2024-10-19 00:14:12 +08:00
bunnie
dabd87aa3a add usb mass storage command handling 2024-10-19 00:13:52 +08:00
bunnie
ed9759f524 remove a debug statement 2024-10-18 17:18:06 +08:00
bunnie
90d7f45f0a adjust locations of memory for USB loader
and document the rationale
2024-10-18 17:17:29 +08:00
bunnie
6c655e9358 re-enable interrupts immediately in the handler
we need to catch an interrupt that gets issued while we
are still handling the pending interrupt.
2024-10-18 17:15:24 +08:00
bunnie
a6e7459cdd re-organize the USB subsystem into modules 2024-10-18 14:45:15 +08:00
bunnie
e4f5c32ff3 update link locations to make space in loader for USB stack
this is in preparation for loader-based updates

may have to increase space even more when we pull in e.g.
firmware signing and verification primitives.
2024-10-18 04:17:36 +08:00
bunnie
d8cd9ba5c5 add hook to USB testing, and also move the kernel to make space for loader USB 2024-10-18 04:16:31 +08:00
bunnie
3a4ae8f09f add usb to cramium platform 2024-10-18 04:16:08 +08:00
bunnie
af6f4766ff translated reference USB stack into Rust
implements mass storage; needs debugging
2024-10-18 04:13:57 +08:00
bunnie
778af25414 add handler for pmic open failure; add test case for self-powerdown 2024-10-12 00:46:47 +08:00