Commit Graph

898 Commits

Author SHA1 Message Date
ebc5168cb0 Remove the use of symlinks
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>
2023-07-31 09:06:23 -06:00
9b7c6704c3 docs: Build with mdBook
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-31 09:05:53 -06:00
bd291871f4 Rename doc/ to docs/
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-31 09:05:53 -06:00
9302a30a2d pmc: Add interrupt control and enable registers
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-31 09:04:52 -06:00
459e5a3614 ec/ite: Add WUC functions to handle interrupts
Add functions to enable, disable, and clear an interrupt.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-31 09:04:20 -06:00
120ed1e2c5 ec/ite: Add INTC functions to handle interrupts
Add functions to enable, disable, and clear an interrupt.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-31 09:04:20 -06:00
d4ecd8a79a kbscan: Remove comparing matrix to keymap
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>
2023-07-28 20:07:24 -06:00
0f2ff7e540 kbscan: Switch from GPIO mode to KBS (Normal) mode
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>
2023-07-28 20:07:24 -06:00
546458e368 kbscan: Return early if debouncing
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>
2023-07-25 13:03:25 -06:00
8a1adc2bdc Enable power switch WDT on IT5570E boards
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>
2023-07-22 06:35:42 -06:00
45520646aa power: Reset KBC on CPU reset
Ensure the keyboard controller is not left locked/disabled.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-22 06:32:07 -06:00
de546fa761 kbc: Add reset function
This function can be called after EC init to put the KBC into a known
working state.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-22 06:32:07 -06:00
0d83819a21 Pad binary file to total flash size
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-19 06:13:17 -06:00
64e5b8308d lemp: Remove pull-down from CPU fan sense
Matches the GPIO for all other boards.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-17 18:06:35 -06:00
1ebc0bc6c2 galp6: Set CPU/VGA fan sense to TACH functionality
Set D6 and D7 to ALT to use as tachometers inputs from the fans.

Matches config for all other boards.

Ref: IT5570E V0.3.2 datasheet; 7.5.4 Alternate Function Selection
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-17 18:06:35 -06:00
e093952dd2 kbscan: Reduce debounce time from 15ms to 5ms
Allows increased typing speed while avoiding repeating keys due to
contact bounce and keys being rejected by ghost key detection.

This is the default value for QMK.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-17 13:38:15 -06:00
1fded3f7bf Use %cs format when getting the commit date
From the man page:

    %cs
        committer date, short format (YYYY-MM-DD)

This is identical to what we use, without having to specify a custom
date format for it.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-07 23:20:51 -06:00
4458d5dbe2 bonw15: Set battery Rsense to 5
PRS3 is 0.005 Ohms.

However, I am unsure about this change because PRS1 and PRS2 are also
both 0.005 Ohms, but are in *parallel*.

Ref: bonw15 schematics, Charger (Sheet 70)
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-06 12:31:03 -06:00
42a19b3d6b oryp11,serw13: Set adapter Rsense to 10 milliohms
PRS1 is 5, but it is in series with PRS3, which is also 5. PRS1 by
itself is only connected to ACP/ACN.

Ref: oryp11 schematics, AC In Charger (Sheet 59)
Ref: serw13 schematics, AC_In, Charger (Sheet 70)
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-07-06 12:31:03 -06:00
dd555b9012 peci: Clear status on completion
The PECI-over-eSPI implementation, like the legacy implementation, must
acknowledge when the transaction is done by clearing the bit in the
register.

Fixes a hang during shutdown on oryp11 after unplugging a TBT display.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-21 12:44:12 -06:00
c7288a5a60 darp9,oryp11: Update keyboard
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-16 14:49:54 -06:00
8e6d938f90 Add new keyboards
Replace micmute and darp9 layouts with new keyboards.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-16 14:40:43 -06:00
347bbf0d9a reuse make target for board list 2023-06-15 13:45:12 -06:00
faede6264a Generate matrix from directory 2023-06-15 13:45:12 -06:00
fe6faa21fc Add reset command to ectool 2023-06-14 13:50:20 -06:00
485f390077 darp9: Set CC_EN high
Fixes using the non-TBT USB-C port.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-08 12:18:53 -06:00
9b111bafc6 Fix K_MIC_MUTE keycode 2023-06-07 17:24:06 -06:00
c09960cbc6 Replace Call Mute with random key for micmute
Replace the Windows specific key with an arbitrary keycode to remap to
micmute on Linux.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-07 17:24:06 -06:00
2dd33ffec5 Add "Call Mute" combo key for darp9
The proprietary firmware for the darp9 adds the mic mute hotkey using
the new "Call Mute" hotkey from Windows 11 22H2, which is mapped to
`Super+Alt+K` [1]. Match the behavior in open firmware.

