LLVM/clang is not used for any compilation due to it not supporting the
8-bit architectures we use (MCS-51, AVR). This means we are effectively
installing 250+ MiB of dependencies for a C formatting tool.
Replace it with uncrustify, which uses only ~600 KiB of space and has
more granular control of formatting (800+ options).
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Boards may not have USB-PD. Remove the need for a "none" option by only
adding USB-PD sources when enabled.
The resulting binary for boards with USB-PD enabled (addw3, bonw15,
serw13) are identical. The binary for boards without USB-PD now have the
empty calls optimized out.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Use the sequence specified by the flowcharts in the ITE manuals.
Ref: IT5570E V0.3.2 datasheet; 7.15.5 EC2I Programming Guide
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Remove the need for a "none" option by only adding KBLED sources when
enabled.
The resulting binaries with KBLED enabled (all of them) are identical.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
This is more descriptive than the comment and allows for changing
values, such as using a chip with a different clock frequency.
The resulting binary is identical.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
SDCC 4.4.0 now fails to compile if there are empty switch cases.
src/board/system76/common/main.c:105: error 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
Signed-off-by: Tim Crawford <tcrawford@system76.com>
The upcoming addw4 will use the IT5570E-256, which requires removing the
assumption that every ITE chip is 128K. Introduce new configs so boards
may select which flash size they use.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
This prevents `moduint` from being called for the superloop.
A bitwise AND is used instead of using the equivalent `% 4` as an
indication that modulo should not be used, as not using a power of 2
(which is optimized) will result in an expensive call to SDCC library
functions.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Pull the lid check out to the loop to avoid accessing the matrix when we
know we do not need the data. It is left in kbscan (instead of simply
disabling reading) to clear the state of the matrix data.
The lid check for wake is removed as it will never be true.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
SDCC 4.3.3 (terribly) reports this as an error:
src/board/system76/common/smfi.c:244: error 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
Signed-off-by: Tim Crawford <tcrawford@system76.com>
SDCC 4.3.3 complains about the declaration not matching the prototype:
error 283: function declarator with no prototype
Add `void` to the AVR functions as well, even though no warning is
issued by GCC.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
As a follow up to c461e20df3 ("make: Remove version from build output
path"), only support building a single version of a single board by
default. The build directory can still be specified by passing `BUILD`.
Fixes running the `clean` target when `BUILD` is a custom value or
`BOARD` isn't set.
Fixes: b03c960b4f ("make: Reduce build output")
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Add timeouts to the legacy PECI implementation to prevent the EC locking
up when PECI stops working, such as during S0ix opportunistic suspend.
This is not the optimal solution, as PECI should not be available at all
to cause the lock up in the first place, but it at least prevents the
issue.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Some users are reporting that a debounce time of 5ms is not enough to
prevent keys from registering twice. Split the difference between the
old and the new debounce times and set it to 10ms.
Ref: https://github.com/system76/firmware-open/issues/471
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Implement a FnLock toggle that behaves as follows:
- Disabled: F1-F12 are normal
- Enabled: F1-F12 are the alternate function
Signed-off-by: Tim Crawford <tcrawford@system76.com>
If eSPI is used, use Virtual Wires to determine if PECI is available.
Fixes incorrectly reporting PECI as available on systems using S0ix, as
the CPU would be in C10 but `PLTRST#` would not be asserted.
Requires enabling `HOST_C10` reporting in FSP-S.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Replace symlinks with directories with `board.mk`, using relative paths
to include the files rather than duplicate them.
This allows making board-specific changes without affecting other
boards, such as when firmware security had to be enabled on galp6 when
it was enabled on galp7 (2d5cbadf71).
Signed-off-by: Tim Crawford <tcrawford@system76.com>