Attention is currently required from: Arthur Heymans, Shelley Chen, Hung-Te Lin, Furquan Shaikh, 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:
(4 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/56791/comment/45a23d00_46b6176d
PS9, Line 12: - MT8195 Register Map V0.3-2, Chapter 3.18 PCIe controller (Page 1250)
Is this publicly available? If not, (how) can one obtain it?
Patchset:
PS9:
IMHO this patch does too much at once for review. PCIe is organized
in layers and this change seems to try to cover all at once. Some
parts are Mediatek specific, others are just PCI standard (like the
resource allocation). It would be nice to split at least all the
standard things into a separate patch (if there is anything left
that is not already covered by common coreboot code).
File src/soc/mediatek/common/Kconfig:
https://review.coreboot.org/c/coreboot/+/56791/comment/4c91d22b_abc07c5b
PS9, Line 46: bool "Enable MediaTek PCIe support"
Should this have a prompt? I guess at least the board code should know
if there is PCIe and select it? If that's the case, you could enable
NO_ECAM_MMCONF_SUPPORT conditionally for the SOC_MEDIATEK_COMMON
config above:
config SOC_MEDIATEK_COMMON
bool
select NO_ECAM_MMCONF_SUPPORT if PCI
Then the SoC/board Kconfig would only have to select PCI.
File src/soc/mediatek/common/pcie.c:
https://review.coreboot.org/c/coreboot/+/56791/comment/a9f27a9e_65c1e408
PS2, Line 329: mtk_pcie_gen3_probe
> > Sorry for the late response, the device_operations has been used by soc_ops, can we still add this […]
For the IO windows, you have to implement your own version of
pci_domain_read_resources(). Beside mtk_pcie_startup_port()
which looks vendor specific, these IO windows are the only
non-standard thing I've spotted.
Maybe setting the domain ops should be done per SoC, i.e.
in the follow-up change?
--
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(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Shelley Chen <shchen(a)google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-CC: Arthur Heymans <arthur.heymans(a)9elements.com>
Gerrit-CC: Furquan Shaikh <furquan.m.shaikh(a)gmail.com>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Arthur Heymans <arthur.heymans(a)9elements.com>
Gerrit-Attention: Shelley Chen <shchen(a)google.com>
Gerrit-Attention: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Attention: Furquan Shaikh <furquan.m.shaikh(a)gmail.com>
Gerrit-Attention: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Attention: Jianjun Wang <jianjun.wang(a)mediatek.corp-partner.google.com>
Gerrit-Comment-Date: Fri, 31 Dec 2021 13:00:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Arthur Heymans <arthur.heymans(a)9elements.com>
Comment-In-Reply-To: Shelley Chen <shchen(a)google.com>
Comment-In-Reply-To: Furquan Shaikh <furquan.m.shaikh(a)gmail.com>
Comment-In-Reply-To: Yu-Ping Wu <yupingso(a)google.com>
Comment-In-Reply-To: Jianjun Wang <jianjun.wang(a)mediatek.corp-partner.google.com>
Gerrit-MessageType: comment
Attention is currently required from: Shelley Chen, Hung-Te Lin, Furquan Shaikh, Yu-Ping Wu, Jianjun Wang.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/56791 )
Change subject: soc/mediatek: Add PCIe support
......................................................................
Patch Set 9:
(6 comments)
File src/soc/mediatek/common/include/soc/pcie_common.h:
https://review.coreboot.org/c/coreboot/+/56791/comment/a57c12cc_ac6e70e5
PS9, Line 6: #include <device/device.h>
Please add:
#include <types.h>
File src/soc/mediatek/common/pcie.c:
https://review.coreboot.org/c/coreboot/+/56791/comment/c7175f66_80c49ff6
PS9, Line 37: val
please add parentheses around macro parameters
https://review.coreboot.org/c/coreboot/+/56791/comment/5309f2a8_28a9ac77
PS9, Line 69:
remove space after `*` unary operator
https://review.coreboot.org/c/coreboot/+/56791/comment/0357fdb5_3e30bf54
PS9, Line 69: static const char * const ltssm_str[] = {
Is this Mediatek-specific?
https://review.coreboot.org/c/coreboot/+/56791/comment/c4d365d1_fcfacc8b
PS9, Line 103: devfn = (dev >> 12) & 0xf;
: val = PCIE_CFG_HEADER((dev >> 20) & 0xf, devfn);
This seems unnecessarily complex. Looks like this is equivalent:
val = (dev >> 12) & 0x0f0f;
I don't know where the 0xf masks come from. Maybe it's because the register fields are only 4 bits wide, but I don't have any datasheets to check.
https://review.coreboot.org/c/coreboot/+/56791/comment/26e0fd6f_ac87fdae
PS9, Line 218: 0x100000
What is this magic number?
--
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(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Shelley Chen <shchen(a)google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-CC: Arthur Heymans <arthur.heymans(a)9elements.com>
Gerrit-CC: Furquan Shaikh <furquan.m.shaikh(a)gmail.com>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Shelley Chen <shchen(a)google.com>
Gerrit-Attention: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Attention: Furquan Shaikh <furquan.m.shaikh(a)gmail.com>
Gerrit-Attention: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Attention: Jianjun Wang <jianjun.wang(a)mediatek.corp-partner.google.com>
Gerrit-Comment-Date: Fri, 31 Dec 2021 12:50:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment