Commit Graph

950 Commits

Author SHA1 Message Date
Jeremy Soller
b4768ed2dd Add lemp13-b 2024-05-17 08:34:54 -06:00
Tim Crawford
88c77aa1d3 darp10-b: Add custom keymap
The darp10-b replaces the display toggle with mic mute like other newer
units.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-05-07 14:35:29 -06:00
Jeremy Soller
522284e5d5 Add darp10-b 2024-05-07 14:35:29 -06:00
Tim Crawford
e7ad77898b darp10: Add custom keymap
The customer units for darp10 will have custom keyboard with the alt
legend on Num / removed.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-05-07 14:35:29 -06:00
Tim Crawford
b744529960 [HACK] darp10: Set FAN2 duty to FAN1
This model has a second CPU fan connected to PWM3.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-05-07 14:35:29 -06:00
Tim Crawford
748ec13132 darp10: Add Darter Pro 10
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-05-07 14:35:29 -06:00
Tim Crawford
38d4666a90 oryp12: Use OZ26786 charger
Ref: Schematics sheet 58 ("AC In Charger")
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-03-21 13:32:38 -06:00
Tim Crawford
637036ec02 oryp12: Enable security
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-03-19 17:22:49 -06:00
Tim Crawford
6a40a54932 oryp12: Add Oryx Pro 12
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-03-19 14:28:24 -06:00
Jeremy Soller
91b8c48773 Add lemp13 2024-03-19 13:22:24 -06:00
Jeremy Soller
90af96faf5 eSPI: debug all vwire indexes 2024-03-19 13:22:24 -06:00
Jeremy Soller
17aae5af71 Update ecspy 2024-03-19 13:22:24 -06:00
Tim Crawford
6aced2fd57 ci: Update actions/checkout to v4
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>
2024-03-18 14:27:58 -06:00
Tim Crawford
16e4f93f2c Mark pointed-to data const where possible
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-03-18 14:27:36 -06:00
Tim Crawford
9fb08ffa46 Mark pointers as const
Resulting binaries are identical.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-03-18 14:27:36 -06:00
Tim Crawford
d60a8e4c8e scripts: Remove explicit rustup self update
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>
2024-03-18 14:20:31 -06:00
Jeremy Soller
8c52c313e1 addw4: improved fan curve 2024-03-11 08:54:13 -06:00
Tim Crawford
8af7fd5bad addw4: Enable security
Development is sufficiently far along that this can default to enabled.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-03-01 11:15:40 -07:00
Tim Crawford
2174b4593a addw4: Enable KBLED support
Fixes: fff6208f98 ("Conditionally compile KBLED support")
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-03-01 09:44:34 -07:00
Tim Crawford
fff6208f98 Conditionally compile KBLED support
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>
2024-02-28 13:20:23 -07:00
Tim Crawford
ecac574671 addw4: Add Adder WS 4
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-02-28 11:40:32 -07:00
Tim Crawford
acf67d4413 tool: Assume ROM size is total flash size
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>
2024-02-28 11:40:32 -07:00
Tim Crawford
183778c32f make: Fix printing error if BOARD unset
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-02-28 11:40:32 -07:00
Tim Crawford
82b9e19746 time: Replace hard-coded values with macro
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>
2024-02-26 09:06:05 -07:00
Tim Crawford
449bafd130 main: Remove empty switch case
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>
2024-02-24 21:03:21 -07:00
Tim Crawford
ef4eeae2df ite: Add support for 256K flash
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>
2024-01-25 13:26:43 -07:00
Tim Crawford
4b86176659 main: Replace MOD with bitwise AND
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>
2024-01-05 15:04:28 -07:00
Tim Crawford
766fb738a0 kbscan: Remove unused array
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-01-04 15:05:40 -07:00
Tim Crawford
0ccb8079ae kbscan: Do not read matrix if lid is closed
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>
2024-01-04 15:05:40 -07:00
Tim Crawford
0e1a748b16 kbscan: Disable reading columns at init
The functionality is split into a separate function to optimize the use
case for each.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-01-04 11:55:56 -07:00
Tim Crawford
11b1e724b5 docs: Add note about write lock for flashing
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2024-01-03 09:45:34 -07:00
Ian Douglas Scott
47b070418a ectool: Use clap derive syntax
Co-authored-by: Tim Crawford <tcrawford@system76.com>
2023-12-08 16:04:37 -07:00
Tim Crawford
cbad8e09be smfi: Remove always true conditional
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>
2023-10-19 08:02:41 -06:00
Tim Crawford
713e1d9681 Add void to function declarations with no args
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>
2023-10-19 08:02:41 -06:00
Tim Crawford
01be30f107 Only support building a single board at a time
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>
2023-10-12 12:49:43 -06:00
Tim Crawford
946415f3a7 peci: Add timeouts to infinitely blocking waits
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>
2023-10-12 09:09:20 -06:00
Tim Crawford
a3fb9e1c77 avr: Fix compiling with GCC 13
Apply the CFLAGS workaround for GCC 13.

The issue is fixed in GCC 14, so only 12 and 13 are affected.

Ref: 84fe76cad4 ("avr: Fix compiling with GCC 12")
Ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-06 13:58:27 -06:00
Tim Crawford
166e03972b tool: Derive Eq, PartialEq on enums
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-05 14:32:15 -06:00
Tim Crawford
4fa389e1bd tool: Fix clippy warnings
Fix:

- clippy::unnecessary_cast
- clippy::needless_borrow

Allow:

- clippy::uninlined_format_args
- clippy::get_first

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-05 14:32:15 -06:00
Tim Crawford
782f18a3f6 tool: Update toolchain, edition, deps
- 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>
2023-10-05 14:32:15 -06:00
Tim Crawford
c461e20df3 make: Remove version from build output path
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>
2023-10-03 09:40:42 -06:00
Matt Parnell
bb1ce2273b fix sdcc 4.3.0 #14184 build error - error 283: function declarator with no prototype 2023-09-20 09:36:34 -06:00
Tim Crawford
181d4c5d59 kbscan: Increase debounce time from 5ms to 10ms
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>
2023-09-07 17:14:44 -06:00
Jeremy Soller
1097fd999a Do not force charging if end threshold is not set 2023-08-17 17:55:04 -06:00
Tim Crawford
34dd9ccbac battery: Disable charger if full or not on AC
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-08-17 17:55:04 -06:00
Jeremy Soller
894b82d4fb Set default battery start threshold to 90% 2023-08-17 17:55:04 -06:00
Tim Crawford
dc482dd11a Add basic support for IT5571E
The IT5571E is nearly identical to the IT5570E.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-08-15 08:24:02 -06:00
Winston Hoy
13dd6a1038 Update debugging.md 2023-08-02 09:14:35 -06:00
Winston Hoy
c0bfb257db Update debugging.md 2023-08-02 09:14:35 -06:00
Winston Hoy
8d844cf966 add console_internal debugging instructions 2023-08-02 09:14:35 -06:00