Commit Graph

110 Commits

Author SHA1 Message Date
Ondrej Jirman aaffb9940a Update README 2023-02-18 02:52:49 +01:00
Ondrej Jirman 3726b6adc2 Pull-up port 8 upper nibble of pins and keep them as inputs
This avoids pulling them low temporarily during startup.
2023-02-18 02:51:20 +01:00
Ondrej Jirman 6fbfb61c14 Revert "Add extra 50uA savings by disabling the USB 3.3V regulator"
This reverts commit c4f36fdb14.
2023-02-17 18:49:01 +01:00
Ondrej Jirman 9943053bc1 Update power use measurements 2023-02-17 17:33:12 +01:00
Ondrej Jirman 470f230d15 Disable USB stack in stock firmware by default, for max power savings 2023-02-17 17:31:47 +01:00
Ondrej Jirman c4f36fdb14 Add extra 50uA savings by disabling the USB 3.3V regulator 2023-02-17 17:31:47 +01:00
Ondrej Jirman b24b0f1d84 Configure MCU pins properly to avoid floating inputs
This reduces the power consumption of the MCU significantly.
2023-02-17 16:46:12 +01:00
Ondrej Jirman 3e2fc2a6ed Update keyboard schematic 2023-02-17 16:45:10 +01:00
Ondrej Jirman 6145b3df0a Fix re-entry to sleep after the first keypress 2023-02-17 14:02:28 +01:00
Ondrej Jirman 61e90842de Fix no-USB build of the stock firwmare 2023-02-17 14:01:33 +01:00
Ondrej Jirman 4b3d885b61 Check that no key is pressed right after setting up IC interrupt and before going to sleep 2023-02-17 14:00:32 +01:00
Ondrej Jirman 0899765c07 Don't declare variables that are unused in certain firmware configurations 2023-02-17 13:59:18 +01:00
Ondrej Jirman 073505f31f Add firmware build target shortcut 2023-02-17 13:58:19 +01:00
Ondrej Jirman 693cf5ae86 Fix issue with ppkb inputd not working after using the kernel driver
This was caused by kernel driver disabling the matrix scan in the KB
firmware and userspace tools not re-enabling it on startup. :)
2022-07-27 23:02:15 +02:00
Ondrej Jirman ec8e248883 Add more bit definitions to cahrger ctl register map 2022-07-27 22:25:05 +02:00
Ondrej Jirman 91163251e6 Don't exit the debugger on I2C communication errors, just report them 2022-02-02 10:45:17 +01:00
Ondrej Jirman 5e365d71d1 Improve inputd error reprting 2022-02-02 08:53:05 +01:00
Ondrej Jirman d585c744e3 Remove selftest 2022-02-02 08:39:54 +01:00
Ondrej Jirman 4a65f41988 Don't do probing at startup 2022-02-02 08:39:11 +01:00
Ondrej Jirman 6bc1736857 Inputd improvements
- retry reading kb data after interrupt if the first read fails
- poll for data when the key is pressed to detect missed interrupts
- report issues
2022-02-02 08:38:48 +01:00
Ondrej Jirman 2da55b7d62 Build only the tools by default 2022-02-02 08:36:18 +01:00
Ondrej Jirman 024d52263e Fix charger status reporting (VIN overvoltage/low load bits were swapped) 2022-01-19 03:32:34 +01:00
Ondrej Jirman 013149dc89 Disable the self-test binary build (it doesn't work anyway) 2022-01-18 02:07:26 +01:00
Ondrej Jirman f681795424 ENOENT means the i2c userspace device driver is missing 2022-01-17 16:08:27 +01:00
Ondrej Jirman 75b7cdaed2 Add some helpful messages 2022-01-17 16:06:01 +01:00
Ondrej Jirman 13bf8c43ca Update TODO 2022-01-16 17:00:46 +01:00
Ondrej Jirman 3ade80f425 Add support for Pinephone Pro 2022-01-16 17:00:03 +01:00
Ondrej Jirman af4009e3bf Make kmap.h build more resilient
Building with missing php resulted in empty kmap.h
2022-01-15 23:53:04 +01:00
Ondrej Jirman a1978d22ed i2c-charger-ctl doesn't need the INT gpio access, remove it 2022-01-12 13:45:13 +01:00
Ondrej Jirman a4ca2223e1 Compile with -Wall and fix issues this revealed 2022-01-12 13:37:48 +01:00
Ondrej Jirman 457e5658d9 Add missing argument to error reporting functions 2022-01-12 13:37:12 +01:00
Ondrej Jirman 7830c7986f Fix writing charger registers (result detection was broken) 2022-01-12 13:36:47 +01:00
Ondrej Jirman 31c41b7d9e Drop I2C bit functions, to make timing easier to modify
I2C to the charger now has clean 100kHz timing. One read command now takes
400us, and one write command takes 300us to execute.
2021-09-05 02:26:55 +02:00
Ondrej Jirman 78c72fe448 Make register define order less confusing 2021-09-05 02:07:12 +02:00
Ondrej Jirman a049cd5107 Make charger tool read/write data from charger via MCU I2C proxy commands 2021-09-05 02:06:57 +02:00
Ondrej Jirman 21374993b3 Allow to reset to stock firmware from user firmware by holding pine+f+h 2021-09-05 01:58:48 +02:00
Ondrej Jirman 0b280ebc14 Fix I2C bit banging code 2021-09-05 01:57:58 +02:00
Ondrej Jirman bf0c0e9c97 Make i2c flasger reset the app block flag 2021-09-05 01:53:42 +02:00
Ondrej Jirman 574d68aa89 fw: Change to bit-banging I2C implementation for charger comm
New code, compiles, but it's not tested yet!
2021-09-01 00:48:27 +02:00
Ondrej Jirman 4a1abce0eb Update inputd to make it work with the latest firmware API 2021-08-31 19:01:43 +02:00
Ondrej Jirman 62e2ebe7ec Fix keymap generator, drop prototype keymap 2021-08-31 19:00:49 +02:00
Ondrej Jirman f1e3f6dce6 Drop prototype keyboard build 2021-08-31 19:00:18 +02:00
Ondrej Jirman 3c02d41c4b Add final PCB photos/schematics 2021-08-31 15:09:21 +02:00
Ondrej Jirman fa19294d05 Dump option ROM when reading flash over USB 2021-08-31 14:29:50 +02:00
Ondrej Jirman 0e4f426dfb Add bin2pgd tool
This is used by the vendor's flashing tool. It's ROM image + option
ROM image appended (256 bytes).

Option ROM contains some flags and configuration data for the MCU.
Things like oscillator configuration, HW reset pin enable, data EEPROM
enable, etc.
2021-08-31 14:29:21 +02:00
Samuel Holland 246aaaa42e firmware: Statically allocate keys array
Allocating the array on the stack before initializing the stack pointer
does not work.
2021-08-05 21:17:09 -05:00
Samuel Holland 3c6488b99e Disable I2CA in all firmware builds
It is unlikely that any future revision of the hardware will use I2CA.
2021-08-05 21:17:09 -05:00
Samuel Holland 3107546c04 Revert "firmware: Make interrupt signal shorter (10us)"
The longer duration is actually required, likely due to debouncing
applied on the SoC side. Even 50us was unreliable.

This reverts commit 3b723583e7.
2021-08-05 21:17:09 -05:00
Ondrej Jirman ee438569e3 Update TODO 2021-08-05 03:40:40 +02:00
Ondrej Jirman f8b901e832 firmware: Add final/proto-v3 builds 2021-08-05 03:40:07 +02:00