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>
Fixes the following warnings in Actions:
Node.js 16 actions are deprecated. Please update the following
actions to use Node.js 20: actions/checkout@v3.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Commit 17f8e37ed5 ("Convert toolchain file to TOML syntax") switched
from the bare toolchain file to the TOML-based one for better management
of the toolchain and components used.
Commit 1cb61e6918 ("deps.sh: Update rustup or inform user of env
vars") added an explicit `rustup self update` because there were still
cases, a year later, of people not having a rustup new enough to support
the TOML-based toolchain file.
Now 2 years after that, it should be safe to drop the explicit self
update. The TOML format has widespread adoption and rustup now self
updates by default. This should allow distro-provided rustup, which
disables the self update feature, to work if it is already installed in
place of the one downloaded from https://rustup.rs.
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>
Remove the hard-coded assumption that the EC is always 128K, as ITE
chips can also be 256K (which Clevo has started using since addw4).
Instead assume the ROM is correctly sized, which we do since
0d83819a21 ("Pad binary file to total flash size") and proprietary
firmware has always done.
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>