Hello build bot (Jenkins), Furquan Shaikh, Caveh Jalali, Duncan Laurie, Dossym Nurmukhanov, Srinidhi N Kaushik, Raj Astekar, Shreesh Chhabbi,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40463
to look at the new patch set (#19).
Change subject: mb/google/volteer: add generic SPDs
......................................................................
mb/google/volteer: add generic SPDs
Add SPDs created by Intel for different memory module options.
NOTE: Renamed Intel's SPD_LPDDR4X_200b_2R_32Gb_QDP_4266.spd.hex to
SPD_LPDDR4X_200b_2R_32Gb_87MinCAS_QDP_4267.spd.hex to remain
consistent with regard to dram frequency in filename (speed is
4267, not 4266).
BUG=b:147857288
TEST=none
Change-Id: Ib4cd148e28efe458f2b312a7f1c5b6d71e8ef433
Signed-off-by: Nick Vaccaro <nvaccaro(a)google.com>
---
A src/mainboard/google/volteer/spd/SPD_LPDDR4X_200b_1R_16Gb_DDP_3733.spd.hex
A src/mainboard/google/volteer/spd/SPD_LPDDR4X_200b_1R_16Gb_DDP_4267.spd.hex
A src/mainboard/google/volteer/spd/SPD_LPDDR4X_200b_2R_32Gb_87MinCAS_QDP_4267.spd.hex
A src/mainboard/google/volteer/spd/SPD_LPDDR4X_200b_2R_32Gb_QDP_3733.spd.hex
A src/mainboard/google/volteer/spd/SPD_LPDDR4X_200b_2R_32Gb_QDP_4267.spd.hex
A src/mainboard/google/volteer/spd/SPD_LPDDR4X_200b_2R_64Gb_ODP_3733.spd.hex
A src/mainboard/google/volteer/spd/SPD_LPDDR4X_200b_2R_64Gb_ODP_4267.spd.hex
A src/mainboard/google/volteer/spd/SPD_LPDDR4X_556b_1R_32Gb_QDP_3733.spd.hex
A src/mainboard/google/volteer/spd/SPD_LPDDR4X_556b_1R_32Gb_QDP_4267.spd.hex
A src/mainboard/google/volteer/spd/SPD_LPDDR4X_556b_2R_48Gb_ODP_3733.spd.hex
A src/mainboard/google/volteer/spd/SPD_LPDDR4X_556b_2R_48Gb_ODP_4267.spd.hex
A src/mainboard/google/volteer/spd/SPD_LPDDR4X_556b_2R_64Gb_ODP_3733.spd.hex
A src/mainboard/google/volteer/spd/SPD_LPDDR4X_556b_2R_64Gb_ODP_4267.spd.hex
13 files changed, 416 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/63/40463/19
--
To view, visit https://review.coreboot.org/c/coreboot/+/40463
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib4cd148e28efe458f2b312a7f1c5b6d71e8ef433
Gerrit-Change-Number: 40463
Gerrit-PatchSet: 19
Gerrit-Owner: Nick Vaccaro <nvaccaro(a)google.com>
Gerrit-Reviewer: Caveh Jalali <caveh(a)chromium.org>
Gerrit-Reviewer: Dossym Nurmukhanov <dossym(a)google.com>
Gerrit-Reviewer: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Raj Astekar <raj.astekar(a)intel.com>
Gerrit-Reviewer: Shreesh Chhabbi <shreesh.chhabbi(a)intel.corp-partner.google.com>
Gerrit-Reviewer: Srinidhi N Kaushik <srinidhi.n.kaushik(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
Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39484 )
Change subject: memrange: Add support for stealing required memory from given ranges
......................................................................
memrange: Add support for stealing required memory from given ranges
This change adds support for memranges_steal() which allows the user
to steal memory from the list of available ranges by providing a set
of constraints (limit, size, alignment, tag). It tries to find the
first big enough range that can satisfy the constraints, creates a
hole as per the request and returns base of the stolen memory.
BUG=b:149186922
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
Change-Id: Ibe9cfae18fc6101ab2e7e27233e45324c8117708
---
M src/include/memrange.h
M src/lib/memrange.c
2 files changed, 60 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/39484/1
diff --git a/src/include/memrange.h b/src/include/memrange.h
index fba77af..9b1d1d2 100644
--- a/src/include/memrange.h
+++ b/src/include/memrange.h
@@ -16,6 +16,7 @@
#define MEMRANGE_H_
#include <device/resource.h>
+#include <stdbool.h>
/* A memranges structure consists of a list of range_entry(s). The structure
* is exposed so that a memranges can be used on the stack if needed. */
@@ -166,4 +167,17 @@
/* Returns next entry after the provided entry. NULL if r is last. */
struct range_entry *memranges_next_entry(struct memranges *ranges,
const struct range_entry *r);
+
+/* Steals memory from the available list in given ranges as per the constraints:
+ * limit = Limit beyond which the stolen memory cannot grow.
+ * size = Requested size for the stolen memory.
+ * align = Alignment requirements for the starting address of the stolen memory.
+ * tag = Use a range that matches the given tag.
+ *
+ * If it is not possible to fulfill the request as per given constraints, this function returns
+ * false. Else, it sets the base address of stolen memory in stolen_base, creates a hole of
+ * required size at the stolen_base and returns true to indicate success. */
+bool memranges_steal(struct memranges *ranges, resource_t limit, resource_t size, size_t align,
+ unsigned long tag, resource_t *stolen_base);
+
#endif /* MEMRANGE_H_ */
diff --git a/src/lib/memrange.c b/src/lib/memrange.c
index a76f24c..b57c6cb 100644
--- a/src/lib/memrange.c
+++ b/src/lib/memrange.c
@@ -385,3 +385,49 @@
{
return r->next;
}
+
+/* Find a range entry that satisfies the given constraints to fit a hole that matches the
+ * required alignment, is big enough, does not exceed the limit and has a matching tag. */
+static const struct range_entry *memranges_find_entry(struct memranges *ranges,
+ resource_t limit, resource_t size,
+ size_t align, unsigned long tag)
+{
+ const struct range_entry *r;
+ resource_t base, end;
+
+ memranges_each_entry(r, ranges) {
+
+ if (r->tag != tag)
+ continue;
+
+ base = ALIGN_UP(r->begin, align);
+ end = base + size - 1;
+
+ if (end > r->end)
+ continue;
+
+ if (end > limit)
+ continue;
+
+ return r;
+ }
+
+ return NULL;
+}
+
+bool memranges_steal(struct memranges *ranges, resource_t limit, resource_t size, size_t align,
+ unsigned long tag, resource_t *stolen_base)
+{
+ resource_t base;
+ const struct range_entry *r = memranges_find_entry(ranges, limit, size, align, tag);
+
+ if (r == NULL)
+ return false;
+
+ base = ALIGN_UP(r->begin, align);
+
+ memranges_create_hole(ranges, base, size);
+ *stolen_base = base;
+
+ return true;
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/39484
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibe9cfae18fc6101ab2e7e27233e45324c8117708
Gerrit-Change-Number: 39484
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan(a)google.com>
Gerrit-MessageType: newchange
Hello build bot (Jenkins), Nico Huber, Patrick Georgi, Martin Roth, Paul Menzel, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/40581
to look at the new patch set (#30).
Change subject: mb/clevo/n141cu: Add new Comet Lake mainboard
......................................................................
mb/clevo/n141cu: Add new Comet Lake mainboard
Add a new mainboard with the following specs:
- Intel i5-10210U (Comet Lake)
- Intel UHD graphics
- Intel HD audio
- 1x Ethernet 1Gbit/s
- 1x SATA3
- 1x M.2 slot x4 (PCIe/SATA)
- 1x M.2 slot x1 (WLAN/BT)
- 1x 3G/LTE
- USB2/3
- Thunderbolt
- HDMI, mDP
- CCD camera + mic
- SD card reader
- TPM2 SLB9670
The ACPI code has been taken from System76 CML-U mainboard series.
Tested:
- Clevo N141CU / TUXEDO InfinityBook Pro 14 v5
- SeaBIOS and TianoCore
- vboot with RO, RO+A, RO+A+B
- Booted Arch Linux
- Linux 5.6.10
- Linux LTS 5.4.38
What works / What works not:
- WLAN/BT does not work, but also not with vendor firmware
- Everything else works
Todos:
- Missing libgfxinit support
- Missing flashrom support
- Different configuration switches mentioned in ramstage.c
Signed-off-by: Felix Singer <felixsinger(a)posteo.net>
Change-Id: I9f83fab64e4cc9036698ca0fdd5edbb677d77eb9
---
M MAINTAINERS
A src/mainboard/clevo/Kconfig
A src/mainboard/clevo/Kconfig.name
A src/mainboard/clevo/cml-u/Kconfig
A src/mainboard/clevo/cml-u/Kconfig.name
A src/mainboard/clevo/cml-u/Makefile.inc
A src/mainboard/clevo/cml-u/acpi/ac.asl
A src/mainboard/clevo/cml-u/acpi/battery.asl
A src/mainboard/clevo/cml-u/acpi/buttons.asl
A src/mainboard/clevo/cml-u/acpi/ec.asl
A src/mainboard/clevo/cml-u/acpi/ec_ram.asl
A src/mainboard/clevo/cml-u/acpi/gpe.asl
A src/mainboard/clevo/cml-u/acpi/hid.asl
A src/mainboard/clevo/cml-u/acpi/keyboard.asl
A src/mainboard/clevo/cml-u/acpi/lid.asl
A src/mainboard/clevo/cml-u/acpi/mainboard.asl
A src/mainboard/clevo/cml-u/acpi/sleep.asl
A src/mainboard/clevo/cml-u/acpi/tbt.asl
A src/mainboard/clevo/cml-u/board_info.txt
A src/mainboard/clevo/cml-u/dsdt.asl
A src/mainboard/clevo/cml-u/fmds/vboot-ro.fmd
A src/mainboard/clevo/cml-u/fmds/vboot-roa.fmd
A src/mainboard/clevo/cml-u/fmds/vboot-roab.fmd
A src/mainboard/clevo/cml-u/ramstage.c
A src/mainboard/clevo/cml-u/romstage.c
A src/mainboard/clevo/cml-u/variants/n141cu/data.vbt
A src/mainboard/clevo/cml-u/variants/n141cu/devicetree.cb
A src/mainboard/clevo/cml-u/variants/n141cu/gma-mainboard.ads
A src/mainboard/clevo/cml-u/variants/n141cu/hda_verb.c
A src/mainboard/clevo/cml-u/variants/n141cu/include/gpio_table.h
30 files changed, 1,705 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/40581/30
--
To view, visit https://review.coreboot.org/c/coreboot/+/40581
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I9f83fab64e4cc9036698ca0fdd5edbb677d77eb9
Gerrit-Change-Number: 40581
Gerrit-PatchSet: 30
Gerrit-Owner: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41029 )
Change subject: soc/intel/jasperlake: Allow SataEnable to be filled from devicetree
......................................................................
Patch Set 6:
(2 comments)
https://review.coreboot.org/c/coreboot/+/41029/6/src/soc/intel/jasperlake/f…
File src/soc/intel/jasperlake/fsp_params.c:
https://review.coreboot.org/c/coreboot/+/41029/6/src/soc/intel/jasperlake/f…
PS6, Line 139: dev->enabled
If we can use dev->enabled, is there any point in using SataEnable config? Can we drop it and just use dev->enabled instead?
https://review.coreboot.org/c/coreboot/+/41029/6/src/soc/intel/jasperlake/f…
PS6, Line 140: SataEnable
I believe there are generally more params that you would have to set when Sata is being enabled? Like SataMode, SataPortsDevSlp and so on.
--
To view, visit https://review.coreboot.org/c/coreboot/+/41029
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4f7e7508b8cd483508293ee3e7b760574d8f025f
Gerrit-Change-Number: 41029
Gerrit-PatchSet: 6
Gerrit-Owner: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Reviewer: Aamir Bohra <aamir.bohra(a)intel.com>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Maulik V Vaghela <maulik.v.vaghela(a)intel.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Furquan Shaikh <furquan(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Wed, 06 May 2020 17:34:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Name of user not set #1002873 has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40538 )
Change subject: tests: Add lib/string-test test case
......................................................................
tests: Add lib/string-test test case
This commit's purpose is to show basic example of how unit testing may
be applied for coreboot project. It adds test harness for lib/string.c
module.
In order to run this example, one need to install (beside general
coreboot dependencies) cmocka package:
sudo apt-get install -y libcmocka-dev
sudo emerge dev-util/cmocka
yum install libcmocka-devel
After invoking:
make unit-tests
report from unit test will be created and shown on the screen
This test harness definitely isn't complete, as it only checks for some
functions within module. Purpose of this code is only an example and a
starting point for a discussion about implementation.
Signed-off-by: Jan Dabros <jsd(a)semihalf.com>
Change-Id: Ibf5554d1e99a393721a66bdd35af0122c2e412c4
---
A tests/include/mocks/assert.h
A tests/lib/Makefile.inc
A tests/lib/string-test.c
3 files changed, 152 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/38/40538/1
diff --git a/tests/include/mocks/assert.h b/tests/include/mocks/assert.h
new file mode 100644
index 0000000..0b0499b
--- /dev/null
+++ b/tests/include/mocks/assert.h
@@ -0,0 +1,83 @@
+/*
+ * 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 __ASSERT_H__
+#define __ASSERT_H__
+
+#include <arch/hlt.h>
+#include <console/console.h>
+
+/* TODO: Fix vendorcode headers to not define macros coreboot uses or to be more
+ properly isolated. */
+#ifdef ASSERT
+#undef ASSERT
+#endif
+
+/* GCC and CAR versions */
+#define ASSERT(x) { \
+ if (!(x)) { \
+ printk(BIOS_EMERG, "ASSERTION ERROR: file '%s'" \
+ ", line %d\n", __FILE__, __LINE__); \
+ if (CONFIG(FATAL_ASSERTS)) \
+ hlt(); \
+ } \
+}
+
+#define ASSERT_MSG(x, msg) { \
+ if (!(x)) { \
+ printk(BIOS_EMERG, "ASSERTION ERROR: file '%s'" \
+ ", line %d\n", __FILE__, __LINE__); \
+ printk(BIOS_EMERG, "%s", msg); \
+ if (CONFIG(FATAL_ASSERTS)) \
+ hlt(); \
+ } \
+}
+
+/* Compile-out BUG() macro, since checkpatch is not happy with it,
+ * to be revised later.
+ */
+/* #define BUG() { \
+ printk(BIOS_EMERG, "ERROR: BUG ENCOUNTERED at file '%s'"\
+ ", line %d\n", __FILE__, __LINE__); \
+ if (CONFIG(FATAL_ASSERTS)) \
+ hlt(); \
+} */
+
+#define assert(statement) ASSERT(statement)
+
+/*
+ * Original dead_code() from src/include/assert.h breaks compilation when
+ * non-intended code is compiled in. This is not suitable for unit testing,
+ * thus we are changing this macro to be run-time assert. mock_assert() allows
+ * Cmocka to expect such assert and pass test, when dead_code() is correctly
+ * called.
+ */
+
+extern void mock_assert(const int result, const char * const expression,
+ const char * const file, const int line);
+
+#define dead_code() \
+ mock_assert(0, "dead_code", __FILE__, __LINE__)
+
+#undef assert
+#define assert(expression) \
+ mock_assert((int)(expression), #expression, __FILE__, __LINE__)
+
+/* This can be used in the context of an expression of type 'type'. */
+#define dead_code_t(type) ({ \
+ dead_code(); \
+ *(type *)(uintptr_t)0; \
+})
+
+#endif // __ASSERT_H__
diff --git a/tests/lib/Makefile.inc b/tests/lib/Makefile.inc
new file mode 100644
index 0000000..5f73446
--- /dev/null
+++ b/tests/lib/Makefile.inc
@@ -0,0 +1,20 @@
+##
+## 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.
+##
+
+# object filest should be under build/tests/ build/test/src/ build/test/run/
+# two examples - first should be simply string.c, second should use -wrap
+
+tests += string-test
+
+string-test-srcs += tests/lib/string-test.c
+string-test-srcs += src/lib/string.c
diff --git a/tests/lib/string-test.c b/tests/lib/string-test.c
new file mode 100644
index 0000000..3ce0563
--- /dev/null
+++ b/tests/lib/string-test.c
@@ -0,0 +1,49 @@
+#include <stdarg.h>
+#include <stddef.h>
+#include <setjmp.h>
+#include <cmocka.h>
+
+#include <string.h>
+
+struct strings_t {
+ char *str;
+ size_t size;
+} strings[] = {
+ {"coreboot", 8},
+ {"is\0very", 2}, /* strlen should be 2 because of the embedded \0 */
+ {"nice\n", 5}
+};
+
+static void test_strlen_strings(void **state)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(strings); i++)
+ assert_int_equal(strings[i].size, strlen(strings[i].str));
+}
+
+/* Since strdup() requires malloc() it may only be invoked during ramstage
+ * phase. Expect dead_code/assert invocation otherwise.
+ */
+static void test_strdup(void **state)
+{
+#ifdef __RAMSTAGE__
+ char str[] = "Hello coreboot\n";
+ char *duplicate;
+
+ duplicate = strdup(str);
+ assert_int_equal(0, memcmp(str, duplicate, strlen(str)));
+#else
+ expect_assert_failure(strdup(NULL));
+#endif
+}
+
+int main(void)
+{
+ const struct CMUnitTest tests[] = {
+ cmocka_unit_test(test_strlen_strings),
+ cmocka_unit_test(test_strdup),
+ };
+
+ return cmocka_run_group_tests(tests, NULL, NULL);
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/40538
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibf5554d1e99a393721a66bdd35af0122c2e412c4
Gerrit-Change-Number: 40538
Gerrit-PatchSet: 1
Gerrit-Owner: Name of user not set #1002873
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange