Hello Iru Cai,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/30912
to review the following change.
Change subject: autoport: Generate a libgfxinit template
......................................................................
autoport: Generate a libgfxinit template
Change-Id: I213628e525cc11c502de7d538bd60f49f3a930b9
Signed-off-by: Iru Cai <mytbk920423(a)gmail.com>
---
M util/autoport/main.go
1 file changed, 42 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/12/30912/1
diff --git a/util/autoport/main.go b/util/autoport/main.go
index 05a829b..c1a7907 100644
--- a/util/autoport/main.go
+++ b/util/autoport/main.go
@@ -748,6 +748,10 @@
ScanRoot(ctx)
+ KconfigBool["MAINBOARD_HAS_LIBGFXINIT"] = true
+ KconfigComment["MAINBOARD_HAS_LIBGFXINIT"] = "FIXME: check this"
+ AddRAMStageFile("gma-mainboard.ads", "CONFIG_MAINBOARD_USE_LIBGFXINIT")
+
if len(ROMStageFiles) > 0 || len(RAMStageFiles) > 0 || len(SMMFiles) > 0 {
mf := Create(ctx, "Makefile.inc")
defer mf.Close()
@@ -882,4 +886,42 @@
}
`)
+ gma := Create(ctx, "gma-mainboard.ads")
+ defer gma.Close()
+
+ gma.WriteString(`--
+-- 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; either version 2 of the License, or
+-- (at your option) any later version.
+--
+-- 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.
+--
+
+with HW.GFX.GMA;
+with HW.GFX.GMA.Display_Probing;
+
+use HW.GFX.GMA;
+use HW.GFX.GMA.Display_Probing;
+
+private package GMA.Mainboard is
+
+ ports : constant Port_List :=
+ (DP1,
+ DP2,
+ DP3,
+ HDMI1,
+ HDMI2,
+ HDMI3,
+ Analog,
+ Internal,
+ others => Disabled);
+
+end GMA.Mainboard;
+`)
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/30912
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I213628e525cc11c502de7d538bd60f49f3a930b9
Gerrit-Change-Number: 30912
Gerrit-PatchSet: 1
Gerrit-Owner: Iru Cai (vimacs) <mytbk920423(a)gmail.com>
Gerrit-Reviewer: Iru Cai <mytbk920423(a)gmail.com>
Gerrit-MessageType: newchange
Kacper Słomiński has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30980
Change subject: mainboard/Kconfig: add option for a 6144 KB(6 MB) ROM size
......................................................................
mainboard/Kconfig: add option for a 6144 KB(6 MB) ROM size
Signed-off-by: Kacper Słomiński <kacper.slominski72(a)gmail.com>
Change-Id: I7a1949c3512528b6b73955d907efc21728eed739
---
M src/mainboard/Kconfig
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/30980/1
diff --git a/src/mainboard/Kconfig b/src/mainboard/Kconfig
index 363df55..c88d317 100644
--- a/src/mainboard/Kconfig
+++ b/src/mainboard/Kconfig
@@ -24,6 +24,8 @@
bool
config BOARD_ROMSIZE_KB_4096
bool
+config BOARD_ROMSIZE_KB_6144
+ bool
config BOARD_ROMSIZE_KB_8192
bool
config BOARD_ROMSIZE_KB_10240
@@ -47,6 +49,7 @@
default COREBOOT_ROMSIZE_KB_1024 if BOARD_ROMSIZE_KB_1024
default COREBOOT_ROMSIZE_KB_2048 if BOARD_ROMSIZE_KB_2048
default COREBOOT_ROMSIZE_KB_4096 if BOARD_ROMSIZE_KB_4096
+ default COREBOOT_ROMSIZE_KB_6144 if BOARD_ROMSIZE_KB_6144
default COREBOOT_ROMSIZE_KB_8192 if BOARD_ROMSIZE_KB_8192
default COREBOOT_ROMSIZE_KB_10240 if BOARD_ROMSIZE_KB_10240
default COREBOOT_ROMSIZE_KB_12288 if BOARD_ROMSIZE_KB_12288
@@ -94,6 +97,11 @@
help
Choose this option if you have a 4096 KB (4 MB) ROM chip.
+config COREBOOT_ROMSIZE_KB_6144
+ bool "6144 KB (6 MB)"
+ help
+ Choose this option if you have a 6144 KB (6 MB) ROM chip.
+
config COREBOOT_ROMSIZE_KB_8192
bool "8192 KB (8 MB)"
help
@@ -136,6 +144,7 @@
default 1024 if COREBOOT_ROMSIZE_KB_1024
default 2048 if COREBOOT_ROMSIZE_KB_2048
default 4096 if COREBOOT_ROMSIZE_KB_4096
+ default 6144 if COREBOOT_ROMSIZE_KB_6144
default 8192 if COREBOOT_ROMSIZE_KB_8192
default 10240 if COREBOOT_ROMSIZE_KB_10240
default 12288 if COREBOOT_ROMSIZE_KB_12288
@@ -153,6 +162,7 @@
default 0x100000 if COREBOOT_ROMSIZE_KB_1024
default 0x200000 if COREBOOT_ROMSIZE_KB_2048
default 0x400000 if COREBOOT_ROMSIZE_KB_4096
+ default 0x600000 if COREBOOT_ROMSIZE_KB_6144
default 0x800000 if COREBOOT_ROMSIZE_KB_8192
default 0xa00000 if COREBOOT_ROMSIZE_KB_10240
default 0xc00000 if COREBOOT_ROMSIZE_KB_12288
--
To view, visit https://review.coreboot.org/c/coreboot/+/30980
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7a1949c3512528b6b73955d907efc21728eed739
Gerrit-Change-Number: 30980
Gerrit-PatchSet: 1
Gerrit-Owner: Kacper Słomiński <kacper.slominski72(a)gmail.com>
Gerrit-MessageType: newchange
Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32356
Change subject: drivers/usb/ucsi: Add driver to generate UCSI memory region
......................................................................
drivers/usb/ucsi: Add driver to generate UCSI memory region
The USB Type-C Connector System Software Interface (UCSI) defines a
required memory oregion for the OS UCSI driver to use to communicate
with the BIOS and EC.
This driver allocates a cbmem region for this required ACPI UCSI
memory and generates the ACPI AML code to describe it into the SSDT.
This driver must be paired with an EC implementation that actually
instantiates the UCSI device and provides the _DSM method that
translates from this shared memory to the EC. In order to connect
this driver to the EC the ACPI path of the UCSI device is provided
in the mainboard devicetree.
Change-Id: Id5b7fa19436443bc11a6ebe3ce89cd552cee4d85
Signed-off-by: Duncan Laurie <dlaurie(a)google.com>
---
M src/commonlib/include/commonlib/cbmem_id.h
A src/drivers/usb/ucsi/Kconfig
A src/drivers/usb/ucsi/Makefile.inc
A src/drivers/usb/ucsi/chip.h
A src/drivers/usb/ucsi/ucsi.c
5 files changed, 188 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/32356/1
diff --git a/src/commonlib/include/commonlib/cbmem_id.h b/src/commonlib/include/commonlib/cbmem_id.h
index af79a59..fb2d3e3 100644
--- a/src/commonlib/include/commonlib/cbmem_id.h
+++ b/src/commonlib/include/commonlib/cbmem_id.h
@@ -19,6 +19,7 @@
#define CBMEM_ID_ACPI 0x41435049
#define CBMEM_ID_ACPI_GNVS 0x474e5653
+#define CBMEM_ID_ACPI_UCSI 0x55435349
#define CBMEM_ID_AFTER_CAR 0xc4787a93
#define CBMEM_ID_AGESA_RUNTIME 0x41474553
#define CBMEM_ID_AMDMCT_MEMINFO 0x494D454E
@@ -81,6 +82,7 @@
#define CBMEM_ID_TO_NAME_TABLE \
{ CBMEM_ID_ACPI, "ACPI " }, \
{ CBMEM_ID_ACPI_GNVS, "ACPI GNVS " }, \
+ { CBMEM_ID_ACPI_UCSI, "ACPI UCSI " }, \
{ CBMEM_ID_AGESA_RUNTIME, "AGESA RSVD " }, \
{ CBMEM_ID_AFTER_CAR, "AFTER CAR " }, \
{ CBMEM_ID_AMDMCT_MEMINFO, "AMDMEM INFO" }, \
diff --git a/src/drivers/usb/ucsi/Kconfig b/src/drivers/usb/ucsi/Kconfig
new file mode 100644
index 0000000..22e751d
--- /dev/null
+++ b/src/drivers/usb/ucsi/Kconfig
@@ -0,0 +1,12 @@
+config DRIVERS_USB_UCSI
+ bool
+ default n
+ depends on HAVE_ACPI_TABLES
+ help
+ This driver allocates a fixed memory region in cbmem for the EC
+ implementation of the USB Type-C System Software Interface.
+ The shared memory region is used for the OS driver to pass
+ data to the _DSM method, which must be implemented by the EC.
+ The ACPI path of the EC device is provided in devicetree so the
+ ACPI operation region can be added to the specific UCSI device
+ that the EC implements.
diff --git a/src/drivers/usb/ucsi/Makefile.inc b/src/drivers/usb/ucsi/Makefile.inc
new file mode 100644
index 0000000..a62d58c
--- /dev/null
+++ b/src/drivers/usb/ucsi/Makefile.inc
@@ -0,0 +1 @@
+ramstage-$(CONFIG_DRIVERS_USB_UCSI) += ucsi.c
diff --git a/src/drivers/usb/ucsi/chip.h b/src/drivers/usb/ucsi/chip.h
new file mode 100644
index 0000000..860d6c5
--- /dev/null
+++ b/src/drivers/usb/ucsi/chip.h
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+#ifndef __USB_UCSI_CHIP_H__
+#define __USB_UCSI_CHIP_H__
+
+struct drivers_usb_ucsi_config {
+ /* Location of the UCSI device defined by the EC */
+ const char *path;
+};
+
+#endif /* __USB_UCSI_CHIP_H__ */
diff --git a/src/drivers/usb/ucsi/ucsi.c b/src/drivers/usb/ucsi/ucsi.c
new file mode 100644
index 0000000..a697e4f
--- /dev/null
+++ b/src/drivers/usb/ucsi/ucsi.c
@@ -0,0 +1,149 @@
+/*
+ * 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 <arch/acpi_device.h>
+#include <arch/acpigen.h>
+#include <cbmem.h>
+#include <console/console.h>
+#include <device/device.h>
+#include <device/path.h>
+#include <device/pnp.h>
+#include <stdint.h>
+#include "chip.h"
+
+/*
+ * The UCSI fields are defined in the UCSI specification at
+ * https://www.intel.com/content/www/us/en/io/universal-serial-bus/usb-type-c-…
+ * https://www.intel.com/content/www/us/en/io/universal-serial-bus/bios-implem…
+ */
+
+static struct fieldlist ucsi_region_fields[] = {
+ FIELDLIST_NAMESTR("VER0", 8),
+ FIELDLIST_NAMESTR("VER1", 8),
+ FIELDLIST_NAMESTR("RSV0", 8),
+ FIELDLIST_NAMESTR("RSV1", 8),
+ FIELDLIST_NAMESTR("CCI0", 8),
+ FIELDLIST_NAMESTR("CCI1", 8),
+ FIELDLIST_NAMESTR("CCI2", 8),
+ FIELDLIST_NAMESTR("CCI3", 8),
+ FIELDLIST_NAMESTR("CTL0", 8),
+ FIELDLIST_NAMESTR("CTL1", 8),
+ FIELDLIST_NAMESTR("CTL2", 8),
+ FIELDLIST_NAMESTR("CTL3", 8),
+ FIELDLIST_NAMESTR("CTL4", 8),
+ FIELDLIST_NAMESTR("CTL5", 8),
+ FIELDLIST_NAMESTR("CTL6", 8),
+ FIELDLIST_NAMESTR("CTL7", 8),
+ FIELDLIST_NAMESTR("MGI0", 8),
+ FIELDLIST_NAMESTR("MGI1", 8),
+ FIELDLIST_NAMESTR("MGI2", 8),
+ FIELDLIST_NAMESTR("MGI3", 8),
+ FIELDLIST_NAMESTR("MGI4", 8),
+ FIELDLIST_NAMESTR("MGI5", 8),
+ FIELDLIST_NAMESTR("MGI6", 8),
+ FIELDLIST_NAMESTR("MGI7", 8),
+ FIELDLIST_NAMESTR("MGI8", 8),
+ FIELDLIST_NAMESTR("MGI9", 8),
+ FIELDLIST_NAMESTR("MGIA", 8),
+ FIELDLIST_NAMESTR("MGIB", 8),
+ FIELDLIST_NAMESTR("MGIC", 8),
+ FIELDLIST_NAMESTR("MGID", 8),
+ FIELDLIST_NAMESTR("MGIE", 8),
+ FIELDLIST_NAMESTR("MGIF", 8),
+ FIELDLIST_NAMESTR("MGO0", 8),
+ FIELDLIST_NAMESTR("MGO1", 8),
+ FIELDLIST_NAMESTR("MGO2", 8),
+ FIELDLIST_NAMESTR("MGO3", 8),
+ FIELDLIST_NAMESTR("MGO4", 8),
+ FIELDLIST_NAMESTR("MGO5", 8),
+ FIELDLIST_NAMESTR("MGO6", 8),
+ FIELDLIST_NAMESTR("MGO7", 8),
+ FIELDLIST_NAMESTR("MGO8", 8),
+ FIELDLIST_NAMESTR("MGO9", 8),
+ FIELDLIST_NAMESTR("MGOA", 8),
+ FIELDLIST_NAMESTR("MGOB", 8),
+ FIELDLIST_NAMESTR("MGOC", 8),
+ FIELDLIST_NAMESTR("MGOD", 8),
+ FIELDLIST_NAMESTR("MGOE", 8),
+ FIELDLIST_NAMESTR("MGOF", 8),
+};
+static const size_t ucsi_region_len = ARRAY_SIZE(ucsi_region_fields);
+
+/* Allocate cbmem region for EC UCSI device to use for OS shared memory */
+static void ucsi_fill_ssdt_generator(struct device *dev)
+{
+ struct drivers_usb_ucsi_config *config = dev->chip_info;
+ struct opregion opreg;
+ void *region_ptr;
+
+ if (!dev->enabled || !config)
+ return;
+ if (!config->path) {
+ printk(BIOS_ERR, "%s: ACPI path for UCSI device required\n",
+ dev_path(dev));
+ return;
+ }
+
+ region_ptr = cbmem_add(CBMEM_ID_ACPI_UCSI, ucsi_region_len);
+ if (!region_ptr)
+ return;
+ memset(region_ptr, 0, ucsi_region_len);
+
+ opreg.name = "UCSM";
+ opreg.regionspace = SYSTEMMEMORY;
+ opreg.regionoffset = (uintptr_t)region_ptr;
+ opreg.regionlen = ucsi_region_len;
+
+ acpigen_write_scope(config->path);
+ acpigen_write_name("_CRS");
+ acpigen_write_resourcetemplate_header();
+ acpigen_write_mem32fixed(1, (uintptr_t)region_ptr, ucsi_region_len);
+ acpigen_write_resourcetemplate_footer();
+ acpigen_write_opregion(&opreg);
+ acpigen_write_field(opreg.name, ucsi_region_fields, ucsi_region_len,
+ FIELD_ANYACC | FIELD_LOCK | FIELD_PRESERVE);
+ acpigen_pop_len(); /* Scope */
+
+ printk(BIOS_INFO, "%s: %s at %s\n", config->path,
+ dev->chip_ops->name, dev_path(dev));
+}
+
+static const char *ucsi_acpi_name(const struct device *dev)
+{
+ return "UCSI";
+}
+
+static struct device_operations ops = {
+ .read_resources = DEVICE_NOOP,
+ .set_resources = DEVICE_NOOP,
+ .enable_resources = DEVICE_NOOP,
+ .acpi_name = ucsi_acpi_name,
+ .scan_bus = scan_generic_bus,
+ .acpi_fill_ssdt_generator = ucsi_fill_ssdt_generator,
+};
+
+static struct pnp_info info[] = {
+ { NULL, 0, 0, 0, }
+};
+
+static void ucsi_enable(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops, ARRAY_SIZE(info), info);
+}
+
+struct chip_operations drivers_usb_ucsi_ops = {
+ CHIP_NAME("USB Type-C Connector System Software Interface (UCSI)")
+ .enable_dev = ucsi_enable
+};
--
To view, visit https://review.coreboot.org/c/coreboot/+/32356
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id5b7fa19436443bc11a6ebe3ce89cd552cee4d85
Gerrit-Change-Number: 32356
Gerrit-PatchSet: 1
Gerrit-Owner: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-MessageType: newchange