23 Commits

Author SHA1 Message Date
d63c954746 Generate capsules after building
UEFI capsules require versions be represented as a u32, so our current
versioning scheme is not usable. Hard-code the versions to 1 for now.

fwupd can represent this u32 in multiple ways depending on the
`VersionFormat` specified in the MetaInfo or a quirk.

Ref: https://github.com/fwupd/fwupd/blob/1.8.12/plugins/uefi-capsule/README.md#version-format
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-11-03 12:00:03 -06:00
66d20b0138 Add FMP UUIDs for ESRT
These are just version 4 (random) UUIDs to use as FMP GUIDs.

This change was generated with the following command:

    find models/ -name edk2.config -exec bash -c 'echo -e "\n# FMP UUIDs for ESRT\nSYSTEM_FMP_UUID=$(uuidgen -r)\nEC_FMP_UUID=$(uuidgen -r)" >> {}' \;

And then staged for everything except QEMU.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-11-03 12:00:03 -06:00
2e4e34bf83 coreboot: Fix bonw15, oryp11 speaker output
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-20 15:06:52 -06:00
968a612824 scripts: Address shellcheck issues
Report issues by shell files with:

    git ls-files '*.sh' | xargs shellcheck --exclude=SC2162

Address the following:

- SC1087: Use braces when expanding arrays
- SC1091: Not following
- SC2004: `$`/`${}` is unnecessary on arithmetic variables
- SC2024: `sudo` doesn't affect redirects
- SC2034: foo appears unused. Verify it or export it
- SC2086: Double quote to prevent globbing and word splitting
- SC2087: Quote `EOF`
- SC2115: Use `"${var:?}"` to ensure this never expands to `/*`
- SC2148: Add a shebang

Addresses (at least partially) some POSIX/dash issues:

- SC2113: `function` keyword is non-standard
- SC3010: In POSIX sh, `[[` `]]` is undefined
- SC3014: In POSIX sh, `==` in place of `=` is undefined
- SC3020: In POSIX sh, `&>` is undefined
- SC3046: In POSIX sh, `source` in place of `.` is undefined

Does not address:

- SC2162: `read` without `-r` will mangle backslashes
- Any other POSIX/dash-specific issues

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-19 14:45:22 -06:00
aa32ba26e1 coreboot: Fix LTR for card reader on TGL-U boards
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-19 08:08:52 -06:00
38b6bdc6e9 Update Rust apps for new toolchain
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-19 08:08:11 -06:00
48079c3de2 Update Rust toolchain to 2023-09-07
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-19 08:08:11 -06:00
b379c94b76 Split building coreboot toolchains to a separate file
Specify dependencies specifically for building coreboot toolchains in
the file, so they are not conflated with the dependencies required for
building firmware-open.

Remove building the toolchain when building firmware, so that the new
script is the single source for building coreboot toolchains.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-19 08:08:02 -06:00
5fb1624187 Set and use XGCCPATH
Allow overriding the coreboot toolchain location with `XGCCPATH` so
that xgcc can be installed to a separate location, such as `/opt`.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-19 08:07:39 -06:00
5d997d1c41 coreboot: Fix OZ711LV2 LTR for galp5 3050 variant
Fix programming the LTR so that CPU can reach C-states deeper than C2.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-13 11:30:05 -06:00
c1dafbbfad scripts: Always set EC build dir
Building EC was broken as the build output from the previous board was
not being cleaned. `BUILD` is now always set, defaulting to "build",
instead of only when `BOARD` is specified. For good measure, add it
to the clean command in case a custom path is used.

Fixes: 569321f9ac ("scripts: Set EC build dir")
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-12 13:27:55 -06:00
c4df2f4005 ec: Fix lock up during opportunistic suspend
Fix a potential lock up during S0ix opportunistic suspend, caused by
waiting indefinitely for a PECI command to complete when it is not
available.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-12 09:36:10 -06:00
569321f9ac scripts: Set EC build dir
Specify the EC build directory so that it does not require the model or
version to be determined in the script.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-11 19:05:16 -06:00
b22e8dee41 scripts: Split installing Rust to its own script
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-03 14:04:54 -06:00
51e3e1a53a Jenkins: Misc changes
- Use `GIT_COMMIT` instead of stashing the commit
- Do not shadow built-in `GIT_BRANCH` variable with a parameter
- Update `scmGit` config based on docs

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-10-02 09:51:15 -06:00
16ef69cb45 coreboot: rpl-hx: Add support for 5600 MHz RAM
Allow using 5600 MHz RAM on addw3, bonw15, and serw13.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-09-19 14:49:54 -06:00
42bf7a65d9 Update coreboot and ec
- coreboot: Fixed SMMSTORE init sometimes failing
- ec: Increased key debounce from 5ms to 10ms

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-09-08 16:52:38 -04:00
5a9565a684 adl: Update CSME to 16.1.25.2124
Generate new CSME images from ADL-P MR5 BKC (Kit 766225).

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-09-07 10:34:31 -06:00
52f6d72713 docs: Add note about checking CSME state
I had forgotten that CSME reporting an error was normal when disabled.
Document what is should report when enabled/disabled.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-09-07 10:24:10 -04:00
5844541031 jenkins: Add build duration to Slack notifications
The scripted projects using the default Slack notifications settings
report the time the build took. Add it to the declarative jobs as well.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-08-30 16:46:30 -04:00
81731199f2 Update coreboot and changelog 2023-08-23 14:04:40 -06:00
a8dd6c2c0b Update ec
- Changed battery charge start threshold to 90%
- Changed charger to disable when battery is full

These are made in response to Clevo's request for changes. The battery
now defaults to a charge-discharge cycle of 90-100% capacity instead of
always charging to 100%.

It is possible to force charging by setting the start threshold to 0, or
by resetting the EC (power off and unplug).

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-08-18 14:47:58 -06:00
38c7019286 Update coreboot
- Fixed CPU not going lower than C2 due to card reader LTR

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-08-18 14:47:58 -06:00
92 changed files with 446 additions and 157 deletions

View File

