summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJianjun Wang <jianjun.wang@mediatek.com>2022-03-31 15:34:34 +0800
committerShelley Chen <shchen@google.com>2022-05-19 16:34:55 +0000
commitd16c2aa6de75fb5f0bc4d73e77891461c6977968 (patch)
tree51e99f00f4647c976257500f0e2be903f352a883 /src/lib
parentcd259cb08a99812082f8bb2f7ecd23c031bb4e2d (diff)
downloadcoreboot-d16c2aa6de75fb5f0bc4d73e77891461c6977968.tar.gz
coreboot-d16c2aa6de75fb5f0bc4d73e77891461c6977968.tar.bz2
coreboot-d16c2aa6de75fb5f0bc4d73e77891461c6977968.zip
coreboot_tables: Add PCIe info to coreboot table
Add 'lb_fill_pcie' function to pass PCIe information from coreboot to libpayload, and add CB_ERR_NOT_IMPLEMENTED to the cb_err enum for the __weak function. ARM platform usually does not have common address for PCIe to access the configuration space of devices. Therefore, new API is added to pass the base address of PCIe controller for payloads to access PCIe devices. TEST=Build pass and boot up to kernel successfully via SSD on Dojo board, here is the SSD information in boot log: == NVME IDENTIFY CONTROLLER DATA == PCI VID : 0x15b7 PCI SSVID : 0x15b7 SN : 21517J440114 MN : WDC PC SN530 SDBPTPZ-256G-1006 RAB : 0x4 AERL : 0x7 SQES : 0x66 CQES : 0x44 NN : 0x1 Identified NVMe model WDC PC SN530 SDBPTPZ-256G-1006 BUG=b:178565024 BRANCH=cherry Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com> Change-Id: I6cdce21efc66aa441ec077e6fc1d5d1c6a9aafb0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63251 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Shelley Chen <shchen@google.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/coreboot_table.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c
index ebaa3a52f555..2a7ccc5f55c0 100644
--- a/src/lib/coreboot_table.c
+++ b/src/lib/coreboot_table.c
@@ -33,6 +33,11 @@
void lb_string_platform_blob_version(struct lb_header *header);
#endif
+__weak enum cb_err lb_fill_pcie(struct lb_pcie *pcie)
+{
+ return CB_ERR_NOT_IMPLEMENTED;
+}
+
static struct lb_header *lb_table_init(unsigned long addr)
{
struct lb_header *header;
@@ -118,6 +123,16 @@ void lb_add_console(uint16_t consoletype, void *data)
console->type = consoletype;
}
+static void lb_pcie(struct lb_header *header)
+{
+ struct lb_pcie pcie = { .tag = LB_TAG_PCIE, .size = sizeof(pcie) };
+
+ if (lb_fill_pcie(&pcie) != CB_SUCCESS)
+ return;
+
+ memcpy(lb_new_record(header), &pcie, sizeof(pcie));
+}
+
static void lb_framebuffer(struct lb_header *header)
{
struct lb_framebuffer *framebuffer;
@@ -483,6 +498,9 @@ static uintptr_t write_coreboot_table(uintptr_t rom_table_end)
if (CONFIG(CONSOLE_USB))
lb_add_console(LB_TAG_CONSOLE_EHCI, head);
+ if (CONFIG(PCI))
+ lb_pcie(head);
+
/* Record our various random string information */
lb_strings(head);
if (CONFIG(PLATFORM_USES_FSP2_0))