<p>Matt DeVillier has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21127">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">google/edgar: add new board as variant of cyan baseboard<br><br>Add support for google/edgar (Acer Chromebook 14 CB3-431) as<br>a variant of the cyan Braswell basebaseboard. Add common code<br>to the baseboard and selectively apply it on a per-variant basis.<br><br>Sourced from Chromium branch firmware-edgar-7287.167.B,<br>commit 2319742: Edgar: Add Micron MT52L256M32D1PF-107 SPD data<br><br>Change-Id: I58548cbbc85828f37c0023e8aa9e09bdca612659<br>Signed-off-by: Matt DeVillier <matt.devillier@gmail.com><br>---<br>M src/mainboard/google/cyan/Kconfig<br>M src/mainboard/google/cyan/Kconfig.name<br>M src/mainboard/google/cyan/Makefile.inc<br>A src/mainboard/google/cyan/acpi/codec_realtek.asl<br>M src/mainboard/google/cyan/acpi_tables.c<br>M src/mainboard/google/cyan/chromeos.c<br>M src/mainboard/google/cyan/romstage.c<br>M src/mainboard/google/cyan/smihandler.c<br>A src/mainboard/google/cyan/spd/empty.spd.hex<br>A src/mainboard/google/cyan/spd/hynix_dimm_H9CCNNN8JTBLAR-NUD.spd.hex<br>A src/mainboard/google/cyan/spd/mainboard_spd.h<br>A src/mainboard/google/cyan/spd/samsung_dimm_K4E8E304EE-EGCE.spd.hex<br>A src/mainboard/google/cyan/spd/samsung_dimm_K4E8E324EB-EGCF.spd.hex<br>A src/mainboard/google/cyan/variants/edgar/Makefile.inc<br>A src/mainboard/google/cyan/variants/edgar/board_info.txt<br>A src/mainboard/google/cyan/variants/edgar/devicetree.cb<br>A src/mainboard/google/cyan/variants/edgar/gpio.c<br>A src/mainboard/google/cyan/variants/edgar/include/variant/acpi/dptf.asl<br>A src/mainboard/google/cyan/variants/edgar/include/variant/acpi/mainboard.asl<br>A src/mainboard/google/cyan/variants/edgar/include/variant/onboard.h<br>A src/mainboard/google/cyan/variants/edgar/spd.c<br>21 files changed, 1,060 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/21127/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/mainboard/google/cyan/Kconfig b/src/mainboard/google/cyan/Kconfig<br>index ea8047f..71cde58 100644<br>--- a/src/mainboard/google/cyan/Kconfig<br>+++ b/src/mainboard/google/cyan/Kconfig<br>@@ -37,10 +37,12 @@<br> config VARIANT_DIR<br> string<br> default "cyan" if BOARD_GOOGLE_CYAN<br>+ default "edgar" if BOARD_GOOGLE_EDGAR<br> <br> config MAINBOARD_PART_NUMBER<br> string<br> default "Cyan" if BOARD_GOOGLE_CYAN<br>+ default "Edgar" if BOARD_GOOGLE_EDGAR<br> <br> config MAINBOARD_VENDOR<br> string<br>@@ -49,6 +51,7 @@<br> config DEVICETREE<br> string<br> default "variants/cyan/devicetree.cb" if BOARD_GOOGLE_CYAN<br>+ default "variants/edgar/devicetree.cb" if BOARD_GOOGLE_EDGAR<br> <br> config VGA_BIOS_FILE<br> string<br>@@ -71,5 +74,6 @@<br> string<br> depends on CHROMEOS<br> default "CYAN TEST A-A 1829" if BOARD_GOOGLE_CYAN<br>+ default "EDGAR TEST A-A 1829" if BOARD_GOOGLE_EDGAR<br> <br> endif # BOARD_GOOGLE_BASEBOARD_CYAN<br>diff --git a/src/mainboard/google/cyan/Kconfig.name b/src/mainboard/google/cyan/Kconfig.name<br>index 91e10c9..50f9c58 100644<br>--- a/src/mainboard/google/cyan/Kconfig.name<br>+++ b/src/mainboard/google/cyan/Kconfig.name<br>@@ -1,3 +1,7 @@<br> config BOARD_GOOGLE_CYAN<br> bool "Cyan"<br> select BOARD_GOOGLE_BASEBOARD_CYAN<br>+<br>+config BOARD_GOOGLE_EDGAR<br>+ bool "Edgar"<br>+ select BOARD_GOOGLE_BASEBOARD_CYAN<br>diff --git a/src/mainboard/google/cyan/Makefile.inc b/src/mainboard/google/cyan/Makefile.inc<br>index 274e9f0..da7ac8c 100644<br>--- a/src/mainboard/google/cyan/Makefile.inc<br>+++ b/src/mainboard/google/cyan/Makefile.inc<br>@@ -32,3 +32,4 @@<br> subdirs-y += variants/$(VARIANT_DIR)<br> <br> CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include<br>+CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/spd<br>diff --git a/src/mainboard/google/cyan/acpi/codec_realtek.asl b/src/mainboard/google/cyan/acpi/codec_realtek.asl<br>new file mode 100644<br>index 0000000..d3fa84e<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/acpi/codec_realtek.asl<br>@@ -0,0 +1,63 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2012 Google Inc.<br>+ * Copyright (C) 2015 Intel Corp.<br>+ *<br>+ * This program is free software; you can redistribute it and/or<br>+ * modify it under the terms of the GNU General Public License as<br>+ * published by the Free Software Foundation; version 2 of<br>+ * the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+Scope (\_SB.PCI0.I2C5)<br>+{<br>+ /* Realtek Audio Codec */<br>+ Device (RTEK) /* Audio Codec driver I2C */<br>+ {<br>+ Name (_ADR, 0)<br>+ Name (_HID, AUDIO_CODEC_HID)<br>+ Name (_CID, AUDIO_CODEC_CID)<br>+ Name (_DDN, AUDIO_CODEC_DDN)<br>+ Name (_UID, 1)<br>+<br>+ Method(_CRS, 0x0, NotSerialized)<br>+ {<br>+ Name(SBUF,ResourceTemplate ()<br>+ {<br>+ I2CSerialBus(<br>+ AUDIO_CODEC_I2C_ADDR, /* SlaveAddress: bus address */<br>+ ControllerInitiated, /* SlaveMode: default to ControllerInitiated */<br>+ 400000, /* ConnectionSpeed: in Hz */<br>+ AddressingMode7Bit, /* Addressing Mode: default to 7 bit */<br>+ "\\_SB.PCI0.I2C5", /* ResourceSource: I2C bus controller name */<br>+ )<br>+<br>+ /* Jack Detect (index 0) */<br>+ GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone,,<br>+ "\\_SB.GPSW") { JACK_DETECT_GPIO_INDEX }<br>+ } )<br>+ Return (SBUF)<br>+ }<br>+<br>+ Method (_STA)<br>+ {<br>+ Return (0xF)<br>+ }<br>+ }<br>+}<br>+<br>+Scope (\_SB.PCI0.LPEA)<br>+{<br>+ Name (GBUF, ResourceTemplate ()<br>+ {<br>+ /* Jack Detect (index 0) */<br>+ GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone,,<br>+ "\\_SB.GPSW") { JACK_DETECT_GPIO_INDEX }<br>+ })<br>+}<br>diff --git a/src/mainboard/google/cyan/acpi_tables.c b/src/mainboard/google/cyan/acpi_tables.c<br>index d4271e5..47ddc0b 100644<br>--- a/src/mainboard/google/cyan/acpi_tables.c<br>+++ b/src/mainboard/google/cyan/acpi_tables.c<br>@@ -43,6 +43,9 @@<br> <br> /* Enable DPTF */<br> gnvs->dpte = 1;<br>+<br>+ /* PMIC is configured in I2C1, hidden it from OS */<br>+ gnvs->dev.lpss_en[LPSS_NVS_I2C2] = 0;<br> }<br> <br> unsigned long acpi_fill_madt(unsigned long current)<br>diff --git a/src/mainboard/google/cyan/chromeos.c b/src/mainboard/google/cyan/chromeos.c<br>index 8aac84f..5bf8380 100644<br>--- a/src/mainboard/google/cyan/chromeos.c<br>+++ b/src/mainboard/google/cyan/chromeos.c<br>@@ -24,6 +24,8 @@<br> #define WP_STATUS_PAD_CFG0 0x4838<br> #define WP_STATUS_PAD_CFG1 0x483C<br> <br>+#define WP_GPIO GP_E_22<br>+<br> #if ENV_RAMSTAGE<br> #include <boot/coreboot_tables.h><br> <br>@@ -52,15 +54,23 @@<br> * in the reading.<br> */<br> #if ENV_ROMSTAGE<br>- write32((void *)(COMMUNITY_GPEAST_BASE + WP_STATUS_PAD_CFG0),<br>- (PAD_PULL_UP_20K | PAD_GPIO_ENABLE | PAD_CONFIG0_GPI_DEFAULT));<br>- write32((void *)(COMMUNITY_GPEAST_BASE + WP_STATUS_PAD_CFG1),<br>- PAD_CONFIG1_DEFAULT0);<br>+ if (IS_ENABLED(CONFIG_BOARD_GOOGLE_CYAN)) {<br>+ write32((void *)(COMMUNITY_GPEAST_BASE + WP_STATUS_PAD_CFG0),<br>+ (PAD_PULL_UP_20K | PAD_GPIO_ENABLE | PAD_CONFIG0_GPI_DEFAULT));<br>+ write32((void *)(COMMUNITY_GPEAST_BASE + WP_STATUS_PAD_CFG1),<br>+ PAD_CONFIG1_DEFAULT0);<br>+ } else {<br>+ gpio_input_pullup(WP_GPIO);<br>+ }<br> #endif<br> <br> /* WP is enabled when the pin is reading high. */<br>- return (read32((void *)(COMMUNITY_GPEAST_BASE + WP_STATUS_PAD_CFG0))<br>- & PAD_VAL_HIGH);<br>+ if (IS_ENABLED(CONFIG_BOARD_GOOGLE_CYAN)) {<br>+ return (read32((void *)(COMMUNITY_GPEAST_BASE + WP_STATUS_PAD_CFG0))<br>+ & PAD_VAL_HIGH);<br>+ } else {<br>+ return !!gpio_get(WP_GPIO);<br>+ }<br> }<br> <br> static const struct cros_gpio cros_gpios[] = {<br>diff --git a/src/mainboard/google/cyan/romstage.c b/src/mainboard/google/cyan/romstage.c<br>index 61ebde9..c3fce62 100644<br>--- a/src/mainboard/google/cyan/romstage.c<br>+++ b/src/mainboard/google/cyan/romstage.c<br>@@ -22,6 +22,7 @@<br> #include <soc/romstage.h><br> #include <string.h><br> <br>+<br> /* All FSP specific code goes in this block */<br> void mainboard_romstage_entry(struct romstage_params *rp)<br> {<br>diff --git a/src/mainboard/google/cyan/smihandler.c b/src/mainboard/google/cyan/smihandler.c<br>index 75c1890..f31f68f 100644<br>--- a/src/mainboard/google/cyan/smihandler.c<br>+++ b/src/mainboard/google/cyan/smihandler.c<br>@@ -152,6 +152,12 @@<br> /* Clear pending events that may trigger immediate wake */<br> while (google_chromeec_get_event() != 0)<br> ;<br>+<br>+ /* Set LPC lines to low power in S3/S5. */<br>+ if (!IS_ENABLED(CONFIG_BOARD_GOOGLE_CYAN) &&<br>+ ((slp_typ == ACPI_S3) || (slp_typ == ACPI_S5))) {<br>+ lpc_set_low_power();<br>+ }<br> #endif<br> }<br> <br>diff --git a/src/mainboard/google/cyan/spd/empty.spd.hex b/src/mainboard/google/cyan/spd/empty.spd.hex<br>new file mode 100644<br>index 0000000..9ec39f1<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/spd/empty.spd.hex<br>@@ -0,0 +1,16 @@<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>diff --git a/src/mainboard/google/cyan/spd/hynix_dimm_H9CCNNN8JTBLAR-NUD.spd.hex b/src/mainboard/google/cyan/spd/hynix_dimm_H9CCNNN8JTBLAR-NUD.spd.hex<br>new file mode 100644<br>index 0000000..a8e0c26<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/spd/hynix_dimm_H9CCNNN8JTBLAR-NUD.spd.hex<br>@@ -0,0 +1,16 @@<br>+91 20 F1 03 04 11 05 0B 03 11 01 08 09 00 40 05<br>+78 78 90 50 90 11 50 E0 10 04 3C 3C 01 90 00 00<br>+00 00 CA FA 00 00 00 A8 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 80 AD 01 00 00 00 00 00 00 00 00<br>+48 39 43 43 4E 4E 4E 38 4A 54 42 4C 41 52 2D 4E<br>+55 44 00 00 80 AD 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br>diff --git a/src/mainboard/google/cyan/spd/mainboard_spd.h b/src/mainboard/google/cyan/spd/mainboard_spd.h<br>new file mode 100644<br>index 0000000..ca3e30a<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/spd/mainboard_spd.h<br>@@ -0,0 +1,32 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2014 Google Inc.<br>+ * Copyright (C) 2015 Intel Corporation.<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; version 2 of the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#ifndef _MAINBOARD_SPD_H_<br>+#define _MAINBOARD_SPD_H_<br>+<br>+#define SPD_LEN 256<br>+<br>+#define SPD_DRAM_TYPE 2<br>+#define SPD_DRAM_DDR3 0x0b<br>+#define SPD_DRAM_LPDDR3 0xf1<br>+#define SPD_DENSITY_BANKS 4<br>+#define SPD_ADDRESSING 5<br>+#define SPD_ORGANIZATION 7<br>+#define SPD_BUS_DEV_WIDTH 8<br>+#define SPD_PART_OFF 128<br>+#define SPD_PART_LEN 18<br>+<br>+#endif /* _MAINBOARD_SPD_H_ */<br>diff --git a/src/mainboard/google/cyan/spd/samsung_dimm_K4E8E304EE-EGCE.spd.hex b/src/mainboard/google/cyan/spd/samsung_dimm_K4E8E304EE-EGCE.spd.hex<br>new file mode 100644<br>index 0000000..056dc25<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/spd/samsung_dimm_K4E8E304EE-EGCE.spd.hex<br>@@ -0,0 +1,32 @@<br>+91 20 F1 03 04 11 05 0B<br>+03 11 01 08 0A 00 40 01<br>+78 78 90 50 90 11 50 E0<br>+10 04 3C 3C 01 90 00 00<br>+00 00 00 00 00 00 00 A8<br>+00 88 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 80 CE 01<br>+00 00 55 00 00 00 00 00<br>+4B 34 45 38 45 33 30 34<br>+45 45 2D 45 47 43 45 20<br>+20 20 00 00 80 CE 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>diff --git a/src/mainboard/google/cyan/spd/samsung_dimm_K4E8E324EB-EGCF.spd.hex b/src/mainboard/google/cyan/spd/samsung_dimm_K4E8E324EB-EGCF.spd.hex<br>new file mode 100644<br>index 0000000..6d9ae52<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/spd/samsung_dimm_K4E8E324EB-EGCF.spd.hex<br>@@ -0,0 +1,32 @@<br>+91 20 F1 03 05 19 05 03<br>+03 11 01 08 09 00 40 05<br>+78 78 90 50 90 11 50 E0<br>+90 06 3C 3C 01 90 00 00<br>+00 00 CA FA 00 00 00 A8<br>+00 88 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 80 CE 01<br>+00 00 55 00 00 00 00 00<br>+4B 34 45 38 45 33 32 34<br>+45 42 2D 45 47 43 46 20<br>+20 20 00 00 80 CE 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>+00 00 00 00 00 00 00 00<br>diff --git a/src/mainboard/google/cyan/variants/edgar/Makefile.inc b/src/mainboard/google/cyan/variants/edgar/Makefile.inc<br>new file mode 100644<br>index 0000000..e406f67<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/variants/edgar/Makefile.inc<br>@@ -0,0 +1,41 @@<br>+##<br>+## This file is part of the coreboot project.<br>+##<br>+## Copyright (C) 2013 Google Inc.<br>+## Copyright (C) 2015 Intel Corp.<br>+##<br>+## This program is free software; you can redistribute it and/or modify<br>+## it under the terms of the GNU General Public License as published by<br>+## the Free Software Foundation; version 2 of the License.<br>+##<br>+## This program is distributed in the hope that it will be useful,<br>+## but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>+## GNU General Public License for more details.<br>+##<br>+<br>+romstage-y += spd.c<br>+<br>+SPD_BIN = $(obj)/spd.bin<br>+<br>+SPD_SOURCES = samsung_dimm_K4E8E304EE-EGCE<br>+SPD_SOURCES += hynix_dimm_H9CCNNN8JTBLAR-NUD<br>+SPD_SOURCES += samsung_dimm_K4E8E304EE-EGCE<br>+SPD_SOURCES += hynix_dimm_H9CCNNN8JTBLAR-NUD<br>+SPD_SOURCES += samsung_dimm_K4E8E324EB-EGCF<br>+SPD_SOURCES += empty<br>+SPD_SOURCES += samsung_dimm_K4E8E324EB-EGCF<br>+<br>+SPD_DEPS := $(foreach f, $(SPD_SOURCES), src/mainboard/$(MAINBOARDDIR)/spd/$(f).spd.hex)<br>+<br>+# Include spd ROM data<br>+$(SPD_BIN): $(SPD_DEPS)<br>+ for f in $+; \<br>+ do for c in $$(cat $$f | grep -v ^#); \<br>+ do printf $$(printf '\%o' 0x$$c); \<br>+ done; \<br>+ done > $@<br>+<br>+cbfs-files-y += spd.bin<br>+spd.bin-file := $(SPD_BIN)<br>+spd.bin-type := spd<br>diff --git a/src/mainboard/google/cyan/variants/edgar/board_info.txt b/src/mainboard/google/cyan/variants/edgar/board_info.txt<br>new file mode 100644<br>index 0000000..e50ba0b<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/variants/edgar/board_info.txt<br>@@ -0,0 +1,6 @@<br>+Vendor name: Google<br>+Board name: Edgar<br>+Category: laptop<br>+ROM protocol: SPI<br>+ROM socketed: n<br>+Flashrom support: y<br>diff --git a/src/mainboard/google/cyan/variants/edgar/devicetree.cb b/src/mainboard/google/cyan/variants/edgar/devicetree.cb<br>new file mode 100644<br>index 0000000..2033f9e<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/variants/edgar/devicetree.cb<br>@@ -0,0 +1,144 @@<br>+chip soc/intel/braswell<br>+<br>+ ############################################################<br>+ # Set the parameters for MemoryInit<br>+ ############################################################<br>+<br>+ register "PcdMrcInitTsegSize" = "8" # SMM Region size in MiB<br>+<br>+ register "PcdMrcInitMmioSize" = "0x0800"<br>+ register "PcdMrcInitSpdAddr1" = "0xa0"<br>+ register "PcdMrcInitSpdAddr2" = "0xa2"<br>+ register "PcdIgdDvmt50PreAlloc" = "1"<br>+ register "PcdApertureSize" = "2"<br>+ register "PcdGttSize" = "1"<br>+ register "PcdDvfsEnable" = "1"<br>+ register "PcdCaMirrorEn" = "1"<br>+<br>+ ############################################################<br>+ # Set the parameters for SiliconInit<br>+ ############################################################<br>+<br>+ register "PcdSdcardMode" = "PCH_DISABLED"<br>+ register "PcdEnableHsuart0" = "0"<br>+ register "PcdEnableHsuart1" = "1"<br>+ register "PcdEnableAzalia" = "1"<br>+ register "PcdEnableXhci" = "1"<br>+ register "PcdEnableLpe" = "1"<br>+ register "PcdEnableDma0" = "1"<br>+ register "PcdEnableDma1" = "1"<br>+ register "PcdEnableI2C0" = "0"<br>+ register "PcdEnableI2C1" = "0"<br>+ register "PcdEnableI2C2" = "0"<br>+ register "PcdEnableI2C3" = "0"<br>+ register "PcdEnableI2C4" = "1"<br>+ register "PcdEnableI2C5" = "1"<br>+ register "PcdEnableI2C6" = "0"<br>+ register "PunitPwrConfigDisable" = "0" # Enable SVID<br>+ register "ChvSvidConfig" = "SVID_PMIC_CONFIG"<br>+ register "PcdEmmcMode" = "PCH_ACPI_MODE"<br>+ register "PcdUsb3ClkSsc" = "1"<br>+ register "PcdDispClkSsc" = "1"<br>+ register "PcdSataClkSsc" = "1"<br>+ register "PcdEnableSata" = "0" # Disable SATA<br>+ register "Usb2Port0PerPortPeTxiSet" = "7"<br>+ register "Usb2Port0PerPortTxiSet" = "5"<br>+ register "Usb2Port0IUsbTxEmphasisEn" = "2"<br>+ register "Usb2Port0PerPortTxPeHalf" = "1"<br>+ register "Usb2Port1PerPortPeTxiSet" = "7"<br>+ register "Usb2Port1PerPortTxiSet" = "3"<br>+ register "Usb2Port1IUsbTxEmphasisEn" = "2"<br>+ register "Usb2Port1PerPortTxPeHalf" = "1"<br>+ register "Usb2Port2PerPortPeTxiSet" = "7"<br>+ register "Usb2Port2PerPortTxiSet" = "3"<br>+ register "Usb2Port2IUsbTxEmphasisEn" = "2"<br>+ register "Usb2Port2PerPortTxPeHalf" = "1"<br>+ register "Usb2Port3PerPortPeTxiSet" = "7"<br>+ register "Usb2Port3PerPortTxiSet" = "6"<br>+ register "Usb2Port3IUsbTxEmphasisEn" = "3"<br>+ register "Usb2Port3PerPortTxPeHalf" = "1"<br>+ register "Usb2Port4PerPortPeTxiSet" = "7"<br>+ register "Usb2Port4PerPortTxiSet" = "0"<br>+ register "Usb2Port4IUsbTxEmphasisEn" = "2"<br>+ register "Usb2Port4PerPortTxPeHalf" = "1"<br>+ register "Usb3Lane0Ow2tapgen2deemph3p5" = "0x3a"<br>+ register "Usb3Lane1Ow2tapgen2deemph3p5" = "0x64"<br>+ register "Usb3Lane2Ow2tapgen2deemph3p5" = "0x64"<br>+ register "Usb3Lane3Ow2tapgen2deemph3p5" = "0x3a"<br>+ register "PcdSataInterfaceSpeed" = "3"<br>+ register "PcdPchSsicEnable" = "0"<br>+ register "PcdPchUsbHsicPort" = "0"<br>+ register "PcdRtcLock" = "0" # Disable RTC access locking to NVRAM<br>+ register "PMIC_I2CBus" = "1"<br>+ register "ISPEnable" = "0" # Disable IUNIT<br>+ register "ISPPciDevConfig" = "3"<br>+ register "PcdSdDetectChk" = "0" # Disable SD card detect<br>+<br>+ # LPE audio codec settings<br>+ register "lpe_codec_clk_src" = "LPE_CLK_SRC_XTAL" # 19.2MHz clock<br>+<br>+ # Enable devices in ACPI mode<br>+ register "lpss_acpi_mode" = "1"<br>+ register "emmc_acpi_mode" = "1"<br>+ register "sd_acpi_mode" = "1"<br>+ register "lpe_acpi_mode" = "1"<br>+<br>+ # Disable SLP_X stretching after SUS power well fail.<br>+ register "disable_slp_x_stretch_sus_fail" = "1"<br>+<br>+ # Allow PCIe devices to wake system from suspend<br>+ register "pcie_wake_enable" = "1"<br>+<br>+ device cpu_cluster 0 on<br>+ device lapic 0 on end<br>+ end<br>+ device domain 0 on<br>+ # EDS Table 24-4, Figure 24-5<br>+ device pci 00.0 on end # 8086 2280 - SoC transaction router<br>+ device pci 02.0 on end # 8086 22b0/22b1 - B1/C0 stepping Graphics and Display<br>+ device pci 03.0 off end # 8086 22b8 - Camera and Image Processor<br>+ device pci 0b.0 on end # 8086 22dc - ?<br>+ device pci 10.0 on end # 8086 2294 - MMC Port<br>+ device pci 11.0 off end # 8086 0F15 - SDIO Port<br>+ device pci 12.0 off end # 8086 0F16 - SD Port<br>+ device pci 13.0 off end # 8086 22a3 - Sata controller<br>+ device pci 14.0 on end # 8086 22b5 - USB XHCI - Only 1 USB controller at a time<br>+ device pci 15.0 on end # 8086 22a8 - LP Engine Audio<br>+ device pci 16.0 off end # 8086 22b7 - USB device<br>+ device pci 18.0 on end # 8086 22c0 - SIO - DMA<br>+ device pci 18.1 off end # 8086 22c1 - I2C Port 1<br>+ device pci 18.2 on end # 8086 22c2 - I2C Port 2<br>+ device pci 18.3 off end # 8086 22c3 - I2C Port 3<br>+ device pci 18.4 off end # 8086 22c4 - I2C Port 4<br>+ device pci 18.5 on end # 8086 22c5 - I2C Port 5<br>+ device pci 18.6 on end # 8086 22c6 - I2C Port 6<br>+ device pci 18.7 off end # 8086 22c7 - I2C Port 7<br>+ device pci 1a.0 off end # 8086 0F18 - Trusted Execution Engine<br>+ device pci 1b.0 on end # 8086 0F04 - HD Audio<br>+ device pci 1c.0 on end # 8086 0000 - PCIe Root Port 1<br>+ device pci 1c.1 off end # 8086 0000 - PCIe Root Port 2<br>+ device pci 1c.2 on end # 8086 0000 - PCIe Root Port 3<br>+ device pci 1c.3 off end # 8086 0000 - PCIe Root Port 4<br>+ device pci 1e.0 on end # 8086 2286 - SIO - DMA<br>+ device pci 1e.1 off end # 8086 0F08 - PWM 1<br>+ device pci 1e.2 off end # 8086 0F09 - PWM 2<br>+ device pci 1e.3 on end # 8086 228a - HSUART 1<br>+ device pci 1e.4 off end # 8086 228c - HSUART 2<br>+ device pci 1e.5 on end # 8086 228e - SPI 1<br>+ device pci 1e.6 off end # 8086 2290 - SPI 2<br>+ device pci 1e.7 off end # 8086 22ac - SPI 3<br>+ device pci 1f.0 on # 8086 229c - LPC bridge<br>+ chip drivers/pc80/tpm<br>+ # Rising edge interrupt<br>+ register "irq_polarity" = "2"<br>+ device pnp 0c31.0 on<br>+ irq 0x70 = 10<br>+ end<br>+ end<br>+ chip ec/google/chromeec<br>+ device pnp 0c09.0 on end<br>+ end<br>+ end # LPC Bridge<br>+ device pci 1f.3 off end # 8086 0F12 - SMBus 0<br>+ end<br>+end<br>diff --git a/src/mainboard/google/cyan/variants/edgar/gpio.c b/src/mainboard/google/cyan/variants/edgar/gpio.c<br>new file mode 100644<br>index 0000000..6e81c23<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/variants/edgar/gpio.c<br>@@ -0,0 +1,257 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright(C) 2013 Google Inc.<br>+ * Copyright (C) 2015 Intel Corp.<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; version 2 of the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#include <mainboard/google/cyan/irqroute.h><br>+#include <soc/gpio.h><br>+#include <stdlib.h><br>+<br>+/* South East Community */<br>+static const struct soc_gpio_map gpse_gpio_map[] = {<br>+ Native_M1,/* MF_PLT_CLK0 */<br>+ GPIO_NC, /* 01 PWM1 */<br>+ GPIO_INPUT_NO_PULL, /* 02 MF_PLT_CLK1, RAMID2 */<br>+ GPIO_NC, /* 03 MF_PLT_CLK4 */<br>+ GPIO_NC, /* 04 MF_PLT_CLK3 */<br>+ GPIO_NC, /* PWM0 05 */<br>+ GPIO_NC, /* 06 MF_PLT_CLK5 */<br>+ GPIO_NC, /* 07 MF_PLT_CLK2 */<br>+ GPIO_NC, /* 15 SDMMC2_D3_CD_B */<br>+ Native_M1, /* 16 SDMMC1_CLK */<br>+ NATIVE_PU20K(1), /* 17 SDMMC1_D0 */<br>+ GPIO_NC, /* 18 SDMMC2_D1 */<br>+ GPIO_NC, /* 19 SDMMC2_CLK */<br>+ NATIVE_PU20K(1),/* 20 SDMMC1_D2 */<br>+ GPIO_NC, /* 21 SDMMC2_D2 */<br>+ GPIO_NC, /* 22 SDMMC2_CMD */<br>+ NATIVE_PU20K(1), /* 23 SDMMC1_CMD */<br>+ NATIVE_PU20K(1), /* 24 SDMMC1_D1 */<br>+ GPIO_NC, /* 25 SDMMC2_D0 */<br>+ NATIVE_PU20K(1), /* 26 SDMMC1_D3_CD_B */<br>+ GPIO_NC, /* 30 SDMMC3_D1 */<br>+ GPIO_NC, /* 31 SDMMC3_CLK */<br>+ GPIO_NC, /* 32 SDMMC3_D3 */<br>+ GPIO_NC, /* 33 SDMMC3_D2 */<br>+ GPIO_NC, /* 34 SDMMC3_CMD */<br>+ GPIO_NC, /* 35 SDMMC3_D0 */<br>+ NATIVE_PU20K(1), /* 45 MF_LPC_AD2 */<br>+ NATIVE_PU20K(1), /* 46 LPC_CLKRUNB */<br>+ NATIVE_PU20K(1), /* 47 MF_LPC_AD0 */<br>+ Native_M1, /* 48 LPC_FRAMEB */<br>+ Native_M1, /* 49 MF_LPC_CLKOUT1 */<br>+ NATIVE_PU20K(1), /* 50 MF_LPC_AD3 */<br>+ Native_M1, /* 51 MF_LPC_CLKOUT0 */<br>+ NATIVE_PU20K(1), /* 52 MF_LPC_AD1 */<br>+ Native_M1,/* SPI1_MISO */<br>+ Native_M1, /* 61 SPI1_CS0_B */<br>+ Native_M1, /* SPI1_CLK */<br>+ NATIVE_PU20K(1), /* 63 MMC1_D6 */<br>+ Native_M1, /* 62 SPI1_MOSI */<br>+ NATIVE_PU20K(1), /* 65 MMC1_D5 */<br>+ GPIO_NC, /* SPI1_CS1_B 66 */<br>+ NATIVE_PU20K(1), /* 67 MMC1_D4_SD_WE */<br>+ NATIVE_PU20K(1), /* 68 MMC1_D7 */<br>+ GPIO_NC, /* 69 MMC1_RCLK */<br>+ Native_M1, /* 75 GPO USB_OC1_B */<br>+ Native_M1, /* 76 PMU_RESETBUTTON_B */<br>+ GPI(trig_edge_both, L0, NA, non_maskable, en_edge_detect, NA , NA),<br>+ /* GPIO_ALERT 77 */<br>+ Native_M1, /* 78 SDMMC3_PWR_EN_B */<br>+ GPIO_NC, /* 79 GPI ILB_SERIRQ */<br>+ Native_M1, /* 80 USB_OC0_B */<br>+ GPIO_NC, /* 81 SDMMC3_CD_B */<br>+ GPIO_NC, /* 82 spkr asummed gpio number */<br>+ Native_M1, /* 83 SUSPWRDNACK */<br>+ SPARE_PIN,/* 84 spare pin */<br>+ Native_M1, /* 85 SDMMC3_1P8_EN */<br>+ GPIO_END<br>+};<br>+<br>+<br>+/* South West Community */<br>+static const struct soc_gpio_map gpsw_gpio_map[] = {<br>+ GPIO_NC, /* 00 FST_SPI_D2 */<br>+ Native_M1, /* 01 FST_SPI_D0 */<br>+ Native_M1, /* 02 FST_SPI_CLK */<br>+ GPIO_NC, /* 03 FST_SPI_D3 */<br>+ GPIO_NC, /* GPO FST_SPI_CS1_B */<br>+ Native_M1, /* 05 FST_SPI_D1 */<br>+ Native_M1, /* 06 FST_SPI_CS0_B */<br>+ GPIO_NC, /* 07 FST_SPI_CS2_B */<br>+ GPIO_NC, /* 15 UART1_RTS_B */<br>+ Native_M2, /* 16 UART1_RXD */<br>+ GPIO_NC, /* 17 UART2_RXD */<br>+ GPIO_NC, /* 18 UART1_CTS_B */<br>+ GPIO_NC, /* 19 UART2_RTS_B */<br>+ Native_M2, /* 20 UART1_TXD */<br>+ GPIO_NC, /* 21 UART2_TXD */<br>+ GPIO_NC, /* 22 UART2_CTS_B */<br>+ GPIO_NC, /* 30 MF_HDA_CLK */<br>+ GPIO_NC, /* 31 GPIO_SW31/MF_HDA_RSTB */<br>+ GPIO_NC, /* 32 GPIO_SW32 /MF_HDA_SDI0 */<br>+ GPIO_NC, /* 33 MF_HDA_SDO */<br>+ GPIO_NC, /* 34 MF_HDA_DOCKRSTB */<br>+ GPIO_NC, /* 35 MF_HDA_SYNC */<br>+ GPIO_NC, /* 36 GPIO_SW36 MF_HDA_SDI1 */<br>+ GPIO_NC, /* 37 MF_HDA_DOCKENB */<br>+ NATIVE_PU1K_CSEN_INVTX(1), /* 45 I2C5_SDA */<br>+ NATIVE_PU1K_CSEN_INVTX(1), /* 46 I2C4_SDA */<br>+ NATIVE_PU1K_CSEN_INVTX(1), /* 47 I2C6_SDA */<br>+ NATIVE_PU1K_CSEN_INVTX(1), /* 48 I2C5_SCL */<br>+ GPIO_NC, /* 49 I2C_NFC_SDA */<br>+ NATIVE_PU1K_CSEN_INVTX(1), /* 50 I2C4_SCL */<br>+ NATIVE_PU1K_CSEN_INVTX(1), /* 51 I2C6_SCL */<br>+ GPIO_NC, /* 52 I2C_NFC_SCL */<br>+ NATIVE_PU1K_CSEN_INVTX(1), /* 60 I2C1_SDA */<br>+ GPIO_NC, /* 61 I2C0_SDA */<br>+ GPIO_NC, /* 62 I2C2_SDA */<br>+ NATIVE_PU1K_CSEN_INVTX(1), /* 63 I2C1_SCL */<br>+ GPIO_INPUT_NO_PULL, /* 64 I2C3_SDA RAMID3*/<br>+ GPIO_NC, /* 65 I2C0_SCL */<br>+ GPIO_NC, /* 66 I2C2_SCL */<br>+ GPIO_INPUT_NO_PULL,/* 67 I2C3_SCL,RAMID1 */<br>+ GPIO_OUT_HIGH, /* 75 SATA_GP0 */<br>+ GPIO_NC,<br>+ /* 76 GPI SATA_GP1 */<br>+ GPIO_INPUT_PU_20K, /* 77 SATA_LEDN */<br>+ GPIO_NC, /* 78 SATA_GP2 */<br>+ Native_M1, /* 79 MF_SMB_ALERTB */<br>+ GPIO_INPUT_NO_PULL, /* 80 SATA_GP3,RAMID0 */<br>+ Native_M1, /* 81 NFC_DEV_WAKE , MF_SMB_CLK */<br>+ Native_M1, /* 82 NFC_FW_DOWNLOAD, MF_SMB_DATA */<br>+ /* Per DE request, change PCIE_CLKREQ0123B to GPIO_INPUT */<br>+ GPIO_INPUT_PU_20K, /* 90 PCIE_CLKREQ0B */<br>+ GPIO_INPUT_PU_20K, /* 91 GPI PCIE_CLKREQ1B/LTE_WAKE# */<br>+ Native_M1, /* 92 GP_SSP_2_CLK */<br>+ NATIVE_PU20K(1), /* 93 PCIE_CLKREQ2B/PCIE_CLKREQ_WLAN# */<br>+ Native_M1, /* 94 GP_SSP_2_RXD */<br>+ GPI(trig_edge_both, L1, P_5K_H, non_maskable, en_edge_detect, NA, NA),<br>+ /* 95 PCIE_CLKREQ3B/AUDIO_CODEC_IRQ */<br>+ Native_M1, /* 96 GP_SSP_2_FS */<br>+ NATIVE_FUNC(1, 0, inv_tx_enable), /* 97 GP_SSP_2f_TXD */<br>+ GPIO_END<br>+};<br>+<br>+<br>+/* North Community */<br>+static const struct soc_gpio_map gpn_gpio_map[] = {<br>+ GPIO_NC, /* 00 GPIO_DFX0 */<br>+ GPIO_NC, /* 01 GPIO_DFX3 */<br>+ GPIO_NC, /* 02 GPIO_DFX7 */<br>+ GPIO_NC, /* 03 GPIO_DFX1 */<br>+ GPIO_NC, /* 04 GPIO_DFX5 */<br>+ GPIO_NC, /* 05 GPIO_DFX4 */<br>+ GPIO_NC, /* 06 GPIO_DFX8 */<br>+ GPIO_NC, /* 07 GPIO_DFX2 */<br>+ GPIO_NC, /* 08 GPIO_DFX6 */<br>+ GPI(trig_edge_low, L8, NA, non_maskable, en_edge_rx_data ,<br>+ UNMASK_WAKE, SCI), /* 15 GPIO_SUS0 */<br>+ GPO_FUNC(NA, NA), /* 16 SEC_GPIO_SUS10 */<br>+ GPI(trig_edge_low, L0, P_1K_H, non_maskable, NA, NA, NA),<br>+ /* 17 GPIO_SUS3 */<br>+ GPI(trig_edge_low, L1, P_1K_H, non_maskable, NA, UNMASK_WAKE, NA),<br>+ /* 18 GPIO_SUS7 */<br>+ GPIO_NC, /* 19 GPIO_SUS1 */<br>+ GPIO_NC, /* 20 GPIO_SUS5 */<br>+ GPIO_NC, /* 21 SEC_GPIO_SUS11 */<br>+ GPIO_NC, /* 22 GPIO_SUS4 */<br>+ GPIO_NC, /* 23 SEC_GPIO_SUS8 */<br>+ Native_M6, /* 24 GPIO_SUS2 */<br>+ GPIO_INPUT_PU_5K,/* 25 GPIO_SUS6 */<br>+ Native_M1, /* 26 CX_PREQ_B */<br>+ GPIO_NC, /* 27 SEC_GPIO_SUS9 */<br>+ Native_M1, /* 30 TRST_B */<br>+ Native_M1, /* 31 TCK */<br>+ GPIO_SKIP, /* 32 PROCHOT_B */<br>+ GPIO_SKIP, /* 33 SVID0_DATA */<br>+ Native_M1, /* 34 TMS */<br>+ GPIO_NC, /* 35 CX_PRDY_B_2 */<br>+ GPIO_NC, /* 36 TDO_2 */<br>+ Native_M1, /* 37 CX_PRDY_B */<br>+ GPIO_SKIP, /* 38 SVID0_ALERT_B */<br>+ Native_M1, /* 39 TDO */<br>+ GPIO_SKIP, /* 40 SVID0_CLK */<br>+ Native_M1, /* 41 TDI */<br>+ Native_M2, /* 45 GP_CAMERASB05 */<br>+ Native_M2, /* 46 GP_CAMERASB02 */<br>+ Native_M2, /* 47 GP_CAMERASB08 */<br>+ Native_M2, /* 48 GP_CAMERASB00 */<br>+ Native_M2, /* 49 GP_CAMERASBO6 */<br>+ GPIO_NC, /* 50 GP_CAMERASB10 */<br>+ Native_M2, /* 51 GP_CAMERASB03 */<br>+ GPIO_NC, /* 52 GP_CAMERASB09 */<br>+ Native_M2, /* 53 GP_CAMERASB01 */<br>+ Native_M2, /* 54 GP_CAMERASB07 */<br>+ GPIO_NC, /* 55 GP_CAMERASB11 */<br>+ Native_M2, /* 56 GP_CAMERASB04 */<br>+ GPIO_NC, /* 60 PANEL0_BKLTEN */<br>+ GPIO_NC, /* 61 HV_DDI0_HPD */<br>+ NATIVE_PU1K_M1, /* 62 HV_DDI2_DDC_SDA */<br>+ Native_M1, /* 63 PANEL1_BKLTCTL */<br>+ NATIVE_TX_RX_EN, /* 64 HV_DDI1_HPD */<br>+ GPIO_NC, /* 65 PANEL0_BKLTCTL */<br>+ GPIO_NC, /* 66 HV_DDI0_DDC_SDA */<br>+ NATIVE_PU1K_M1, /* 67 HV_DDI2_DDC_SCL */<br>+ NATIVE_TX_RX_EN, /* 68 HV_DDI2_HPD */<br>+ Native_M1, /* 69 PANEL1_VDDEN */<br>+ Native_M1, /* 70 PANEL1_BKLTEN */<br>+ GPIO_NC, /* 71 HV_DDI0_DDC_SCL */<br>+ GPIO_NC, /* 72 PANEL0_VDDEN */<br>+ GPIO_END<br>+};<br>+<br>+<br>+/* East Community */<br>+static const struct soc_gpio_map gpe_gpio_map[] = {<br>+ Native_M1, /* 00 PMU_SLP_S3_B */<br>+ GPIO_NC, /* 01 PMU_BATLOW_B */<br>+ Native_M1, /* 02 SUS_STAT_B */<br>+ Native_M1, /* 03 PMU_SLP_S0IX_B */<br>+ Native_M1, /* 04 PMU_AC_PRESENT */<br>+ Native_M1, /* 05 PMU_PLTRST_B */<br>+ Native_M1, /* 06 PMU_SUSCLK */<br>+ GPIO_NC, /* 07 PMU_SLP_LAN_B */<br>+ Native_M1, /* 08 PMU_PWRBTN_B */<br>+ Native_M1, /* 09 PMU_SLP_S4_B */<br>+ NATIVE_FUNC(M1, P_1K_H, NA), /* 10 PMU_WAKE_B */<br>+ GPIO_NC, /* 11 PMU_WAKE_LAN_B */<br>+ GPIO_NC, /* 15 MF_GPIO_3 */<br>+ GPIO_NC, /* 16 MF_GPIO_7 */<br>+ GPIO_NC, /* 17 MF_I2C1_SCL */<br>+ GPIO_NC, /* 18 MF_GPIO_1 */<br>+ GPIO_NC, /* 19 MF_GPIO_5 */<br>+ GPIO_NC, /* 20 MF_GPIO_9 */<br>+ GPIO_NC, /* 21 MF_GPIO_0 */<br>+ GPIO_INPUT_PU_20K, /* 22 MF_GPIO_4 */<br>+ GPIO_NC, /* 23 MF_GPIO_8 */<br>+ GPIO_NC, /* 24 MF_GPIO_2 */<br>+ GPIO_NC, /* 25 MF_GPIO_6 */<br>+ GPIO_NC, /* 26 MF_I2C1_SDA */<br>+ GPIO_END<br>+};<br>+<br>+<br>+static struct soc_gpio_config gpio_config = {<br>+ /* BSW */<br>+ .north = gpn_gpio_map,<br>+ .southeast = gpse_gpio_map,<br>+ .southwest = gpsw_gpio_map,<br>+ .east = gpe_gpio_map<br>+};<br>+<br>+struct soc_gpio_config *mainboard_get_gpios(void)<br>+{<br>+ return &gpio_config;<br>+}<br>diff --git a/src/mainboard/google/cyan/variants/edgar/include/variant/acpi/dptf.asl b/src/mainboard/google/cyan/variants/edgar/include/variant/acpi/dptf.asl<br>new file mode 100644<br>index 0000000..287b4b4<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/variants/edgar/include/variant/acpi/dptf.asl<br>@@ -0,0 +1,78 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2012 Google Inc.<br>+ * Copyright (C) 2105 Intel Corp.<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; version 2 of the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#define DPTF_TSR0_SENSOR_ID 0<br>+#define DPTF_TSR0_SENSOR_NAME "TMP432_Internal"<br>+#define DPTF_TSR0_PASSIVE 45<br>+#define DPTF_TSR0_CRITICAL 75<br>+<br>+<br>+#define DPTF_TSR1_SENSOR_ID 2<br>+#define DPTF_TSR1_SENSOR_NAME "R4303_CPU"<br>+#define DPTF_TSR1_PASSIVE 49<br>+#define DPTF_TSR1_CRITICAL 70<br>+<br>+#define DPTF_TSR2_SENSOR_ID 1<br>+#define DPTF_TSR2_SENSOR_NAME "TMP432_CPU_bottom"<br>+#define DPTF_TSR2_PASSIVE 49<br>+#define DPTF_TSR2_CRITICAL 70<br>+<br>+<br>+#define DPTF_ENABLE_CHARGER<br>+<br>+/* Charger performance states, board-specific values from charger and EC */<br>+Name (CHPS, Package () {<br>+ Package () { 0, 0, 0, 0, 255, 0x6a4, "mA", 0 }, /* 1.7A (MAX) */<br>+ Package () { 0, 0, 0, 0, 24, 0x600, "mA", 0 }, /* 1.5A */<br>+ Package () { 0, 0, 0, 0, 16, 0x400, "mA", 0 }, /* 1.0A */<br>+ Package () { 0, 0, 0, 0, 8, 0x200, "mA", 0 }, /* 0.5A */<br>+ Package () { 0, 0, 0, 0, 0, 0x000, "mA", 0 }, /* 0.0A */<br>+})<br>+<br>+/* Mainboard specific _PDL is 1GHz */<br>+Name (MPDL, 8)<br>+<br>+Name (DTRT, Package () {<br>+ /* CPU Throttle Effect on CPU */<br>+ Package () { \_SB.PCI0.B0DB, \_SB.PCI0.B0DB, 100, 50, 0, 0, 0, 0 },<br>+<br>+ /* CPU Effect on Temp Sensor 1 */<br>+ Package () { \_SB.PCI0.B0DB, \_SB.DPTF.TSR1, 100, 300, 0, 0, 0, 0 },<br>+<br>+ /* CPU Effect on Temp Sensor 2 */<br>+ Package () { \_SB.PCI0.B0DB, \_SB.DPTF.TSR2, 100, 300, 0, 0, 0, 0 },<br>+})<br>+<br>+Name (MPPC, Package ()<br>+{<br>+ 0x2, /* Revision */<br>+ Package () { /* Power Limit 1 */<br>+ 0, /* PowerLimitIndex, 0 for Power Limit 1 */<br>+ 2000, /* PowerLimitMinimum */<br>+ 6200, /* PowerLimitMaximum */<br>+ 1000, /* TimeWindowMinimum */<br>+ 1000, /* TimeWindowMaximum */<br>+ 200 /* StepSize */<br>+ },<br>+ Package () { /* Power Limit 2 */<br>+ 1, /* PowerLimitIndex, 1 for Power Limit 2 */<br>+ 8000, /* PowerLimitMinimum */<br>+ 8000, /* PowerLimitMaximum */<br>+ 1000, /* TimeWindowMinimum */<br>+ 1000, /* TimeWindowMaximum */<br>+ 1000 /* StepSize */<br>+ }<br>+})<br>diff --git a/src/mainboard/google/cyan/variants/edgar/include/variant/acpi/mainboard.asl b/src/mainboard/google/cyan/variants/edgar/include/variant/acpi/mainboard.asl<br>new file mode 100644<br>index 0000000..8e7868e<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/variants/edgar/include/variant/acpi/mainboard.asl<br>@@ -0,0 +1,20 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2017 Matt DeVillier<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; version 2 of the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+/* Elan trackpad */<br>+#include <mainboard/google/cyan/acpi/trackpad_elan.asl><br>+<br>+/* Realtek audio codec */<br>+#include <mainboard/google/cyan/acpi/codec_realtek.asl><br>diff --git a/src/mainboard/google/cyan/variants/edgar/include/variant/onboard.h b/src/mainboard/google/cyan/variants/edgar/include/variant/onboard.h<br>new file mode 100644<br>index 0000000..796ddb0<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/variants/edgar/include/variant/onboard.h<br>@@ -0,0 +1,67 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2013 Google Inc.<br>+ * Copyright (C) 2015 Intel Corp.<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; version 2 of the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#ifndef ONBOARD_H<br>+#define ONBOARD_H<br>+<br>+#include <mainboard/google/cyan/irqroute.h><br>+<br>+/*<br>+ * Calculation of gpio based irq.<br>+ * Gpio banks ordering : GPSW, GPNC, GPEC, GPSE<br>+ * Max direct irq (MAX_DIRECT_IRQ) is 114.<br>+ * Size of gpio banks are<br>+ * GPSW_SIZE = 98<br>+ * GPNC_SIZE = 73<br>+ * GPEC_SIZE = 27<br>+ * GPSE_SIZE = 86<br>+ */<br>+<br>+/*<br>+ * gpio based irq for kbd, 17th index in North Bank<br>+ * MAX_DIRECT_IRQ + GPSW_SIZE + 18<br>+ */<br>+/* ToDo: change kbd irq to gpio bank index */<br>+#define BOARD_I8042_IRQ 182<br>+<br>+/* Audio: Gpio index in SW bank */<br>+#define JACK_DETECT_GPIO_INDEX 95<br>+/* SCI: Gpio index in N bank */<br>+#define BOARD_SCI_GPIO_INDEX 15<br>+/* Trackpad: Gpio index in N bank */<br>+#define BOARD_TRACKPAD_GPIO_INDEX 18<br>+<br>+#define BOARD_TRACKPAD_NAME "trackpad"<br>+#define BOARD_TRACKPAD_WAKE_GPIO ACPI_ENABLE_WAKE_SUS_GPIO(1)<br>+#define BOARD_TRACKPAD_I2C_BUS 5<br>+#define BOARD_TRACKPAD_I2C_ADDR 0x15<br>+<br>+/* SD CARD gpio */<br>+#define SDCARD_CD 81<br>+<br>+#define AUDIO_CODEC_HID "10EC5650"<br>+#define AUDIO_CODEC_CID "10EC5650"<br>+#define AUDIO_CODEC_DDN "RTEK Codec Controller "<br>+#define AUDIO_CODEC_I2C_ADDR 0x1A<br>+#define BCRD2_PMIC_I2C_BUS 0x01<br>+<br>+/* I2C data hold time */<br>+#define BOARD_I2C6_DATA_HOLD_TIME 0x2F<br>+<br>+#define DPTF_CPU_PASSIVE 88<br>+#define DPTF_CPU_CRITICAL 90<br>+<br>+#endif<br>\ No newline at end of file<br>diff --git a/src/mainboard/google/cyan/variants/edgar/spd.c b/src/mainboard/google/cyan/variants/edgar/spd.c<br>new file mode 100644<br>index 0000000..0bb16f4<br>--- /dev/null<br>+++ b/src/mainboard/google/cyan/variants/edgar/spd.c<br>@@ -0,0 +1,221 @@<br>+/*<br>+ * This file is part of the coreboot project.<br>+ *<br>+ * Copyright (C) 2013 Google Inc.<br>+ * Copyright (C) 2015 Intel Corp.<br>+ *<br>+ * This program is free software; you can redistribute it and/or modify<br>+ * it under the terms of the GNU General Public License as published by<br>+ * the Free Software Foundation; version 2 of the License.<br>+ *<br>+ * This program is distributed in the hope that it will be useful,<br>+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>+ * GNU General Public License for more details.<br>+ */<br>+<br>+#include <cbfs.h><br>+#include <cbmem.h><br>+#include <console/console.h><br>+#include <gpio.h><br>+#include <lib.h><br>+#include <spd.h><br>+#include <memory_info.h><br>+#include <smbios.h><br>+#include <soc/gpio.h><br>+#include <soc/romstage.h><br>+#include <string.h><br>+#include <mainboard_spd.h><br>+<br>+/*<br>+ * 0b0000 - 4GiB total - 2 x 2GiB Samsung K4E8E304EE-EGCE<br>+ * 0b0001 - 4GiB total - 2 x 2GiB Hynix H9CCNNN8JTBLAR-NUD<br>+ * 0b0010 - 2GiB total - 1 x 2GiB Samsung K4E8E304EE-EGCE<br>+ * 0b0011 - 2GiB total - 1 x 2GiB Hynix H9CCNNN8JTBLAR-NUD<br>+ * 0b0100 - 4GiB total - 2 x 2GiB Samsung K4E8E324EB-EGCF<br>+ * 0b0101 - TBD<br>+ * 0b0110 - 2GiB total - 1 x 2GiB Samsung K4E8E324EB-EGCF<br>+ */<br>+static const uint32_t dual_channel_config = (1 << 0) | (1 << 1) | (1 << 4);<br>+<br>+static void *get_spd_pointer(char *spd_file_content, int total_spds, int *dual)<br>+{<br>+ int ram_id = 0;<br>+<br>+ gpio_t spd_gpios[] = {<br>+ GP_SW_80, /* SATA_GP3, RAMID0 */<br>+ GP_SW_67, /* I2C3_SCL, RAMID1 */<br>+ GP_SE_02, /* MF_PLT_CLK1, RAMID2 */<br>+ GP_SW_64, /* I2C3_SDA, RAMID3 */<br>+ };<br>+<br>+ ram_id = gpio_base2_value(spd_gpios, ARRAY_SIZE(spd_gpios));<br>+ printk(BIOS_DEBUG, "ram_id=%d, total_spds: %d\n", ram_id, total_spds);<br>+ if (ram_id >= total_spds)<br>+ return NULL;<br>+<br>+ /* Determine if this is a single or dual channel memory system */<br>+ if (dual_channel_config & (1 << ram_id))<br>+ *dual = 1;<br>+<br>+ /* Display the RAM type */<br>+ switch (ram_id) {<br>+ case 0:<br>+ printk(BIOS_DEBUG, "4GiB Samsung K4E8E304EE-EGCE\n");<br>+ break;<br>+ case 1:<br>+ printk(BIOS_DEBUG, "4GiB Hynix H9CCNNN8JTBLAR-NUD\n");<br>+ break;<br>+ case 2:<br>+ printk(BIOS_DEBUG, "2GiB Samsung K4E8E304EE-EGCE\n");<br>+ break;<br>+ case 3:<br>+ printk(BIOS_DEBUG, "2GiB Hynix H9CCNNN8JTBLAR-NUD\n");<br>+ break;<br>+ case 4:<br>+ printk(BIOS_DEBUG, "4GiB Samsung K4E8E324EB-EGCF\n");<br>+ break;<br>+ case 5:<br>+ printk(BIOS_DEBUG, "empty\n");<br>+ break;<br>+ case 6:<br>+ printk(BIOS_DEBUG, "2GiB Samsung K4E8E324EB-EGCF\n");<br>+ break;<br>+ }<br>+<br>+ /* Return the serial product data for the RAM */<br>+ return &spd_file_content[SPD_LEN * ram_id];<br>+}<br>+<br>+/* Copy SPD data for on-board memory */<br>+void mainboard_fill_spd_data(struct pei_data *ps)<br>+{<br>+ char *spd_file;<br>+ size_t spd_file_len;<br>+ void *spd_content;<br>+ int dual_channel = 0;<br>+<br>+ /* Find the SPD data in CBFS. */<br>+ spd_file = cbfs_boot_map_with_leak("spd.bin", CBFS_TYPE_SPD,<br>+ &spd_file_len);<br>+ if (!spd_file)<br>+ die("SPD data not found.");<br>+<br>+ if (spd_file_len < SPD_LEN)<br>+ die("Missing SPD data.");<br>+<br>+ /*<br>+ * Both channels are always present in SPD data. Always use matched<br>+ * DIMMs so use the same SPD data for each DIMM.<br>+ */<br>+ spd_content = get_spd_pointer(spd_file,<br>+ spd_file_len / SPD_LEN,<br>+ &dual_channel);<br>+ if (IS_ENABLED(CONFIG_DISPLAY_SPD_DATA) && spd_content != NULL) {<br>+ printk(BIOS_DEBUG, "SPD Data:\n");<br>+ hexdump(spd_content, SPD_LEN);<br>+ printk(BIOS_DEBUG, "\n");<br>+ }<br>+<br>+ /*<br>+ * Set SPD and memory configuration:<br>+ * Memory type: 0=DimmInstalled,<br>+ * 1=SolderDownMemory,<br>+ * 2=DimmDisabled<br>+ */<br>+ if (spd_content != NULL) {<br>+ ps->spd_data_ch0 = spd_content;<br>+ ps->spd_ch0_config = 1;<br>+ if (dual_channel) {<br>+ ps->spd_data_ch1 = spd_content;<br>+ ps->spd_ch1_config = 1;<br>+ } else {<br>+ ps->spd_ch1_config = 2;<br>+ }<br>+ }<br>+}<br>+<br>+static void set_dimm_info(uint8_t *spd, struct dimm_info *dimm)<br>+{<br>+ const int spd_capmb[8] = { 1, 2, 4, 8, 16, 32, 64, 0 };<br>+ const int spd_ranks[8] = { 1, 2, 3, 4, -1, -1, -1, -1 };<br>+ const int spd_devw[8] = { 4, 8, 16, 32, -1, -1, -1, -1 };<br>+ const int spd_busw[8] = { 8, 16, 32, 64, -1, -1, -1, -1 };<br>+<br>+ int capmb = spd_capmb[spd[SPD_DENSITY_BANKS] & 7] * 256;<br>+ int ranks = spd_ranks[(spd[SPD_ORGANIZATION] >> 3) & 7];<br>+ int devw = spd_devw[spd[SPD_ORGANIZATION] & 7];<br>+ int busw = spd_busw[spd[SPD_BUS_DEV_WIDTH] & 7];<br>+<br>+ void *hob_list_ptr;<br>+ EFI_HOB_GUID_TYPE *hob_ptr;<br>+ FSP_SMBIOS_MEMORY_INFO *memory_info_hob;<br>+ const EFI_GUID memory_info_hob_guid = FSP_SMBIOS_MEMORY_INFO_GUID;<br>+<br>+ /* Locate the memory info HOB, presence validated by raminit */<br>+ hob_list_ptr = fsp_get_hob_list();<br>+ hob_ptr = get_next_guid_hob(&memory_info_hob_guid, hob_list_ptr);<br>+ if (hob_ptr != NULL) {<br>+ memory_info_hob = (FSP_SMBIOS_MEMORY_INFO *)(hob_ptr + 1);<br>+ dimm->ddr_frequency = memory_info_hob->MemoryFrequencyInMHz;<br>+ } else {<br>+ printk(BIOS_ERR, "Can't get memory info hob pointer\n");<br>+ dimm->ddr_frequency = 0;<br>+ }<br>+<br>+ /* Parse the SPD data to determine the DIMM information */<br>+ dimm->ddr_type = MEMORY_DEVICE_LPDDR3;<br>+ dimm->dimm_size = capmb / 8 * busw / devw * ranks; /* MiB */<br>+ dimm->mod_type = spd[3] & 0xf;<br>+ memcpy((char *)&dimm->module_part_number[0], &spd[0x80],<br>+ sizeof(dimm->module_part_number) - 1);<br>+ dimm->mod_id = *(uint16_t *)&spd[0x94];<br>+<br>+ switch (busw) {<br>+ default:<br>+ case 8:<br>+ dimm->bus_width = MEMORY_BUS_WIDTH_8;<br>+ break;<br>+<br>+ case 16:<br>+ dimm->bus_width = MEMORY_BUS_WIDTH_16;<br>+ break;<br>+<br>+ case 32:<br>+ dimm->bus_width = MEMORY_BUS_WIDTH_32;<br>+ break;<br>+<br>+ case 64:<br>+ dimm->bus_width = MEMORY_BUS_WIDTH_64;<br>+ break;<br>+ }<br>+}<br>+<br>+void mainboard_save_dimm_info(struct romstage_params *params)<br>+{<br>+ struct dimm_info *dimm;<br>+ struct memory_info *mem_info;<br>+<br>+ /*<br>+ * Allocate CBMEM area for DIMM information used to populate SMBIOS<br>+ * table 17<br>+ */<br>+ mem_info = cbmem_add(CBMEM_ID_MEMINFO, sizeof(*mem_info));<br>+ printk(BIOS_DEBUG, "CBMEM entry for DIMM info: 0x%p\n", mem_info);<br>+ if (mem_info == NULL)<br>+ return;<br>+ memset(mem_info, 0, sizeof(*mem_info));<br>+<br>+ /* Describe the first channel memory */<br>+ dimm = &mem_info->dimm[0];<br>+ set_dimm_info(params->pei_data->spd_data_ch0, dimm);<br>+ mem_info->dimm_cnt = 1;<br>+<br>+ /* Describe the second channel memory */<br>+ if (params->pei_data->spd_ch1_config == 1) {<br>+ dimm = &mem_info->dimm[1];<br>+ set_dimm_info(params->pei_data->spd_data_ch1, dimm);<br>+ dimm->channel_num = 1;<br>+ mem_info->dimm_cnt = 2;<br>+ }<br>+}<br></pre><p>To view, visit <a href="https://review.coreboot.org/21127">change 21127</a>. To unsubscribe, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/21127"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I58548cbbc85828f37c0023e8aa9e09bdca612659 </div>
<div style="display:none"> Gerrit-Change-Number: 21127 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Matt DeVillier <matt.devillier@gmail.com> </div>