@ -8,12 +8,42 @@ features apply to your model and firmware version, see the
## unreleased ## unreleased
- tgl-u: Fixed CPU not going lower than C2 due to card reader LTR
- bonw15: Fixed speaker audio cutting in/out
- oryp11: Fixed speaker audio cutting in/out
## 2023-10-13
- tgl-u: Fixed potential EC lock up during opportunistic suspend
- galp5: Fixed CPU not going lower than C2 due to card reader LTR
## 2023-09-19
- rpl-hx: Added support for 5600 MHz RAM
## 2023-09-08
- adl: Updated CSME to 16.1.25.2124
- adl,rpl: Fixed SMMSTORE init sometimes failing
- Increased key debounce from 5ms to 10ms
## 2023-08-23
- rpl: Fixed RPL-S GPIO driver on Windows
## 2023-08-18
- cml-u: Fixed boot failing at FSP-S - cml-u: Fixed boot failing at FSP-S
- Added KBC reset on CPU reset to prevent keyboard from being locked - Added KBC reset on CPU reset to prevent keyboard from being locked
- Enabled power switch Watch Dog Timer with a timeout of 10 seconds - Enabled power switch Watch Dog Timer with a timeout of 10 seconds
- Fixed detecting if PECI is available on eSPI systems using S0ix - Fixed detecting if PECI is available on eSPI systems using S0ix
- Added support for a FnLock key - Added support for a FnLock key
- tgl: Fixed Bluetooth performance by enabling audio offload - tgl: Fixed Bluetooth performance by enabling audio offload
- gaze16: Fixed CPU not going lower than C2 due to card reader LTR
- adl: Fixed CPU not going lower than C2 due to card reader LTR
- rpl: Fixed CPU not going lower than C2 due to card reader LTR
- Changed battery charge start threshold to 90%
- Changed charger to disable when battery is full
## 2023-07-19 ## 2023-07-19

49
Jenkinsfile vendored
View File

@ -9,14 +9,7 @@
def all_models = 'addw2 addw3 bonw14 bonw15 darp5 darp6 darp7 darp8 darp9 galp3-c galp4 galp5 galp6 galp7 gaze15 gaze16-3050 gaze16-3060 gaze16-3060-b gaze16-3050 gaze16-3060-b gaze17-3050 gaze17-3060-b gaze18 lemp9 lemp10 lemp11 lemp12 oryp5 oryp6 oryp7 oryp8 oryp9 oryp10 oryp11 serw13' def all_models = 'addw2 addw3 bonw14 bonw15 darp5 darp6 darp7 darp8 darp9 galp3-c galp4 galp5 galp6 galp7 gaze15 gaze16-3050 gaze16-3060 gaze16-3060-b gaze16-3050 gaze16-3060-b gaze17-3050 gaze17-3060-b gaze18 lemp9 lemp10 lemp11 lemp12 oryp5 oryp6 oryp7 oryp8 oryp9 oryp10 oryp11 serw13'
def getCommitSha() {
sh "git rev-parse HEAD > .git/current-commit"
return readFile(".git/current-commit").trim()
}
void setBuildStatus(String state, String message) { void setBuildStatus(String state, String message) {
commit = getCommitSha()
// FIXME: https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#string-interpolation // FIXME: https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#string-interpolation
sh """ sh """
curl \ curl \
@ -24,7 +17,7 @@ void setBuildStatus(String state, String message) {
-H \'Accept: application/vnd.github+json\' \ -H \'Accept: application/vnd.github+json\' \
-H \'Authorization: Bearer ${GITHUB_TOKEN}\' \ -H \'Authorization: Bearer ${GITHUB_TOKEN}\' \
-H \'X-GitHub-Api-Version: 2022-11-28\' \ -H \'X-GitHub-Api-Version: 2022-11-28\' \
https://api.github.com/repos/system76/firmware-open/statuses/${commit} \ https://api.github.com/repos/system76/firmware-open/statuses/${GIT_COMMIT} \
-d \'{\"state\": \"${state}\", \"target_url\": \"${BUILD_URL}\", \"description\": \"${message}\"}\' -d \'{\"state\": \"${state}\", \"target_url\": \"${BUILD_URL}\", \"description\": \"${message}\"}\'
""" """
} }
@ -48,7 +41,7 @@ pipeline {
parameters { parameters {
string(name: 'MODELS', defaultValue: "$all_models", description: 'Space separated list of models to build', trim: true) string(name: 'MODELS', defaultValue: "$all_models", description: 'Space separated list of models to build', trim: true)
string(name: 'GIT_BRANCH', defaultValue: 'master', description: 'Git branch or revision to build', trim: true) string(name: 'SOURCE_BRANCH', defaultValue: 'master', description: 'Git branch or revision to build', trim: true)
} }
triggers { triggers {
@ -58,30 +51,28 @@ pipeline {
stages { stages {
stage('Prepare') { stage('Prepare') {
steps { steps {
checkout([ setBuildStatus("pending", "Pending")
$class: 'GitSCM', slackSend(color: "good", message: "${env.JOB_NAME} - #${env.BUILD_ID} started (<${env.BUILD_URL}|Open>)")
branches: [[name: "${GIT_BRANCH}"]],
// https://www.jenkins.io/doc/pipeline/steps/params/scmgit/
checkout scmGit(
branches: [[name: '${SOURCE_BRANCH}']],
extensions: [ extensions: [
[ lfs(),
$class: 'SubmoduleOption', pruneStaleBranch(),
disableSubmodules: false, pruneTags(true),
submodule(
parentCredentials: true, parentCredentials: true,
recursiveSubmodules: true, recursiveSubmodules: true,
reference: '', reference: ''
trackingSubmodules: false ),
], ],
[ $class: 'GitLFSPull' ], userRemoteConfigs: [[url: 'https://github.com/system76/firmware-open.git']]
[ $class: 'PruneStaleBranch' ], )
],
userRemoteConfigs: [[url: 'https://github.com/system76/firmware-open']]
])
setBuildStatus("pending", "Pending")
slackSend(color: "good", message: "${JOB_NAME} - #${BUILD_ID} started (<${BUILD_URL}|Open>)")
sh """#!/bin/bash sh """#!/bin/bash
# Install dependencies # Install dependencies
#./scripts/deps.sh #./scripts/install-deps.sh
. "${HOME}/.cargo/env" . "${HOME}/.cargo/env"
# Reset # Reset
@ -124,15 +115,15 @@ pipeline {
} }
success { success {
setBuildStatus("success", "Successful") setBuildStatus("success", "Successful")
slackSend(color: "good", message: "${JOB_NAME} - #${BUILD_ID} successful (<${BUILD_URL}|Open>)") slackSend(color: "good", message: "${env.JOB_NAME} - #${env.BUILD_ID} successful after ${currentBuild.durationString} (<${env.BUILD_URL}|Open>)")
} }
failure { failure {
setBuildStatus("failure", "Failed") setBuildStatus("failure", "Failed")
slackSend(color: "danger", message: "${JOB_NAME} - #${BUILD_ID} failed (<${BUILD_URL}|Open>)") slackSend(color: "danger", message: "${env.JOB_NAME} - #${env.BUILD_ID} failed after ${currentBuild.durationString} (<${env.BUILD_URL}|Open>)")
} }
aborted { aborted {
setBuildStatus("failure", "Failed") setBuildStatus("failure", "Failed")
slackSend(color: "warning", message: "${JOB_NAME} - #${BUILD_ID} aborted (<${BUILD_URL}|Open>)") slackSend(color: "warning", message: "${env.JOB_NAME} - #${env.BUILD_ID} aborted after ${currentBuild.durationString} (<${env.BUILD_URL}|Open>)")
} }
} }
} }

View File

@ -32,8 +32,8 @@ For a list of important changes please see the [changelog](./CHANGELOG.md).
Dependencies can be installed with the provided script. Dependencies can be installed with the provided script.
``` ```sh
./scripts/deps.sh ./scripts/install-deps.sh
``` ```
If rustup was installed for the first time, it will be required to source the If rustup was installed for the first time, it will be required to source the

View File

@ -27,6 +27,34 @@ A restart is required for the change to take effect. On the boot after changing
the value, the system will perform a global reset (power off again) to complete the value, the system will perform a global reset (power off again) to complete
the change and ensure the IME is operating in a valid state. the change and ensure the IME is operating in a valid state.
### Checking the state
coreboot will log some IME data to cbmem during startup. This can be used to
check if it is in the correct state.
```
make -C coreboot/util/cbmem
sudo ./coreboot/util/cbmem/cbmem -c
```
When disabled it will report:
```
ME: Current Working State : 4
ME: Current Operation State : 1
ME: Current Operation Mode : 3
ME: Error Code : 2
```
When enabled it will report:
```
ME: Current Working State : 5
ME: Current Operation State : 1
ME: Current Operation Mode : 0
ME: Error Code : 0
```
## Tiger Lake-U ## Tiger Lake-U
Models using TGL-U processors default to having the IME enabled. TGL-U removes Models using TGL-U processors default to having the IME enabled. TGL-U removes

2
ec

Submodule ec updated: 01907011bb...01be30f107

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=230b1cbc-6df5-437a-a364-b61f9fa6a4f6
EC_FMP_UUID=45a6839a-1666-40e3-8e90-103de469f025

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=baaca94e-b8e8-4357-acb9-35819eeba12b
EC_FMP_UUID=3e21b09a-c90c-43b7-a9e9-07704264d44a

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=6f4bb433-7ba2-4665-8793-72583a11ca06
EC_FMP_UUID=7e1cd184-2ef7-490c-9201-c3229b9361b8

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=ddb89e07-21a5-4fc4-a489-a1dd805de663
EC_FMP_UUID=38bf32e8-d40d-47cd-9412-cd362779ad1b

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=2cf0f73c-f043-425a-a50e-111169eb6697
EC_FMP_UUID=50cb5c95-5618-49b9-a075-ce47d990daad

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=6b4f28e4-5042-4800-b8ed-c7eabca4cca0
EC_FMP_UUID=9fd9e876-faa4-4967-9bc4-1b2e4e9e82eb

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=66291ad4-79c0-4729-b500-fe86a622a171
EC_FMP_UUID=1b94f5e0-4e3e-4575-adec-dedab7ab9691

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=519360a8-111a-4279-b55c-fd7d62e24f1c
EC_FMP_UUID=d16d934a-68ac-4381-99ab-eb1dfdb97ada

View File

@ -9,4 +9,4 @@
- HAP: false - HAP: false
- [ME](./me.rom) - [ME](./me.rom)
- Size: 4824 KB - Size: 4824 KB
- Version: 16.0.15.1829 - Version: 16.1.25.2124

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=8e9eebcd-21c7-4187-b0c8-b4aa11ab8152
EC_FMP_UUID=caa0f156-d2ef-4ed6-949e-322eff2f2c74

BIN
models/darp8/fd.rom (Stored with Git LFS)

Binary file not shown.

BIN
models/darp8/me.rom (Stored with Git LFS)

Binary file not shown.

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=7119893e-9d2e-4664-8c6a-a0cba1943a11
EC_FMP_UUID=08a7e5c7-e04e-4968-a2db-cbc3d2392f0d

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=0a72c745-f2b5-47ee-9f06-596a10c6d91b
EC_FMP_UUID=6cc60ab6-68fe-4cd7-a2af-498ccea8f154

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=748a5cf7-5d6d-48aa-88ac-9a58a7707ad7
EC_FMP_UUID=5bbc4600-9f7b-424d-bc7a-f31528ad6887

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=f7ff804e-00d1-4879-9fbc-5d9e98aad921
EC_FMP_UUID=b4110dea-a9a5-4336-b3d2-1dda742f0755

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=0ba5d88e-b62e-424a-8a83-663668ff4319
EC_FMP_UUID=74b6d179-b96b-4ae3-8f68-38ffd421af36

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=35a5f4e2-697c-4789-887f-1f72180b4547
EC_FMP_UUID=b64c646c-f182-4601-bf4d-20857a8922d7

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=db152fa9-3a66-4071-92c5-3ee90990b7fb
EC_FMP_UUID=43bfc388-b206-4ba7-a4a3-690d28072837

View File

@ -9,4 +9,4 @@
- HAP: false - HAP: false
- [ME](./me.rom) - [ME](./me.rom)
- Size: 4824 KB - Size: 4824 KB
- Version: 16.0.15.1829 - Version: 16.1.25.2124

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=58363716-8335-497f-975e-c08c0267f574
EC_FMP_UUID=68000e4c-4a53-449d-95d9-4ddacbf90704

BIN
models/galp6/fd.rom (Stored with Git LFS)

Binary file not shown.

BIN
models/galp6/me.rom (Stored with Git LFS)

Binary file not shown.

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=8319b52f-25ca-4eba-a449-4873ba770983
EC_FMP_UUID=059d18e0-7e9e-444c-9f0b-53338775769d

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=9e6089d4-a7c3-4883-a183-baa05a178b9a
EC_FMP_UUID=d8dd8b0a-1e8a-4bb0-bbe6-3d7cc4ec55e0

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=fbf1ff7e-c73c-4a96-b736-c2f61a15ac11
EC_FMP_UUID=f9fb50d1-e096-41f4-b3f7-1c92cdc60f96

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=6f5ea998-26e4-460f-8253-4bc11dec9147
EC_FMP_UUID=171d941d-7945-4f93-991e-fbab63711a72

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=5b7a128a-be0e-4582-9369-2da230a0bfdc
EC_FMP_UUID=8fb07243-f361-4e86-9d3d-c8af04023ed9

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=49324634-74d5-45f8-8ff3-1d6cf55f0838
EC_FMP_UUID=19f88309-549b-4d41-b9d4-5109d4c7a43f

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=a5b63408-83c3-4286-b4b9-89dcb4dce2ab
EC_FMP_UUID=05db216c-9887-442c-83ad-def6976eaf2e

View File

@ -9,4 +9,4 @@
- HAP: false - HAP: false
- [ME](./me.rom) - [ME](./me.rom)
- Size: 4824 KB - Size: 4824 KB
- Version: 16.0.15.1829 - Version: 16.1.25.2124

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=30a601c2-017a-40e5-b699-edfb12010a68
EC_FMP_UUID=1b906e64-5b6e-4118-9c9f-0c7675ac5bd0

BIN
models/gaze17-3050/fd.rom (Stored with Git LFS)

Binary file not shown.

BIN
models/gaze17-3050/me.rom (Stored with Git LFS)

Binary file not shown.

View File

@ -9,4 +9,4 @@
- HAP: false - HAP: false
- [ME](./me.rom) - [ME](./me.rom)
- Size: 4824 KB - Size: 4824 KB
- Version: 16.0.15.1829 - Version: 16.1.25.2124

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=466987a3-59f2-45b2-8f33-b91a51cb19bb
EC_FMP_UUID=b708506b-a265-4e99-aec5-18a2704f739a

BIN
models/gaze17-3060-b/fd.rom (Stored with Git LFS)

Binary file not shown.

BIN
models/gaze17-3060-b/me.rom (Stored with Git LFS)

Binary file not shown.

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=c950bb89-fb68-4c77-802b-6634d986951f
EC_FMP_UUID=cdc7a1fb-eb74-44ae-b886-42e1410d4227

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=6ea0e16f-746e-4799-949c-f4eb087963bf
EC_FMP_UUID=a53fb0e2-1bb3-4844-955b-d6109273062e

View File

@ -9,4 +9,4 @@
- HAP: false - HAP: false
- [ME](./me.rom) - [ME](./me.rom)
- Size: 4824 KB - Size: 4824 KB
- Version: 16.0.15.1829 - Version: 16.1.25.2124

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=eae9abe0-3ebe-4fa1-9a77-03d934196343
EC_FMP_UUID=e20fdee2-8f47-40fc-a53d-635b6834adc5

BIN
models/lemp11/fd.rom (Stored with Git LFS)

Binary file not shown.

BIN
models/lemp11/me.rom (Stored with Git LFS)

Binary file not shown.

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=2ba3e971-8799-4709-ab2a-7bb28da045f9
EC_FMP_UUID=87f66db7-9f59-4985-80c0-f5db88556203

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=546cc02a-e435-4ba3-83c0-6fa96c348d79
EC_FMP_UUID=0b653180-a2a6-4703-8cc1-00de43b8a1fa

View File

@ -9,4 +9,4 @@
- HAP: false - HAP: false
- [ME](./me.rom) - [ME](./me.rom)
- Size: 4824 KB - Size: 4824 KB
- Version: 16.0.15.1829 - Version: 16.1.25.2124

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=99c70651-493f-4516-9319-cf9b9c1ea26a
EC_FMP_UUID=1ec9ca56-ca05-448e-8362-5c78bb515246

BIN
models/oryp10/fd.rom (Stored with Git LFS)

Binary file not shown.

BIN
models/oryp10/me.rom (Stored with Git LFS)

Binary file not shown.

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=f915bafe-7912-49c2-9052-076119a4165e
EC_FMP_UUID=963780ec-770e-4f9c-b8a2-50ff08be72d0

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=f17c6779-3053-4326-a176-1bfaac00f961
EC_FMP_UUID=392db467-b100-47e8-a2df-c12a5bd8256e

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=778469a7-ab6c-441c-86e0-af6ea763c451
EC_FMP_UUID=45432a47-7c45-4833-a05e-deed6556581d

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=d4d3b541-5e6a-4a66-ae93-aa832aa58802
EC_FMP_UUID=85db9eab-4df6-4ddf-ac96-d3fe58ec7f30

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=2d71caa4-f991-4cc8-835d-89985b1df0cb
EC_FMP_UUID=835b51bc-e0d0-4f31-b523-c1844056a6ce

View File

@ -9,4 +9,4 @@
- HAP: false - HAP: false
- [ME](./me.rom) - [ME](./me.rom)
- Size: 4824 KB - Size: 4824 KB
- Version: 16.0.15.1829 - Version: 16.1.25.2124

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=ab019fe3-5528-475c-b27f-f6add0e38dd3
EC_FMP_UUID=0116b87c-b7c8-4ec0-8b32-63d783d3f908

BIN
models/oryp9/fd.rom (Stored with Git LFS)

Binary file not shown.

BIN
models/oryp9/me.rom (Stored with Git LFS)

Binary file not shown.

View File

@ -7,3 +7,7 @@ SERIAL_DRIVER_ENABLE=FALSE
SHELL_TYPE=NONE SHELL_TYPE=NONE
TPM_ENABLE=TRUE TPM_ENABLE=TRUE
#SYSTEM76_EC_LOGGING=TRUE #SYSTEM76_EC_LOGGING=TRUE
# FMP UUIDs for ESRT
SYSTEM_FMP_UUID=7aa20a68-da5a-4232-9c6d-438e49804ff6
EC_FMP_UUID=4b03cb51-b3f8-4921-9e64-68998cb3f6ed

View File

@ -1,3 +1,3 @@
[toolchain] [toolchain]
channel = "nightly-2023-01-21" channel = "nightly-2023-09-07"
components = ["rust-src"] components = ["rust-src"]

View File

@ -2,7 +2,7 @@
set -e set -e
if [ -z "$1" -o ! -e "$1" -o -z "$2" ] if [ -z "$1" ] || [ ! -e "$1" ] || [ -z "$2" ]
then then
echo "$0 [coreboot.config] [coreboot.rom]" >&2 echo "$0 [coreboot.config] [coreboot.rom]" >&2
exit 1 exit 1
@ -10,7 +10,7 @@ fi
CONFIG="$(realpath "$1")" CONFIG="$(realpath "$1")"
COREBOOT="$(realpath "$2")" COREBOOT="$(realpath "$2")"
function check_configs() { check_configs() {
local defconfig="$1" local defconfig="$1"
while read -r line; do while read -r line; do
@ -32,10 +32,6 @@ function check_configs() {
} }
pushd coreboot >/dev/null pushd coreboot >/dev/null
if [ ! -d util/crossgcc/xgcc ]
then
make CPUS="$(nproc)" crossgcc-i386
fi
make distclean make distclean
make defconfig KBUILD_DEFCONFIG="${CONFIG}" make defconfig KBUILD_DEFCONFIG="${CONFIG}"
check_configs "${CONFIG}" check_configs "${CONFIG}"

View File

@ -1,8 +1,10 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC1090
set -e set -e
if [ -z "$1" -o ! -e "$1" -o -z "$2" ] if [ -z "$1" ] || [ ! -e "$1" ] || [ -z "$2" ]
then then
echo "$0 <config> <output>" >&2 echo "$0 <config> <output>" >&2
exit 1 exit 1
@ -15,7 +17,8 @@ while read line; do
fi fi
done < "$1" done < "$1"
source "$1" BUILD_DIR="build"
make -C ec VERSION="${VERSION}" "${EC_ARGS[@]}" clean
make -C ec VERSION="${VERSION}" "${EC_ARGS[@]}" -j "$(nproc)" make -C ec BUILD="$BUILD_DIR" clean
cp "ec/build/${BOARD}/${VERSION}/ec.rom" "$2" make -C ec VERSION="${VERSION}" "${EC_ARGS[@]}" BUILD="$BUILD_DIR" -j "$(nproc)"
cp "ec/$BUILD_DIR/ec.rom" "$2"

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC1091
set -e set -e
if [ -z "$1" ] if [ -z "$1" ]
@ -14,12 +16,7 @@ BUILD_TYPE=RELEASE
#BUILD_TYPE=DEBUG #BUILD_TYPE=DEBUG
TOOLCHAIN=COREBOOT TOOLCHAIN=COREBOOT
COREBOOT_TOOLS_DEF="${PWD}/coreboot/payloads/external/edk2/tools_def.txt" COREBOOT_TOOLS_DEF="$XGCCPATH/../share/edk2config/tools_def.txt"
export GCC_CC_x86_32="${PWD}/coreboot/util/crossgcc/xgcc/bin/i386-elf-gcc"
export GCC_CC_x86_64="${PWD}/coreboot/util/crossgcc/xgcc/bin/x86_64-elf-gcc"
export OBJCOPY_x86_32="${PWD}/coreboot/util/crossgcc/xgcc/bin/i386-elf-objcopy"
export OBJCOPY_x86_64="${PWD}/coreboot/util/crossgcc/xgcc/bin/x86_64-elf-objcopy"
export NASM_PREFIX="${PWD}/coreboot/util/crossgcc/xgcc/bin/"
# Force use of python3 # Force use of python3
export PYTHON_COMMAND=python3 export PYTHON_COMMAND=python3

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2034
if [ ! -d "models/${MODEL}" ] if [ ! -d "models/${MODEL}" ]
then then
echo "model '${MODEL}' not found" >&2 echo "model '${MODEL}' not found" >&2

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2034
SPIPI=${SPIPI:-"system76@spipi.local"} SPIPI=${SPIPI:-"system76@spipi.local"}
if [ ! -d "models/${MODEL}" ] if [ ! -d "models/${MODEL}" ]

View File

@ -2,8 +2,8 @@
set -e set -e
# TODO: Move this to build scripts that require it on Debian export XGCCPATH="${XGCCPATH:-$PWD/coreboot/util/crossgcc/xgcc/bin}"
PATH="$PATH:/usr/sbin" export PATH="$XGCCPATH:$PATH:/usr/sbin"
if [ -z "$1" ] if [ -z "$1" ]
then then
@ -24,6 +24,9 @@ REV="$(git describe --always --dirty --abbrev=7)"
VERSION="${DATE}_${REV}" VERSION="${DATE}_${REV}"
echo "Building '${VERSION}' for '${MODEL}'" echo "Building '${VERSION}' for '${MODEL}'"
# Path to edk2's Python script to generate UEFI capsules
GENERATE_CAPSULE="./edk2/BaseTools/BinWrappers/PosixLike/GenerateCapsule"
# Clean build directory # Clean build directory
mkdir -p build mkdir -p build
BUILD="$(realpath "build/${MODEL}")" BUILD="$(realpath "build/${MODEL}")"
@ -46,7 +49,7 @@ EDK2_ARGS+=(
) )
# Rebuild gop-policy (used by edk2) # Rebuild gop-policy (used by edk2)
if [ -e "${MODEL_DIR}/IntelGopDriver.inf" -a -e "${MODEL_DIR}/vbt.rom" ] if [ -e "${MODEL_DIR}/IntelGopDriver.inf" ] && [ -e "${MODEL_DIR}/vbt.rom" ]
then then
touch apps/gop-policy/Cargo.toml touch apps/gop-policy/Cargo.toml
FIRMWARE_OPEN_VBT="${MODEL_DIR}/vbt.rom" \ FIRMWARE_OPEN_VBT="${MODEL_DIR}/vbt.rom" \
@ -62,13 +65,16 @@ if [ -e "${MODEL_DIR}/edk2.config" ]
then then
while read line while read line
do do
if [[ "$line" != "#"* ]] if [ -n "$line" ] && [[ "$line" != "#"* ]]
then then
EDK2_ARGS+=(-D "$line") EDK2_ARGS+=(-D "$line")
fi fi
done < "${MODEL_DIR}/edk2.config" done < "${MODEL_DIR}/edk2.config"
fi fi
# Source edk2 config for FMP values
. "$MODEL_DIR/edk2.config"
# Rebuild UefiPayloadPkg using edk2 # Rebuild UefiPayloadPkg using edk2
PACKAGES_PATH="${MODEL_DIR}:$(realpath apps)" \ PACKAGES_PATH="${MODEL_DIR}:$(realpath apps)" \
./scripts/_build/edk2.sh \ ./scripts/_build/edk2.sh \
@ -83,13 +89,33 @@ KERNELVERSION="${VERSION}" \
"${MODEL_DIR}/coreboot.config" \ "${MODEL_DIR}/coreboot.config" \
"${COREBOOT}" "${COREBOOT}"
if [ "$MODEL" != "qemu" ]; then
# Generate system firmware capsule
SYSTEM_FMP_VERSION=1
$GENERATE_CAPSULE -e \
--guid "$SYSTEM_FMP_UUID" \
--fw-version "$SYSTEM_FMP_VERSION" \
--lsv 0 \
-o "$BUILD/firmware.cap" \
"$BUILD/firmware.rom"
fi
# Rebuild EC firmware for System76 EC models # Rebuild EC firmware for System76 EC models
if [ ! -e "${MODEL_DIR}/ec.rom" -a -e "${MODEL_DIR}/ec.config" ] if [ ! -e "${MODEL_DIR}/ec.rom" ] && [ -e "${MODEL_DIR}/ec.config" ]
then then
env VERSION="${VERSION}" \ env VERSION="${VERSION}" \
./scripts/_build/ec.sh \ ./scripts/_build/ec.sh \
"${MODEL_DIR}/ec.config" \ "${MODEL_DIR}/ec.config" \
"${BUILD}/ec.rom" "${BUILD}/ec.rom"
# Generate EC firmware capsule
EC_FMP_VERSION=1
$GENERATE_CAPSULE -e \
--guid "$EC_FMP_UUID" \
--fw-version "$EC_FMP_VERSION" \
--lsv 0 \
-o "$BUILD/ec.cap" \
"$BUILD/ec.rom"
fi fi
if [ "${MODEL}" != "qemu" ] if [ "${MODEL}" != "qemu" ]

View File

@ -9,7 +9,7 @@ then
fi fi
MODEL="$1" MODEL="$1"
source scripts/_ch341a.sh . scripts/_ch341a.sh
flashrom -p ch341a_spi -c "${CHIP}" -r build/dump.rom flashrom -p ch341a_spi -c "${CHIP}" -r build/dump.rom

View File

@ -9,6 +9,6 @@ then
fi fi
MODEL="$1" MODEL="$1"
source scripts/_ch341a.sh . scripts/_ch341a.sh
flashrom -p ch341a_spi -c "${CHIP}" -w "build/${MODEL}/firmware.rom" flashrom -p ch341a_spi -c "${CHIP}" -w "build/${MODEL}/firmware.rom"

View File

@ -33,8 +33,8 @@ do
do do
parts+=("$part") parts+=("$part")
done done
parts[1]="$(printf '0x%08x' "$((${parts[1]} & 0xfffffffd))")" parts[1]="$(printf '0x%08x' "$((parts[1] & 0xfffffffd))")"
parts[2]="$(printf '0x%04x' "$((${parts[2]} & 0x00003c00))")" parts[2]="$(printf '0x%04x' "$((parts[2] & 0x00003c00))")"
case "${parts[1]}" in case "${parts[1]}" in
0x0???????) 0x0???????)

63
scripts/coreboot-sdk.sh Executable file
View File

@ -0,0 +1,63 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-only
# Build the coreboot toolchains
# shellcheck disable=SC1091
set -e
. /etc/os-release
if [ "$ID" = "arch" ] || [[ "$ID_LIKE" =~ "arch" ]]; then
sudo pacman -S --noconfirm \
bison \
bzip2 \
ca-certificates \
curl \
flex \
gcc \
gcc-ada \
make \
patch \
tar \
xz \
zlib
elif [ "$ID" = "fedora" ] || [[ "$ID_LIKE" =~ "fedora" ]]; then
sudo dnf install --assumeyes \
bison \
bzip2 \
ca-certificates \
curl \
flex \
gcc \
gcc-c++ \
gcc-gnat \
make \
patch \
tar \
xz \
zlib-devel
elif [ "$ID" = "ubuntu" ] || [[ "$ID_LIKE" =~ "debian" ]]; then
sudo apt-get --quiet update
sudo apt-get --quiet install --no-install-recommends --assume-yes \
bison \
bzip2 \
ca-certificates \
curl \
flex \
g++ \
gcc \
gnat \
make \
patch \
tar \
xz-utils \
zlib1g-dev
else
printf "\e[1;31munsupported host:\e[0m %s\n" "$ID"
exit 1
fi
make -C coreboot CPUS="$(nproc)" crossgcc-i386
make -C coreboot CPUS="$(nproc)" crossgcc-x64
make -C coreboot gitconfig

View File

@ -14,7 +14,6 @@ then
echo "model '${MODEL}' not found" >&2 echo "model '${MODEL}' not found" >&2
exit 1 exit 1
fi fi
MODEL_DIR="$(realpath "models/${MODEL}")"
DMI_MODEL="$(cat /sys/class/dmi/id/product_version)" DMI_MODEL="$(cat /sys/class/dmi/id/product_version)"
if [ "${DMI_MODEL}" != "${MODEL}" ] if [ "${DMI_MODEL}" != "${MODEL}" ]
@ -29,7 +28,7 @@ export BASEDIR="system76-firmware-update"
# Clean build directory # Clean build directory
mkdir -p build mkdir -p build
BUILD="$(realpath "build/${MODEL}")" BUILD="$(realpath "build/${MODEL}")"
rm -rf "${BUILD}/${BASEDIR}" rm -rf "${BUILD:?}/${BASEDIR}"
mkdir -p "${BUILD}/${BASEDIR}" mkdir -p "${BUILD}/${BASEDIR}"
# Rebuild and copy firmware-update # Rebuild and copy firmware-update
@ -50,7 +49,7 @@ fi
# Locate EFI partition mount path # Locate EFI partition mount path
EFI_PATH="$(bootctl --print-esp-path)" EFI_PATH="$(bootctl --print-esp-path)"
if [ -z "${EFI_PATH}" -o ! -d "${EFI_PATH}" ] if [ -z "${EFI_PATH}" ] || [ ! -d "${EFI_PATH}" ]
then then
echo "EFI system partition '${EFI_PATH}' not found" >&2 echo "EFI system partition '${EFI_PATH}' not found" >&2
exit 1 exit 1
@ -63,7 +62,7 @@ then
echo "EFI system partition name not found" >&2 echo "EFI system partition name not found" >&2
exit 1 exit 1
fi fi
EFI_PART="$(cat /sys/class/block/${EFI_PART_NAME}/partition)" EFI_PART="$(cat "/sys/class/block/${EFI_PART_NAME}/partition")"
# Locate EFI disk # Locate EFI disk
EFI_DISK="" EFI_DISK=""

View File

@ -28,9 +28,9 @@ do
count="$(echo "$line" | cut -d '[' -f2 | cut -d ']' -f1)" count="$(echo "$line" | cut -d '[' -f2 | cut -d ']' -f1)"
for i in $(seq 0 "$count") for i in $(seq 0 "$count")
do do
if [[ "$i" != "$count" ]] if [ "$i" != "$count" ]
then then
echo "DISPLAY_UPD($var[$i]);" echo "DISPLAY_UPD(${var[$i]});"
fi fi
done done
else else

View File

@ -2,6 +2,8 @@
# #
# Copyright 2020 System76 # Copyright 2020 System76
# shellcheck disable=SC2024
set -e set -e
SCRIPT_DIR=$(dirname "$0") SCRIPT_DIR=$(dirname "$0")
@ -54,8 +56,8 @@ cargo build --release
sudo target/release/coreboot-collector > "${MODEL_DIR}/coreboot-collector.txt" sudo target/release/coreboot-collector > "${MODEL_DIR}/coreboot-collector.txt"
popd popd
${SCRIPT_DIR}/coreboot-gpio.sh "${MODEL_DIR}/coreboot-collector.txt" > "${MODEL_DIR}/gpio.h" "${SCRIPT_DIR}/coreboot-gpio.sh" "${MODEL_DIR}/coreboot-collector.txt" > "${MODEL_DIR}/gpio.h"
${SCRIPT_DIR}/coreboot-hda.sh "${MODEL_DIR}/coreboot-collector.txt" > "${MODEL_DIR}/hda_verb.c" "${SCRIPT_DIR}/coreboot-hda.sh" "${MODEL_DIR}/coreboot-collector.txt" > "${MODEL_DIR}/hda_verb.c"
if [ -n "${BIOS_IMAGE}" ] if [ -n "${BIOS_IMAGE}" ]
then then
@ -108,4 +110,4 @@ then
fi fi
fi fi
${SCRIPT_DIR}/readmes.sh "${SCRIPT_DIR}/readmes.sh"

View File

@ -1,15 +1,17 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-only
# shellcheck disable=SC1091
set -eE set -eE
function msg { msg() {
echo -e "\x1B[1m$*\x1B[0m" >&2 echo -e "\x1B[1m$*\x1B[0m" >&2
} }
trap 'msg "\x1B[31mFailed to install dependencies!"' ERR trap 'msg "\x1B[31mFailed to install dependencies!"' ERR
source /etc/os-release . /etc/os-release
msg "Installing system build dependencies" msg "Installing system build dependencies"
if [[ "${ID}" =~ "debian" ]] || [[ "${ID_LIKE}" =~ "debian" ]]; then if [[ "${ID}" =~ "debian" ]] || [[ "${ID_LIKE}" =~ "debian" ]]; then
@ -17,7 +19,6 @@ if [[ "${ID}" =~ "debian" ]] || [[ "${ID_LIKE}" =~ "debian" ]]; then
sudo apt-get --quiet install \ sudo apt-get --quiet install \
--no-install-recommends \ --no-install-recommends \
--assume-yes \ --assume-yes \
bison \
build-essential \ build-essential \
ccache \ ccache \
cmake \ cmake \
@ -25,9 +26,7 @@ if [[ "${ID}" =~ "debian" ]] || [[ "${ID_LIKE}" =~ "debian" ]]; then
devmem2 \ devmem2 \
dosfstools \ dosfstools \
flashrom \ flashrom \
flex \
git-lfs \ git-lfs \
gnat \
libncurses-dev \ libncurses-dev \
libudev-dev \ libudev-dev \
msr-tools \ msr-tools \
@ -46,7 +45,6 @@ elif [[ "${ID}" =~ "fedora" ]] || [[ "${ID_LIKE}" =~ "fedora" ]]; then
curl \ curl \
dosfstools \ dosfstools \
flashrom \ flashrom \
gcc-gnat \
git-lfs \ git-lfs \
libuuid-devel \ libuuid-devel \
msr-tools \ msr-tools \
@ -61,14 +59,11 @@ elif [[ "${ID}" =~ "fedora" ]] || [[ "${ID_LIKE}" =~ "fedora" ]]; then
elif [[ "${ID}" =~ "arch" ]] || [[ "${ID_LIKE}" =~ "arch" ]]; then elif [[ "${ID}" =~ "arch" ]] || [[ "${ID_LIKE}" =~ "arch" ]]; then
sudo pacman -S \ sudo pacman -S \
--noconfirm \ --noconfirm \
bison \
ccache \ ccache \
cmake \ cmake \
curl \ curl \
dosfstools \ dosfstools \
flashrom \ flashrom \
flex \
gcc-ada \
git-lfs \ git-lfs \
msr-tools \ msr-tools \
mtools \ mtools \
@ -96,43 +91,16 @@ fi
msg "Initializing submodules" msg "Initializing submodules"
git submodule update --init --recursive --checkout --progress git submodule update --init --recursive --checkout --progress
msg "Installing coreboot commit hook" msg "Building coreboot toolchains"
curl -sSf https://review.coreboot.org/tools/hooks/commit-msg \ ./scripts/coreboot-sdk.sh
-o .git/modules/coreboot/hooks/commit-msg && \
chmod +x .git/modules/coreboot/hooks/commit-msg
RUSTUP_NEW_INSTALL=0 msg "Installing Rust toolchain and components"
if which rustup &> /dev/null; then ./scripts/install-rust.sh
msg "Updating rustup"
rustup self update
else
RUSTUP_NEW_INSTALL=1
msg "Installing Rust"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --default-toolchain stable
msg "Loading Rust environment"
source "${HOME}/.cargo/env"
fi
msg "Installing pinned Rust toolchain and components"
rustup show
msg "Installing EC dependencies" msg "Installing EC dependencies"
pushd ec pushd ec
./scripts/deps.sh ./scripts/deps.sh
popd popd
msg "Building coreboot toolchains"
pushd coreboot
make CPUS="$(nproc)" crossgcc-i386
make CPUS="$(nproc)" crossgcc-x64
popd
if [[ $RUSTUP_NEW_INSTALL = 1 ]]; then
msg "\x1B[33m>> rustup was just installed. Ensure cargo is on the PATH with:"
echo -e " source ~/.cargo/env\n"
fi
msg "\x1B[32mSuccessfully installed dependencies" msg "\x1B[32mSuccessfully installed dependencies"
echo "Ready to run ./scripts/build.sh [model]" >&2 echo "Ready to run ./scripts/build.sh [model]" >&2

31
scripts/install-rust.sh Executable file
View File

@ -0,0 +1,31 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-only
# Install Rust via rustup, along with the pinned toolchain.
# shellcheck shell=dash
# shellcheck disable=SC1091
set -Ee
RUSTUP_NEW_INSTALL=0
# NOTE: rustup is used to allow multiple toolchain installations.
if command -v rustup >/dev/null 2>&1; then
rustup self update
else
RUSTUP_NEW_INSTALL=1
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --default-toolchain stable
. "${HOME}/.cargo/env"
fi
# XXX: rustup has no command to install a toolchain from a TOML file.
# Rely on the fact that `show` will install the default toolchain.
rustup show
if [ "$RUSTUP_NEW_INSTALL" = "1" ]; then
printf "\e[33m>> rustup was just installed. Ensure cargo is on the PATH with:\e[0m\n"
printf " source ~/.cargo/env\n\n"
fi

View File

@ -2,21 +2,8 @@
set -e set -e
# if [ -z "$1" ]
# then
# echo "$0 [model]" >&2
# exit 1
# fi
# MODEL="$1"
MODEL="qemu" MODEL="qemu"
if [ ! -d "models/${MODEL}" ]
then
echo "model '${MODEL}' not found" >&2
exit 1
fi
MODEL_DIR="$(realpath "models/${MODEL}")"
qemu-system-x86_64 \ qemu-system-x86_64 \
-enable-kvm \ -enable-kvm \
-M q35 \ -M q35 \

View File

@ -12,7 +12,7 @@ cargo build --manifest-path "scripts/modeltool/Cargo.toml" --release
MODELTOOL="$(realpath "scripts/modeltool/target/release/modeltool")" MODELTOOL="$(realpath "scripts/modeltool/target/release/modeltool")"
function readme_model { readme_model() {
echo -e "\x1B[1m$1\x1B[0m" >&2 echo -e "\x1B[1m$1\x1B[0m" >&2
pushd "$1" > /dev/null pushd "$1" > /dev/null
@ -28,7 +28,7 @@ do
readme_model "${dir%/}" readme_model "${dir%/}"
done done
function readme_line { readme_line() {
echo -e " \x1B[1m$1\x1B[0m" >&2 echo -e " \x1B[1m$1\x1B[0m" >&2
name="$(basename "$1")" name="$(basename "$1")"
@ -42,7 +42,7 @@ function readme_line {
fi fi
submodule="$(git submodule status "$1" 2> /dev/null | cut -d ' ' -f 3 || true)" submodule="$(git submodule status "$1" 2> /dev/null | cut -d ' ' -f 3 || true)"
if [ "$submodule" == "$1" ] if [ "$submodule" = "$1" ]
then then
# Link to submodule URL # Link to submodule URL
origin="$(git -C "$1" remote get-url origin)" origin="$(git -C "$1" remote get-url origin)"
@ -53,7 +53,7 @@ function readme_line {
fi fi
} }
function readme_dir { readme_dir() {
echo -e "\x1B[1m$1\x1B[0m" >&2 echo -e "\x1B[1m$1\x1B[0m" >&2
pushd "$1" > /dev/null pushd "$1" > /dev/null

View File

@ -13,7 +13,7 @@ do
codec_sys="/sys/class/sound/${codec_id}" codec_sys="/sys/class/sound/${codec_id}"
vendor="$(cat "${codec_sys}/vendor_name")" vendor="$(cat "${codec_sys}/vendor_name")"
chip="$(cat "${codec_sys}/chip_name")" chip="$(cat "${codec_sys}/chip_name")"
if [ "${vendor}" == "Realtek" ] if [ "${vendor}" = "Realtek" ]
then then
echo "# ${codec_id}: ${vendor} ${chip}" echo "# ${codec_id}: ${vendor} ${chip}"
@ -27,7 +27,7 @@ do
do do
# Set coefficient index # Set coefficient index
index_hex="$(printf "0x%02x\n" "${index}")" index_hex="$(printf "0x%02x\n" "${index}")"
hda-verb "${codec}" "${nid}" SET_COEF_INDEX "${index_hex}" &>/dev/null hda-verb "${codec}" "${nid}" SET_COEF_INDEX "${index_hex}" >/dev/null 2>&1
# Get processing coefficient # Get processing coefficient
value="$(hda-verb "${codec}" "${nid}" GET_PROC_COEF 0 2>/dev/null | cut -d " " -f 3)" value="$(hda-verb "${codec}" "${nid}" GET_PROC_COEF 0 2>/dev/null | cut -d " " -f 3)"

View File

@ -8,7 +8,7 @@ REMOTES=(
set -e set -e
function git_remote { git_remote() {
echo -e "\x1B[1m$1\x1B[0m" echo -e "\x1B[1m$1\x1B[0m"
pushd "$1" > /dev/null pushd "$1" > /dev/null
if git remote | grep "^$2\$" if git remote | grep "^$2\$"
@ -23,5 +23,5 @@ function git_remote {
for remote in "${REMOTES[@]}" for remote in "${REMOTES[@]}"
do do
git_remote $remote git_remote "$remote"
done done

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2087
set -e set -e
if [ -z "$1" ] if [ -z "$1" ]
@ -9,7 +11,7 @@ then
fi fi
MODEL="$1" MODEL="$1"
source scripts/_spipi.sh . scripts/_spipi.sh
ssh -T "${SPIPI}" <<EOF ssh -T "${SPIPI}" <<EOF
cd firmware cd firmware

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2087
set -e set -e
if [ -z "$1" ] if [ -z "$1" ]
@ -9,7 +11,7 @@ then
fi fi
MODEL="$1" MODEL="$1"
source scripts/_spipi.sh . scripts/_spipi.sh
ssh -T "${SPIPI}" <<EOF ssh -T "${SPIPI}" <<EOF
cd firmware cd firmware

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# shellcheck disable=SC2087
set -e set -e
if [ -z "$1" ] if [ -z "$1" ]
@ -9,7 +11,7 @@ then
fi fi
MODEL="$1" MODEL="$1"
source scripts/_spipi.sh . scripts/_spipi.sh
sftp "${SPIPI}" <<EOF sftp "${SPIPI}" <<EOF
cd firmware cd firmware

View File

@ -1 +1,3 @@
#!/bin/sh
sudo flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=24000 "$@" sudo flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=24000 "$@"