David Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34400 )
Change subject: mb/google/hatch/var/kindred: Implement variant_devtree_update() ......................................................................
mb/google/hatch/var/kindred: Implement variant_devtree_update()
This change provides an implementation of variant_devtree_update() for kindred that disable eMMC controller when SKU ID is 1.
BUG=None TEST=Verify eMMC is disabled when SKU ID is 1
Change-Id: I8ccb4dae54f223881e0ced9e034bf45b994cc6f2 Signed-off-by: David Wu david_wu@quanta.corp-partner.google.com --- M src/mainboard/google/hatch/variants/kindred/Makefile.inc A src/mainboard/google/hatch/variants/kindred/variant.c 2 files changed, 38 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/00/34400/1
diff --git a/src/mainboard/google/hatch/variants/kindred/Makefile.inc b/src/mainboard/google/hatch/variants/kindred/Makefile.inc index 563275d..78f3812 100644 --- a/src/mainboard/google/hatch/variants/kindred/Makefile.inc +++ b/src/mainboard/google/hatch/variants/kindred/Makefile.inc @@ -21,3 +21,4 @@
bootblock-y += gpio.c ramstage-y += gpio.c +ramstage-y += variant.c diff --git a/src/mainboard/google/hatch/variants/kindred/variant.c b/src/mainboard/google/hatch/variants/kindred/variant.c new file mode 100644 index 0000000..786838e --- /dev/null +++ b/src/mainboard/google/hatch/variants/kindred/variant.c @@ -0,0 +1,37 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2019 Google LLC + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <baseboard/variants.h> +#include <soc/pci_devs.h> +#include <ec/google/chromeec/ec.h> + +#define SKU_UNKNOWN 0xFFFFFFFF + +void variant_devtree_update(void) +{ + uint32_t sku_id = SKU_UNKNOWN; + struct device *emmc_host; + + emmc_host = pcidev_path_on_root(PCH_DEVFN_EMMC); + + if (emmc_host == NULL) + return; + + /* SKU ID 1 does not have a eMMC device, hence disable it. */ + google_chromeec_cbi_get_sku_id(&sku_id); + if (sku_id == 1){ + emmc_host->enabled = 0; + } +}