Hello Felix Singer, build bot (Jenkins), Nico Huber, Patrick Georgi, Jeremy Soller, Christian Walter, Paul Menzel, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/45112
to look at the new patch set (#3).
Change subject: soc/intel: skl,cnl,icl,jsl,tgl: disable usb over-current pin by default
......................................................................
soc/intel: skl,cnl,icl,jsl,tgl: disable usb over-current pin by default
Fsp configures the USB over-current pin, regardless of the port being
configured as disabled. Thus, set the OC pin to 0xff ("disabled") in
this case.
This allows us to skip setting USBx_PORT_EMPTY in the devicetree for
disabled ports.
Change-Id: Ib8ea2ea26c0623d4db910e487b37255e907b299d
Signed-off-by: Michael Niewöhner <foss(a)mniewoehner.de>
---
M src/soc/intel/cannonlake/fsp_params.c
M src/soc/intel/icelake/fsp_params.c
M src/soc/intel/jasperlake/fsp_params.c
M src/soc/intel/skylake/chip.c
M src/soc/intel/tigerlake/fsp_params.c
5 files changed, 50 insertions(+), 30 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/45112/3
--
To view, visit https://review.coreboot.org/c/coreboot/+/45112
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib8ea2ea26c0623d4db910e487b37255e907b299d
Gerrit-Change-Number: 45112
Gerrit-PatchSet: 3
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Christian Walter <christian.walter(a)9elements.com>
Gerrit-Reviewer: Jeremy Soller <jeremy(a)system76.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45112 )
Change subject: soc/intel: skl,cnl,icl,jsl,tgl: disable usb over-current pin by default
......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45112/2/src/soc/intel/cannonlake/f…
File src/soc/intel/cannonlake/fsp_params.c:
https://review.coreboot.org/c/coreboot/+/45112/2/src/soc/intel/cannonlake/f…
PS2, Line 376: params->Usb2OverCurrentPin[i] = config->usb2_ports[i].ocpin;
> just ignore 2 vs 3 above; that's copy pasta faults ;) this was just to show "how" to do it in genera […]
oh, I just realized it's a bad idea to skip programming the other settings (variant 3), since then we would use the fsp defaults, which are _not_ 0. I'll go for variant 2
--
To view, visit https://review.coreboot.org/c/coreboot/+/45112
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib8ea2ea26c0623d4db910e487b37255e907b299d
Gerrit-Change-Number: 45112
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Christian Walter <christian.walter(a)9elements.com>
Gerrit-Reviewer: Jeremy Soller <jeremy(a)system76.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 05 Sep 2020 11:30:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Michael Niewöhner
Gerrit-MessageType: comment
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45112 )
Change subject: soc/intel: skl,cnl,icl,jsl,tgl: disable usb over-current pin by default
......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45112/2/src/soc/intel/cannonlake/f…
File src/soc/intel/cannonlake/fsp_params.c:
https://review.coreboot.org/c/coreboot/+/45112/2/src/soc/intel/cannonlake/f…
PS2, Line 376: params->Usb2OverCurrentPin[i] = config->usb2_ports[i].ocpin;
> oops... correction for variant 2: […]
just ignore 2 vs 3 above; that's copy pasta faults ;) this was just to show "how" to do it in general
--
To view, visit https://review.coreboot.org/c/coreboot/+/45112
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib8ea2ea26c0623d4db910e487b37255e907b299d
Gerrit-Change-Number: 45112
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Christian Walter <christian.walter(a)9elements.com>
Gerrit-Reviewer: Jeremy Soller <jeremy(a)system76.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 05 Sep 2020 11:05:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Michael Niewöhner
Gerrit-MessageType: comment
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45112 )
Change subject: soc/intel: skl,cnl,icl,jsl,tgl: disable usb over-current pin by default
......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45112/2/src/soc/intel/cannonlake/f…
File src/soc/intel/cannonlake/fsp_params.c:
https://review.coreboot.org/c/coreboot/+/45112/2/src/soc/intel/cannonlake/f…
PS2, Line 376: params->Usb2OverCurrentPin[i] = config->usb2_ports[i].ocpin;
> There are multiple ways of doing this different. I'm not sure what the "best" way is. […]
oops... correction for variant 2:
```
for (i = 0; i < ARRAY_SIZE(config->usb2_ports); i++) {
params->PortUsb20Enable[i] = config->usb2_ports[i].enable;
if (config->usb2_ports[i].enable)
params->Usb3OverCurrentPin[i] = config->usb3_ports[i].ocpin;
else
params->Usb3OverCurrentPin[i] = 0xff;
...
```
--
To view, visit https://review.coreboot.org/c/coreboot/+/45112
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib8ea2ea26c0623d4db910e487b37255e907b299d
Gerrit-Change-Number: 45112
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Christian Walter <christian.walter(a)9elements.com>
Gerrit-Reviewer: Jeremy Soller <jeremy(a)system76.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 05 Sep 2020 08:40:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Michael Niewöhner
Gerrit-MessageType: comment
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/45112 )
Change subject: soc/intel: skl,cnl,icl,jsl,tgl: disable usb over-current pin by default
......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/45112/2/src/soc/intel/cannonlake/f…
File src/soc/intel/cannonlake/fsp_params.c:
https://review.coreboot.org/c/coreboot/+/45112/2/src/soc/intel/cannonlake/f…
PS2, Line 376: params->Usb2OverCurrentPin[i] = config->usb2_ports[i].ocpin;
> Why the indirection when we can have a simple if/else […]
There are multiple ways of doing this different. I'm not sure what the "best" way is.
Variant 1 (as Felix suggested):
```
for (i = 0; i < ARRAY_SIZE(config->usb2_ports); i++) {
params->PortUsb20Enable[i] = config->usb2_ports[i].enable;
params->Usb3OverCurrentPin[i] = config->usb3_ports[i].enable ?
config->usb3_ports[i].ocpin :
0xff;
...
```
Variant 2 (I don't like this)
```
for (i = 0; i < ARRAY_SIZE(config->usb2_ports); i++) {
params->PortUsb20Enable[i] = config->usb2_ports[i].enable;
if (config->usb2_ports[i].enable) {
params->Usb3OverCurrentPin[i] = config->usb3_ports[i].enable ?
config->usb3_ports[i].ocpin :
0xff;
...
```
Variant 3 (changes logic for the other options, too)
```
memset(params->Usb3OverCurrentPin, 0xff, sizeof(params->Usb3OverCurrentPin));
for (i = 0; i < ARRAY_SIZE(config->usb2_ports); i++) {
if (!config->usb2_ports[i].enable)
continue;
params->PortUsb20Enable[i] = 1
params->Usb3OverCurrentPin[i] = config->usb3_ports[i].ocpin;
...
```
--
To view, visit https://review.coreboot.org/c/coreboot/+/45112
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib8ea2ea26c0623d4db910e487b37255e907b299d
Gerrit-Change-Number: 45112
Gerrit-PatchSet: 2
Gerrit-Owner: Michael Niewöhner
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Christian Walter <christian.walter(a)9elements.com>
Gerrit-Reviewer: Jeremy Soller <jeremy(a)system76.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sat, 05 Sep 2020 08:38:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Gerrit-MessageType: comment