Tim Wawrzynczak has submitted this change. ( https://review.coreboot.org/c/coreboot/+/58058 )
Change subject: ec/google/chromeec: Update some PD and DisplayPort APIs
......................................................................
ec/google/chromeec: Update some PD and DisplayPort APIs
1. Update google_chromeec_pd_get_amode() to return bitmask.
2. Update google_chromeec_wait_for_displayport() to handle the
updated return value of google_chromeec_pd_get_amode().
3. Drop google_chromeec_pd_get_amode() from ec.h and make it static
because it's not used outside of ec.c.
BUG=b:192947843
Signed-off-by: Derek Huang <derek.huang(a)intel.corp-partner.google.com>
Change-Id: I6020c4305e30018d4c97d862c16e8d642c951765
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58058
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Furquan Shaikh <furquan(a)google.com>
---
M src/ec/google/chromeec/ec.c
M src/ec/google/chromeec/ec.h
2 files changed, 29 insertions(+), 13 deletions(-)
Approvals:
build bot (Jenkins): Verified
Furquan Shaikh: Looks good to me, approved
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c
index 650fd14..9086693 100644
--- a/src/ec/google/chromeec/ec.c
+++ b/src/ec/google/chromeec/ec.c
@@ -1542,9 +1542,10 @@
* Check if EC/TCPM is in an alternate mode or not.
*
* @param svid SVID of the alternate mode to check
- * @return 0: Not in the mode. -1: Error. 1: Yes.
+ * @return 0: Not in the mode. -1: Error.
+ * >=1: bitmask of the ports that are in the mode.
*/
-int google_chromeec_pd_get_amode(uint16_t svid)
+static int google_chromeec_pd_get_amode(uint16_t svid)
{
struct ec_response_usb_pd_ports resp;
struct chromeec_command cmd = {
@@ -1557,6 +1558,7 @@
.cmd_dev_index = 0,
};
int i;
+ int ret = 0;
if (google_chromeec_command(&cmd) < 0)
return -1;
@@ -1582,12 +1584,12 @@
if (google_chromeec_command(&cmd) < 0)
return -1;
if (resp2.svid == svid)
- return 1;
+ ret |= BIT(i);
svid_idx++;
} while (resp2.svid);
}
- return 0;
+ return ret;
}
#define USB_SID_DISPLAYPORT 0xff01
@@ -1595,20 +1597,31 @@
/**
* Wait for DisplayPort to be ready
*
- * @param timeout Wait aborts after <timeout> ms.
- * @return 1: Success or 0: Timeout.
+ * @param timeout_ms Wait aborts after <timeout_ms> ms.
+ * @return -1: Error. 0: Timeout.
+ * >=1: Bitmask of the ports that DP device is connected
*/
-int google_chromeec_wait_for_displayport(long timeout)
+int google_chromeec_wait_for_displayport(long timeout_ms)
{
struct stopwatch sw;
+ int ret = 0;
printk(BIOS_INFO, "Waiting for DisplayPort\n");
- stopwatch_init_msecs_expire(&sw, timeout);
- while (google_chromeec_pd_get_amode(USB_SID_DISPLAYPORT) != 1) {
+ stopwatch_init_msecs_expire(&sw, timeout_ms);
+ while (1) {
+ ret = google_chromeec_pd_get_amode(USB_SID_DISPLAYPORT);
+ if (ret > 0)
+ break;
+
+ if (ret < 0) {
+ printk(BIOS_ERR, "Can't get alternate mode!\n");
+ return ret;
+ }
+
if (stopwatch_expired(&sw)) {
printk(BIOS_WARNING,
"DisplayPort not ready after %ldms. Abort.\n",
- timeout);
+ timeout_ms);
return 0;
}
mdelay(200);
@@ -1616,7 +1629,7 @@
printk(BIOS_INFO, "DisplayPort ready after %lu ms\n",
stopwatch_duration_msecs(&sw));
- return 1;
+ return ret;
}
int google_chromeec_get_keybd_config(struct ec_response_keybd_config *keybd)
diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h
index ebb7ae2..6fa58a9 100644
--- a/src/ec/google/chromeec/ec.h
+++ b/src/ec/google/chromeec/ec.h
@@ -26,7 +26,6 @@
int google_ec_running_ro(void);
enum ec_image google_chromeec_get_current_image(void);
void google_chromeec_init(void);
-int google_chromeec_pd_get_amode(uint16_t svid);
/* Check for the current mux state in EC
* in: int port physical port number of the type-c port
* out: uint8_t flags representing the status of the mux such as
@@ -36,7 +35,11 @@
/* Returns data role and type of device connected */
int google_chromeec_usb_pd_get_info(int port, bool *ufp, bool *dbg_acc,
bool *active_cable, uint8_t *dp_mode);
-int google_chromeec_wait_for_displayport(long timeout);
+/* Poll (up to `timeout_ms` ms) for DisplayPort to be ready
+ * Return: -1: Error. 0: Timeout.
+ * >=1: Bitmask of the ports that DP device is connected
+ */
+int google_chromeec_wait_for_displayport(long timeout_ms);
/* Device events */
uint64_t google_chromeec_get_device_enabled_events(void);
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://review.coreboot.org/c/coreboot/+/58058
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6020c4305e30018d4c97d862c16e8d642c951765
Gerrit-Change-Number: 58058
Gerrit-PatchSet: 5
Gerrit-Owner: Derek Huang <derek.huang(a)intel.corp-partner.google.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-MessageType: merged
Attention is currently required from: Paul Menzel, Derek Huang.
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/58058 )
Change subject: ec/google/chromeec: Update some PD and DisplayPort APIs
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4:
NM gerrit was being silly
--
To view, visit https://review.coreboot.org/c/coreboot/+/58058
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6020c4305e30018d4c97d862c16e8d642c951765
Gerrit-Change-Number: 58058
Gerrit-PatchSet: 4
Gerrit-Owner: Derek Huang <derek.huang(a)intel.corp-partner.google.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Derek Huang <derek.huang(a)intel.corp-partner.google.com>
Gerrit-Comment-Date: Wed, 06 Oct 2021 22:17:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Paul Menzel, Derek Huang.
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/58058 )
Change subject: ec/google/chromeec: Update some PD and DisplayPort APIs
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4:
Needs to be rebased
--
To view, visit https://review.coreboot.org/c/coreboot/+/58058
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6020c4305e30018d4c97d862c16e8d642c951765
Gerrit-Change-Number: 58058
Gerrit-PatchSet: 4
Gerrit-Owner: Derek Huang <derek.huang(a)intel.corp-partner.google.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Derek Huang <derek.huang(a)intel.corp-partner.google.com>
Gerrit-Comment-Date: Wed, 06 Oct 2021 22:17:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Sugnan Prabhu S, EricR Lai.
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/58137 )
Change subject: mb/google/brya: Disable unused i2s pins for BT offload
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/58137
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ifbc53848c6ad12e537216cac3c2871088c094f3d
Gerrit-Change-Number: 58137
Gerrit-PatchSet: 1
Gerrit-Owner: Sugnan Prabhu S <sugnan.prabhu.s(a)intel.com>
Gerrit-Reviewer: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Sugnan Prabhu S <sugnan.prabhu.s(a)intel.com>
Gerrit-Attention: EricR Lai <ericr_lai(a)compal.corp-partner.google.com>
Gerrit-Comment-Date: Wed, 06 Oct 2021 22:02:50 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Cliff Huang, Martin Roth, Tim Wawrzynczak, Rizwan Qureshi, Sridhar Siricilla, Bernardo Perez Priego, Andrew McRae.
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/55503 )
Change subject: util/cse_serger: Add a new tool for stitching CSE components
......................................................................
Patch Set 17:
(3 comments)
File util/cbfstool/bpdt_formats/subpart_entry_1.c:
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-129933):
https://review.coreboot.org/c/coreboot/+/55503/comment/0ab8ca5a_36067693
PS17, Line 49: printf("%-25s%-25s%-25s%-25s%-25s%-25s\n", "Entry #", "Name", "Offset", "Huffman Compressed?",
line over 96 characters
File util/cbfstool/cse_serger.c:
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-129933):
https://review.coreboot.org/c/coreboot/+/55503/comment/17b8193e_73ccb67b
PS17, Line 272: ERROR("Part(%d) exceeds file size. Part offset=0x%x, Part size = 0x%x, File size = 0x%zx\n",
line over 96 characters
Robot Comment from checkpatch (run ID jenkins-coreboot-checkpatch-129933):
https://review.coreboot.org/c/coreboot/+/55503/comment/6aca2da2_9a940927
PS17, Line 923: if (c < LONGOPT_START) {
braces {} are not necessary for any arm of this statement
--
To view, visit https://review.coreboot.org/c/coreboot/+/55503
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I90dd809b47fd16afdc80e66431312721082496aa
Gerrit-Change-Number: 55503
Gerrit-PatchSet: 17
Gerrit-Owner: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Andrew McRae <amcrae(a)google.com>
Gerrit-Reviewer: Bernardo Perez Priego <bernardo.perez.priego(a)intel.com>
Gerrit-Reviewer: Bernardo Perez Priego <bernardo.perez.priego(a)intel.corp-partner.google.com>
Gerrit-Reviewer: Cliff Huang <cliff.huang(a)intel.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Cliff Huang <cliff.huang(a)intel.com>
Gerrit-Attention: Martin Roth <martinroth(a)google.com>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Attention: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Attention: Bernardo Perez Priego <bernardo.perez.priego(a)intel.com>
Gerrit-Attention: Bernardo Perez Priego <bernardo.perez.priego(a)intel.corp-partner.google.com>
Gerrit-Attention: Andrew McRae <amcrae(a)google.com>
Gerrit-Comment-Date: Wed, 06 Oct 2021 20:40:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Cliff Huang, Martin Roth, Tim Wawrzynczak, Rizwan Qureshi, Sridhar Siricilla, Bernardo Perez Priego, Andrew McRae.
Hello build bot (Jenkins), Cliff Huang, Martin Roth, Patrick Georgi, Rizwan Qureshi, Tim Wawrzynczak, Sridhar Siricilla, Bernardo Perez Priego, Bernardo Perez Priego, Andrew McRae,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/55503
to look at the new patch set (#17).
Change subject: util/cse_serger: Add a new tool for stitching CSE components
......................................................................
util/cse_serger: Add a new tool for stitching CSE components
This change adds a new tool `cse_serger` which can be used to print,
dump and stitch together different components for the CSE region.
BUG=b:189177186
Change-Id: I90dd809b47fd16afdc80e66431312721082496aa
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
---
M Makefile.inc
M util/cbfstool/Makefile
M util/cbfstool/Makefile.inc
A util/cbfstool/bpdt_formats/Makefile.inc
A util/cbfstool/bpdt_formats/bpdt_1_6.c
A util/cbfstool/bpdt_formats/bpdt_1_7.c
A util/cbfstool/bpdt_formats/subpart_entry_1.c
A util/cbfstool/bpdt_formats/subpart_hdr_1.c
A util/cbfstool/bpdt_formats/subpart_hdr_2.c
A util/cbfstool/cse_serger.c
A util/cbfstool/cse_serger.h
11 files changed, 1,960 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/55503/17
--
To view, visit https://review.coreboot.org/c/coreboot/+/55503
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I90dd809b47fd16afdc80e66431312721082496aa
Gerrit-Change-Number: 55503
Gerrit-PatchSet: 17
Gerrit-Owner: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Andrew McRae <amcrae(a)google.com>
Gerrit-Reviewer: Bernardo Perez Priego <bernardo.perez.priego(a)intel.com>
Gerrit-Reviewer: Bernardo Perez Priego <bernardo.perez.priego(a)intel.corp-partner.google.com>
Gerrit-Reviewer: Cliff Huang <cliff.huang(a)intel.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Cliff Huang <cliff.huang(a)intel.com>
Gerrit-Attention: Martin Roth <martinroth(a)google.com>
Gerrit-Attention: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Attention: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Attention: Sridhar Siricilla <sridhar.siricilla(a)intel.com>
Gerrit-Attention: Bernardo Perez Priego <bernardo.perez.priego(a)intel.com>
Gerrit-Attention: Bernardo Perez Priego <bernardo.perez.priego(a)intel.corp-partner.google.com>
Gerrit-Attention: Andrew McRae <amcrae(a)google.com>
Gerrit-MessageType: newpatchset