Commit Graph

780 Commits

Author SHA1 Message Date
d68a42180b Rename oryp11 to serw13 2023-04-03 13:06:16 -06:00
55f961406c addp3: Use virtual wire for calculating power state 2023-04-03 13:06:16 -06:00
db10c198b3 addp3: Add new board 2023-04-03 13:06:16 -06:00
c7bc078cbd gaze18-3050: Fix GPIOs for power sequence
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-04-03 13:06:16 -06:00
60f9cfc8d6 gaze18-3050: Add new board
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-04-03 13:06:16 -06:00
e4542d2aa5 oryp11: Adjust fan points
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-04-03 13:06:16 -06:00
e4d7196b5c oryp11: Increase AC power limit to 280W
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-04-03 13:06:16 -06:00
d723e2e13d gaze18-40x0: Fix prochot polarity 2023-04-03 13:06:16 -06:00
ff7d7138b0 Support power limits above 256W 2023-04-03 13:06:16 -06:00
8bd3b49273 gaze18-40x0: gpio fixes 2023-04-03 13:06:16 -06:00
213f79e2b6 oryp11: Add new board
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-04-03 13:06:16 -06:00
bc111b7a4b gaze18-40x0: Let PCH handle panel 2023-04-03 13:06:16 -06:00
ef6ea32c37 Add gaze18-40x0 2023-04-03 13:06:16 -06:00
1046dd7aec Update Rust toolchain to 2023-01-21
Update the toolchain and deps, and use the sparse registry access.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-02-18 06:28:21 -07:00
96b2d78c2e Remove PMC hack for S0ix
Whatever the issue was appears to be fixed after rebasing coreboot on
the 4.19 release. lemp11 has successfully reached S0ix with SLP_S0#
asserted when booted on battery power for 100 cycles.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-02-18 06:27:17 -07:00
ddb19e8738 ec/ite: Add Wake-Up Control registers
Groups 1, 3, and 4 require explicitly enabling the wake-up function
before unmasking them in INTC.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-02-07 10:47:24 -07:00
084aefd506 ec/ite: Add Interrupt Controller registers
- IT8587E has groups 0-18
- IT5570E has groups 0-21
- IT81202E has groups 0-23

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-02-07 10:47:24 -07:00
59c386ec12 Move gpio_debug from board to EC code
The gpio_debug() functionality depends on the ITE registers and not
anything board-specific.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-23 14:26:30 -07:00
f687000a4f ci: Install deps before running lints
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 13:52:14 -07:00
7205f1a49e Add shellcheck lint
Run shellcheck [1] on the bash files.

[1]: https://www.shellcheck.net/

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 13:52:14 -07:00
623d3ce8ab make: Add new targets
- fmt: Apply clang-format
- list-boards: list of available build targets
- help: Short description of make targets

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 13:52:14 -07:00
58f9ed4051 Run lints at pre-commit
Install a hook to run lints at pre-commit to force issues to be fixed
during development.

This introduces a 5-10 second delay when committing due to how slow
clang-format is.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 13:52:14 -07:00
1aadc68257 scripts: Rewrite lint scripts
Rewrite lint scripts to report what they do and if they pass. In the
case they fail list the files that caused the failure, except for
clang-format, which will be slow to run of every file individually
(should just run `make fmt` anyway). Also add a script to run all the
lints in order with a single command.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 13:52:14 -07:00
b03c960b4f make: Reduce build output
Default to silent builds, only outputting the file being generated. This
gives output similar to Linux/coreboot output when building. `VERBOSE=1`
can be passed to show the actual commands.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 12:18:31 -07:00
2056d4d5e0 make: Disable built-in rules and variables
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 12:18:31 -07:00
9a52042f95 Generate and use compiler dep rules
SDCC supports the `-MMD` option. Use it instead of having every file
depend on *all* the headers. Reduces incremental build time after
modifying headers as it will now only rebuild the actual dependents and
not the entire project.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-18 12:18:31 -07:00
84fe76cad4 avr: Fix compiling with GCC 12
Compiling the Arduino targets with GCC 12 fails with the following:

    error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds]

Apply the workaround from the bug discussion to fix it.

Ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-13 12:10:49 -07:00
28882975e3 make: Ensure git hash is 7 characters
Specify abbrev so the version string is the same across systems with
different values for core.abbrev.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-13 12:01:49 -07:00
f46360fb45 make: Ensure main object file is first
Per the SDCC manual, the object that declares main must be passed first
to the linker. The resulting binary is identical, and this has not
caused a problem yet, so I'm unsure how "required" this is.

