Attention is currently required from: Arthur Heymans, Shelley Chen, Hung-Te Lin, Furquan Shaikh, Angel Pons, Yu-Ping Wu, Jianjun Wang.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/56791 )
Change subject: soc/mediatek: Add PCIe support
......................................................................
Patch Set 9:
(1 comment)
File src/soc/mediatek/common/pcie.c:
https://review.coreboot.org/c/coreboot/+/56791/comment/c6b01df1_685104b1
PS9, Line 103: devfn = (dev >> 12) & 0xf;
: val = PCIE_CFG_HEADER((dev >> 20) & 0xf, devfn);
This seems unnecessarily complex. Looks like this is equivalent: […]
It looks broken. `devfn` should be 8 bits wide unless there are
2 device at most in the whole PCI hierarchy. And given the mask
in PCIE_CFG_BUS() above, I guess the bus number should be 8 bits
wide too. To be readable, this should suit:
devfn = PCI_DEV2DEVFN(dev);
bus = PCI_DEV2SEGBUS(dev);
val = PCIE_CFG_HEADER(bus, devfn);
OTOH, if the 4-bit fields are correct, the macros should be fixed
to reflect that and a comment explaining the limits would be nice.
--
To view, visit
https://review.coreboot.org/c/coreboot/+/56791
To unsubscribe, or for help writing mail filters, visit
https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib9b6adaafa20aeee136372ec9564273f86776da0
Gerrit-Change-Number: 56791
Gerrit-PatchSet: 9
Gerrit-Owner: Jianjun Wang
jianjun.wang@mediatek.corp-partner.google.com
Gerrit-Reviewer: Hung-Te Lin
hungte@chromium.org
Gerrit-Reviewer: Shelley Chen
shchen@google.com
Gerrit-Reviewer: Yu-Ping Wu
yupingso@google.com
Gerrit-Reviewer: build bot (Jenkins)
no-reply@coreboot.org
Gerrit-CC: Angel Pons
th3fanbus@gmail.com
Gerrit-CC: Arthur Heymans
arthur.heymans@9elements.com
Gerrit-CC: Furquan Shaikh
furquan.m.shaikh@gmail.com
Gerrit-CC: Nico Huber
nico.h@gmx.de
Gerrit-CC: Paul Menzel
paulepanter@mailbox.org
Gerrit-Attention: Arthur Heymans
arthur.heymans@9elements.com
Gerrit-Attention: Shelley Chen
shchen@google.com
Gerrit-Attention: Hung-Te Lin
hungte@chromium.org
Gerrit-Attention: Furquan Shaikh
furquan.m.shaikh@gmail.com
Gerrit-Attention: Angel Pons
th3fanbus@gmail.com
Gerrit-Attention: Yu-Ping Wu
yupingso@google.com
Gerrit-Attention: Jianjun Wang
jianjun.wang@mediatek.corp-partner.google.com
Gerrit-Comment-Date: Fri, 31 Dec 2021 13:22:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Angel Pons
th3fanbus@gmail.com
Gerrit-MessageType: comment