Hello Patrick Rudolph, Lance Zhao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/33097
to review the following change.
Change subject: soc/intel/common/uart: Correctly guard uart_platform_base()
......................................................................
soc/intel/common/uart: Correctly guard uart_platform_base()
We should only provide this implementation when the Intel LPSS UART is
used. Otherwise, no other UART could be used for the console with these
SoCs.
Change-Id: Iebd89edb3f21d4a68587fd02659b4d529f3f4bbe
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M src/soc/intel/common/block/uart/uart.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/97/33097/1
diff --git a/src/soc/intel/common/block/uart/uart.c b/src/soc/intel/common/block/uart/uart.c
index 47774b6..84ba1ee 100644
--- a/src/soc/intel/common/block/uart/uart.c
+++ b/src/soc/intel/common/block/uart/uart.c
@@ -43,7 +43,7 @@
CONFIG_SOC_INTEL_COMMON_LPSS_UART_CLK_N_VAL);
}
-#if CONFIG(DRIVERS_UART_8250MEM)
+#if CONFIG(INTEL_LPSS_UART_FOR_CONSOLE)
uintptr_t uart_platform_base(int idx)
{
if (idx == CONFIG_UART_FOR_CONSOLE)
--
To view, visit https://review.coreboot.org/c/coreboot/+/33097
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iebd89edb3f21d4a68587fd02659b4d529f3f4bbe
Gerrit-Change-Number: 33097
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Lance Zhao <lance.zhao(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Hello Patrick Rudolph, Lance Zhao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/33096
to review the following change.
Change subject: soc/intel/common/uart: Only return valid UART base
......................................................................
soc/intel/common/uart: Only return valid UART base
We only configure the base address for the console UART, the other
addresses are never assigned to the hardware. It seems better to
return 0 for them instead of a spurious value.
Change-Id: I3fa5c99958b56ca5b0b603917c086bdddb677fa2
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M src/soc/intel/common/block/uart/uart.c
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/33096/1
diff --git a/src/soc/intel/common/block/uart/uart.c b/src/soc/intel/common/block/uart/uart.c
index 35c2c6c..47774b6 100644
--- a/src/soc/intel/common/block/uart/uart.c
+++ b/src/soc/intel/common/block/uart/uart.c
@@ -46,8 +46,9 @@
#if CONFIG(DRIVERS_UART_8250MEM)
uintptr_t uart_platform_base(int idx)
{
- /* return Base address for UART console index */
- return UART_BASE_0_ADDR(idx);
+ if (idx == CONFIG_UART_FOR_CONSOLE)
+ return UART_BASE_0_ADDR(CONFIG_UART_FOR_CONSOLE);
+ return 0;
}
#endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/33096
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3fa5c99958b56ca5b0b603917c086bdddb677fa2
Gerrit-Change-Number: 33096
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Lance Zhao <lance.zhao(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Hello Patrick Rudolph, Lance Zhao,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/33095
to review the following change.
Change subject: soc/intel/common/uart: Drop dead call to soc_uart_set_legacy_mode()
......................................................................
soc/intel/common/uart: Drop dead call to soc_uart_set_legacy_mode()
The only path that leads here is guarded by both !DRIVERS_UART_
8250MEM_32 and INTEL_LPSS_UART_FOR_CONSOLE but the latter selects
the former.
Change-Id: I6e0765b028572950991c45b45b2051f4f176a94a
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M src/soc/intel/common/block/include/intelblocks/uart.h
M src/soc/intel/common/block/uart/uart.c
2 files changed, 0 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/33095/1
diff --git a/src/soc/intel/common/block/include/intelblocks/uart.h b/src/soc/intel/common/block/include/intelblocks/uart.h
index ad2ddf4..55f259d 100644
--- a/src/soc/intel/common/block/include/intelblocks/uart.h
+++ b/src/soc/intel/common/block/include/intelblocks/uart.h
@@ -91,10 +91,4 @@
*/
struct device *soc_uart_console_to_device(int uart_console);
-/*
- * Set UART to legacy mode
- * Put UART in byte access mode for 16550 compatibility
- */
-void soc_uart_set_legacy_mode(void);
-
#endif /* SOC_INTEL_COMMON_BLOCK_UART_H */
diff --git a/src/soc/intel/common/block/uart/uart.c b/src/soc/intel/common/block/uart/uart.c
index a8e5792..35c2c6c 100644
--- a/src/soc/intel/common/block/uart/uart.c
+++ b/src/soc/intel/common/block/uart/uart.c
@@ -139,10 +139,6 @@
uart_common_init(uart_get_device(),
UART_BASE(CONFIG_UART_FOR_CONSOLE));
- if (!CONFIG(DRIVERS_UART_8250MEM_32))
- /* Put UART in byte access mode for 16550 compatibility */
- soc_uart_set_legacy_mode();
-
/* Configure the 2 pads per UART. */
uart_configure_gpio_pads();
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/33095
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6e0765b028572950991c45b45b2051f4f176a94a
Gerrit-Change-Number: 33095
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Lance Zhao <lance.zhao(a)gmail.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33049
Change subject: drivers/intel/fsp1_1: Exit cleanly if FSP not found
......................................................................
drivers/intel/fsp1_1: Exit cleanly if FSP not found
Instead of dereferencing a null pointer, print a nice message and exit
cleanly if the FSP isn't found in the CBFS.
Change-Id: I761e7febc7cec5bd2ef3af214bc51777ee5c313d
Signed-off-by: Jacob Garber <jgarber1(a)ualberta.ca>
Found-by: Coverity CID 1401467
---
M src/drivers/intel/fsp1_1/car.c
1 file changed, 6 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/33049/1
diff --git a/src/drivers/intel/fsp1_1/car.c b/src/drivers/intel/fsp1_1/car.c
index 34b2518..194406b 100644
--- a/src/drivers/intel/fsp1_1/car.c
+++ b/src/drivers/intel/fsp1_1/car.c
@@ -159,19 +159,16 @@
{
/* Need to locate the current FSP_INFO_HEADER. The cache-as-ram
* is still enabled. We can directly access work buffer here. */
- FSP_INFO_HEADER *fih;
struct prog fsp = PROG_INIT(PROG_REFCODE, "fsp.bin");
console_init();
- if (prog_locate(&fsp)) {
- fih = NULL;
- printk(BIOS_ERR, "Unable to locate %s\n", prog_name(&fsp));
- } else {
- /* This leaks a mapping which this code assumes is benign as
- * the flash is memory mapped CPU's address space. */
- fih = find_fsp((uintptr_t)rdev_mmap_full(prog_rdev(&fsp)));
- }
+ if (prog_locate(&fsp))
+ die_with_post_code(POST_INVALID_CBFS, "Unable to locate fsp.bin");
+
+ /* This leaks a mapping which this code assumes is benign as
+ * the flash is memory mapped CPU's address space. */
+ FSP_INFO_HEADER *fih = find_fsp((uintptr_t)rdev_mmap_full(prog_rdev(&fsp)));
cache_as_ram_stage_main(fih);
--
To view, visit https://review.coreboot.org/c/coreboot/+/33049
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I761e7febc7cec5bd2ef3af214bc51777ee5c313d
Gerrit-Change-Number: 33049
Gerrit-PatchSet: 1
Gerrit-Owner: Jacob Garber <jgarber1(a)ualberta.ca>
Gerrit-MessageType: newchange
Jacob Garber has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33134
Change subject: mb/sifive/hifive-unleashed: Check for errors in fixup_fdt
......................................................................
mb/sifive/hifive-unleashed: Check for errors in fixup_fdt
It is possible that cbfs_boot_map_with_leak() and malloc() could fail,
so detect those conditions and print error messages if they do.
Change-Id: I34951da0b73028c4c89446cb1779a72422997325
Signed-off-by: Jacob Garber <jgarber1(a)ualberta.ca>
Found-by: Coverity CID 1399147
---
M src/mainboard/sifive/hifive-unleashed/fixup_fdt.c
1 file changed, 11 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/33134/1
diff --git a/src/mainboard/sifive/hifive-unleashed/fixup_fdt.c b/src/mainboard/sifive/hifive-unleashed/fixup_fdt.c
index ea58e02..6c42fc8 100644
--- a/src/mainboard/sifive/hifive-unleashed/fixup_fdt.c
+++ b/src/mainboard/sifive/hifive-unleashed/fixup_fdt.c
@@ -86,6 +86,11 @@
/* load flat dt from cbfs */
fdt_rom = cbfs_boot_map_with_leak("fallback/DTB", CBFS_TYPE_RAW, NULL);
+ if (fdt_rom == NULL) {
+ printk(BIOS_ERR, "Unable to load fallback/DTB from CBFS\n");
+ return;
+ }
+
/* Expand DT into a tree */
tree = fdt_unflatten(fdt_rom);
@@ -95,6 +100,12 @@
/* convert the tree to a flat dt */
void *dt = malloc(dt_flat_size(tree));
+
+ if (dt == NULL) {
+ printk(BIOS_ERR, "Unable to allocate memory for flat device tree\n");
+ return;
+ }
+
dt_flatten(tree, dt);
/* update HLS */
--
To view, visit https://review.coreboot.org/c/coreboot/+/33134
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I34951da0b73028c4c89446cb1779a72422997325
Gerrit-Change-Number: 33134
Gerrit-PatchSet: 1
Gerrit-Owner: Jacob Garber <jgarber1(a)ualberta.ca>
Gerrit-MessageType: newchange