Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42043 )
Change subject: util/amdfwtool: update to allow building in any location
......................................................................
util/amdfwtool: update to allow building in any location
For the verstage-on-PSP implementation, we need 2 additional copies
of the AMD firmware tables at non-standard locations. These are
for RW-A & RW-B fmap regions. This change allows us to build the
AMD firmware tables into those regions.
BUG=b:148767300
TEST=boot with psp_verstage, verify boot location
Signed-off-by: Martin Roth <martin(a)coreboot.org>
Original-Signed-off-by: Martin Roth <martinroth(a)chromium.org>
Original-Change-Id: I2b591b50e9b179fdfaead46ff93722fa2a155e9c
Original-Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/coreboot/…
Original-Reviewed-by: Simon Glass <sjg(a)chromium.org>
Change-Id: I7f841db8617b953dc671a9c12576145f85263581
---
M util/amdfwtool/amdfwtool.c
1 file changed, 30 insertions(+), 16 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/42043/1
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c
index 71da6fb..e6fa220 100644
--- a/util/amdfwtool/amdfwtool.c
+++ b/util/amdfwtool/amdfwtool.c
@@ -211,6 +211,7 @@
MIN_ROM_KB);
printf(" and must a multiple of 1024\n");
printf("-l | --location Location of Directory\n");
+ printf("-q | --anywhere Use any 64-byte aligned addr for Directory\n");
printf("-h | --help show this help\n");
}
@@ -1021,8 +1022,8 @@
fill_dir_header(biosdir, count, cookie);
}
-// Unused values: CDEPqR
-static const char *optstring = "x:i:g:AMS:p:b:s:r:k:c:n:d:t:u:w:m:T:z:J:B:K:L:Y:N:UW:I:a:Q:V:e:v:j:y:G:O:X:F:H:o:f:l:hZ:";
+// Unused values: CDEPR
+static const char *optstring = "x:i:g:AMS:p:b:s:r:k:c:n:d:t:u:w:m:T:z:J:B:K:L:Y:N:UW:I:a:Q:V:e:v:j:y:G:O:X:F:H:o:f:l:hZ:q";
static struct option long_options[] = {
{"xhci", required_argument, 0, 'x' },
@@ -1073,6 +1074,7 @@
{"output", required_argument, 0, 'o' },
{"flashsize", required_argument, 0, 'f' },
{"location", required_argument, 0, 'l' },
+ {"anywhere", no_argument, 0, 'q' },
{"help", no_argument, 0, 'h' },
{NULL, 0, 0, 0 }
};
@@ -1177,6 +1179,7 @@
uint8_t sub = 0, instance = 0;
int abl_image = 0;
uint32_t dir_location = 0;
+ uint8_t any_location = 0;
uint32_t romsig_offset;
uint32_t rom_base_address;
int multi = 0;
@@ -1392,6 +1395,9 @@
retval = 1;
}
break;
+ case 'q':
+ any_location = 1;
+ break;
case 'h':
usage();
@@ -1434,20 +1440,28 @@
return 1;
}
- switch (dir_location) {
- case 0: /* Fall through */
- case 0xFFFA0000: /* Fall through */
- case 0xFFF20000: /* Fall through */
- case 0xFFE20000: /* Fall through */
- case 0xFFC20000: /* Fall through */
- case 0xFF820000: /* Fall through */
- case 0xFF020000: /* Fall through */
- break;
- default:
- printf("Error: Invalid Directory location.\n");
- printf(" Valid locations are 0xFFFA0000, 0xFFF20000,\n");
- printf(" 0xFFE20000, 0xFFC20000, 0xFF820000, 0xFF020000\n");
- return 1;
+ if (any_location) {
+ if (dir_location & 0x3f) {
+ printf("Error: Invalid Directory location.\n");
+ printf(" Valid locations are 64-byte aligned\n");
+ return 1;
+ }
+ } else {
+ switch (dir_location) {
+ case 0: /* Fall through */
+ case 0xFFFA0000: /* Fall through */
+ case 0xFFF20000: /* Fall through */
+ case 0xFFE20000: /* Fall through */
+ case 0xFFC20000: /* Fall through */
+ case 0xFF820000: /* Fall through */
+ case 0xFF020000: /* Fall through */
+ break;
+ default:
+ printf("Error: Invalid Directory location.\n");
+ printf(" Valid locations are 0xFFFA0000, 0xFFF20000,\n");
+ printf(" 0xFFE20000, 0xFFC20000, 0xFF820000, 0xFF020000\n");
+ return 1;
+ }
}
ctx.rom = malloc(ctx.rom_size);
--
To view, visit https://review.coreboot.org/c/coreboot/+/42043
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7f841db8617b953dc671a9c12576145f85263581
Gerrit-Change-Number: 42043
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth(a)google.com>
Gerrit-MessageType: newchange
John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/41042 )
Change subject: device: Add a disbling PCIe device bus master function
......................................................................
device: Add a disbling PCIe device bus master function
A function pci_dev_disable_bus_master() is created. This function
can be used to disable Thunderbolt PCIe root ports, bridges and
devices for Vt-d based security platform at end of boot service.
BUG=None
TEST=verified PCIe device bus master enable bit is cleared.
Signed-off-by: John Zhao <john.zhao(a)intel.com>
Change-Id: Ie92a15bf2c66fdc311098acb81019d4fb7f68313
---
M src/device/pci_device.c
M src/include/device/pci.h
2 files changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/41042/1
diff --git a/src/device/pci_device.c b/src/device/pci_device.c
index 6fce761..7c1b9d8 100644
--- a/src/device/pci_device.c
+++ b/src/device/pci_device.c
@@ -1568,4 +1568,20 @@
#endif
}
}
+
+/**
+ * Disable device bus master.
+ *
+ * This function is to disable device bus master.
+ *
+ * @param dev Pointer to the device.
+ */
+void pci_dev_disable_bus_master(struct device *dev)
+{
+ u16 reg;
+
+ reg = pci_read_config16(dev, PCI_COMMAND);
+ reg &= ~PCI_COMMAND_MASTER;
+ pci_write_config16(dev, PCI_COMMAND, reg);
+}
#endif
diff --git a/src/include/device/pci.h b/src/include/device/pci.h
index f091105..2283359 100644
--- a/src/include/device/pci.h
+++ b/src/include/device/pci.h
@@ -127,6 +127,7 @@
return (attr & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_MEMORY;
}
+void pci_dev_disable_bus_master(struct device *dev);
#endif /* CONFIG_PCI */
void pci_early_bridge_init(void);
--
To view, visit https://review.coreboot.org/c/coreboot/+/41042
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie92a15bf2c66fdc311098acb81019d4fb7f68313
Gerrit-Change-Number: 41042
Gerrit-PatchSet: 1
Gerrit-Owner: John Zhao <john.zhao(a)intel.com>
Gerrit-MessageType: newchange
Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42101 )
Change subject: vendorcode/amd: Clean up code smell
......................................................................
vendorcode/amd: Clean up code smell
Change-Id: I8a39e862176cd1c8a14424eb6d2bf7edabd36adb
Found-by: Silvio Cesare, https://twitter.com/silviocesare/status/1268784333029965824
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
M src/vendorcode/amd/agesa/f16kb/Proc/CPU/Feature/cpuSrat.c
1 file changed, 0 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/42101/1
diff --git a/src/vendorcode/amd/agesa/f16kb/Proc/CPU/Feature/cpuSrat.c b/src/vendorcode/amd/agesa/f16kb/Proc/CPU/Feature/cpuSrat.c
index 9d6ca3d..2a935b2 100644
--- a/src/vendorcode/amd/agesa/f16kb/Proc/CPU/Feature/cpuSrat.c
+++ b/src/vendorcode/amd/agesa/f16kb/Proc/CPU/Feature/cpuSrat.c
@@ -226,7 +226,6 @@
// Get Node count
NodeCount = 1;
- NodeCount = 1;
// The worst-case buffer size to request is for the SRAT table header, one
// entree for special region (base 640k block), two memory
--
To view, visit https://review.coreboot.org/c/coreboot/+/42101
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8a39e862176cd1c8a14424eb6d2bf7edabd36adb
Gerrit-Change-Number: 42101
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange