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; + } +}
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34400 )
Change subject: mb/google/hatch/var/kindred: Implement variant_devtree_update() ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34400/1/src/mainboard/google/hatch/... File src/mainboard/google/hatch/variants/kindred/variant.c:
https://review.coreboot.org/c/coreboot/+/34400/1/src/mainboard/google/hatch/... PS1, Line 34: if (sku_id == 1){ space required before the open brace '{'
https://review.coreboot.org/c/coreboot/+/34400/1/src/mainboard/google/hatch/... PS1, Line 34: if (sku_id == 1){ braces {} are not necessary for single statement blocks
Hello Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34400
to look at the new patch set (#2).
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, 37 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/00/34400/2
David Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34400 )
Change subject: mb/google/hatch/var/kindred: Implement variant_devtree_update() ......................................................................
Patch Set 2:
Kled/Kindred SKU ID table as below https://docs.google.com/spreadsheets/d/1ArUCV75fZXzZKK-uEyojpV5mbcbiT8OU71AP...
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34400 )
Change subject: mb/google/hatch/var/kindred: Implement variant_devtree_update() ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34400/2/src/mainboard/google/hatch/... File src/mainboard/google/hatch/variants/kindred/variant.c:
https://review.coreboot.org/c/coreboot/+/34400/2/src/mainboard/google/hatch/... PS2, Line 33: google_chromeec_cbi_get_sku_id There is an implementation of get_board_sku() in hatch/mainboard.c. You can make it non-static and use that over here. Then you won't need to call into ec code directly.
https://review.coreboot.org/c/coreboot/+/34400/2/src/mainboard/google/hatch/... PS2, Line 34: (sku_id == 1) Isn't this more than just sku 1?
David Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34400 )
Change subject: mb/google/hatch/var/kindred: Implement variant_devtree_update() ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34400/2/src/mainboard/google/hatch/... File src/mainboard/google/hatch/variants/kindred/variant.c:
https://review.coreboot.org/c/coreboot/+/34400/2/src/mainboard/google/hatch/... PS2, Line 33: google_chromeec_cbi_get_sku_id
There is an implementation of get_board_sku() in hatch/mainboard.c. […]
Make it non-static, will show compile error as below. how to fix this error? thanks.
CC ramstage/mainboard/google/hatch/ramstage.o src/mainboard/google/hatch/mainboard.c:26:10: error: no previous prototype for 'get_board_sku' [-Werror=missing-prototypes] uint32_t get_board_sku(void) ^~~~~~~~~~~~~ CC ramstage/lib/b64_decode.o CC ramstage/lib/boot_device.o CC ramstage/lib/bootmem.o cc1: all warnings being treated as errors make: *** [Makefile:357: build-kindred/ramstage/mainboard/google/hatch/mainboard.o] Error 1 make: *** Waiting for unfinished jobs.... * ERROR: sys-boot/coreboot-9999::chromiumos failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=sys-boot/coreboot-9999::chromiumos'`, * the complete build log and the output of `emerge -pqv '=sys-boot/coreboot-9999::chromiumos'`. * The complete build log is located at '/build/hatch/tmp/portage/logs/sys-boot:coreboot-9999:20190719-024940.log'.
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34400 )
Change subject: mb/google/hatch/var/kindred: Implement variant_devtree_update() ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34400/2/src/mainboard/google/hatch/... File src/mainboard/google/hatch/variants/kindred/variant.c:
https://review.coreboot.org/c/coreboot/+/34400/2/src/mainboard/google/hatch/... PS2, Line 33: google_chromeec_cbi_get_sku_id
Make it non-static, will show compile error as below. how to fix this error? thanks. […]
Posted comment on your other CL. You are missing a header include.
Hello Paul Fagerburg, Tim Wawrzynczak, Shelley Chen, build bot (Jenkins), Furquan Shaikh, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34400
to look at the new patch set (#3).
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 = 1 or 3
BUG=b:132918661 TEST=Verify eMMC is disabled when SKU ID = 1 or 3
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, 37 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/00/34400/3
David Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34400 )
Change subject: mb/google/hatch/var/kindred: Implement variant_devtree_update() ......................................................................
Patch Set 3:
(1 comment)
Thank you.
https://review.coreboot.org/c/coreboot/+/34400/2/src/mainboard/google/hatch/... File src/mainboard/google/hatch/variants/kindred/variant.c:
https://review.coreboot.org/c/coreboot/+/34400/2/src/mainboard/google/hatch/... PS2, Line 33: google_chromeec_cbi_get_sku_id
Posted comment on your other CL. You are missing a header include.
Done
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34400 )
Change subject: mb/google/hatch/var/kindred: Implement variant_devtree_update() ......................................................................
Patch Set 3:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34400/3/src/mainboard/google/hatch/... File src/mainboard/google/hatch/variants/kindred/variant.c:
https://review.coreboot.org/c/coreboot/+/34400/3/src/mainboard/google/hatch/... PS3, Line 20: #define SKU_UNKNOWN 0xFFFFFFFF Not required.
https://review.coreboot.org/c/coreboot/+/34400/3/src/mainboard/google/hatch/... PS3, Line 24: SKU_UNKNOWN Not required anymore. sku_id is set in line 33.
Hello Paul Fagerburg, Tim Wawrzynczak, Shelley Chen, build bot (Jenkins), Furquan Shaikh, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34400
to look at the new patch set (#4).
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 = 1 or 3
BUG=b:132918661 TEST=Verify eMMC is disabled when SKU ID = 1 or 3
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, 35 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/00/34400/4
David Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34400 )
Change subject: mb/google/hatch/var/kindred: Implement variant_devtree_update() ......................................................................
Patch Set 4:
(2 comments)
Thanks.
https://review.coreboot.org/c/coreboot/+/34400/3/src/mainboard/google/hatch/... File src/mainboard/google/hatch/variants/kindred/variant.c:
https://review.coreboot.org/c/coreboot/+/34400/3/src/mainboard/google/hatch/... PS3, Line 20: #define SKU_UNKNOWN 0xFFFFFFFF
Not required.
Done
https://review.coreboot.org/c/coreboot/+/34400/3/src/mainboard/google/hatch/... PS3, Line 24: SKU_UNKNOWN
Not required anymore. sku_id is set in line 33.
Done
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34400 )
Change subject: mb/google/hatch/var/kindred: Implement variant_devtree_update() ......................................................................
Patch Set 4: Code-Review+2
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34400 )
Change subject: mb/google/hatch/var/kindred: Implement variant_devtree_update() ......................................................................
Patch Set 4: Code-Review+2
Martin Roth has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34400 )
Change subject: mb/google/hatch/var/kindred: Implement variant_devtree_update() ......................................................................
Patch Set 4:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34400/2/src/mainboard/google/hatch/... File src/mainboard/google/hatch/variants/kindred/variant.c:
https://review.coreboot.org/c/coreboot/+/34400/2/src/mainboard/google/hatch/... PS2, Line 34: (sku_id == 1)
Isn't this more than just sku 1?
Done
Martin Roth has submitted this change and it was merged. ( 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 = 1 or 3
BUG=b:132918661 TEST=Verify eMMC is disabled when SKU ID = 1 or 3
Change-Id: I8ccb4dae54f223881e0ced9e034bf45b994cc6f2 Signed-off-by: David Wu david_wu@quanta.corp-partner.google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/34400 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Furquan Shaikh furquan@google.com Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/mainboard/google/hatch/variants/kindred/Makefile.inc A src/mainboard/google/hatch/variants/kindred/variant.c 2 files changed, 35 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved Tim Wawrzynczak: Looks good to me, approved
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..14b26ed --- /dev/null +++ b/src/mainboard/google/hatch/variants/kindred/variant.c @@ -0,0 +1,34 @@ +/* + * 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> + +void variant_devtree_update(void) +{ + uint32_t sku_id; + struct device *emmc_host; + + emmc_host = pcidev_path_on_root(PCH_DEVFN_EMMC); + + if (emmc_host == NULL) + return; + + /* SKU ID 1, 3 doesn't have a eMMC device, hence disable it. */ + sku_id = get_board_sku(); + if (sku_id == 1 || sku_id == 3) + emmc_host->enabled = 0; +}