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>
- Update toolchain to nightly-2023-09-07
- Update edition to 2021
- Update deps
`OpenHidDeviceError` is deprecated, and is removed in newer versions.
Replace it with `HidApiErrorEmpty`, because there are no descriptions
for what anything means so I just picked one that didn't require fields.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Support building only a single version for a model. This removes the
need to determine the git commit hash and date in order to access build
artifacts.
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>
Remove checking against the real keys declared in the keymap. It appears
to have no effect on behavior.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Use the default mode for reading the keyboard scan matrix when being
used as a keyboard. There should be no perceived change in behavior, but
should make the code easier to understand.
Note: `KSO[17:16]` are configured by `GPCRC` on boards that use them.
They are now set to alternate function to use in KBS mode rather than
GPIO mode, with the pull-up enabled to prevent them from floating when
configured as open-drain.
As part of this change, we now only read the hardware matrix state once
upfront, instead of on every iteration through the loop applying the
logic.
Tested by verifying that typing still works on darp9.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
A single timer is used for debouncing all keys, so there is no reason to
perform any operations if the matrix is being debounced. Just return
early and remove some of the convoluted logic.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Enable PWRSW WDT 2 and use the default timeout of 10 seconds.
Allows forcing an EC reset in case it gets into an invalid state.
Signed-off-by: Tim Crawford <tcrawford@system76.com>