Michał Żygowski has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37402 )
Change subject: soc/amd/common/blocks: introduce two new BIOSRAM based common blocks
......................................................................
soc/amd/common/blocks: introduce two new BIOSRAM based common blocks
All AMD CPU families supported in coreboot have BIOSRAM space. Looking at
the source code, every family could have the same API to save and restore
cbmem top or UMA base and size.
Create unified BIOSRAM layout, AMD UMA block and AMD RAMTOP block.
Signed-off-by: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Change-Id: I69a03e4f01d7fb2ffc9f8b5af73d7e4e7ec027da
---
A src/soc/amd/common/block/include/amdblocks/biosram_layout.h
A src/soc/amd/common/block/include/amdblocks/uma.h
A src/soc/amd/common/block/ramtop/Kconfig
A src/soc/amd/common/block/ramtop/Makefile.inc
A src/soc/amd/common/block/ramtop/ramtop.c
A src/soc/amd/common/block/uma/Kconfig
A src/soc/amd/common/block/uma/Makefile.inc
A src/soc/amd/common/block/uma/uma.c
8 files changed, 136 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/37402/1
diff --git a/src/soc/amd/common/block/include/amdblocks/biosram_layout.h b/src/soc/amd/common/block/include/amdblocks/biosram_layout.h
new file mode 100644
index 0000000..2ca4f74
--- /dev/null
+++ b/src/soc/amd/common/block/include/amdblocks/biosram_layout.h
@@ -0,0 +1,22 @@
+/*
+ * 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 __AMDBLOCKS_BIOSRAM_H__
+#define __AMDBLOCKS_BIOSRAM_H__
+
+/* BiosRam Ranges at 0xfed80500 or I/O 0xcd4/0xcd5 */
+#define BIOSRAM_CBMEM_TOP 0xf0 /* 4 bytes */
+#define BIOSRAM_UMA_SIZE 0xf4 /* 4 bytes */
+#define BIOSRAM_UMA_BASE 0xf8 /* 8 bytes */
+
+#endif
diff --git a/src/soc/amd/common/block/include/amdblocks/uma.h b/src/soc/amd/common/block/include/amdblocks/uma.h
new file mode 100644
index 0000000..939713d
--- /dev/null
+++ b/src/soc/amd/common/block/include/amdblocks/uma.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 __AMDBLOCKS_UMA_H__
+#define __AMDBLOCKS_UMA_H__
+
+/* Saves the UMA size returned by AGESA */
+void save_uma_size(uint32_t size);
+/* Saves the UMA base address returned by AGESA */
+void save_uma_base(uint64_t base);
+/* Returns the saved UMA size */
+uint32_t get_uma_size(void);
+/* Returns the saved UMA base */
+uint64_t get_uma_base(void);
+
+#endif
diff --git a/src/soc/amd/common/block/ramtop/Kconfig b/src/soc/amd/common/block/ramtop/Kconfig
new file mode 100644
index 0000000..36bf074
--- /dev/null
+++ b/src/soc/amd/common/block/ramtop/Kconfig
@@ -0,0 +1,7 @@
+config SOC_AMD_COMMON_BLOCK_RAMTOP
+ bool
+ default n
+ depends on SOC_AMD_COMMON_BLOCK_ACPIMMIO
+ help
+ Select this option to enable common cbmem top save and restore
+ functions usign BIOSRAM.
diff --git a/src/soc/amd/common/block/ramtop/Makefile.inc b/src/soc/amd/common/block/ramtop/Makefile.inc
new file mode 100644
index 0000000..bb2d290
--- /dev/null
+++ b/src/soc/amd/common/block/ramtop/Makefile.inc
@@ -0,0 +1,3 @@
+romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_RAMTOP) += ramtop.c
+postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_RAMTOP) += ramtop.c
+ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_RAMTOP) += ramtop.c
diff --git a/src/soc/amd/common/block/ramtop/ramtop.c b/src/soc/amd/common/block/ramtop/ramtop.c
new file mode 100644
index 0000000..ae93537
--- /dev/null
+++ b/src/soc/amd/common/block/ramtop/ramtop.c
@@ -0,0 +1,27 @@
+/*
+ * 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 <stdint.h>
+#include <cbmem.h>
+#include <amdblocks/acpimmio.h>
+#include <amdblocks/biosram_layout.h>
+
+void backup_top_of_low_cacheable(uintptr_t ramtop)
+{
+ biosram_write32(BIOSRAM_CBMEM_TOP, ramtop);
+}
+
+uintptr_t restore_top_of_low_cacheable(void)
+{
+ return biosram_read32(BIOSRAM_CBMEM_TOP);
+}
diff --git a/src/soc/amd/common/block/uma/Kconfig b/src/soc/amd/common/block/uma/Kconfig
new file mode 100644
index 0000000..8b0e18a
--- /dev/null
+++ b/src/soc/amd/common/block/uma/Kconfig
@@ -0,0 +1,7 @@
+config SOC_AMD_COMMON_BLOCK_UMA
+ bool
+ default n
+ depends on SOC_AMD_COMMON_BLOCK_ACPIMMIO
+ help
+ Select this option to enable common UMA parameters save and
+ restore functions using BIOSRAM.
diff --git a/src/soc/amd/common/block/uma/Makefile.inc b/src/soc/amd/common/block/uma/Makefile.inc
new file mode 100644
index 0000000..b3bb8c6
--- /dev/null
+++ b/src/soc/amd/common/block/uma/Makefile.inc
@@ -0,0 +1,3 @@
+romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_UMA) += uma.c
+postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_UMA) += uma.c
+ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_UMA) += uma.c
diff --git a/src/soc/amd/common/block/uma/uma.c b/src/soc/amd/common/block/uma/uma.c
new file mode 100644
index 0000000..00b4642
--- /dev/null
+++ b/src/soc/amd/common/block/uma/uma.c
@@ -0,0 +1,41 @@
+/*
+ * 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 <stdint.h>
+#include <amdblocks/acpimmio.h>
+#include <amdblocks/biosram_layout.h>
+#include <amdblocks/uma.h>
+
+void save_uma_size(uint32_t size)
+{
+ biosram_write32(BIOSRAM_UMA_SIZE, size);
+}
+
+void save_uma_base(uint64_t base)
+{
+ biosram_write32(BIOSRAM_UMA_BASE, (uint32_t) base);
+ biosram_write32(BIOSRAM_UMA_BASE + 4, (uint32_t) (base >> 32));
+}
+
+uint32_t get_uma_size(void)
+{
+ return biosram_read32(BIOSRAM_UMA_SIZE);
+}
+
+uint64_t get_uma_base(void)
+{
+ uint64_t base;
+ base = biosram_read32(BIOSRAM_UMA_BASE);
+ base |= ((uint64_t)(biosram_read32(BIOSRAM_UMA_BASE + 4)) << 32);
+ return base;
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/37402
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I69a03e4f01d7fb2ffc9f8b5af73d7e4e7ec027da
Gerrit-Change-Number: 37402
Gerrit-PatchSet: 1
Gerrit-Owner: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Michał Żygowski has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37178 )
Change subject: soc/amd/common/block/acpimmio: fix the ACPIMMIO decode enable function
......................................................................
soc/amd/common/block/acpimmio: fix the ACPIMMIO decode enable function
According to BKDG's for families 15h and 16h the ACPI MMIO decode enable
bit is the second LSB not the first LSB.
Signed-off-by: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Change-Id: Iaa31abc3dbdf77d8513fa83c7415b9a1b7fd266f
---
M src/soc/amd/common/block/include/amdblocks/acpimmio_map.h
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/78/37178/1
diff --git a/src/soc/amd/common/block/include/amdblocks/acpimmio_map.h b/src/soc/amd/common/block/include/amdblocks/acpimmio_map.h
index 755af52..d636432 100644
--- a/src/soc/amd/common/block/include/amdblocks/acpimmio_map.h
+++ b/src/soc/amd/common/block/include/amdblocks/acpimmio_map.h
@@ -28,7 +28,8 @@
* newer method.
*/
#define ACPIMMIO_DECODE_REGISTER 0x4
-#define ACPIMMIO_DECODE_EN BIT(0)
+#define BIOSRAM_DECODE_EN BIT(0)
+#define ACPIMMIO_DECODE_EN BIT(1)
/* MMIO register blocks are at fixed offsets from 0xfed80000 and are enabled
* in PMx24[1] (older implementations) and PMx04[1] (newer implementations).
--
To view, visit https://review.coreboot.org/c/coreboot/+/37178
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iaa31abc3dbdf77d8513fa83c7415b9a1b7fd266f
Gerrit-Change-Number: 37178
Gerrit-PatchSet: 1
Gerrit-Owner: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-MessageType: newchange
Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37438 )
Change subject: binaryPI: Fix failing AP startup
......................................................................
binaryPI: Fix failing AP startup
Fix regression with commit 5639736
binaryPI: Drop CAR teardown without POSTCAR_STAGE
Occassionally (maybe 1 boot in 10) SMP lapic_cpu_init() fails
with following errors in the logs of pcengines/apu2:
CPU 0x03 would not start!
CPU 0x03 did not initialize!
The CPU number is sometimes 0x02, never seen 0x01. Work-around also
suggests something to do with cache coherency and MTRRs that is really
at fault.
As a work-around return the BSP CAR teardown to use wbinvd instead
of invd. These platforms do not support S3 resume so this is the
easy work-around for the time being.
Change-Id: I3dac8785aaf4af5c7c105ec9dd0b95156b7cca21
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
M src/vendorcode/amd/pi/00630F01/binaryPI/gcccar.inc
M src/vendorcode/amd/pi/00660F01/binaryPI/gcccar.inc
M src/vendorcode/amd/pi/00730F01/binaryPI/gcccar.inc
3 files changed, 6 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/37438/1
diff --git a/src/vendorcode/amd/pi/00630F01/binaryPI/gcccar.inc b/src/vendorcode/amd/pi/00630F01/binaryPI/gcccar.inc
index 4d903e6..cecf5ca 100644
--- a/src/vendorcode/amd/pi/00630F01/binaryPI/gcccar.inc
+++ b/src/vendorcode/amd/pi/00630F01/binaryPI/gcccar.inc
@@ -904,7 +904,8 @@
btr $INVD_WBINVD, %eax # Disable INVD -> WBINVD conversion
_WRMSR
- invd
+ # An invd here sometimes breaks AP CPU startup ?
+ wbinvd
#.if (bh == 01h) || (bh == 03h) ; Is this TN or KV?
cmp $01, %bh
diff --git a/src/vendorcode/amd/pi/00660F01/binaryPI/gcccar.inc b/src/vendorcode/amd/pi/00660F01/binaryPI/gcccar.inc
index b208cc1..88e1a7d 100644
--- a/src/vendorcode/amd/pi/00660F01/binaryPI/gcccar.inc
+++ b/src/vendorcode/amd/pi/00660F01/binaryPI/gcccar.inc
@@ -639,7 +639,8 @@
btr $INVD_WBINVD, %eax # Disable INVD -> WBINVD conversion
_WRMSR
- invd
+ # An invd here sometimes breaks AP CPU startup ?
+ wbinvd
# #.if (bh == 01h) || (bh == 03h) ; Is this TN or KM?
# cmp $01, %bh
diff --git a/src/vendorcode/amd/pi/00730F01/binaryPI/gcccar.inc b/src/vendorcode/amd/pi/00730F01/binaryPI/gcccar.inc
index 7d86a31..c246b99 100644
--- a/src/vendorcode/amd/pi/00730F01/binaryPI/gcccar.inc
+++ b/src/vendorcode/amd/pi/00730F01/binaryPI/gcccar.inc
@@ -603,7 +603,8 @@
btr $INVD_WBINVD, %eax # Disable INVD -> WBINVD conversion
_WRMSR
- invd
+ # An invd here sometimes breaks AP CPU startup
+ wbinvd
#Do Standard Family 16 work
mov $HWCR, %ecx # MSR:C001_0015h
--
To view, visit https://review.coreboot.org/c/coreboot/+/37438
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3dac8785aaf4af5c7c105ec9dd0b95156b7cca21
Gerrit-Change-Number: 37438
Gerrit-PatchSet: 1
Gerrit-Owner: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Hello Patrick Rudolph, Subrata Banik, Lean Sheng Tan, Aamir Bohra, Maulik V Vaghela, Rizwan Qureshi, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/37434
to look at the new patch set (#5).
Change subject: soc/intel/common: Add Jasperlake Device IDs
......................................................................
soc/intel/common: Add Jasperlake Device IDs
Add Jasperlake SA and PCH IDs
Change-Id: I2c9ec1ee4236184b986d99250f263172c80f7117
Signed-off-by: Ronak Kanabar <ronak.kanabar(a)intel.com>
---
M src/include/device/pci_ids.h
M src/soc/intel/common/block/cse/cse.c
M src/soc/intel/common/block/dsp/dsp.c
M src/soc/intel/common/block/graphics/graphics.c
M src/soc/intel/common/block/i2c/i2c.c
M src/soc/intel/common/block/lpc/lpc.c
M src/soc/intel/common/block/p2sb/p2sb.c
M src/soc/intel/common/block/pcie/pcie.c
M src/soc/intel/common/block/pmc/pmc.c
M src/soc/intel/common/block/sata/sata.c
M src/soc/intel/common/block/scs/sd.c
M src/soc/intel/common/block/smbus/smbus.c
M src/soc/intel/common/block/spi/spi.c
M src/soc/intel/common/block/sram/sram.c
M src/soc/intel/common/block/systemagent/systemagent.c
M src/soc/intel/common/block/uart/uart.c
M src/soc/intel/common/block/xhci/xhci.c
M src/soc/intel/tigerlake/bootblock/report_platform.c
18 files changed, 76 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/37434/5
--
To view, visit https://review.coreboot.org/c/coreboot/+/37434
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2c9ec1ee4236184b986d99250f263172c80f7117
Gerrit-Change-Number: 37434
Gerrit-PatchSet: 5
Gerrit-Owner: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Reviewer: Aamir Bohra <aamir.bohra(a)intel.com>
Gerrit-Reviewer: Lean Sheng Tan <lean.sheng.tan(a)intel.com>
Gerrit-Reviewer: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newpatchset
Hello Patrick Rudolph, Subrata Banik, Lean Sheng Tan, Aamir Bohra, Maulik V Vaghela, Rizwan Qureshi, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/37434
to look at the new patch set (#4).
Change subject: soc/intel/common: Add Jasperlake Device IDs
......................................................................
soc/intel/common: Add Jasperlake Device IDs
Jasperlake CPU, SA and PCH IDs
Change-Id: I2c9ec1ee4236184b986d99250f263172c80f7117
Signed-off-by: Ronak Kanabar <ronak.kanabar(a)intel.com>
---
M src/include/device/pci_ids.h
M src/soc/intel/common/block/cpu/mp_init.c
M src/soc/intel/common/block/cse/cse.c
M src/soc/intel/common/block/dsp/dsp.c
M src/soc/intel/common/block/graphics/graphics.c
M src/soc/intel/common/block/i2c/i2c.c
M src/soc/intel/common/block/include/intelblocks/mp_init.h
M src/soc/intel/common/block/lpc/lpc.c
M src/soc/intel/common/block/p2sb/p2sb.c
M src/soc/intel/common/block/pcie/pcie.c
M src/soc/intel/common/block/pmc/pmc.c
M src/soc/intel/common/block/sata/sata.c
M src/soc/intel/common/block/scs/sd.c
M src/soc/intel/common/block/smbus/smbus.c
M src/soc/intel/common/block/spi/spi.c
M src/soc/intel/common/block/sram/sram.c
M src/soc/intel/common/block/systemagent/systemagent.c
M src/soc/intel/common/block/uart/uart.c
M src/soc/intel/common/block/xhci/xhci.c
M src/soc/intel/tigerlake/bootblock/report_platform.c
20 files changed, 79 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/37434/4
--
To view, visit https://review.coreboot.org/c/coreboot/+/37434
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2c9ec1ee4236184b986d99250f263172c80f7117
Gerrit-Change-Number: 37434
Gerrit-PatchSet: 4
Gerrit-Owner: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Reviewer: Aamir Bohra <aamir.bohra(a)intel.com>
Gerrit-Reviewer: Lean Sheng Tan <lean.sheng.tan(a)intel.com>
Gerrit-Reviewer: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newpatchset