Dtrain Hsu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37229 )
Change subject: hatch: Create stryke variant
......................................................................
hatch: Create stryke variant
(Auto-Generated by create_coreboot_variant.sh version 1.0.0).
BUG=b:145101696
TEST=util/abuild/abuild -p none -t google/hatch -x -a
make sure the build includes GOOGLE_STRYKE
Signed-off-by: Dtrain Hsu <dtrain_hsu(a)compal.corp-partner.google.com>
Change-Id: Iea6f8a1c6c24a1e3545c364551cb623debdc4a1a
---
M src/mainboard/google/hatch/Kconfig
M src/mainboard/google/hatch/Kconfig.name
A src/mainboard/google/hatch/variants/stryke/Makefile.inc
A src/mainboard/google/hatch/variants/stryke/include/variant/acpi/dptf.asl
A src/mainboard/google/hatch/variants/stryke/include/variant/ec.h
A src/mainboard/google/hatch/variants/stryke/include/variant/gpio.h
A src/mainboard/google/hatch/variants/stryke/overridetree.cb
7 files changed, 85 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/29/37229/1
diff --git a/src/mainboard/google/hatch/Kconfig b/src/mainboard/google/hatch/Kconfig
index d6e6e46..8be340e 100644
--- a/src/mainboard/google/hatch/Kconfig
+++ b/src/mainboard/google/hatch/Kconfig
@@ -96,6 +96,7 @@
default "Kindred" if BOARD_GOOGLE_KINDRED
default "Kohaku" if BOARD_GOOGLE_KOHAKU
default "Puff" if BOARD_GOOGLE_PUFF
+ default "Stryke" if BOARD_GOOGLE_STRYKE
config MAINBOARD_VENDOR
string
@@ -125,6 +126,7 @@
default "kindred" if BOARD_GOOGLE_KINDRED
default "kohaku" if BOARD_GOOGLE_KOHAKU
default "puff" if BOARD_GOOGLE_PUFF
+ default "stryke" if BOARD_GOOGLE_STRYKE
config VBOOT
select HAS_RECOVERY_MRC_CACHE
diff --git a/src/mainboard/google/hatch/Kconfig.name b/src/mainboard/google/hatch/Kconfig.name
index 82da883..ed90de6 100644
--- a/src/mainboard/google/hatch/Kconfig.name
+++ b/src/mainboard/google/hatch/Kconfig.name
@@ -50,3 +50,8 @@
select BOARD_ROMSIZE_KB_16384
select CHROMEOS_DSM_CALIB
select DRIVERS_I2C_RT1011
+
+config BOARD_GOOGLE_STRYKE
+ bool "-> Stryke"
+ select BOARD_GOOGLE_BASEBOARD_HATCH
+ select BOARD_ROMSIZE_KB_16384
diff --git a/src/mainboard/google/hatch/variants/stryke/Makefile.inc b/src/mainboard/google/hatch/variants/stryke/Makefile.inc
new file mode 100644
index 0000000..38cf728
--- /dev/null
+++ b/src/mainboard/google/hatch/variants/stryke/Makefile.inc
@@ -0,0 +1,13 @@
+## This file is part of the coreboot project.
+##
+## 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.
+##
+
+SPD_SOURCES =
diff --git a/src/mainboard/google/hatch/variants/stryke/include/variant/acpi/dptf.asl b/src/mainboard/google/hatch/variants/stryke/include/variant/acpi/dptf.asl
new file mode 100644
index 0000000..496334d
--- /dev/null
+++ b/src/mainboard/google/hatch/variants/stryke/include/variant/acpi/dptf.asl
@@ -0,0 +1,14 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * 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/acpi/dptf.asl>
diff --git a/src/mainboard/google/hatch/variants/stryke/include/variant/ec.h b/src/mainboard/google/hatch/variants/stryke/include/variant/ec.h
new file mode 100644
index 0000000..2526962
--- /dev/null
+++ b/src/mainboard/google/hatch/variants/stryke/include/variant/ec.h
@@ -0,0 +1,19 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * 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.
+ */
+
+#ifndef VARIANT_EC_H
+#define VARIANT_EC_H
+
+#include <baseboard/ec.h>
+
+#endif
diff --git a/src/mainboard/google/hatch/variants/stryke/include/variant/gpio.h b/src/mainboard/google/hatch/variants/stryke/include/variant/gpio.h
new file mode 100644
index 0000000..3b07c1b
--- /dev/null
+++ b/src/mainboard/google/hatch/variants/stryke/include/variant/gpio.h
@@ -0,0 +1,26 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * 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.
+ */
+
+#ifndef VARIANT_GPIO_H
+#define VARIANT_GPIO_H
+
+#include <baseboard/gpio.h>
+
+/* Memory configuration board straps */
+/* Copied from baseboard and may need to change for the new variant. */
+#define GPIO_MEM_CONFIG_0 GPP_F20
+#define GPIO_MEM_CONFIG_1 GPP_F21
+#define GPIO_MEM_CONFIG_2 GPP_F11
+#define GPIO_MEM_CONFIG_3 GPP_F22
+
+#endif
diff --git a/src/mainboard/google/hatch/variants/stryke/overridetree.cb b/src/mainboard/google/hatch/variants/stryke/overridetree.cb
new file mode 100644
index 0000000..abbcaaa
--- /dev/null
+++ b/src/mainboard/google/hatch/variants/stryke/overridetree.cb
@@ -0,0 +1,6 @@
+chip soc/intel/cannonlake
+
+ device domain 0 on
+ end
+
+end
--
To view, visit https://review.coreboot.org/c/coreboot/+/37229
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iea6f8a1c6c24a1e3545c364551cb623debdc4a1a
Gerrit-Change-Number: 37229
Gerrit-PatchSet: 1
Gerrit-Owner: Dtrain Hsu <dtrain_hsu(a)compal.corp-partner.google.com>
Gerrit-MessageType: newchange
Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37220 )
Change subject: soc/amd/stoneyidge: Use USE_AMD_BLOBS to remove default paths
......................................................................
soc/amd/stoneyidge: Use USE_AMD_BLOBS to remove default paths
Remove default path/to/file strings when USE_AMD_BLOBS is not enabled.
This will result in a buildable, but not runable image, in the default
configuration.
Drop the check for HAVE_MERLINFALCON_BINARIES in the path default.
A later patch will address the poor use of this symbol
All PSP blobs are still assumed to be in the same directory as the AMD
public key. Qualify building the amdfw.rom intermediate image and
including it into coreboot.rom on whether the public key remains "".
This change infers it's OK to skip xHCI and GEC firmware too, although
the images normally reside in a separate directory.
This change only determines whether default paths and names exist.
Paths will be updated in a follow-on patch.
Change-Id: Ic21fbd7a58b340a9bcaaea456e1f38b567215b81
Signed-off-by: Marshall Dawson <marshalldawson3rd(a)gmail.com>
---
M src/soc/amd/stoneyridge/Kconfig
M src/soc/amd/stoneyridge/Makefile.inc
2 files changed, 20 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/37220/1
diff --git a/src/soc/amd/stoneyridge/Kconfig b/src/soc/amd/stoneyridge/Kconfig
index b55833d..c477e03 100644
--- a/src/soc/amd/stoneyridge/Kconfig
+++ b/src/soc/amd/stoneyridge/Kconfig
@@ -176,7 +176,8 @@
config VGA_BIOS_FILE
string
- default "3rdparty/blobs/soc/amd/merlinfalcon/VBIOS.bin" if AMD_APU_MERLINFALCON && HAVE_MERLINFALCON_BINARIES
+ default "" if !USE_AMD_BLOBS
+ default "3rdparty/blobs/soc/amd/merlinfalcon/VBIOS.bin" if AMD_APU_MERLINFALCON
default "3rdparty/blobs/soc/amd/stoneyridge/VBIOS.bin"
config S3_VGA_ROM_RUN
@@ -216,6 +217,7 @@
config STONEYRIDGE_XHCI_FWM_FILE
string "XHCI firmware path and filename"
+ default "" if !USE_AMD_BLOBS
default "3rdparty/blobs/soc/amd/stoneyridge/xhci.bin"
depends on STONEYRIDGE_XHCI_FWM
@@ -225,7 +227,8 @@
config AMD_PUBKEY_FILE
string "AMD public Key"
- default "3rdparty/blobs/soc/amd/merlinfalcon/PSP/AmdPubKeyCZ.bin" if AMD_APU_MERLINFALCON && HAVE_MERLINFALCON_BINARIES
+ default "" if !USE_AMD_BLOBS
+ default "3rdparty/blobs/soc/amd/merlinfalcon/PSP/AmdPubKeyCZ.bin" if AMD_APU_MERLINFALCON
default "3rdparty/blobs/soc/amd/stoneyridge/PSP/AmdPubKeyST.bin"
config STONEYRIDGE_SATA_MODE
diff --git a/src/soc/amd/stoneyridge/Makefile.inc b/src/soc/amd/stoneyridge/Makefile.inc
index f697fc2..d2d64c8 100644
--- a/src/soc/amd/stoneyridge/Makefile.inc
+++ b/src/soc/amd/stoneyridge/Makefile.inc
@@ -137,20 +137,15 @@
### 0
FIRMWARE_LOCATE=$(dir $(call strip_quotes, $(CONFIG_AMD_PUBKEY_FILE)))
+ifneq ($(FIRMWARE_LOCATE),)
ifeq ($(CONFIG_AMD_APU_STONEYRIDGE),y)
FIRMWARE_TYPE=ST
else
-
ifeq ($(CONFIG_AMD_APU_MERLINFALCON),y)
-# If Merlin Falcon, but blobs aren't present, use Stoney Ridge instead
-ifeq ($(CONFIG_HAVE_MERLINFALCON_BINARIES),y)
FIRMWARE_TYPE=CZ
else
-FIRMWARE_TYPE=ST
-endif # CONFIG_HAVE_MERLINFALCON_BINARIES
-else
-$(error stoneyridge: Unknown FIRMWARE_TYPE)
+$(error soc/amd/stoneyridge: Unusable FIRMWARE_TYPE)
endif # CONFIG_AMD_APU_MERLINFALCON
endif # CONFIG_AMD_APU_STONEYRIDGE
@@ -332,4 +327,17 @@
endif # ifeq ($(CONFIG_SOC_AMD_PSP_SELECTABLE_SMU_FW),y)
+else # ifneq ($(FIRMWARE_LOCATE),)
+
+warn_no_amdfw:
+ printf "\n\t** WARNING **\n"
+ printf "coreboot has been built with no PSP firmware and "
+ printf "a non-booting image has been generated.\n\n"
+
+PHONY+=warn_no_amdfw
+
+files_added:: warn_no_amdfw
+
+endif # ifneq ($(FIRMWARE_LOCATE),)
+
endif # ($(CONFIG_SOC_AMD_MERLINFALCON)$(CONFIG_SOC_AMD_STONEYRIDGE_FP4)$(CONFIG_SOC_AMD_STONEYRIDGE_FT4),y)
--
To view, visit https://review.coreboot.org/c/coreboot/+/37220
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ic21fbd7a58b340a9bcaaea456e1f38b567215b81
Gerrit-Change-Number: 37220
Gerrit-PatchSet: 1
Gerrit-Owner: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Stefan Reinauer has uploaded this change for review. ( https://review.coreboot.org/c/em100/+/37258 )
Change subject: Add compatibility mode
......................................................................
Add compatibility mode
Add a compatibility mode to the em100 tool. Right now coreboot
and the Chrome OS build system carry a bunch of work-arounds to
produce two sets of images, one for "real SPI chips" and one for
use with the EM100Pro. Instead, we can (and should) just recognize
these images and have the em100 tool handle them correctly during
upload. em100 --compatibility ... does exactly that.
Signed-off-by: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Change-Id: Ie02264facb028841d18ed84680ffa40f45987510
---
M Makefile
M em100.c
M em100.h
A ifd.h
A image.c
5 files changed, 251 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/em100 refs/changes/58/37258/1
diff --git a/Makefile b/Makefile
index 0b7c217..3bdb103 100644
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,7 @@
XZ = xz/xz_crc32.c xz/xz_crc64.c xz/xz_dec_bcj.c xz/xz_dec_lzma2.c xz/xz_dec_stream.c
SOURCES = em100.c firmware.c fpga.c hexdump.c sdram.c spi.c system.c trace.c usb.c
-SOURCES += curl.c chips.c tar.c $(XZ)
+SOURCES += image.c curl.c chips.c tar.c $(XZ)
OBJECTS = $(SOURCES:.c=.o)
all: dep em100
diff --git a/em100.c b/em100.c
index e52222b..abd8415 100644
--- a/em100.c
+++ b/em100.c
@@ -758,7 +758,8 @@
{"device", 1, 0, 'x'},
{"list-devices", 0, 0, 'l'},
{"update-files", 0, 0, 'U'},
- {"terminal",0 ,0, 'T'},
+ {"terminal", 0, 0, 'T'},
+ {"compatible", 0, 0, 'C'},
{NULL, 0, 0, 0}
};
@@ -787,6 +788,7 @@
" -x|--device EMxxxxxx use EM100pro with serial no EMxxxxxx\n"
" -l|--list-devices list all connected EM100pro devices\n"
" -U|--update-files update device (chip) and firmware database\n"
+ " -C|--compatible enable compatibility mode (patch image for EM100Pro)\n"
" -D|--debug: print debug information.\n"
" -h|--help: this help text\n\n",
name);
@@ -802,7 +804,7 @@
const char *holdpin = NULL;
int do_start = 0, do_stop = 0;
int verify = 0, trace = 0, terminal=0;
- int debug = 0;
+ int debug = 0, compatibility = 0;
int bus = 0, device = 0;
int firmware_is_dpfw = 0;
unsigned int serial_number = 0;
@@ -810,7 +812,7 @@
unsigned int spi_start_address = 0;
const char *voltage = NULL;
- while ((opt = getopt_long(argc, argv, "c:d:a:u:rsvtO:F:f:g:S:V:p:Dx:lUhT",
+ while ((opt = getopt_long(argc, argv, "c:d:a:u:rsvtO:F:f:g:S:V:p:DCx:lUhT",
longopts, &idx)) != -1) {
switch (opt) {
case 'c':
@@ -881,6 +883,9 @@
case 'U':
update_all_files();
return 0;
+ case 'C':
+ compatibility = 1;
+ break;
default:
case 'h':
usage(argv[0]);
@@ -1074,6 +1079,9 @@
return 1;
}
+ if (compatibility)
+ autocorrect_image(&em100, data, length);
+
if (spi_start_address) {
readback = malloc(maxlen);
if (readback == NULL) {
diff --git a/em100.h b/em100.h
index f0bacf2..448e6bb 100644
--- a/em100.h
+++ b/em100.h
@@ -196,9 +196,13 @@
#define MB * 1024 * 1024
#define FILENAME_BUFFER_SIZE 1024
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
char *get_em100_file(const char *name);
/* Chips */
int parse_dcfg(chipdesc *chip, TFILE *dcfg);
+/* Images */
+int autocorrect_image(struct em100 *em100, char *image, size_t size);
+
#endif
diff --git a/ifd.h b/ifd.h
new file mode 100644
index 0000000..dac4edb
--- /dev/null
+++ b/ifd.h
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+enum ifd_version {
+ IFD_VERSION_1,
+ IFD_VERSION_2,
+};
+
+enum platform {
+ PLATFORM_APL,
+ PLATFORM_CNL,
+ PLATFORM_GLK,
+ PLATFORM_ICL,
+ PLATFORM_SKLKBL,
+ PLATFORM_TGL,
+};
+
+enum spi_frequency {
+ SPI_FREQUENCY_20MHZ = 0,
+ SPI_FREQUENCY_33MHZ = 1,
+ SPI_FREQUENCY_48MHZ = 2,
+ SPI_FREQUENCY_50MHZ_30MHZ = 4,
+ SPI_FREQUENCY_17MHZ = 6,
+};
+
+/* flash descriptor */
+typedef struct {
+ uint32_t flvalsig;
+ uint32_t flmap0;
+ uint32_t flmap1;
+ uint32_t flmap2;
+} __attribute__((packed)) fdbar_t;
+
+/* component section */
+typedef struct {
+ uint32_t flcomp;
+ uint32_t flill;
+ uint32_t flpb;
+} __attribute__((packed)) fcba_t;
+
diff --git a/image.c b/image.c
new file mode 100644
index 0000000..138436b
--- /dev/null
+++ b/image.c
@@ -0,0 +1,185 @@
+/*
+ * 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 <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include "em100.h"
+#include "ifd.h"
+
+/**
+ * PTR_IN_RANGE - examine whether a pointer falls in [base, base + limit)
+ * @param ptr: the non-void* pointer to a single arbitrary-sized object.
+ * @param base: base address represented with char* type.
+ * @param limit: upper limit of the legal address.
+ *
+ */
+#define PTR_IN_RANGE(ptr, base, limit) \
+ ((const char *)(ptr) >= (base) && \
+ (const char *)&(ptr)[1] <= (base) + (limit))
+
+static int ifd_version;
+static int platform = -1;
+
+static fdbar_t *find_fd(char *image, int size)
+{
+ int i, found = 0;
+
+ /* Scan for FD signature */
+ for (i = 0; i < (size - 4); i += 4) {
+ if (*(uint32_t *) (image + i) == 0x0FF0A55A) {
+ found = 1;
+ break; // signature found.
+ }
+ }
+
+ if (!found) {
+ printf("No Flash Descriptor found in this image\n");
+ return NULL;
+ }
+
+ fdbar_t *fdb = (fdbar_t *) (image + i);
+ return PTR_IN_RANGE(fdb, image, size) ? fdb : NULL;
+}
+
+static fcba_t *find_fcba(char *image, int size)
+{
+ fdbar_t *fdb = find_fd(image, size);
+ if (!fdb)
+ return NULL;
+ fcba_t *fcba = (fcba_t *) (image + ((fdb->flmap0 & 0xff) << 4));
+ return PTR_IN_RANGE(fcba, image, size) ? fcba : NULL;
+
+}
+
+/*
+ * Some newer platforms have re-defined the FCBA field that was used to
+ * distinguish IFD v1 v/s v2. Define a list of platforms that we know do not
+ * have the required FCBA field, but are IFD v2 and return true if current
+ * platform is one of them.
+ */
+static int is_platform_ifd_2(void)
+{
+ static const int ifd_2_platforms[] = {
+ PLATFORM_GLK,
+ PLATFORM_CNL,
+ PLATFORM_ICL,
+ PLATFORM_TGL,
+ };
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(ifd_2_platforms); i++) {
+ if (platform == ifd_2_platforms[i])
+ return 1;
+ }
+
+ return 0;
+}
+
+/*
+ * There is no version field in the descriptor so to determine
+ * if this is a new descriptor format we check the hardcoded SPI
+ * read frequency to see if it is fixed at 20MHz or 17MHz.
+ */
+static int get_ifd_version_from_fcba(char *image, int size)
+{
+ int read_freq;
+ const fcba_t *fcba = find_fcba(image, size);
+ const fdbar_t *fdb = find_fd(image, size);
+ if (!fcba || !fdb)
+ exit(EXIT_FAILURE);
+
+ read_freq = (fcba->flcomp >> 17) & 7;
+
+ switch (read_freq) {
+ case SPI_FREQUENCY_20MHZ:
+ return IFD_VERSION_1;
+ case SPI_FREQUENCY_17MHZ:
+ case SPI_FREQUENCY_50MHZ_30MHZ:
+ return IFD_VERSION_2;
+ default:
+ fprintf(stderr, "Unknown descriptor version: %d\n",
+ read_freq);
+ exit(EXIT_FAILURE);
+ }
+}
+
+static void check_ifd_version(char *image, int size)
+{
+ if (is_platform_ifd_2())
+ ifd_version = IFD_VERSION_2;
+ else
+ ifd_version = get_ifd_version_from_fcba(image, size);
+}
+
+static void set_spi_frequency(char *image, int size, enum spi_frequency freq)
+{
+ fcba_t *fcba = find_fcba(image, size);
+ if (!fcba)
+ exit(EXIT_FAILURE);
+
+ /* clear bits 21-29 */
+ fcba->flcomp &= ~0x3fe00000;
+ /* Read ID and Read Status Clock Frequency */
+ fcba->flcomp |= freq << 27;
+ /* Write and Erase Clock Frequency */
+ fcba->flcomp |= freq << 24;
+ /* Fast Read Clock Frequency */
+ fcba->flcomp |= freq << 21;
+}
+
+static void set_em100_mode(struct em100 *em100, char *image, int size)
+{
+ fcba_t *fcba = find_fcba(image, size);
+ if (!fcba)
+ exit(EXIT_FAILURE);
+
+ int freq;
+
+ if (em100->hwversion == 6) {
+ printf("EM100Pro-G2 can run at full speed.\n");
+ return;
+ }
+
+ switch (ifd_version) {
+ case IFD_VERSION_1:
+ freq = SPI_FREQUENCY_20MHZ;
+ break;
+ case IFD_VERSION_2:
+ freq = SPI_FREQUENCY_17MHZ;
+ break;
+ default:
+ freq = SPI_FREQUENCY_17MHZ;
+ break;
+ }
+
+ fcba->flcomp &= ~(1 << 30);
+ set_spi_frequency(image, size, freq);
+}
+
+int autocorrect_image(struct em100 *em100, char *image, size_t size)
+{
+ printf("Auto-detecting IFD image ... ");
+ if (find_fd(image, size))
+ printf("OK\n");
+ else
+ return 1; /* No support for other image types (yet). */
+
+ /* Auto-detect IFD version */
+ check_ifd_version(image, size);
+
+ /* Set EM100 mode */
+ set_em100_mode(em100, image, size);
+
+ return 0;
+}
--
To view, visit https://review.coreboot.org/c/em100/+/37258
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: em100
Gerrit-Branch: master
Gerrit-Change-Id: Ie02264facb028841d18ed84680ffa40f45987510
Gerrit-Change-Number: 37258
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-MessageType: newchange
Mathew King has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36043 )
Change subject: soc/intel/cannonlake: Add gfx.asl file
......................................................................
soc/intel/cannonlake: Add gfx.asl file
Add gfx.asl file for cannonlake SOCs to allow for graphics related ACPI
devices and methods on cannonlake devices.
BUG=b:142237145
TEST=gfx.asl added to drallion dsdt.asl
Change-Id: I38a26f3135d571e2f9b63840d38fd4d3476fc142
Signed-off-by: Mathew King <mathewk(a)chromium.org>
---
A src/soc/intel/cannonlake/acpi/gfx.asl
1 file changed, 20 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/36043/1
diff --git a/src/soc/intel/cannonlake/acpi/gfx.asl b/src/soc/intel/cannonlake/acpi/gfx.asl
new file mode 100644
index 0000000..fef28f0
--- /dev/null
+++ b/src/soc/intel/cannonlake/acpi/gfx.asl
@@ -0,0 +1,20 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 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.
+ */
+
+Device (GFX0)
+{
+ Name (_ADR, 0x00020000)
+}
\ No newline at end of file
--
To view, visit https://review.coreboot.org/c/coreboot/+/36043
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I38a26f3135d571e2f9b63840d38fd4d3476fc142
Gerrit-Change-Number: 36043
Gerrit-PatchSet: 1
Gerrit-Owner: Mathew King <mathewk(a)chromium.org>
Gerrit-Reviewer: Mathew King <mathewk(a)chromium.org>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-MessageType: newchange