Ref: Section 3.2.3 Projects with Multiple Source Files
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-13 12:01:49 -07:00
7ebec4f7b1 make: Enable compiling asm files
Allow specifying asm files the same way C files are added:

    board-common-y += foo.asm

The file must use an `.asm` extension. The toolchain file filters the
sources to compile them into objects correctly, as the C compiler
doesn't handle asm files itself.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-13 12:01:49 -07:00
e032c5f0f2 Update .clang-format and apply
Update .clang-format for LLVM 14.0, available on Ubuntu 22.04.

There is still plenty that clang-format sucks at or does wrong, so
either add some more blocks to disable it, or just put up with it.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-10 12:02:21 -07:00
c3267fc4ad ci: Update to Ubuntu 22.04
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-10 12:02:21 -07:00
d687df482a Conditionally compile eSPI support
A board may use either the LPC bus or the eSPI bus. Only include eSPI
support for boards that use it.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-06 12:47:54 -07:00
5e884cf413 scratch: Use relative path for source
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-01-06 12:47:54 -07:00
a8e37276e9 tool: Disable default features of redox-hwio
Fixes using as a dependency in no-std environments.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-12-20 13:41:02 -07:00
1019878e3c tool: Update dependencies
clap is only updated to 3.2 instead of 4.0 because I didn't want to deal
with all the changes.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-11-30 08:39:16 -07:00
cd28de382d Add a K_NONE define
Seems like this define might as well be included. It means `layouts.py`
doesn't need to handle it specially.
2022-11-29 09:20:41 -07:00
004c7acf6c Remove scripts/layouts.sh
Superseded by `keyboard-configurator/layouts.py`.
2022-11-29 09:20:41 -07:00
2a8befc195 Enable WLAN at power_on() instead of board_init()
If the board is on AC power when powered off the EC will not reset, and
WLAN power will not be enabled on next boot. Move enabling WLAN from
`board_init()` to `power_on()`.

Fixes: be4659a0cb ("Set wireless power at init and power off")
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-11-18 19:11:01 -07:00
be4659a0cb Set wireless power at init and power off
Add a new wireless object for controlling WLAN power state. Change the
power sequence to enable WLAN at board init and disable it at power off.

Newer galp5 units sold to customers have an issue where they do not
fully power off. This is apparently somehow caused by `WLAN_PWR_EN`.

The unit received for development do not have this issue.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-11-18 07:32:18 -07:00
839abf7878 galp5: Remove BT_EN
BT is enabled PCH side by `PCH_BT_EN`. `BT_EN` is not connected.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-11-18 07:32:18 -07:00
861f1f2cc8 make: Add config for each ITE EC
EC_VARIANT is only used on AVR as a parameter to avrdude.

Replace its use on ITE with 2 choices:

- CONFIG_EC_ITE_IT8587E
- CONFIG_EC_ITE_IT5570E

Replace the EC defines with a matching define for the variable.
2022-11-17 14:19:39 -07:00
ac9631f948 make: Specify source files to include
Replace use of wildcard with list of source files to include. The `-y`
suffix is added, but has no significance since conditional compilation
has not been added yet.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-11-17 14:19:39 -07:00
ce66685c70 make: Move arch.mk to toolchain.mk
The arch.mk file contains variables/rules to build, so rename it. Leave
an empty arch.mk so it can still be used in a follow-up commit.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-11-17 14:19:39 -07:00
c5b737f505 ESPI systems should always power off if in S5 state 2022-11-17 13:54:43 -07:00
edbb5b594a HACK: pmc: Apply hack for S0ix to all ADL boards
For some reason, *all* the ADL boards are now failing to enter S0ix.
Apply the PMC hack to the remaining boards.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-11-08 09:44:14 -07:00
be5d34dc0d Add other launch keyboards 2022-11-01 16:22:11 -06:00
d36fb62cd7 Replace makebin with objcopy
Replace custom SDCC tool with the more standard binutils tool.

scratch.rom and flash.rom are different (no unnecessary padding), but
resulting ec.rom is the same.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-10-28 15:01:45 -06:00
69f97fe149 Merge common EC directories
Split the EC define into base and variant. Merge the 3 ATmega chips as
atmega, and the 2 ITE chips as ite.

Tested that the generated files are identical.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-10-27 09:42:45 -06:00
01885609e8 HACK: pmc: Add hack to force S0ix entry on lemp11
lemp11 sometimes fails to reach C10 and gets stuck in C0 during s2idle.
For some reason, sending a PMC SCI allows the CPU to go to C10.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2022-10-17 18:36:35 -06:00