Shelley Chen has submitted this change. ( https://review.coreboot.org/c/coreboot/+/70164 )
(
4 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: mb/google/herobrine: Mask out upper bits from sku_id() ......................................................................
mb/google/herobrine: Mask out upper bits from sku_id()
When retrieving the SKU id value through the sku_id() function in mainboard_needs_pcie_init(), we only want the values in the lower 5 bits as we can only represent SKU id up to 27. Everything in the higher bits should be masked out because they are not needed.
BUG=b:254281839 BRANCH=None TEST=Make sure that NVMe is not initialized Tested on a herobrine board with SKU id 0
Change-Id: I0e786ec392b5e1484cb2ff6d83a8d4fdd698950c Signed-off-by: Shelley Chen shchen@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/70164 Reviewed-by: Julius Werner jwerner@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/google/herobrine/mainboard.c 1 file changed, 29 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved
diff --git a/src/mainboard/google/herobrine/mainboard.c b/src/mainboard/google/herobrine/mainboard.c index 2648392..c9bca73 100644 --- a/src/mainboard/google/herobrine/mainboard.c +++ b/src/mainboard/google/herobrine/mainboard.c @@ -91,7 +91,12 @@ */ bool mainboard_needs_pcie_init(void) { - uint32_t sku = sku_id(); + /* + * Mask out everything above the actual SKU bits We have 3 sku pins, + * each tristate, so we can represent numbers up to 27, or 5 bits + */ + uint32_t sku_bits_mask = 0xff; + uint32_t sku = sku_id() & sku_bits_mask;
if (sku == CROS_SKU_UNKNOWN) { printk(BIOS_WARNING, "Unknown SKU (%#x); assuming PCIe", sku);