mb/google/herobrine: NVMe id determined by logical (not physical) bit

NVMe is determined by a logical bit 1, not the physical SKU pin.
Thus, (logical) sku_id & 0x2 == 0x2 would mean that the device has
NVMe enabled on it.  Previously, I thought that it was tied to a
physical pin, but this is not correct.

BUG=b:254281839
BRANCH=None
TEST=flash and boot on villager and make sure that NVMe is not
     initialized in coreboot.

Change-Id: Iaa75d2418d6a2351d874842e8678bd6ad3c92526
Signed-off-by: Shelley Chen <shchen@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70230
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Shelley Chen 2022-12-01 13:40:53 -08:00
parent dddaeed4c1
commit e233fc7ac1
1 changed files with 6 additions and 14 deletions

View File

@ -85,18 +85,14 @@ static void display_startup(void)
} }
/* /*
* Determine if board need to perform PCIe initialization. On Herobrine, * Determine if board need to perform PCIe initialization. Will return true if
* resistor strapping will be such that bit 0 will be assigned 2 (high Z) if it * NVMe initialization is needed, or false if it is an eMMC device. On
* is an NVMe enabled platform. * Herobrine, if it is an NVMe enabled platform, logical sku_id & 2 will be
* true.
*/ */
bool mainboard_needs_pcie_init(void) 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) { if (sku == CROS_SKU_UNKNOWN) {
printk(BIOS_WARNING, "Unknown SKU (%#x); assuming PCIe", sku); printk(BIOS_WARNING, "Unknown SKU (%#x); assuming PCIe", sku);
@ -106,11 +102,7 @@ bool mainboard_needs_pcie_init(void)
return true; return true;
} }
if ((sku % 3) == 2) return !!(sku & 0x2);
return true;
/* Otherwise, eMMC */
return false;
} }
static void mainboard_init(struct device *dev) static void mainboard_init(struct device *dev)