mb/ocp/deltalake: Fix SMBIOS type 9 bugs
commitcfe15a20880ecb873942c4c272b6464448137d24
authorJohnny Lin <johnny_lin@wiwynn.com>
Tue, 5 Oct 2021 00:33:08 +0000 (5 08:33 +0800)
committerFelix Held <felix-coreboot@felixheld.de>
Mon, 11 Oct 2021 12:51:31 +0000 (11 12:51 +0000)
treefa73c2b83674123090672a66c984de950ce1bc89
parent08d304f05b1a1871014bf149c1982985b0feed87
mb/ocp/deltalake: Fix SMBIOS type 9 bugs

1. Fix PCIe slot capabilities not being really read from an IIO root
   port device. The Hot-Plug capability of IIO root port cannot be
   enabled due to FSP limitation (v2.1-0.2.2.0), but the code should
   reflect the true capabilities by reading the root port device's CSR.

2. Initialize the characteristics flags to 0 in the for-loop to fix the
   issue of the flags values persists to the next iterations.

Tested=On OCP Delta Lake, dmidecode -t 9 shows the expected results.
For example without the fix it shows 'Hot-plug devices are supported'
but in fact it's not:
System Slot Information
        Designation: SSD1_M2_Data_Drive
        Type: x4 PCI Express 3 x4
        Current Usage: Available
        Length: Short
        ID: 1
        Characteristics:
                3.3 V is provided
                PME signal is supported
                Hot-plug devices are supported
        Bus Address: 0000:00:1d.0

With the fix it shows the correct result:
Handle 0x0016, DMI type 9, 19 bytes
System Slot Information
        Designation: SSD1_M2_Data_Drive
        Type: x4 PCI Express 3 x4
        Current Usage: Available
        Length: Short
        ID: 1
        Characteristics:
                3.3 V is provided
                PME signal is supported
        Bus Address: 0000:00:1d.0

Change-Id: Iea437cdf3da5410b6b7a749a1be970f0948d92d9
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58100
Reviewed-by: Johnny Lin <Johnny_Lin@wiwynn.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
src/mainboard/ocp/deltalake/ramstage.c