- Feb 26, 2021
-
-
Sean Anderson authored
This adds support for partitions of the form "dev.hwpart:part" and "dev#partname". This allows one to flash to eMMC boot partitions without having to use CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT. It also allows one to flash to an entire device without needing CONFIG_FASTBOOT_MMC_USER_NAME. Lastly, one can also flash MMC devices other than CONFIG_FASTBOOT_FLASH_MMC_DEV. Because devices can be specified explicitly, CONFIG_FASTBOOT_FLASH_MMC_DEV is used only when necessary for existing functionality. For those cases, fastboot_mmc_get_dev has been added as a helper function. This allows There should be no conflicts with the existing system, but just in case, I have ordered detection of these names after all existing names. The fastboot_mmc_part test has been updated for these new names. Signed-off-by:
Sean Anderson <sean.anderson@seco.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Sean Anderson authored
This test verifies the mapping between fastboot partitions and partitions as understood by U-Boot. It also tests the creation of GPT partitions, though that is not the primary goal. Signed-off-by:
Sean Anderson <sean.anderson@seco.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Sean Anderson authored
This adds support writing to the sandbox mmc backed by an in-memory buffer. The unit test has been updated to test reading, writing, and erasing. I'm not sure what MMCs erase to; I picked 0, but if it's 0xFF then that can be easily changed. Signed-off-by:
Sean Anderson <sean.anderson@seco.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Feb 24, 2021
-
-
Heinrich Schuchardt authored
test/cmd/setexpr.c cannot be linked with CONFIG_CMD_SETEXPR=n: ld.bfd: test/built-in.o: in function `setexpr_test_sub': test/cmd/setexpr.c:227: undefined reference to `setexpr_regex_sub' ld.bfd: test/built-in.o: in function `setexpr_test_backref': test/cmd/setexpr.c:267: undefined reference to `setexpr_regex_sub' Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Feb 18, 2021
-
-
Nicolas Saenz Julienne authored
By reusing DT nodes already available in sandbox's test DT introduce a test to validate dev_phys_to_bus()/dev_bus_to_phys(). Signed-off-by:
Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by:
Simon Glass <sjg@chromium.org> Tested-by:
Peter Robinson <pbrobinson@gmail.com> Signed-off-by:
Matthias Brugger <mbrugger@suse.com>
-
Nicolas Saenz Julienne authored
Add test to validate dev->dma_offset is properly set on devices. Signed-off-by:
Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by:
Simon Glass <sjg@chromium.org> Tested-by:
Peter Robinson <pbrobinson@gmail.com> Signed-off-by:
Matthias Brugger <mbrugger@suse.com>
-
Nicolas Saenz Julienne authored
Introduce some new nodes in sandbox's test device-tree and dm tests in order to validate dev_get_dma_range(). Signed-off-by:
Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by:
Simon Glass <sjg@chromium.org> Tested-by:
Peter Robinson <pbrobinson@gmail.com> Signed-off-by:
Matthias Brugger <mbrugger@suse.com>
-
Marek Szyprowski authored
Add adc-keys device to the sandbox/test.dts and connect it to the channel #3 of the sandbox_adc driver. The default values sampled by sandbox_adc driver determines that button3 and button4 are released and button5 is pressed. Signed-off-by:
Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by:
Simon Glass <sjg@chromium.org> Signed-off-by:
Neil Armstrong <narmstrong@baylibre.com>
-
- Feb 16, 2021
-
-
Igor Opaniuk authored
Extend existing DM tee tests adding test coverage for reverse RPC calls. Currently this commit only adds tests for I2C requests from TEE driver to TEE supplicant, for instance reading/writing data to emulated i2c eeprom defines in standard sandbox test device tree (arch/sandbox/dts/test.dtb): => i2c bus Bus 0: i2c@0 (active 0) 2c: eeprom@2c, offset len 1, flags 0 ... Running TEE tests: => ut dm tee Test: dm_test_tee: tee.c Test: dm_test_tee: tee.c (flat tree) Failures: 0 Signed-off-by:
Igor Opaniuk <igor.opaniuk@foundries.io> Reviewed-by:
Simon Glass <sjg@chromium.org> Acked-by:
Etienne Carriere <etienne.carriere@linaro.org>
-
Igor Opaniuk authored
Add pygit2 and pyelftools to the list of packages for virtualenv needed to run all sets of pytests.This fixes warnings like: binman.elf_test.TestElf.testDecodeElf (subunit.RemotedTestCase): Python elftools not available Signed-off-by:
Igor Opaniuk <igor.opaniuk@foundries.io> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Using unit addresses in a FIT is a security risk. Add a check for this and disallow it. CVE-2021-27138 Signed-off-by:
Simon Glass <sjg@chromium.org> Reported-by:
Bruce Monroe <bruce.monroe@intel.com> Reported-by:
Arie Haenel <arie.haenel@intel.com> Reported-by:
Julien Lenoir <julien.lenoir@intel.com>
-
Simon Glass authored
It is possible to construct a devicetree blob with multiple root nodes. Update fdt_check_full() to check for this, along with a root node with an invalid name. CVE-2021-27097 Signed-off-by:
Simon Glass <sjg@chromium.org> Reported-by:
Bruce Monroe <bruce.monroe@intel.com> Reported-by:
Arie Haenel <arie.haenel@intel.com> Reported-by:
Julien Lenoir <julien.lenoir@intel.com>
-
Simon Glass authored
Add tests to check that these two attacks are mitigated by recent patches. Signed-off-by:
Simon Glass <sjg@chromium.org> Reported-by:
Bruce Monroe <bruce.monroe@intel.com> Reported-by:
Arie Haenel <arie.haenel@intel.com> Reported-by:
Julien Lenoir <julien.lenoir@intel.com>
-
Simon Glass authored
Add a library which performs two different attacks on a FIT. Signed-off-by:
Julien Lenoir <julien.lenoir@intel.com> Signed-off-by:
Bruce Monroe <bruce.monroe@intel.com> Signed-off-by:
Arie Haenel <arie.haenel@intel.com> Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
When searching for a node called 'fred', any unit address appended to the name is ignored by libfdt, meaning that 'fred' can match 'fred@1'. This means that we cannot be sure that the node originally intended is the one that is used. Disallow use of nodes with unit addresses. Update the forge test also, since it uses @ addresses. CVE-2021-27138 Signed-off-by:
Simon Glass <sjg@chromium.org> Reported-by:
Bruce Monroe <bruce.monroe@intel.com> Reported-by:
Arie Haenel <arie.haenel@intel.com> Reported-by:
Julien Lenoir <julien.lenoir@intel.com>
-
- Feb 03, 2021
-
-
Marek Vasut authored
Add another flag to the DM core which could be assigned to drivers and which makes those drivers call their remove callbacks last, just before booting OS and after all the other drivers finished with their remove callbacks. This is necessary for things like clock drivers, where the other drivers might depend on the clock driver in their remove callbacks. Prime example is the mmc subsystem, which can reconfigure a card from HS mode to slower modes in the remove callback and for that it needs to reconfigure the controller clock. Signed-off-by:
Marek Vasut <marek.vasut+renesas@gmail.com> Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
At present if device_remove() decides that the device should not actually be removed, it still calls the uclass pre_remove() method and powers the device down. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Feb 02, 2021
-
-
Simon Glass authored
Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by:
Simon Glass <sjg@chromium.org> Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Feb 01, 2021
-
-
Stephen Warren authored
The implementation of pytest_runtest_protocol() must call pytest_runtest_logstart() and pytest_runtest_logfinish(). This appears to be necessary even in pytest 5.2.1 judging by the default version of pytest_runtest_protocol(), but evidently some form of code reorganization in pytest only made this have a practical effect in the newer version. I'd previously been under the impression that 100% of the required work of pytest_runtest_protocol() was handled by the fact it called runtestprotocol() as its implementation. However, it appears that custom implementations do need to do a little more than this. Reported-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by:
Stephen Warren <swarren@wwwdotorg.org> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Jan 30, 2021
-
-
Simon Glass authored
At present this function uses the old format for reading hashes. Add support for the current format. Add a test while we are here. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
These cannot work with of-platdata since they currently need the devicetree at runtime. Disable the emulators and the sandbox I2C driver that needs them. We can enable these later, if needed for testing. Switch the of_plat_parent test over to use a simple bus instead. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Heiko Schocher <hs@denx.de>
-
Simon Glass authored
The EC can store small amounts of data for the benefit of the verified boot process. Since the EC is seldom reset, this can allow the AP to store data that survives a reboot or a suspend/resume cycle. Add support for this. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Add a command to show the current events as a list of names. This is easier to decipher than a bit mask. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
On x86 platforms the EC provides a way to read 'switches', which are on/off values determined by the EC. Add a new driver method for this and implement it for LPC. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
The EC can support a variety of features and provides a way to find out what is available. Add support for this. Also update the feature list to the lastest available while we are here. This is at: https://chromium.googlesource.com/chromiumos/platform/ec/+/refs/heads/master/include/ec_commands.h Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This allows reading strapping pins attached to the EC. Add an implementation for this. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
This is used several times in this file. Put it in a function to avoid code duplication. Also add a test for this function. There are no cros_ec tests at present, so it is time to update the code. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Jan 29, 2021
-
-
Heinrich Schuchardt authored
Excluding ut str in test/cmd_ut.c but compiling test/str_ut.c results in failure of the Python test invoking the C unit tests as observed on sipeed_riscv_smode_defconfig: FAILED test/py/tests/test_ut.py::test_ut[ut_str_upper] Allow to compile test/str_ut.c on all boards. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Heinrich Schuchardt authored
Excluding ut bootm in test/cmd_ut.c but compiling test/bootm.c results in failure of the Python test invoking the C unit tests as observed on sipeed_riscv_smode_defconfig: FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_nop] FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_nospace] FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_silent] FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_silent_var] FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_subst] FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_subst_both] FAILED test/py/tests/test_ut.py::test_ut[ut_bootm_subst_var] Only compile test/bootm.c on the sandbox. Fixes: f158ba15 ("bootm: Add tests for fixup_silent_linux()") Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Tom Rini authored
As noted in comments, yield_fixture has been deprecated for longer than our minimum required version of pytest. Newer versions of pytest cause this to be a louder warning, and as the migration is trivial, perform it now. Signed-off-by:
Tom Rini <trini@konsulko.com>
-
Heinrich Schuchardt authored
With Pytest 6.0.2 'make tests' fails: sandbox: Traceback (most recent call last): File "./test/py/test.py", line 20, in <module> sys.exit(load_entry_point('pytest', 'console_scripts', 'pytest')(args)) TypeError: console_main() takes 0 positional arguments but 1 was given The definition of console_scripts has changed as follows: Pytest 4.6.1: [options.entry_points] console_scripts = pytest=pytest:main py.test=pytest:main Pytest 6.0.2: [options.entry_points] console_scripts = pytest=pytest:console_main py.test=pytest:console_main The new function console_main() has a comment: "This function is not meant for programmable use; use `main()`" Hence let's call pytest.main() directly. Move args processing into the __main__ paragraph. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Tested-by:
Tom Rini <trini@konsulko.com>
-
Heinrich Schuchardt authored
Compiling wandboard_defconfig with CONFIG_UT_LOG=y leads to a build error: test/log/pr_cont_test.c: In function ‘log_test_pr_cont’: test/log/pr_cont_test.c:28:14: error: ‘gd_t’ {aka ‘volatile struct global_data’} has no member named ‘log_fmt’ log_fmt = gd->log_fmt; We do not want to let CONFIG_UT_LOG depend on CONFIG_LOG=y because we have tests for logging functions called with CONFIG_LOG=n. Fix the build dependency. Reported-by:
Kever Yang <kever.yang@rock-chips.com> Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-
Tom Rini authored
This test checks for output specific to the sandbox device tree, mark it as sandbox specific. Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Jan 27, 2021
-
-
Simon Glass authored
Typically in TPL/SPL the bloblist is quite small. But U-Boot proper may want to add a lot more to it, such as ACPI tables. Add a way to expand the bloblist by relocating it in U-Boot proper, along with the other relocation activities. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Jan 25, 2021
-
-
Heinrich Schuchardt authored
Provide a unit test for the unit command Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Jan 23, 2021
-
-
Heinrich Schuchardt authored
Convert test/py/README.md to restructured text and add it to the generated HTML documentation. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Heinrich Schuchardt authored
Move test/README to the 'Develop U-Boot' chapter of the HTML documentation. Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Jan 18, 2021
-
-
Pragnesh Patel authored
Add the command "pwm" for controlling the pwm channels. This command provides pwm invert/config/enable/disable functionalities via PWM uclass drivers Signed-off-by:
Pragnesh Patel <pragnesh.patel@sifive.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Jan 17, 2021
-
-
Heinrich Schuchardt authored
Provide a unit test for printing via pr_err() and pr_cont(). Signed-off-by:
Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Jan 16, 2021
-
-
Patrick Delaunay authored
Align the prefix used in cmd_ut_category function and name of tests for ut str. This patch solves the issues detected by "make qcheck" after previous patch. Fixes: fdc79a6b ("lib: Add a function to convert a string to upper case") Signed-off-by:
Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-