[1]: https://support.microsoft.com/en-us/windows/keyboard-shortcuts-in-windows-dcc61a57-8ff0-cffe-9796-cb9706c75eec#WindowsVersion=Windows_11

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-07 17:24:06 -06:00
399415fdf6 Add custom keymap for darp9
Despite the darp9 supporting an RGB backlit keyboard, the keyboard
option was removed and it ships with a white-only LED backlit keyboard
instead. The keypad `/` still has the cycle symbol printed on it, so
replace the color cycling function with the keyboard brightness
function used by other white-only LED keyboards (the 14" TKL ones).

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-07 17:24:06 -06:00
9ac513128a kbled: Add a "step" function for BKL hotkey
Replace the get+set logic with a step function to change the backlight
level for `K_KBD_BKL`.

Keyboards using a DAC have a different set of levels due to the
brightness difference between the keyboards.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-07 17:24:06 -06:00
4c9d3197b8 kbled: Make white_dac work like others
Make `white_dac` functions work based on the DAC power level like the
other I2C and PWM mechanisms, instead of preset values from an array.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-07 17:24:06 -06:00
bfbbfe43e6 acpi: Update keyboard backlight functions
Existing FDAT values remain unchanged in their functionality.
New functionality is added to fill unused FDAT values.

FDAT values correspond to the following functionality:

- 0: Set brightness
- 1: Get brightness
- 2: Get backlight type (new)
- 3: Set color
- 4: Get color (new)
- 5: <unused>
- 6: Set brightness (duplicate)

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-07 17:24:06 -06:00
598aef8c4a kbled: Check if using white or RGB keyboard
Use RGBKB-DET# to determine the type of keyboard connected.

If a white keyboard is attached, always set the color to white, and
always return white for the color.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-07 17:24:06 -06:00
c71a58f7cf Add RGBKB-DET# GPIO
This GPIO can be used to detect if the connected keyboard is RGB.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-07 17:24:06 -06:00
e60873a82c darp9: Add Darter Pro 9
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-07 17:24:06 -06:00
002823908a oryp9,oryp10: enable firmware security 2023-06-07 11:56:11 -06:00
498508f2f1 scripts: Disable showing signature when getting date
Fixes building when `log.showSignature` is enabled.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-06-04 13:48:35 -06:00
f4ad9520a8 bonw15: invert USB power GPIO 2023-05-31 20:20:44 -06:00
82f091ef55 galp{6,7}: Reduce PL4 on AC to 65W
Reduce PL4 to the same value as other non-GPU units, even though the
galp7 has an H series CPU.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-05-25 10:27:42 -06:00
2d5cbadf71 galp6,galp7: Enable firmware security
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-05-18 08:56:37 -06:00
43dfbb055b Increase PL4 on battery to 45W for dGPU boards
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-05-17 10:43:26 -06:00
99dfbeaec3 power: Set PL4 based on AC state on all boards
Limit PL4 based on AC state for all units, not just those with dGPUs.
This will allow setting standard values in coreboot.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-05-17 10:43:26 -06:00
b967e7c921 Format code
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-05-15 10:25:44 -06:00
f5c4eaba97 lemp12: hack to drain LDO_3V3 capacitors 2023-05-12 11:00:27 -06:00
ca1996dd44 lemp12: Reset GPIO to match lemp11 2023-05-12 11:00:27 -06:00
bc92291c26 lemp12: set PSYS current gain to 0.5uA/W 2023-05-12 11:00:27 -06:00
e6b8eb4c42 charger/oz26786: support different PSYS current gains 2023-05-12 11:00:27 -06:00
93c2784eb3 lemp12: adjust GPIOs some more 2023-05-12 11:00:27 -06:00
f5c2548d04 lemp12: check and fix all GPIO config 2023-05-12 11:00:27 -06:00