Nicholas Chin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/69712 )
Change subject: util/scripts: Add script to summarize post code usages
......................................................................
util/scripts: Add script to summarize post code usages
This script finds all usages of post_code() and postcode macros in the
coreboot tree, sorts them by the raw hex value it evaluates to, and then
prints out the collected information including file and line number.
This is meant to assist with efforts to organize and standardize
postcodes in coreboot.
Change-Id: Idcc11ce2e5f6c9760537c549e36145b871276206
Signed-off-by: Nicholas Chin <nic.c3.14(a)gmail.com>
---
M util/scripts/description.md
A util/scripts/post_code_usage.sh
2 files changed, 66 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/69712/1
diff --git a/util/scripts/description.md b/util/scripts/description.md
index 780e9c9..fabad0ee 100644
--- a/util/scripts/description.md
+++ b/util/scripts/description.md
@@ -23,6 +23,8 @@
headers `Shell`
* _parse-maintainers.pl_ - Script to alphabetize MAINTAINERS file
`Perl`
+ * _post_code_usage.sh_ - Summarize all usages of post_code() and post
+ code macros in the tree `Bash`
* _rm_unused_code_ - Remove all code not used for a platform from the local
git repository for auditing or release `Bash`
* _show_platforms.sh_ - Makes a list of platforms in the tree. Does
diff --git a/util/scripts/post_code_usage.sh b/util/scripts/post_code_usage.sh
new file mode 100755
index 0000000..a182572
--- /dev/null
+++ b/util/scripts/post_code_usage.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# Searches the src tree for all calls to post_code() as well as all usages of
+# the post code macros. May miss post code like calls (board/vendor/platform
+# specific functions) that use raw hex values
+
+IFS=$'\n'
+
+# Header files with post code defines
+post_code_header="src/commonlib/include/commonlib/console/post_codes.h"
+amd_post_code_header="src/soc/amd/common/psp_verstage/include/psp_verstage.h"
+
+# Format defines as "MACRO_NAME 0xHH"
+post_macros=$(grep -Pho "(?<=#define )POST.*\s*0x.." $post_code_header \
+ $amd_post_code_header | sed -E "s/\s+/ /g")
+
+# All calls to post_code() using numeric literals instead of macros
+post_usage=$(grep -Pnr "^\s*post_code\(\d.*\)" src | \
+ sed -E "s/(.*:)\s*?(post_code\((.*)\))/\3\t\1\t\2/")
+
+# Search the tree for all usages of each post code macro (will take a while)
+for line in $post_macros; do
+ # Extract MACRO_NAME
+ macro=$(echo $line | cut -d " " -f 1)
+ # Extract hex value associated with macro
+ hex_code=$(echo $line | cut -d " " -f 2 | tr '[:upper:]' '[:lower:]')
+ # The negative lookbehind is to ensure it doesn't match cases where
+ # the macro is the prefix of another macro
+ # Format as "0xhh\t<grep filename:line>\t<raw line of code>"
+ macro_usage=$(grep -rPn "$macro(?![A-Z_])" src | \
+ sed -E "s/\s+/ /g" | sed -E "s/(.*:)\s*(.*)/$hex_code\t\1\t\2/")
+ post_usage=$post_usage$'\n'$macro_usage
+done
+
+post_usage=$(sort <<< $post_usage)
+last_hex_code=""
+
+# Print out the collected information
+for line in $post_usage; do
+ hex_code=$(echo $line | cut -d $'\t' -f 1)
+ if [[ $last_hex_code != $hex_code ]]; then
+ echo ""
+ fi
+ last_hex_code=$hex_code
+ echo $line
+done
--
To view, visit https://review.coreboot.org/c/coreboot/+/69712
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Idcc11ce2e5f6c9760537c549e36145b871276206
Gerrit-Change-Number: 69712
Gerrit-PatchSet: 1
Gerrit-Owner: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-MessageType: newchange
Attention is currently required from: Patrick Rudolph, Richard Hughes, Maximilian Brune, Angel Pons.
Nicholas Chin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/68995 )
Change subject: Documentation/sbom: Add SBOM Documentation
......................................................................
Patch Set 9: Code-Review+1
--
To view, visit https://review.coreboot.org/c/coreboot/+/68995
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I39fbcba60a0fbdbed9f662119ed7692c0a0fd30e
Gerrit-Change-Number: 68995
Gerrit-PatchSet: 9
Gerrit-Owner: Maximilian Brune <maximilian.brune(a)9elements.com>
Gerrit-Reviewer: Nicholas Chin <nic.c3.14(a)gmail.com>
Gerrit-Reviewer: Richard Hughes <richard(a)hughsie.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-CC: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Attention: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Attention: Richard Hughes <richard(a)hughsie.com>
Gerrit-Attention: Maximilian Brune <maximilian.brune(a)9elements.com>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Thu, 17 Nov 2022 04:55:33 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Vadim Bendebury, Martin L Roth, Patrick Georgi, Julius Werner.
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/69710 )
Change subject: build: List all Kconfigs in CBFS `config` file, compress it
......................................................................
Patch Set 2: Code-Review+2
(1 comment)
File Makefile.inc:
https://review.coreboot.org/c/coreboot/+/69710/comment/364e31bc_b014118e
PS1, Line 334: \
Is this `\` intended?
--
To view, visit https://review.coreboot.org/c/coreboot/+/69710
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I5259ec6f932cdc5780b8843f46dd476da9d19728
Gerrit-Change-Number: 69710
Gerrit-PatchSet: 2
Gerrit-Owner: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Martin L Roth <gaumless(a)gmail.com>
Gerrit-Reviewer: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Vadim Bendebury <vbendeb(a)chromium.org>
Gerrit-Attention: Vadim Bendebury <vbendeb(a)chromium.org>
Gerrit-Attention: Martin L Roth <gaumless(a)gmail.com>
Gerrit-Attention: Patrick Georgi <patrick(a)coreboot.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Comment-Date: Thu, 17 Nov 2022 04:24:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Hung-Te Lin, Liju-Clr Chen, johnson wang, Yidi Lin, Yu-Ping Wu.
Rex-BC Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/69688 )
Change subject: soc/mediatek/mt8188: Enable and initialize EINT
......................................................................
Patch Set 3: Code-Review+1
(3 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/69688/comment/af258672_10e3b089
PS1, Line 13: EINT event mask register is used to mask EINT wakeup source. All wakeup sources are masked by default. So we add a driver here to unmask all wakeup sources.
> too long
Done
https://review.coreboot.org/c/coreboot/+/69688/comment/38329ecb_d0c54620
PS1, Line 13: source
> sources
Done
https://review.coreboot.org/c/coreboot/+/69688/comment/f6257b95_56dd505c
PS1, Line 16: device wakes up using power button on MT8188 EVB.
> wake the device up by power key on MT8188 EVB.
Done
--
To view, visit https://review.coreboot.org/c/coreboot/+/69688
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I94b20909b0b8d77f75c41bc745f892baded7a54b
Gerrit-Change-Number: 69688
Gerrit-PatchSet: 3
Gerrit-Owner: johnson wang <johnson.wang(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Liju-Clr Chen <liju-clr.chen(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Rex-BC Chen <rex-bc.chen(a)mediatek.com>
Gerrit-Reviewer: Yidi Lin <yidilin(a)google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Attention: Liju-Clr Chen <liju-clr.chen(a)mediatek.corp-partner.google.com>
Gerrit-Attention: johnson wang <johnson.wang(a)mediatek.corp-partner.google.com>
Gerrit-Attention: Yidi Lin <yidilin(a)google.com>
Gerrit-Attention: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Comment-Date: Thu, 17 Nov 2022 03:58:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Yidi Lin <yidilin(a)google.com>
Gerrit-MessageType: comment
Attention is currently required from: Hung-Te Lin, Liju-Clr Chen, johnson wang, Yu-Ping Wu.
Rex-BC Chen has uploaded a new patch set (#3) to the change originally created by johnson wang. ( https://review.coreboot.org/c/coreboot/+/69688 )
Change subject: soc/mediatek/mt8188: Enable and initialize EINT
......................................................................
soc/mediatek/mt8188: Enable and initialize EINT
Issue:
Device can't wake up using power key.
Root cause and solution:
EINT event mask register is used to mask EINT wakeup sources. All
wakeup sources are masked by default. So we add a driver here to unmask
all wakeup sources.
BUG=none
TEST=wake the device up by power key on MT8188 EVB.
Signed-off-by: Johnson Wang <johnson.wang(a)mediatek.com>
Change-Id: I94b20909b0b8d77f75c41bc745f892baded7a54b
---
M src/soc/mediatek/mt8188/Makefile.inc
M src/soc/mediatek/mt8188/bootblock.c
2 files changed, 24 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/88/69688/3
--
To view, visit https://review.coreboot.org/c/coreboot/+/69688
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I94b20909b0b8d77f75c41bc745f892baded7a54b
Gerrit-Change-Number: 69688
Gerrit-PatchSet: 3
Gerrit-Owner: johnson wang <johnson.wang(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Liju-Clr Chen <liju-clr.chen(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Rex-BC Chen <rex-bc.chen(a)mediatek.com>
Gerrit-Reviewer: Yidi Lin <yidilin(a)google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Attention: Liju-Clr Chen <liju-clr.chen(a)mediatek.corp-partner.google.com>
Gerrit-Attention: johnson wang <johnson.wang(a)mediatek.corp-partner.google.com>
Gerrit-Attention: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Hung-Te Lin, Liju-Clr Chen, johnson wang, Yu-Ping Wu.
Rex-BC Chen has uploaded a new patch set (#2) to the change originally created by johnson wang. ( https://review.coreboot.org/c/coreboot/+/69688 )
Change subject: soc/mediatek/mt8188: Enable and initialize EINT
......................................................................
soc/mediatek/mt8188: Enable and initialize EINT
Issue:
Device can't wake up using power button.
Root cause and solution:
EINT event mask register is used to mask EINT wakeup sources. All
wakeup sources are masked by default. So we add a driver here to unmask
all wakeup sources.
BUG=none
TEST=device wakes up using power button on MT8188 EVB.
Signed-off-by: Johnson Wang <johnson.wang(a)mediatek.com>
Change-Id: I94b20909b0b8d77f75c41bc745f892baded7a54b
---
M src/soc/mediatek/mt8188/Makefile.inc
M src/soc/mediatek/mt8188/bootblock.c
2 files changed, 24 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/88/69688/2
--
To view, visit https://review.coreboot.org/c/coreboot/+/69688
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I94b20909b0b8d77f75c41bc745f892baded7a54b
Gerrit-Change-Number: 69688
Gerrit-PatchSet: 2
Gerrit-Owner: johnson wang <johnson.wang(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Liju-Clr Chen <liju-clr.chen(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Rex-BC Chen <rex-bc.chen(a)mediatek.com>
Gerrit-Reviewer: Yidi Lin <yidilin(a)google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Attention: Liju-Clr Chen <liju-clr.chen(a)mediatek.corp-partner.google.com>
Gerrit-Attention: johnson wang <johnson.wang(a)mediatek.corp-partner.google.com>
Gerrit-Attention: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Hung-Te Lin, Liju-Clr Chen, johnson wang, Yu-Ping Wu.
Yidi Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/69688 )
Change subject: soc/mediatek/mt8188: Enable and initialize EINT
......................................................................
Patch Set 1:
(3 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/69688/comment/df967065_abdb6c26
PS1, Line 13: EINT event mask register is used to mask EINT wakeup source. All wakeup sources are masked by default. So we add a driver here to unmask all wakeup sources.
too long
https://review.coreboot.org/c/coreboot/+/69688/comment/6c530280_9024ba65
PS1, Line 13: source
sources
https://review.coreboot.org/c/coreboot/+/69688/comment/b31d105e_821536d5
PS1, Line 16: device wakes up using power button on MT8188 EVB.
wake the device up by power key on MT8188 EVB.
--
To view, visit https://review.coreboot.org/c/coreboot/+/69688
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I94b20909b0b8d77f75c41bc745f892baded7a54b
Gerrit-Change-Number: 69688
Gerrit-PatchSet: 1
Gerrit-Owner: johnson wang <johnson.wang(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Liju-Clr Chen <liju-clr.chen(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Rex-BC Chen <rex-bc.chen(a)mediatek.com>
Gerrit-Reviewer: Yidi Lin <yidilin(a)google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Attention: Liju-Clr Chen <liju-clr.chen(a)mediatek.corp-partner.google.com>
Gerrit-Attention: johnson wang <johnson.wang(a)mediatek.corp-partner.google.com>
Gerrit-Attention: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Comment-Date: Thu, 17 Nov 2022 03:49:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Tarun Tuli.
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/69693 )
Change subject: [TEST] test firmware for crasskneto
......................................................................
Patch Set 1:
(3 comments)
File src/mainboard/google/brya/variants/craask/gpio.c:
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-163859):
https://review.coreboot.org/c/coreboot/+/69693/comment/0514e285_955ff43f
PS1, Line 48: /* Configure the WWAN GPIO pads */
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-163859):
https://review.coreboot.org/c/coreboot/+/69693/comment/46f8259d_08e9fdeb
PS1, Line 60: /* Configure the WLAN GPIO pads */
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-163859):
https://review.coreboot.org/c/coreboot/+/69693/comment/63eeb1e0_3fd976c1
PS1, Line 66: /* Configure the SSD GPIO pads */
code indent should use tabs where possible
--
To view, visit https://review.coreboot.org/c/coreboot/+/69693
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6b9c90abe562768ea2afff5608a8cfac764569d5
Gerrit-Change-Number: 69693
Gerrit-PatchSet: 1
Gerrit-Owner: Ren Kuo <ren.kuo(a)quanta.corp-partner.google.com>
Gerrit-Reviewer: Tarun Tuli <taruntuli(a)google.com>
Gerrit-CC: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Tarun Tuli <taruntuli(a)google.com>
Gerrit-Comment-Date: Thu, 17 Nov 2022 03:27:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment