Thermal properties of each model differ and they should not rely on an
arbitrary, unoptimized set of fan points.
It is one thing to copy the points from the previous generation for a
model, as a lot of the time the chassis design is nearly identical, but
it should be always be explicit.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Replace hard-coded PWM channels with defines so the second fan on darp10
can be handled like the second fan on units with a dGPU.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
darp10 demonstrates that a board without a dGPU may still have a second
fan, so rename the CPU (PECI) fan to FAN1 and dGPU fan to FAN2.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Move the fan-related logic from the PECI and dGPU modules to the fan
module. The PECI and dGPU modules are now only responsible for reading
the thermal data, and the fan module handles calculating and updating
the fans duties based on that data.
Have peci_get_temp() return the actual temp instead of the offset,
requiring the caller to make another calculation for the temp.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Add a new error for the case of trying to flash when security is enabled
and it is still locked and update the related docs.
Signed-off-by: Tim Crawford <tcrawford@system76.com>
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>