Attention is currently required from: Rex-BC Chen.
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/56204 )
Change subject: soc/mediatek/mt8195: Get DRAM size from DRAM calibration result
......................................................................
Patch Set 1:
(1 comment)
File src/soc/mediatek/mt8195/emi.c:
https://review.coreboot.org/c/coreboot/+/56204/comment/2ac810ef_38c7c361
PS1, Line 10: size_t
I think the sdram_size may be called multiple times in ram stage (also rom stage).
Should we change this to
static size_t dram_size = 0;
if (dram_size)
return dram_size;
--
To view, visit https://review.coreboot.org/c/coreboot/+/56204
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic34f29d1692b94284b2cf6c5d91d323df736c76f
Gerrit-Change-Number: 56204
Gerrit-PatchSet: 1
Gerrit-Owner: Rex-BC Chen <rex-bc.chen(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Ryan Chuang <ryan.chuang(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Attention: Rex-BC Chen <rex-bc.chen(a)mediatek.corp-partner.google.com>
Gerrit-Comment-Date: Mon, 12 Jul 2021 02:53:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Hung-Te Lin.
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/56204 )
Change subject: soc/mediatek/mt8195: Get DRAM size from DRAM calibration result
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/56204
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic34f29d1692b94284b2cf6c5d91d323df736c76f
Gerrit-Change-Number: 56204
Gerrit-PatchSet: 1
Gerrit-Owner: Rex-BC Chen <rex-bc.chen(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Ryan Chuang <ryan.chuang(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Attention: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Comment-Date: Mon, 12 Jul 2021 02:53:04 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Hung-Te Lin, Ryan Chuang, Yu-Ping Wu.
Rex-BC Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/56203 )
Change subject: vc/mediatek/mt8195: Remove redundant code
......................................................................
Patch Set 2:
(1 comment)
File src/vendorcode/mediatek/mt8195/dramc/emi.c:
https://review.coreboot.org/c/coreboot/+/56203/comment/a3665423_14abeb77
PS1, Line 715: //int i;
> Could you take the chance to remove this (and line #717) as well?
Done
--
To view, visit https://review.coreboot.org/c/coreboot/+/56203
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I10b2d3c6cb3480f9e3e3232b5ce87ecf7074bbbf
Gerrit-Change-Number: 56203
Gerrit-PatchSet: 2
Gerrit-Owner: Rex-BC Chen <rex-bc.chen(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Ryan Chuang <ryan.chuang(a)mediatek.corp-partner.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: Ryan Chuang <ryan.chuang(a)mediatek.corp-partner.google.com>
Gerrit-Attention: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Comment-Date: Mon, 12 Jul 2021 02:45:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-MessageType: comment
Attention is currently required from: Hung-Te Lin, Ryan Chuang.
Hello Ryan Chuang,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/56204
to review the following change.
Change subject: soc/mediatek/mt8195: Get DRAM size from DRAM calibration result
......................................................................
soc/mediatek/mt8195: Get DRAM size from DRAM calibration result
Signed-off-by: Ryan Chuang <ryan.chuang(a)mediatek.corp-partner.google.com>
Change-Id: Ic34f29d1692b94284b2cf6c5d91d323df736c76f
---
M src/soc/mediatek/mt8195/emi.c
1 file changed, 15 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/56204/1
diff --git a/src/soc/mediatek/mt8195/emi.c b/src/soc/mediatek/mt8195/emi.c
index 120665a..7833707 100644
--- a/src/soc/mediatek/mt8195/emi.c
+++ b/src/soc/mediatek/mt8195/emi.c
@@ -1,8 +1,22 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+#include <console/console.h>
+#include <emi.h>
#include <soc/emi.h>
size_t sdram_size(void)
{
- return (size_t)4 * GiB;
+ int rank_num;
+ size_t dram_size = 0;
+ u64 rank_size[RANK_MAX];
+
+ get_rank_size_by_emi(rank_size);
+ rank_num = get_rank_nr_by_emi();
+
+ for (int i = 0; i < rank_num; i++)
+ dram_size += rank_size[i];
+
+ printk(BIOS_INFO, "dram size = %#lx\n", dram_size);
+
+ return dram_size;
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/56204
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic34f29d1692b94284b2cf6c5d91d323df736c76f
Gerrit-Change-Number: 56204
Gerrit-PatchSet: 1
Gerrit-Owner: Rex-BC Chen <rex-bc.chen(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Ryan Chuang <ryan.chuang(a)mediatek.corp-partner.google.com>
Gerrit-Attention: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Attention: Ryan Chuang <ryan.chuang(a)mediatek.corp-partner.google.com>
Gerrit-MessageType: newchange
Attention is currently required from: Hung-Te Lin, Rex-BC Chen, Ryan Chuang.
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/56203 )
Change subject: vc/mediatek/mt8195: Remove the redundant code
......................................................................
Patch Set 1:
(1 comment)
File src/vendorcode/mediatek/mt8195/dramc/emi.c:
https://review.coreboot.org/c/coreboot/+/56203/comment/bd663458_35443a4e
PS1, Line 715: //int i;
Could you take the chance to remove this (and line #717) as well?
--
To view, visit https://review.coreboot.org/c/coreboot/+/56203
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I10b2d3c6cb3480f9e3e3232b5ce87ecf7074bbbf
Gerrit-Change-Number: 56203
Gerrit-PatchSet: 1
Gerrit-Owner: Rex-BC Chen <rex-bc.chen(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Reviewer: Ryan Chuang <ryan.chuang(a)mediatek.corp-partner.google.com>
Gerrit-Reviewer: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Attention: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-Attention: Rex-BC Chen <rex-bc.chen(a)mediatek.corp-partner.google.com>
Gerrit-Attention: Ryan Chuang <ryan.chuang(a)mediatek.corp-partner.google.com>
Gerrit-Comment-Date: Mon, 12 Jul 2021 02:18:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Shelley Chen, Ravi kumar, Julius Werner, Prasad Malisetty, mturney mturney.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/53902 )
Change subject: sc7280: Add PCIe RC driver in Coreboot
......................................................................
Patch Set 22:
(1 comment)
File src/soc/qualcomm/sc7280/pcie_host.c:
https://review.coreboot.org/c/coreboot/+/53902/comment/ccd6d323_ddb6877e
PS22, Line 1139: setup_pcie_host
This change is duplicating the logic for training, scanning, assigning resources that is already provided by common code in coreboot. Please see device/pci_device.c, device/device.c, etc. on how this is handled. Examples of how SoCs currently use this common code support is any Intel/AMD platform. See `pci_domain_ops` to see how the different hooks are provided to read/set/scan/enable resources. You are going to need something similar for qualcomm SoC as well i.e. proper device operations that will use the hooks provided by the common code such that qualcomm controller specific work is provided by the SoC-specific code while making use of the common code for performing the standard PCIe operations. If you find something that is currently not provided in the common hooks,it would be helpful if you can outline the limitation. We can work on enabling the required support to ensure that we do not have to duplicate the entire scan/train/assign support in the SoC.
--
To view, visit https://review.coreboot.org/c/coreboot/+/53902
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iccf60aa56541f5230fa9c3f821d7709615c36631
Gerrit-Change-Number: 53902
Gerrit-PatchSet: 22
Gerrit-Owner: Ravi kumar <rbokka(a)codeaurora.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Prasad Malisetty <pmaliset(a)qualcomm.corp-partner.google.com>
Gerrit-Reviewer: Shelley Chen <shchen(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: mturney mturney <mturney(a)codeaurora.org>
Gerrit-CC: Furquan Shaikh <furquan(a)google.com>
Gerrit-CC: Ravi Kumar Bokka <c_rbokka(a)qualcomm.corp-partner.google.com>
Gerrit-Attention: Shelley Chen <shchen(a)google.com>
Gerrit-Attention: Ravi kumar <rbokka(a)codeaurora.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Prasad Malisetty <pmaliset(a)qualcomm.corp-partner.google.com>
Gerrit-Attention: mturney mturney <mturney(a)codeaurora.org>
Gerrit-Comment-Date: Mon, 12 Jul 2021 02:02:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Shelley Chen, Ravi kumar, Julius Werner, Prasad Malisetty, mturney mturney.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/53903 )
Change subject: libpayload: Add MMIO support in PCI lib
......................................................................
Patch Set 22:
(25 comments)
Patchset:
PS22:
This change should be split into at least the following 2 CLs:
1. Add support for passing PCI MMCONF info from coreboot to libpayload (i.e. adding PCI MMCONF base to coreboot tables in coreboot and parsing that info and saving that info in lib_sysinfo in libpayload).
2. Add support for performing PCI MMCONF operations in libpayload (This is the comment I posted in drivers/pci.c)
File payloads/libpayload/Kconfig:
https://review.coreboot.org/c/coreboot/+/53903/comment/88b902da_12d0da67
PS18, Line 401: MMCONF_SUPPORT
This config is not really required in libpayload. Coreboot already has this config and it should expose the coreboot table entry for `MMCONF_BASE_ADDRESS` only when `MMCONF_SUPPORT` is enabled in coreboot. Libpayload needs to basically check if the coreboot table entry is exposed and use pci mmio ops if MMCONF_BASE_ADDRESS is available, else fall back to pci io ops.
File payloads/libpayload/Kconfig:
https://review.coreboot.org/c/coreboot/+/53903/comment/e4befd85_af62cdf3
PS22, Line 401: MMCONF_SUPPORT
This config is not required in libpayload. Reasoning: We already have `MMCONF_SUPPORT` in coreboot which can be used to fill in pci_mmconf_info record. If that record is present, then libpayload knows that the platform supports PCI MMCONF ops.
We need special handling for PCI IO ops which are supported only on x86 platforms. That will require a Kconfig of its own.
File payloads/libpayload/configs/config.herobrine:
https://review.coreboot.org/c/coreboot/+/53903/comment/8b7ecda2_5574fdb9
PS18, Line 1: CONFIG_LP_CHROMEOS=y
Changes in this file should be pushed as a separate CL. Let's use this CL to basically enable support for pci mmio ops in libpayload.
File payloads/libpayload/configs/config.herobrine:
https://review.coreboot.org/c/coreboot/+/53903/comment/6ea27b16_b0c0515a
PS22, Line 7: CONFIG_LP_PCI=y
This is not really required. It is always set to 'y' in Kconfig.
https://review.coreboot.org/c/coreboot/+/53903/comment/f8649851_dbb7981f
PS22, Line 8: CONFIG_LP_PCIE_NVME
This config doesn't exist and is not required.
File payloads/libpayload/drivers/pci.c:
https://review.coreboot.org/c/coreboot/+/53903/comment/b3c82754_532845d5
PS22, Line 35: #if CONFIG(LP_MMCONF_SUPPORT)
: void *cfg_addr = lib_sysinfo.pci_ep_cfg_base + reg;
: return read8(cfg_addr);
: #endif
: outl(device | (reg & ~3), 0xCF8);
: return inb(0xCFC + (reg & 3));
Rather than forcing all architectures to define dummy in/out operations, it would be better to split this into two separate handlers. Something like this should work:
1. Create a file pci_io_ops.c and move all the current pci_{read|write}_config{8|16|32} definitions to it with names pci_io_{read|write}_config{8|16|32}. Define a structure `pci_ops` which pci_io_ops.c can initialize to the moved functions. Add a new Kconfig `PCI_IO_OPS` which will default to 'y' only for ARCH_X86.
2. Create a file pci_mmio_ops.c and add pci_mmio_{read|write}_config{8|16|32} functions and similarly initialize pci_mmio_ops structure.
3. In pci.c, provide a global `pci_ops` which can be set to appropriate ops structure and then used by the pci_{read|write}_config{8|16|32} functions. Following changes would be required here:
a. pci_set_ops: Set `pci_ops` to `pci_mmio_ops` if non-zero `pci_mmconf_base` is passed in coreboot tables. Else set to `pci_io_ops` if `PCI_IO_OPS` is selected.
b. pci_{read|write}_config{8|16|32}: These will have to add a `die_if(pci_ops == NULL, ""); to ensure pci_ops is properly initialized and call appropriate op using the ops structure: pci_ops->{read|write}{8|16|32}(...);
Finally, you will have to call `pci_set_ops()` for each architecture after `lib_get_sysinfo()` is done (and before pci_init for x86).
File payloads/libpayload/include/arm64/arch/io.h:
PS22:
I don't think we need to add dummy in/out operations to arm/arm64 files. See my comments in pci.c
File payloads/libpayload/include/coreboot_tables.h:
https://review.coreboot.org/c/coreboot/+/53903/comment/ca298e90_e49d1cde
PS22, Line 90: CB_TAG_PCI_EP_CONFIG
`CB_TAG_PCI_MMCONF`
https://review.coreboot.org/c/coreboot/+/53903/comment/ae89efcc_8219b766
PS22, Line 90:
Use tabs instead of spaces like other enums.
https://review.coreboot.org/c/coreboot/+/53903/comment/0d087180_b1ddfbe3
PS22, Line 243: EP
Drop EP and instead use MMCONF. Actually the structure name is self-descriptive. Comment isn't really required.
https://review.coreboot.org/c/coreboot/+/53903/comment/025905c3_d918cfbf
PS22, Line 244: cb_pci_config_info
`cb_pci_mmconf_info`
https://review.coreboot.org/c/coreboot/+/53903/comment/3c8ea995_bef21a62
PS22, Line 247: config_base
mmconf_base
File payloads/libpayload/include/sysinfo.h:
https://review.coreboot.org/c/coreboot/+/53903/comment/4431cc7e_9e25216b
PS22, Line 150: pci_ep_cfg_base
`uintptr_t pci_mmconf_base;`
File payloads/libpayload/libc/coreboot.c:
https://review.coreboot.org/c/coreboot/+/53903/comment/50596a13_930ef72b
PS22, Line 122: pci_ep_cfg_base
pci_mmconf_base
https://review.coreboot.org/c/coreboot/+/53903/comment/764474c4_ade864d6
PS22, Line 431: cb_parse_pci_ep_config_base
`cb_parse_pci_mmconf_info`
File src/commonlib/include/commonlib/coreboot_tables.h:
https://review.coreboot.org/c/coreboot/+/53903/comment/5d6d2ed2_9f99217f
PS22, Line 93: 0x00cd
Can you please use 0x0042 to avoid mixing up with CMOS-related options?
https://review.coreboot.org/c/coreboot/+/53903/comment/bbd18722_62c23054
PS22, Line 93: =
Please use tabs after the enum name to align `= <val>,` just like the other enums.
https://review.coreboot.org/c/coreboot/+/53903/comment/0359221b_12a75ad6
PS22, Line 93: LB_TAG_PCI_EP_CONFIG
Why EP? I think it would be better to name this `LB_TAG_PCI_MMCONF` or `LB_TAG_PCI_MMCONFIG` to indicate that this record provides PCI MMCONFIG information.
https://review.coreboot.org/c/coreboot/+/53903/comment/6715ea3b_9f180996
PS22, Line 332: lb_pci_config_info
Probably rename as `lb_pci_mmconfig_info`
https://review.coreboot.org/c/coreboot/+/53903/comment/ce14da32_12d64e8c
PS22, Line 335: void *config_base;
`uint64_t mmconf_base;`
File src/include/boot/coreboot_tables.h:
https://review.coreboot.org/c/coreboot/+/53903/comment/2b5b949f_64754f61
PS22, Line 24: /*Fill PCIe endpoint config window base address*/
: void lb_fill_ep_config_window(struct lb_pci_config_info *pci);
: void lb_add_pci(struct lb_header *header);
: void lb_add_pci_config(struct lb_pci_config_info *info,
: struct lb_pci_config_info *data);
None of these functions are required for back and forth with SoC code. You only need a single `lb_add_pci_mmconf()` and its scope can be limited to coreboot_tables.c.
There are already device Kconfigs for MMCONF base and length that can be used. Please see:
* MMCONF_BASE_ADDRESS
* MMCONF_LENGTH
File src/lib/coreboot_table.c:
https://review.coreboot.org/c/coreboot/+/53903/comment/0d06bcc2_53e0e0fa
PS22, Line 108: lb_fill_ep_config_window(pci);
There is no need to call back into SoC code. There are Kconfigs that already provide this information and utilized within other common code:
```
pci->mmconf_base = CONFIG_MMCONF_BASE_ADDRESS;
```
https://review.coreboot.org/c/coreboot/+/53903/comment/89132618_b437ccfe
PS22, Line 505: if (CONFIG(SC7280_PCIE_NVME))
You don't need SoC specific check here. There is already config `MMCONF_SUPPORT` that can be used:
```
if (CONFIG(MMCONF_SUPPORT))
lb_add_pci_mmconf(head);
```
File src/soc/qualcomm/sc7280/Kconfig:
https://review.coreboot.org/c/coreboot/+/53903/comment/d97209e7_80516146
PS22, Line 41: config SC7280_PCIE_NVME
This is not really required. Please see comment in `coreboot_table.c`.
--
To view, visit https://review.coreboot.org/c/coreboot/+/53903
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7cfb95e31b7ee984ee0c2e7586e6caeecd7deadd
Gerrit-Change-Number: 53903
Gerrit-PatchSet: 22
Gerrit-Owner: Ravi kumar <rbokka(a)codeaurora.org>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Prasad Malisetty <pmaliset(a)qualcomm.corp-partner.google.com>
Gerrit-Reviewer: Ravi Kumar Bokka <c_rbokka(a)qualcomm.corp-partner.google.com>
Gerrit-Reviewer: Shelley Chen <shchen(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: mturney mturney <mturney(a)codeaurora.org>
Gerrit-Attention: Shelley Chen <shchen(a)google.com>
Gerrit-Attention: Ravi kumar <rbokka(a)codeaurora.org>
Gerrit-Attention: Julius Werner <jwerner(a)chromium.org>
Gerrit-Attention: Prasad Malisetty <pmaliset(a)qualcomm.corp-partner.google.com>
Gerrit-Attention: mturney mturney <mturney(a)codeaurora.org>
Gerrit-Comment-Date: Sun, 11 Jul 2021 22:57:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment