Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31140
Change subject: lib/hardwaremain: Remove unused acpi_is_wakeup() function
......................................................................
lib/hardwaremain: Remove unused acpi_is_wakeup() function
Looks like acpi_is_wakeup() return value is not getting honoured,
hence this function is not doing anything rather reading from romstage
buffer.
Change-Id: Icc57804074a58315e72e276fcae799febc10612d
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
---
M src/lib/hardwaremain.c
1 file changed, 1 insertion(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/31140/1
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index 98b8841..3ec7e8e 100644
--- a/src/lib/hardwaremain.c
+++ b/src/lib/hardwaremain.c
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2013 Google, Inc.
+ * Copyright (C) 2019 Intel Inc.
*
* 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
@@ -469,11 +470,6 @@
timestamp_add_now(TS_START_RAMSTAGE);
post_code(POST_ENTRY_RAMSTAGE);
- /* Handoff sleep type from romstage. */
-#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
- acpi_is_wakeup();
-#endif
-
exception_init();
threads_initialize();
--
To view, visit https://review.coreboot.org/c/coreboot/+/31140
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Icc57804074a58315e72e276fcae799febc10612d
Gerrit-Change-Number: 31140
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-MessageType: newchange
Werner Zeh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31544
Change subject: lib: Add Bubble sort algorithm
......................................................................
lib: Add Bubble sort algorithm
Add an implementation for Bubble sort. For now, only Integers can be
sorted in an ascending or descending order. It can be later simply
extended to cover other datasets like strings if needed.
Change-Id: I2c5e0b5685a907243b58ebe6682078272d316bf6
Signed-off-by: Werner Zeh <werner.zeh(a)siemens.com>
---
A src/include/sort.h
M src/lib/Makefile.inc
A src/lib/sort.c
3 files changed, 83 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/31544/1
diff --git a/src/include/sort.h b/src/include/sort.h
new file mode 100644
index 0000000..0117d66
--- /dev/null
+++ b/src/include/sort.h
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 Siemens AG
+ *
+ * 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 SORT_H_
+#define SORT_H_
+
+#include <stddef.h>
+
+typedef enum{
+ NUM_ASCENDING,
+ NUM_DESCENDING
+} sort_order_t;
+
+void bubblesort(int *v, size_t num_entries, sort_order_t order);
+
+#endif /* SORT_H_ */
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index fa1ff8b..33f68d2 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -150,6 +150,7 @@
ramstage-$(CONFIG_FLATTENED_DEVICE_TREE) += device_tree.c
ramstage-$(CONFIG_PAYLOAD_FIT_SUPPORT) += fit.c
ramstage-$(CONFIG_PAYLOAD_FIT_SUPPORT) += fit_payload.c
+ramstage-y += sort.c
romstage-y += cbmem_common.c
romstage-y += imd_cbmem.c
diff --git a/src/lib/sort.c b/src/lib/sort.c
new file mode 100644
index 0000000..48802c1
--- /dev/null
+++ b/src/lib/sort.c
@@ -0,0 +1,55 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 Siemens AG
+ *
+ * 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 <sort.h>
+
+static void swap(int *v1, int *v2)
+{
+ int tmp = *v1;
+
+ *v1 = *v2;
+ *v2 = tmp;
+}
+
+static int is_bigger(int v1, int v2)
+{
+ return v1 > v2 ? 1 : 0;
+}
+/* Implement a simple Bubble sort algorithm. Reduce the needed number of
+ * iterations by taking care of already sorted entries in the list. */
+void bubblesort(int *v, size_t num_entries, sort_order_t order)
+{
+ size_t len = num_entries, idx, i;
+
+ do {
+ idx = 1;
+ for (i = 0; i < (len - 1); ++i) {
+ switch (order) {
+ case NUM_ASCENDING:
+ if (is_bigger(v[i], v[i + 1]))
+ swap(&v[i], &v[i + 1]);
+ break;
+ case NUM_DESCENDING:
+ if (is_bigger(v[i + 1], v[i]))
+ swap(&v[i], &v[i + 1]);
+ break;
+ default:
+ return;
+ }
+ idx = i + 1;
+ }
+ len = idx;
+ } while (len > 1);
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/31544
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2c5e0b5685a907243b58ebe6682078272d316bf6
Gerrit-Change-Number: 31544
Gerrit-PatchSet: 1
Gerrit-Owner: Werner Zeh <werner.zeh(a)siemens.com>
Gerrit-MessageType: newchange
Werner Zeh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31545
Change subject: acpi: Sort the reported APIC-IDs in the MADT table
......................................................................
acpi: Sort the reported APIC-IDs in the MADT table
coreboot performs MP-Init in a parallel way. That leads to the fact
that the order, in which the CPUs are woken up, can vary from boot to
boot. The creation of the MADT table just parses the devicetree and
takes the CPUs reported there as it is for creating the single local
APIC entries. Therefore, The OS will see different order of CPUs.
There are CPUs out there (like Apollo Lake for example) which have
shared caches on core-level and if the order is random this can end up
in assigning cores to different tasks or even OSes (in a virtual
enviroinment) which uses the same cache. This in turn will produce
performance penalties across these distributed tasks/OSes.
Though there is a way on discover the core- and cache-topology it will
in the end be necessary to take the APIC-ID into account. To simplify
it, one can achieve the same output by sorting the APIC-IDs in an
ascending order. This will lead to the fact that CPUs that share a given
cache will be reported right next to each other in the MADT.
Change-Id: Ida74f9f00a4e2a03107a2124014403de60462735
Signed-off-by: Werner Zeh <werner.zeh(a)siemens.com>
---
M src/arch/x86/acpi.c
1 file changed, 8 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/31545/1
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c
index 0c85d3a..c7b9214 100644
--- a/src/arch/x86/acpi.c
+++ b/src/arch/x86/acpi.c
@@ -8,7 +8,7 @@
* Copyright (C) 2005-2009 coresystems GmbH
* Copyright (C) 2015 Timothy Pearson <tpearson(a)raptorengineeringinc.com>,
* Raptor Engineering
- * Copyright (C) 2016-2017 Siemens AG
+ * Copyright (C) 2016-2019 Siemens AG
*
* ACPI FADT, FACS, and DSDT table support added by
* Nick Barker <nick.barker9(a)btinternet.com>, and those portions
@@ -47,6 +47,7 @@
#include <cpu/x86/lapic_def.h>
#include <cpu/cpu.h>
#include <cbfs.h>
+#include <sort.h>
u8 acpi_checksum(u8 *table, u32 length)
{
@@ -148,7 +149,7 @@
unsigned long acpi_create_madt_lapics(unsigned long current)
{
struct device *cpu;
- int index = 0;
+ int index, apic_ids[CONFIG_MAX_CPUS], num_cpus = 0;
for (cpu = all_devices; cpu; cpu = cpu->next) {
if ((cpu->path.type != DEVICE_PATH_APIC) ||
@@ -157,9 +158,12 @@
}
if (!cpu->enabled)
continue;
+ apic_ids[num_cpus++] = cpu->path.apic.apic_id;
+ }
+ bubblesort(apic_ids, num_cpus, NUM_ASCENDING);
+ for (index = 0; index < num_cpus; index++) {
current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current,
- index, cpu->path.apic.apic_id);
- index++;
+ index, apic_ids[index]);
}
return current;
--
To view, visit https://review.coreboot.org/c/coreboot/+/31545
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ida74f9f00a4e2a03107a2124014403de60462735
Gerrit-Change-Number: 31545
Gerrit-PatchSet: 1
Gerrit-Owner: Werner Zeh <werner.zeh(a)siemens.com>
Gerrit-MessageType: newchange
Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31654
Change subject: util/lint: Fix clang-format test and enable it by default
......................................................................
util/lint: Fix clang-format test and enable it by default
git diff needed to emit diffs without prefix (e.g. a/ and b/) for
clang-format-diff to be able to work.
Also require that the test succeeds.
Change-Id: I7e9a32eb9281b5cb0b45506a206500fd1d315372
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
R util/lint/lint-stable-022-clang-format
1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/54/31654/1
diff --git a/util/lint/lint-022-clang-format b/util/lint/lint-stable-022-clang-format
similarity index 79%
rename from util/lint/lint-022-clang-format
rename to util/lint/lint-stable-022-clang-format
index 932d9c0..bd662e4 100755
--- a/util/lint/lint-022-clang-format
+++ b/util/lint/lint-stable-022-clang-format
@@ -30,5 +30,9 @@
fi
if [ $(clang-format $files_to_check | wc -l) -gt 0 ]; then
- git diff HEAD~..HEAD -- $files_to_check | clang-format-diff
+ if [ "$(git diff --no-prefix HEAD~..HEAD -- $files_to_check | clang-format-diff)" != "" ]; then
+ echo "Coding style mismatch. The following patch fixes it:"
+ git diff --no-prefix HEAD~..HEAD -- $files_to_check | clang-format-diff
+ exit 1
+ fi
fi
--
To view, visit https://review.coreboot.org/c/coreboot/+/31654
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7e9a32eb9281b5cb0b45506a206500fd1d315372
Gerrit-Change-Number: 31654
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Hello Mike Banon,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/31222
to review the following change.
Change subject: drivers/intel/wifi/Kconfig: disable DRIVERS_INTEL_WIFI if !SYSTEM_TYPE_LAPTOP
......................................................................
drivers/intel/wifi/Kconfig: disable DRIVERS_INTEL_WIFI if !SYSTEM_TYPE_LAPTOP
Intel PCI-e WiFi adapters are rare outside of laptops. DRIVERS_INTEL_WIFI
should not be selected by default if the mainboard is not a laptop.
Signed-off-by: Mike Banon <mikebdp2(a)gmail.com>
Change-Id: I9a7e5cd515da4ee4c4176227eea2e863ed55c420
---
M src/drivers/intel/wifi/Kconfig
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/31222/1
diff --git a/src/drivers/intel/wifi/Kconfig b/src/drivers/intel/wifi/Kconfig
index 4dc4d7f..80a7ef8 100644
--- a/src/drivers/intel/wifi/Kconfig
+++ b/src/drivers/intel/wifi/Kconfig
@@ -1,7 +1,7 @@
config DRIVERS_INTEL_WIFI
bool "Support Intel PCI-e WiFi adapters"
depends on ARCH_X86
- default y if PCIEXP_PLUGIN_SUPPORT
+ default y if PCIEXP_PLUGIN_SUPPORT && !SYSTEM_TYPE_LAPTOP
help
When enabled, add identifiers in ACPI and SMBIOS tables to
make OS drivers work with certain Intel PCI-e WiFi chipsets.
--
To view, visit https://review.coreboot.org/c/coreboot/+/31222
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I9a7e5cd515da4ee4c4176227eea2e863ed55c420
Gerrit-Change-Number: 31222
Gerrit-PatchSet: 1
Gerrit-Owner: mikeb mikeb <mikebdp2(a)gmail.com>
Gerrit-Reviewer: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-MessageType: newchange