Paul Fagerburg has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38559 )
Change subject: util: add support for Zork
......................................................................
util: add support for Zork
Update the create_coreboot_variant.sh and kconfig.py to support the
zork baseboard. Full template files will be added in a later CL.
BUG=b:148161697
BRANCH=None
TEST=`./create_coreboot_variant.sh zork dalboz` and verify that the
changes staged are correct.
Change-Id: Ie0a29bb9f4bb8f3bb7eaeae8799cef861c395e7d
---
M util/mainboard/google/create_coreboot_variant.sh
M util/mainboard/google/kconfig.py
A util/mainboard/google/zork/template/Makefile.inc
3 files changed, 24 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/38559/1
diff --git a/util/mainboard/google/create_coreboot_variant.sh b/util/mainboard/google/create_coreboot_variant.sh
index 14b2115..c4ca1c6 100755
--- a/util/mainboard/google/create_coreboot_variant.sh
+++ b/util/mainboard/google/create_coreboot_variant.sh
@@ -13,7 +13,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-VERSION="1.0.2"
+VERSION="1.0.3"
SCRIPT=$(basename -- "${0}")
export LC_ALL=C
@@ -61,6 +61,10 @@
# Copy the template tree to the target.
mkdir -p "variants/${VARIANT}/"
cp -pr "${SRC}/${BASE}/template/." "variants/${VARIANT}/"
+if [[ -e "variants/${VARIANT}/Kconfig" ]]; then
+ sed -i -e "s/BOARD_GOOGLE_TEMPLATE/BOARD_GOOGLE_${VARIANT_UPPER}/" \
+ "variants/${VARIANT}/Kconfig"
+fi
git add "variants/${VARIANT}/"
# Now add the new variant to Kconfig and Kconfig.name
diff --git a/util/mainboard/google/kconfig.py b/util/mainboard/google/kconfig.py
index 6f9fccf..57d9610 100755
--- a/util/mainboard/google/kconfig.py
+++ b/util/mainboard/google/kconfig.py
@@ -41,7 +41,7 @@
help='Name of the board variant')
args = parser.parse_args()
- if args.board not in ['hatch', 'volteer']:
+ if args.board not in ['hatch', 'volteer', 'zork']:
print('Unsupported baseboard "' + args.board + '"')
sys.exit(1)
@@ -130,6 +130,11 @@
print('\tbool "-> ' + capitalized + '"', file=outfile)
print('\tselect BOARD_GOOGLE_BASEBOARD_VOLTEER', file=outfile)
+ if baseboard_name == 'zork':
+ print('\nconfig ' + 'BOARD_GOOGLE_' + uppercase, file=outfile)
+ print('\tbool "-> ' + capitalized + '"', file=outfile)
+ print('\tselect BOARD_GOOGLE_BASEBOARD_ZORK', file=outfile)
+
if __name__ == '__main__':
main()
diff --git a/util/mainboard/google/zork/template/Makefile.inc b/util/mainboard/google/zork/template/Makefile.inc
new file mode 100644
index 0000000..38cf728
--- /dev/null
+++ b/util/mainboard/google/zork/template/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 =
--
To view, visit https://review.coreboot.org/c/coreboot/+/38559
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie0a29bb9f4bb8f3bb7eaeae8799cef861c395e7d
Gerrit-Change-Number: 38559
Gerrit-PatchSet: 1
Gerrit-Owner: Paul Fagerburg <pfagerburg(a)chromium.org>
Gerrit-MessageType: newchange
Karthik Ramasubramanian has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38771 )
Change subject: mb/google/dedede: Add GPE configuration
......................................................................
mb/google/dedede: Add GPE configuration
Configure the GPIO groups to be routed to the GPE0 block.
BUG=None
TEST=Build the mainboard.
Signed-off-by: Karthikeyan Ramasubramanian <kramasub(a)google.com>
Change-Id: Ife4d0179bd9fe1785e971686478f7c76de805e87
---
M src/mainboard/google/dedede/variants/baseboard/devicetree.cb
1 file changed, 16 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/38771/1
diff --git a/src/mainboard/google/dedede/variants/baseboard/devicetree.cb b/src/mainboard/google/dedede/variants/baseboard/devicetree.cb
index cdd325c..aedd32f 100644
--- a/src/mainboard/google/dedede/variants/baseboard/devicetree.cb
+++ b/src/mainboard/google/dedede/variants/baseboard/devicetree.cb
@@ -3,6 +3,22 @@
device lapic 0 on end
end
+ # GPE configuration
+ # Note that GPE events called out in ASL code rely on this
+ # route, i.e., if this route changes then the affected GPE
+ # offset bits also need to be changed.
+ # DW0 is used by:
+ # - GPP_B3 - TRACKPAD_INT_ODL
+ # - GPP_B4 - H1_AP_INT_ODL
+ # DW1 is used by:
+ # - GPP_D3 - WLAN_PCIE_WAKE_ODL
+ # DW2 is used by:
+ # - GPP_H16 - WWAN_HOST_WAKE
+ # EC_AP_WAKE_ODL is routed to LAN_WAKE#/GPD02 & is part of DW3.
+ register "pmc_gpe0_dw0" = "GPP_B"
+ register "pmc_gpe0_dw1" = "GPP_D"
+ register "pmc_gpe0_dw2" = "GPP_H"
+
device domain 0 on
device pci 00.0 off end # Host Bridge
device pci 02.0 off end # Integrated Graphics Device
--
To view, visit https://review.coreboot.org/c/coreboot/+/38771
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ife4d0179bd9fe1785e971686478f7c76de805e87
Gerrit-Change-Number: 38771
Gerrit-PatchSet: 1
Gerrit-Owner: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-MessageType: newchange
Karthik Ramasubramanian has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38738 )
Change subject: mb/google/dedede: Add Compute & PCH Global device IDs
......................................................................
mb/google/dedede: Add Compute & PCH Global device IDs
Add compute and PCH Global device IDs with the concerned devices turned
off.
BUG=None
TEST=Build the mainboard.
Signed-off-by: Karthikeyan Ramasubramanian <kramasub(a)google.com>
Change-Id: I6f226abd52d4a27535de6711e93355b5f84a1941
---
M src/mainboard/google/dedede/variants/baseboard/devicetree.cb
1 file changed, 46 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/38738/1
diff --git a/src/mainboard/google/dedede/variants/baseboard/devicetree.cb b/src/mainboard/google/dedede/variants/baseboard/devicetree.cb
index eb9dc1c..cdd325c 100644
--- a/src/mainboard/google/dedede/variants/baseboard/devicetree.cb
+++ b/src/mainboard/google/dedede/variants/baseboard/devicetree.cb
@@ -2,4 +2,50 @@
device cpu_cluster 0 on
device lapic 0 on end
end
+
+ device domain 0 on
+ device pci 00.0 off end # Host Bridge
+ device pci 02.0 off end # Integrated Graphics Device
+ device pci 04.0 off end # SA Thermal device
+ device pci 05.0 off end # IPU
+ device pci 09.0 off end # Intel Trace Hub
+ device pci 12.6 off end # GSPI 2
+ device pci 14.0 off end # USB xHCI
+ device pci 14.1 off end # USB xDCI (OTG)
+ device pci 14.2 off end # PMC SRAM
+ device pci 14.3 off end # CNVi wifi
+ device pci 14.5 off end # SDCard
+ device pci 15.0 off end # I2C 0
+ device pci 15.1 off end # I2C 1
+ device pci 15.2 off end # I2C 2
+ device pci 15.3 off end # I2C 3
+ device pci 16.0 off end # HECI 1
+ device pci 16.1 off end # HECI 2
+ device pci 16.4 off end # HECI 3
+ device pci 16.5 off end # HECI 4
+ device pci 17.0 off end # SATA
+ device pci 19.0 off end # I2C 4
+ device pci 19.1 off end # I2C 5
+ device pci 19.2 off end # UART 2
+ device pci 1a.0 off end # eMMC
+ device pci 1c.0 off end # PCI Express Root Port 1
+ device pci 1c.1 off end # PCI Express Root Port 2
+ device pci 1c.2 off end # PCI Express Root Port 3
+ device pci 1c.3 off end # PCI Express Root Port 4 - WLAN
+ device pci 1c.4 off end # PCI Express Root Port 5
+ device pci 1c.5 off end # PCI Express Root Port 6
+ device pci 1c.6 off end # PCI Express Root Port 7
+ device pci 1c.7 off end # PCI Express Root Port 8
+ device pci 1e.0 off end # UART 0
+ device pci 1e.1 off end # UART 1
+ device pci 1e.2 off end # GSPI 0
+ device pci 1e.3 off end # GSPI 1
+ device pci 1f.0 off end # eSPI Interface
+ device pci 1f.1 off end # P2SB
+ device pci 1f.2 off end # Power Management Controller
+ device pci 1f.3 off end # Intel HDA/cAVS
+ device pci 1f.4 off end # SMBus
+ device pci 1f.5 off end # PCH SPI
+ device pci 1f.7 off end # Intel Trace Hub
+ end
end
--
To view, visit https://review.coreboot.org/c/coreboot/+/38738
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6f226abd52d4a27535de6711e93355b5f84a1941
Gerrit-Change-Number: 38738
Gerrit-PatchSet: 1
Gerrit-Owner: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-MessageType: newchange
Nick Vaccaro has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38606 )
Change subject: soc/intel/tigerlake: add memory configuration support
......................................................................
soc/intel/tigerlake: add memory configuration support
Move some of the common memory code that was being performed in
mainboard into the soc to reduce redundant code going forward.
BUG=b:145642089
BRANCH=none
TEST="emerge-volteer coreboot chromeos-bootimage", flash and boot
volteer, log into kernel and verify memory size shows 8GB.
Change-Id: I8de502d4f05d52b9dae34e3b013c6d5b1886fa55
Signed-off-by: Nick Vaccaro <nvaccaro(a)google.com>
---
M src/soc/intel/tigerlake/Makefile.inc
A src/soc/intel/tigerlake/include/soc/meminit.h
A src/soc/intel/tigerlake/meminit.c
3 files changed, 205 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/38606/1
diff --git a/src/soc/intel/tigerlake/Makefile.inc b/src/soc/intel/tigerlake/Makefile.inc
index 532861d..c1bac36 100644
--- a/src/soc/intel/tigerlake/Makefile.inc
+++ b/src/soc/intel/tigerlake/Makefile.inc
@@ -25,6 +25,7 @@
romstage-y += espi.c
romstage-y += gpio.c
+romstage-y += meminit.c
romstage-y += reset.c
ramstage-y += acpi.c
diff --git a/src/soc/intel/tigerlake/include/soc/meminit.h b/src/soc/intel/tigerlake/include/soc/meminit.h
new file mode 100644
index 0000000..a99b033
--- /dev/null
+++ b/src/soc/intel/tigerlake/include/soc/meminit.h
@@ -0,0 +1,80 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2020 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 _SOC_TIGERLAKE_MEMINIT_H_
+#define _SOC_TIGERLAKE_MEMINIT_H_
+
+#include <stddef.h>
+#include <stdint.h>
+#include <fsp/soc_binding.h>
+
+#define BYTES_PER_CHANNEL 2
+#define BITS_PER_BYTE 8
+#define DQS_PER_CHANNEL 2
+#define NUM_CHANNELS 8
+
+struct spd_by_pointer {
+ size_t spd_data_len;
+ uintptr_t spd_data_ptr;
+};
+
+enum lpddr4x_mem_info_read_type {
+ NOT_EXISTING, /* No memory in this channel */
+ READ_SPD_CBFS, /* Find spd file in CBFS. */
+ READ_SPD_MEMPTR /* Find spd data from pointer. */
+};
+
+struct lpddr4x_spd_info {
+ enum lpddr4x_mem_info_read_type read_type;
+ union spd_data_by {
+ /* To identify spd file when read_type is READ_SPD_CBFS. */
+ int spd_index;
+
+ /* To find spd data when read_type is READ_SPD_MEMPTR. */
+ struct spd_by_pointer spd_data_ptr_info;
+ } spd_spec;
+};
+
+/* Board-specific memory configuration information */
+struct mb_lpddr4x_cfg {
+ /* SPD info */
+ struct lpddr4x_spd_info spd;
+
+ /* DQ mapping */
+ uint8_t dq_map[NUM_CHANNELS][BYTES_PER_CHANNEL * BITS_PER_BYTE];
+
+ /*
+ * DQS CPU<>DRAM map MC0 and MC1. Each array entry represents a
+ * mapping of a dq bit on the CPU to the bit it's connected to on
+ * the memory part. The array index represents the dqs bit number
+ * on the memory part, and the values in the array represent which
+ * pin on the CPU that DRAM pin connects to.
+ */
+ uint8_t dqs_map[NUM_CHANNELS][DQS_PER_CHANNEL];
+
+ /*
+ * Early Command Training Enable/Disable Control
+ * 1 = enable, 0 = disable
+ */
+ uint8_t ect;
+
+ /* Set to true if only populating half the DRAM */
+ bool half_populated;
+};
+
+/* Initialize default memory configurations for lpddr4x */
+void meminit_lpddr4x(FSP_M_CONFIG *mem_cfg, struct mb_lpddr4x_cfg *board_cfg);
+
+#endif /* _SOC_TIGERLAKE_MEMINIT_H_ */
diff --git a/src/soc/intel/tigerlake/meminit.c b/src/soc/intel/tigerlake/meminit.c
new file mode 100644
index 0000000..4c2199b
--- /dev/null
+++ b/src/soc/intel/tigerlake/meminit.c
@@ -0,0 +1,124 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2020 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 <assert.h>
+#include <console/console.h>
+#include <fsp/util.h>
+#include <soc/meminit.h>
+#include <spd_bin.h>
+#include <string.h>
+
+/* If half populating DRAM, those channels would be 0 thru 3 */
+#define HALF_POPULATED_COUNT 4
+
+enum dimm_enable_options {
+ ENABLE_BOTH_DIMMS = 0,
+ DISABLE_DIMM0 = 1,
+ DISABLE_DIMM1 = 2,
+ DISABLE_BOTH_DIMMS = 3
+};
+
+/* Configure memory channel as unpopulated */
+#define MEM_CFG_EMPTY(_mem_cfg, _mc, _ch) \
+ do { \
+ _mem_cfg->DisableDimmMc ## _mc ## Ch ## _ch = DISABLE_BOTH_DIMMS; \
+ _mem_cfg->MemorySpdPtr ## _mc ## _ch ## 0 = 0; \
+ _mem_cfg->MemorySpdPtr ## _mc ## _ch ## 1 = 0; \
+ } while (0)
+
+/* Configure memory channel with only dimm0 used */
+#define MEM_CFG_DIMM0(_mem_cfg, _mc, _ch, _data, _b_cfg) \
+ do { \
+ _mem_cfg->DisableDimmMc ## _mc ## Ch ## _ch = DISABLE_DIMM1; \
+ _mem_cfg->MemorySpdPtr ## _mc ## _ch ## 0 = _data; \
+ _mem_cfg->MemorySpdPtr ## _mc ## _ch ## 1 = 0; \
+ memcpy(&_mem_cfg->DqMapCpu2DramMc ## _mc ## Ch ## _ch, \
+ &_b_cfg->dq_map[_mc * NUM_CHANNELS / 2 + _ch], \
+ sizeof(_b_cfg->dq_map[_mc * NUM_CHANNELS / 2 + _ch])); \
+ memcpy(&_mem_cfg->DqsMapCpu2DramMc ## _mc ## Ch ## _ch, \
+ &_b_cfg->dqs_map[_mc * NUM_CHANNELS / 2 + _ch], \
+ sizeof(_b_cfg->dqs_map[_mc * NUM_CHANNELS / 2 + _ch])); \
+ } while (0)
+
+
+static void spd_read_from_cbfs(const struct lpddr4x_spd_info *spd,
+ uintptr_t *spd_data_ptr, size_t *spd_data_len)
+{
+ struct region_device spd_rdev;
+ size_t spd_index = spd->spd_spec.spd_index;
+
+ printk(BIOS_DEBUG, "SPD INDEX = %lu\n", spd_index);
+ if (get_spd_cbfs_rdev(&spd_rdev, spd_index) < 0)
+ die("spd.bin not found or incorrect index\n");
+
+ *spd_data_len = region_device_sz(&spd_rdev);
+
+ /* Memory leak is ok since we have memory mapped boot media */
+ assert(CONFIG(BOOT_DEVICE_MEMORY_MAPPED));
+
+ *spd_data_ptr = (uintptr_t)rdev_mmap_full(&spd_rdev);
+}
+
+static void get_spd_data(const struct lpddr4x_spd_info *spd,
+ uintptr_t *spd_data_ptr, size_t *spd_data_len)
+{
+ if (spd->read_type == READ_SPD_MEMPTR) {
+ *spd_data_ptr = spd->spd_spec.spd_data_ptr_info.spd_data_ptr;
+ *spd_data_len = spd->spd_spec.spd_data_ptr_info.spd_data_len;
+ return;
+ }
+
+ if (spd->read_type == READ_SPD_CBFS) {
+ spd_read_from_cbfs(spd, spd_data_ptr, spd_data_len);
+ return;
+ }
+
+ die("no valid way to read SPD info");
+}
+
+/* Initialize onboard memory configurations for lpddr4x */
+void meminit_lpddr4x(FSP_M_CONFIG *mem_cfg, struct mb_lpddr4x_cfg *board_cfg)
+{
+ const struct lpddr4x_spd_info *spd = &board_cfg->spd;
+ size_t spd_data_len;
+ uintptr_t spd_data_ptr;
+
+ get_spd_data(spd, &spd_data_ptr, &spd_data_len);
+ print_spd_info((unsigned char *)spd_data_ptr);
+
+ mem_cfg->MemorySpdDataLen = spd_data_len;
+
+ MEM_CFG_DIMM0(mem_cfg, 0, 0, spd_data_ptr, board_cfg);
+ MEM_CFG_DIMM0(mem_cfg, 0, 1, spd_data_ptr, board_cfg);
+ MEM_CFG_DIMM0(mem_cfg, 0, 2, spd_data_ptr, board_cfg);
+ MEM_CFG_DIMM0(mem_cfg, 0, 3, spd_data_ptr, board_cfg);
+
+ if (board_cfg->half_populated) {
+ printk(BIOS_INFO, "%s: DRAM half-populated\n", __func__);
+ MEM_CFG_EMPTY(mem_cfg, 1, 0);
+ MEM_CFG_EMPTY(mem_cfg, 1, 1);
+ MEM_CFG_EMPTY(mem_cfg, 1, 2);
+ MEM_CFG_EMPTY(mem_cfg, 1, 3);
+ } else {
+ MEM_CFG_DIMM0(mem_cfg, 1, 0, spd_data_ptr, board_cfg);
+ MEM_CFG_DIMM0(mem_cfg, 1, 1, spd_data_ptr, board_cfg);
+ MEM_CFG_DIMM0(mem_cfg, 1, 2, spd_data_ptr, board_cfg);
+ MEM_CFG_DIMM0(mem_cfg, 1, 3, spd_data_ptr, board_cfg);
+ }
+
+ /* LPDDR4 does not allow interleaved memory */
+ mem_cfg->DqPinsInterleaved = 0;
+ mem_cfg->ECT = board_cfg->ect;
+ mem_cfg->MrcSafeConfig = 0x1;
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/38606
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8de502d4f05d52b9dae34e3b013c6d5b1886fa55
Gerrit-Change-Number: 38606
Gerrit-PatchSet: 1
Gerrit-Owner: Nick Vaccaro <nvaccaro(a)google.com>
Gerrit-MessageType: newchange