John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33232
Change subject: src/cpu/x86: Check pointer processor_name_start before dereference
......................................................................
src/cpu/x86: Check pointer processor_name_start before dereference
Clang Static Analyzer version 8.0.0 detects the left operand of '=='
is a garbage value if pointer processor_name_start is NULL. Add sanity
check for processor_name_start before dereference.
TEST=Built and boot up to kernel.
Change-Id: I1f831a8661a4686d306b8217655942934102ea16
Signed-off-by: John Zhao <john.zhao(a)intel.com>
---
M src/cpu/x86/name/name.c
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/32/33232/1
diff --git a/src/cpu/x86/name/name.c b/src/cpu/x86/name/name.c
index fc360cd..44a1cf0 100644
--- a/src/cpu/x86/name/name.c
+++ b/src/cpu/x86/name/name.c
@@ -37,6 +37,9 @@
/* Skip leading spaces. */
processor_name_start = (char *)name_as_ints;
+ if (!processor_name_start)
+ return;
+
while (*processor_name_start == ' ')
processor_name_start++;
--
To view, visit https://review.coreboot.org/c/coreboot/+/33232
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1f831a8661a4686d306b8217655942934102ea16
Gerrit-Change-Number: 33232
Gerrit-PatchSet: 1
Gerrit-Owner: John Zhao <john.zhao(a)intel.com>
Gerrit-MessageType: newchange
John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/vboot/+/35021 )
Change subject: vboot: Avoid insecure data handling
......................................................................
vboot: Avoid insecure data handling
Coverity detects the overflowed value "rev" used as return value.
Cast the value "rev" to integer after strtol invocation.
BUG=CID 1401793
TEST=Built and boot up to kernel.
Signed-off-by: John Zhao <john.zhao(a)intel.com>
Change-Id: Idcb48d9a8f7c89744c66f50affb5f9acc6aa4c12
---
M futility/updater.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/vboot refs/changes/21/35021/1
diff --git a/futility/updater.c b/futility/updater.c
index ef142b8..14dd469 100644
--- a/futility/updater.c
+++ b/futility/updater.c
@@ -234,7 +234,7 @@
/* Result should be 'revN' */
if (strncmp(result, STR_REV, strlen(STR_REV)) == 0)
- rev = strtol(result + strlen(STR_REV), NULL, 0);
+ rev = (int)strtol(result + strlen(STR_REV), NULL, 0);
VB2_DEBUG("Raw data = [%s], parsed version is %d\n", result, rev);
free(result);
--
To view, visit https://review.coreboot.org/c/vboot/+/35021
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: vboot
Gerrit-Branch: master
Gerrit-Change-Id: Idcb48d9a8f7c89744c66f50affb5f9acc6aa4c12
Gerrit-Change-Number: 35021
Gerrit-PatchSet: 1
Gerrit-Owner: John Zhao <john.zhao(a)intel.com>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37180 )
Change subject: [TESTME]AGESA: Try to fix S3 resume on CONFIG_NO_STAGE_CACHE
......................................................................
[TESTME]AGESA: Try to fix S3 resume on CONFIG_NO_STAGE_CACHE
TODO: What MTRR's does AGESA set up on the s3 resume path?
Change-Id: I8f9d9d4c0116c965570e289a0b0df7d5f739acde
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/cpu/amd/agesa/Kconfig
M src/drivers/amd/agesa/mtrr_fixme.c
2 files changed, 1 insertion(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/80/37180/1
diff --git a/src/cpu/amd/agesa/Kconfig b/src/cpu/amd/agesa/Kconfig
index ddfe707..84fcaef 100644
--- a/src/cpu/amd/agesa/Kconfig
+++ b/src/cpu/amd/agesa/Kconfig
@@ -26,7 +26,6 @@
select UDELAY_LAPIC
select LAPIC_MONOTONIC_TIMER
select SPI_FLASH if HAVE_ACPI_RESUME
- select CBMEM_STAGE_CACHE if HAVE_ACPI_RESUME
select SMM_ASEG
select NO_FIXED_XIP_ROM_SIZE
diff --git a/src/drivers/amd/agesa/mtrr_fixme.c b/src/drivers/amd/agesa/mtrr_fixme.c
index bbb9eb0..37795e9 100644
--- a/src/drivers/amd/agesa/mtrr_fixme.c
+++ b/src/drivers/amd/agesa/mtrr_fixme.c
@@ -48,7 +48,7 @@
void fixup_cbmem_to_UC(int s3resume)
{
- if (s3resume)
+ if (s3resume && !CONFIG(NO_STAGE_CACHE))
return;
/* For normal path, INIT_POST has returned with all
--
To view, visit https://review.coreboot.org/c/coreboot/+/37180
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8f9d9d4c0116c965570e289a0b0df7d5f739acde
Gerrit-Change-Number: 37180
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36908 )
Change subject: lib/fmap.c: Properly handle cache for !C_ENVIRONMENT_BOOTBLOCK
......................................................................
lib/fmap.c: Properly handle cache for !C_ENVIRONMENT_BOOTBLOCK
On platforms without C_ENVIRONMENT_BOOTBLOCK the first stage
accessing FMAP is romstage. As on these platforms only romstage
is expected to call setup_preram_cache() no further handling is
needed.
Change-Id: I7d70585b0c076707e73e20c2ed3f11e4c9ffdf37
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/lib/fmap.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/36908/1
diff --git a/src/lib/fmap.c b/src/lib/fmap.c
index 4b4179c..f0fae55 100644
--- a/src/lib/fmap.c
+++ b/src/lib/fmap.c
@@ -78,7 +78,7 @@
}
struct fmap *fmap = (struct fmap *)_fmap_cache;
- if (!ENV_BOOTBLOCK) {
+ if (!ENV_BOOTBLOCK && CONFIG(C_ENVIRONMENT_BOOTBLOCK)) {
/* NOTE: This assumes that for all platforms running this code,
the bootblock is the first stage and the bootblock will make
at least one FMAP access (usually from finding CBFS). */
--
To view, visit https://review.coreboot.org/c/coreboot/+/36908
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7d70585b0c076707e73e20c2ed3f11e4c9ffdf37
Gerrit-Change-Number: 36908
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
mturney mturney has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38593 )
Change subject: sc7180: GPIO: Add I2S configuration for sc7180
......................................................................
sc7180: GPIO: Add I2S configuration for sc7180
Configuring GPIO Pins as I2S mode for Audio speaker.
Change-Id: I681aa6d0d57671b0fd9b7bc88de6f2cc202a7af0
Signed-off-by: vsujithk <vsujithk(a)codeaurora.org>
---
M src/soc/qualcomm/sc7180/Makefile.inc
M src/soc/qualcomm/sc7180/bootblock.c
A src/soc/qualcomm/sc7180/include/soc/qi2s.h
A src/soc/qualcomm/sc7180/qi2s.c
4 files changed, 80 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/93/38593/1
diff --git a/src/soc/qualcomm/sc7180/Makefile.inc b/src/soc/qualcomm/sc7180/Makefile.inc
index ba1f675..6d6222b 100644
--- a/src/soc/qualcomm/sc7180/Makefile.inc
+++ b/src/soc/qualcomm/sc7180/Makefile.inc
@@ -15,6 +15,7 @@
bootblock-y += qupv3_fw_config.c
bootblock-y += qupv3_config.c
bootblock-y += qcom_qup_se.c
+bootblock-y += qi2s.c
################################################################################
verstage-y += timer.c
@@ -27,7 +28,7 @@
verstage-y += qcom_qup_se.c
verstage-y += qupv3_config.c
verstage-$(CONFIG_DRIVERS_UART) += qupv3_uart.c
-
+verstage-y += qi2s.c
################################################################################
romstage-y += cbmem.c
romstage-y += timer.c
@@ -45,7 +46,7 @@
romstage-y += qcom_qup_se.c
romstage-y += qupv3_config.c
romstage-$(CONFIG_DRIVERS_UART) += qupv3_uart.c
-
+romstage-y += qi2s.c
################################################################################
ramstage-y += soc.c
ramstage-y += timer.c
@@ -61,7 +62,7 @@
ramstage-y += qupv3_config.c
ramstage-y += qcom_qup_se.c
ramstage-$(CONFIG_DRIVERS_UART) += qupv3_uart.c
-
+romstage-y += qi2s.c
################################################################################
CPPFLAGS_common += -Isrc/soc/qualcomm/sc7180/include
diff --git a/src/soc/qualcomm/sc7180/bootblock.c b/src/soc/qualcomm/sc7180/bootblock.c
index b247d2d..83b22ba 100644
--- a/src/soc/qualcomm/sc7180/bootblock.c
+++ b/src/soc/qualcomm/sc7180/bootblock.c
@@ -18,6 +18,7 @@
#include <soc/mmu.h>
#include <soc/qspi.h>
#include <soc/qupv3_fw_config.h>
+#include <soc/qi2s.h>
void bootblock_soc_init(void)
{
@@ -25,4 +26,5 @@
clock_init();
quadspi_init(25 * MHz);
qupv3_fw_init();
+ qi2s_init();
}
diff --git a/src/soc/qualcomm/sc7180/include/soc/qi2s.h b/src/soc/qualcomm/sc7180/include/soc/qi2s.h
new file mode 100644
index 0000000..ee02094a
--- /dev/null
+++ b/src/soc/qualcomm/sc7180/include/soc/qi2s.h
@@ -0,0 +1,22 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019-2020 Qualcomm Technologies.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * 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_QUALCOMM_SC7180_QI2S_H__
+#define __SOC_QUALCOMM_SC7180_QI2S_H__
+
+void qi2s_init(void);
+
+
+#endif /* __SOC_QUALCOMM_SC7180_QI2S_H__ */
diff --git a/src/soc/qualcomm/sc7180/qi2s.c b/src/soc/qualcomm/sc7180/qi2s.c
new file mode 100644
index 0000000..9661e55
--- /dev/null
+++ b/src/soc/qualcomm/sc7180/qi2s.c
@@ -0,0 +1,52 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019-2020, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * 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/cache.h>
+#include <device/mmio.h>
+#include <soc/addressmap.h>
+#include <soc/gpio.h>
+#include <soc/clock.h>
+#include <symbols.h>
+#include <assert.h>
+#include <gpio.h>
+#include <string.h>
+#include <soc/qi2s.h>
+
+
+static void configure_gpios(void)
+{
+
+ gpio_output(GPIO(49), 1);
+ gpio_output(GPIO(50), 1);
+ gpio_output(GPIO(51), 1);
+ gpio_output(GPIO(23), 1);
+
+ gpio_configure(GPIO(23), 0, GPIO_PULL_UP,
+ GPIO_8MA, GPIO_OUTPUT);
+ gpio_configure(GPIO(49), 1, GPIO_PULL_UP,
+ GPIO_8MA, GPIO_OUTPUT);
+ gpio_configure(GPIO(50), 1, GPIO_PULL_UP,
+ GPIO_8MA, GPIO_OUTPUT);
+ gpio_configure(GPIO(51), 1, GPIO_PULL_UP,
+ GPIO_8MA, GPIO_OUTPUT);
+
+}
+
+
+void qi2s_init()
+{
+ configure_gpios();
+}
+
--
To view, visit https://review.coreboot.org/c/coreboot/+/38593
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I681aa6d0d57671b0fd9b7bc88de6f2cc202a7af0
Gerrit-Change-Number: 38593
Gerrit-PatchSet: 1
Gerrit-Owner: mturney mturney <mturney(a)codeaurora.org>
Gerrit-MessageType: newchange