Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/27642
Change subject: mb/google/octopus/variants/phaser: Provide override GPIO config
......................................................................
mb/google/octopus/variants/phaser: Provide override GPIO config
This change provides override GPIO table for variant phaser depending
upon the board id.
BUG=b:111743717
TEST=Verified that GPIO configuration for the override GPIOs is
different than before with this change.
Change-Id: I4d2e829e1b886299442c17cecc069854b742b43c
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
---
M src/mainboard/google/octopus/variants/phaser/Makefile.inc
A src/mainboard/google/octopus/variants/phaser/gpio.c
2 files changed, 64 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/27642/1
diff --git a/src/mainboard/google/octopus/variants/phaser/Makefile.inc b/src/mainboard/google/octopus/variants/phaser/Makefile.inc
index 1644083..5cb5a05 100644
--- a/src/mainboard/google/octopus/variants/phaser/Makefile.inc
+++ b/src/mainboard/google/octopus/variants/phaser/Makefile.inc
@@ -1 +1,2 @@
ramstage-y += variant.c
+ramstage-y += gpio.c
diff --git a/src/mainboard/google/octopus/variants/phaser/gpio.c b/src/mainboard/google/octopus/variants/phaser/gpio.c
new file mode 100644
index 0000000..54eb95d
--- /dev/null
+++ b/src/mainboard/google/octopus/variants/phaser/gpio.c
@@ -0,0 +1,63 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2018 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/gpio.h>
+#include <baseboard/variants.h>
+#include <boardid.h>
+#include <console/console.h>
+#include <soc/gpio.h>
+
+static const struct pad_config default_override_table[] = {
+ PAD_NC(GPIO_52, UP_20K),
+ PAD_NC(GPIO_53, UP_20K),
+ PAD_NC(GPIO_117, UP_20K),
+ PAD_NC(GPIO_143, UP_20K),
+
+ /* EN_PP3300_TOUCHSCREEN */
+ PAD_CFG_GPO_IOSSTATE_IOSTERM(GPIO_146, 0, DEEP, NONE, Tx0RxDCRx0,
+ DISPUPD),
+
+ PAD_NC(GPIO_161, DN_20K),
+ PAD_NC(GPIO_213, DN_20K),
+ PAD_NC(GPIO_214, DN_20K),
+};
+
+static const struct pad_config bid0_override_table[] = {
+ PAD_NC(GPIO_52, UP_20K),
+ PAD_NC(GPIO_53, UP_20K),
+ PAD_NC(GPIO_67, UP_20K),
+ PAD_NC(GPIO_117, UP_20K),
+ PAD_NC(GPIO_143, UP_20K),
+ PAD_NC(GPIO_161, DN_20K),
+ PAD_NC(GPIO_214, DN_20K),
+};
+
+const struct pad_config *variant_override_gpio_table(size_t *num)
+{
+ const struct pad_config *c;
+
+ switch (board_id()) {
+ case 0:
+ case UNDEFINED_STRAPPING_ID:
+ c = bid0_override_table;
+ *num = ARRAY_SIZE(bid0_override_table);
+ break;
+ default:
+ c = default_override_table;
+ *num = ARRAY_SIZE(default_override_table);
+ }
+
+ return c;
+}
--
To view, visit https://review.coreboot.org/27642
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d2e829e1b886299442c17cecc069854b742b43c
Gerrit-Change-Number: 27642
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan(a)google.com>
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/27639
to look at the new patch set (#2).
Change subject: Stoneyridge: Remove IMC support
......................................................................
Stoneyridge: Remove IMC support
An agreement between AMD and Google decided to remove all support to IMC.
All boards will use external EC. Remove all stoney IMC files and functions
from coreboot.
BUG=b:111780177
TEST=Build grunt and gardenia
Change-Id: I1bda0ac7f8f8f5bb1403396d6703a4fac6f60f88
Signed-off-by: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
---
M src/mainboard/amd/gardenia/BiosCallOuts.c
M src/mainboard/amd/gardenia/Makefile.inc
D src/mainboard/amd/gardenia/fchec.c
M src/soc/amd/stoneyridge/BiosCallOuts.c
M src/soc/amd/stoneyridge/Makefile.inc
D src/soc/amd/stoneyridge/acpi/AmdImc.asl
M src/soc/amd/stoneyridge/acpi/sb_pci0_fch.asl
D src/soc/amd/stoneyridge/imc.c
D src/soc/amd/stoneyridge/include/fchec.h
D src/soc/amd/stoneyridge/include/soc/imc.h
M src/soc/amd/stoneyridge/southbridge.c
M src/soc/amd/stoneyridge/spi.c
D src/vendorcode/amd/pi/00670F00/Lib/imc/HwmLateService.c
D src/vendorcode/amd/pi/00670F00/Lib/imc/ImcLib.c
M src/vendorcode/amd/pi/00670F00/Makefile.inc
M src/vendorcode/amd/pi/00670F00/Proc/Fch/Common/FchDef.h
16 files changed, 2 insertions(+), 832 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/27639/2
--
To view, visit https://review.coreboot.org/27639
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1bda0ac7f8f8f5bb1403396d6703a4fac6f60f88
Gerrit-Change-Number: 27639
Gerrit-PatchSet: 2
Gerrit-Owner: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/27640
Change subject: soc/intel/common/block/gpio: Add API for gpio_configure_pads_with_override
......................................................................
soc/intel/common/block/gpio: Add API for gpio_configure_pads_with_override
This function adds support for gpio_configure_pads_with_override
which:
1. Takes as input two GPIO tables -- base config table and override
config table
2. Configures each pad in base config by first checking if there is a
config available for the pad in override config table. If yes, then
uses the one from override config table. Else, uses the base config to
configure the pad.
This is done to allow sharing of GPIO tables across baseboard-variants
for various boards i.e. Each board can have a base config table which
is provided by the baseboard and an optional override config table
that can be provided by a variant to configure certain GPIOs
differently. It is helpful when the variant GPIO diff list is not very
huge compared to the baseboard.
BUG=b:111743717
TEST=Verified that the GPIO config for phaser is same with and without
this change.
Change-Id: I1c5dc72c8368957201ab53d2e8398ff861341a4c
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
---
M src/soc/intel/common/block/gpio/gpio.c
M src/soc/intel/common/block/include/intelblocks/gpio.h
2 files changed, 52 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/27640/1
diff --git a/src/soc/intel/common/block/gpio/gpio.c b/src/soc/intel/common/block/gpio/gpio.c
index 50a3a02..931fb7f 100644
--- a/src/soc/intel/common/block/gpio/gpio.c
+++ b/src/soc/intel/common/block/gpio/gpio.c
@@ -288,6 +288,43 @@
gpio_configure_pad(cfg + i);
}
+/*
+ * This functions checks to see if there is an override config present for the
+ * provided pad_config. If no override config is present, then the input config
+ * is returned. Else, it returns the override config.
+ */
+static const struct pad_config *gpio_get_config(const struct pad_config *c,
+ const struct pad_config *override_cfg_table,
+ size_t num)
+{
+ size_t i;
+
+ if (override_cfg_table == NULL)
+ return c;
+
+ for (i = 0; i < num; i++) {
+ if (c->pad == override_cfg_table[i].pad)
+ return override_cfg_table + i;
+ }
+
+ return c;
+}
+
+void gpio_configure_pads_with_override(const struct pad_config *base_cfg,
+ size_t base_num_pads,
+ const struct pad_config *override_cfg,
+ size_t override_num_pads)
+{
+ size_t i;
+ const struct pad_config *c;
+
+ for (i = 0; i < base_num_pads; i++) {
+ c = gpio_get_config(base_cfg + i, override_cfg,
+ override_num_pads);
+ gpio_configure_pad(c);
+ }
+}
+
void *gpio_dwx_address(const gpio_t pad)
{
/* Calculate Address of DW0 register for given GPIO
diff --git a/src/soc/intel/common/block/include/intelblocks/gpio.h b/src/soc/intel/common/block/include/intelblocks/gpio.h
index 625ebef..4e26db3 100644
--- a/src/soc/intel/common/block/include/intelblocks/gpio.h
+++ b/src/soc/intel/common/block/include/intelblocks/gpio.h
@@ -133,6 +133,21 @@
void gpio_configure_pads(const struct pad_config *cfg, size_t num_pads);
/*
+ * gpio_configure_pads_with_override accepts as input two GPIO tables:
+ * 1. Base config
+ * 2. Override config
+ *
+ * This function configures raw pads in base config and applies override in
+ * override config if any. Thus, for every GPIO_x in base config, this function
+ * looks up the GPIO in override config and if it is present there, then applies
+ * the configuration from override config.
+ */
+void gpio_configure_pads_with_override(const struct pad_config *base_cfg,
+ size_t base_num_pads,
+ const struct pad_config *override_cfg,
+ size_t override_num_pads);
+
+/*
* Calculate Address of DW0 register for given GPIO
*/
void *gpio_dwx_address(const gpio_t pad);
--
To view, visit https://review.coreboot.org/27640
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c5dc72c8368957201ab53d2e8398ff861341a4c
Gerrit-Change-Number: 27640
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan(a)google.com>