summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'efi-2020-07-rc2' of ↵Tom Rini2020-04-301-24/+6
|\ | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-07-rc2 This pull request contains bug fixes needed due to the merged changes for EFI secure boot. Patches are supplied to identify EFI system partitions.
| * test/py: fix test_efi_secboot/conftest.pyHeinrich Schuchardt2020-04-301-24/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If udisksctl is present test/py/tests/test_efi_secboot/conftest.py fails because the disk image is never mounted. Normal users can only mount fuse file systems. Unfortunately fusefat is still in an experimental state and seems not to work here correctly. So as we have to be root or use the sudo command anyway delete all coding referring to udisksctl. -- We should not use mount point /mnt as this directory or one of its sub-directories might already be in use as active mount points. Instead create a new directory in the build root as mount point. -- Remove debug print statements that have been commented out. print without parentheses is anyway invalid in Python 3. And pytest anyway filters out the output if there is no exception reported. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | acpi: Add an acpi commandSimon Glass2020-04-301-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | It is useful to dump ACPI tables in U-Boot to see what has been generated. Add a command to handle this. To allow the command to find the tables, add a position into the global data. Support subcommands to list and dump the tables. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
* | acpi: Move the xsdt pointer to acpi_ctxSimon Glass2020-04-301-0/+5
| | | | | | | | | | | | | | Put this in the context along with the other important pointers. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
* | acpi: Put table-setup code in its own functionSimon Glass2020-04-301-10/+54
| | | | | | | | | | | | | | | | We always write three basic tables to ACPI at the start. Move this into its own function, along with acpi_fill_header(), so we can write a test for this code. Signed-off-by: Simon Glass <sjg@chromium.org>
* | acpi: Move acpi_add_table() to generic codeSimon Glass2020-04-301-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | Move this code to a generic location so that we can test it with sandbox. This requires adding a few new fields to acpi_ctx, so drop the local variables used in the original code. Also use mapmem to avoid pointer-to-address casts which don't work on sandbox. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
* | acpi: Convert part of acpi_table to use acpi_ctxSimon Glass2020-04-301-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | The current code uses an address but a pointer would result in fewer casts. Also it repeats the alignment code in a lot of places so this would be better done in a helper function. Update write_acpi_tables() to make use of the new acpi_ctx structure, adding a few helpers to clean things up. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
* | acpi: Add a method to write tables for a deviceSimon Glass2020-04-301-3/+71
|/ | | | | | | | A device may want to write out ACPI tables to describe itself to Linux. Add a method to permit this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
* Merge tag 'dm-pull-27apr20' of git://git.denx.de/u-boot-dmTom Rini2020-04-281-10/+16
|\ | | | | | | | | | | Move Python tools to use absolute paths Minor buildman fixes for new features Make libfdt code more similar to upsteam
| * Add a 'make tcheck' option to test toolsSimon Glass2020-04-261-10/+16
| | | | | | | | | | | | | | Running all the unit tests takes a while and is not useful when you are just modifying the tools. Add an option to run only the tools tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* | test: test_fs error messageHeinrich Schuchardt2020-04-271-2/+3
|/ | | | | | | | | | | | | | | | | | | For non-root users mkfs.vfat is not in the search path at least on Debian. Hence when running 'make tests' a message indicates that file system tests have been skipped: SKIPPED [13] test/py/tests/test_fs/conftest.py:340: Setup failed for filesystem: fat16 This message is not really helpful as the executed program is not indicated. Provide a more complete message like SKIPPED [13] test/py/tests/test_fs/conftest.py:340: Setup failed for filesystem: fat16. Command 'mkfs.vfat -F 16 build-sandbox/persistent-data/3GB.fat16.img' returned non-zero exit status 127. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* lib: Add a function to convert a string to upper caseSimon Glass2020-04-241-15/+63
| | | | | | | | Add a helper function for this operation. Update the strtoul() tests to check upper case as well. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* test: Add the beginnings of some string testsSimon Glass2020-04-243-0/+73
| | | | | | | There are quite a few string functions in U-Boot with no tests. Make a start by adding a test for strtoul(). Signed-off-by: Simon Glass <sjg@chromium.org>
* test: pinmux: add pincontrol-gpio for pin configurationPatrick Delaunay2020-04-161-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a simple pincontrol associated to the sandbox gpio driver, that allows to check pin configuration with the command pinmux. The pinmux test is also updated to test behavior with 2 pincontrols. Example to check LED pin configuration: => pinmux list | Device | Driver | Parent | pinctrl-gpio | sandbox_pinctrl_gpio | root_driver | pinctrl | sandbox_pinctrl | root_driver => pinmux dev pinctrl-gpio => pinmux status a0 : gpio input . a1 : gpio input . a2 : gpio input . a3 : gpio input . a4 : gpio input . a5 : gpio output . a6 : gpio output . ... Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* test: dm: update test for pins configuration in gpioPatrick Delaunay2020-04-162-7/+61
| | | | | | | | | | | Add tests for new API set_dir_flags and set_dir_flags and associated code in gpio uclass. Test support for new flags GPIO_OPEN_DRAIN, GPIO_OPEN_SOURCE GPIO_PULL_UP and GPIO_PULL_DOWN. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* test: dm: update test for pins configuration in pinctrl nodePatrick Delaunay2020-04-161-10/+18
| | | | | | | | | | | | Add test for "pins" configuration in gpio uclass with set_state() ops and test for generic parsing of pinconf_param array). set_state() is called by: - pinctrl_generic_set_state |- pinctrl_generic_set_state_subnode Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* gpio: remove the open_drain API and opsPatrick Delaunay2020-04-161-7/+0
| | | | | | | | | | | | | | This patch removes the ops get_open_drain/set_open_drain and the API dm_gpio_get_open_drain/dm_gpio_set_open_drain. The ops only provided in one driver (mpc8xxx gpio) and the associated API is never called in boards. This patch prepare a more generic set/get_dir_flags ops, including the open drain property. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
* dm: core: add ofnode and dev function to iterate on node propertyPatrick Delaunay2020-04-162-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add functions to iterate on all property with livetree - dev_read_first_prop - dev_read_next_prop - dev_read_prop_by_prop and - ofnode_get_first_property - ofnode_get_next_property - ofnode_get_property_by_prop And helper: dev_for_each_property For example: struct ofprop property; dev_for_each_property(property, config) { value = dev_read_prop_by_prop(&property, &propname, &len); or: for (res = ofnode_get_first_property(node, &property); !res; res = ofnode_get_next_property(&property)) { value = ofnode_get_property_by_prop(&property, &propname, &len); .... } Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Merge tag 'efi-2020-07-rc1' of ↵Tom Rini2020-04-166-0/+700
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2020-07-rc1 This pull request * provides an implementation of UEFI secure booting * fixes a problem with the rsa_mod_exp driver which stops some boards from booting when CONFIG_RSA is enabled which is needed for UEFI secure booting * enables the EFI_RNG_PROTOCOL if DM_RNG is enabled * fixes some function comments
| * efi_loader, pytest: add UEFI secure boot tests (image)AKASHI Takahiro2020-04-162-0/+238
| | | | | | | | | | | | | | | | | | | | Provide test cases for * image authentication for signed images (test_efi_secboot/test_signed.py) * image authentication for unsigned images (test_efi_secboot/test_unsigned.py) Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * efi_loader, pytest: add UEFI secure boot tests (authenticated variables)AKASHI Takahiro2020-04-161-0/+282
| | | | | | | | | | | | Provide a couple of test cases for variable authentication. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
| * efi_loader, pytest: set up secure boot environmentAKASHI Takahiro2020-04-163-0/+180
| | | | | | | | | | | | | | | | | | | | | | A fixture for UEFI secure boot tests (image authentication and variable authentication) is defined. A small file system with test data in a single partition formatted in fat is created. This test requires efitools v1.5.2 or later. If the system's efitools is older, you have to build it on your own and define EFITOOLS_PATH. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
* | Merge tag 'dm-pull-10apr20-take2' of git://git.denx.de/u-boot-dmTom Rini2020-04-1610-2/+590
|\ \ | | | | | | | | | | | | | | | | | | | | | Functions for reading indexed values from device tree Enhancements to 'dm' command Log test enhancements and syslog driver DM change to read parent ofdata before children Minor fixes
| * | dm: core: Read parent ofdata before childrenSimon Glass2020-04-161-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present a device can read its ofdata before its parent has done the same. This can cause problems in the case where the parent has a 'ranges' property, thus affecting the operation of dev_read_addr(), for example. We already probe parent devices before children so it does not seem to be a large step to do the same with ofdata. Make the change and update the documentation in this area. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Ley Foon Tan <ley.foon.tan@intel.com>
| * | test: fdtdec: test fdtdec_set_carveout()Laurentiu Tudor2020-04-162-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new test for fdtdec_set_carveout(). Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Drop blank line at EFO: Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dm: core: support reading a single indexed u32 valueDario Binacchi2020-04-161-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | The patch adds helper functions to allow reading a single indexed u32 value from a device-tree property containing multiple u32 values, that is an array of integers. Signed-off-by: Dario Binacchi <dariobin@libero.it> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | dm: test: add test case for dev_read_u64 functionDario Binacchi2020-04-161-0/+10
| | | | | | | | | | | | | | | | | | | | | Add test case to cover dev_read_u64 and dev_read_u64_default functions. Signed-off-by: Dario Binacchi <dariobin@libero.it> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | test: log: test syslog logging driverHeinrich Schuchardt2020-04-162-0/+284
| | | | | | | | | | | | | | | | | | | | | Provide unit tests for the syslog logging driver. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | test: log functions with CONFIG_LOG=nHeinrich Schuchardt2020-04-166-1/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If CONFIG_LOG=n, we still expect output for log_err(), log_warning(), log_notice(), log_info() and in case of DEBUG=1 also for log_debug(). Provide unit tests verifying this. The tests depend on: CONFIG_CONSOLE_RECORD=y CONFIG_LOG=n CONFIG_UT_LOG=y It may be necessary to increase the value of CONFIG_SYS_MALLOC_F_LEN to accommodate CONFIG_CONSOLE_RECORD=y. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
| * | dm: core: Move "/chosen" and "/firmware" node scanPatrick Delaunay2020-04-161-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new function dm_scan_fdt_ofnode_path() to scan all the nodes which aren't devices themselves but may contain some: - "/chosen" - "/clocks" - "/firmware" The patch removes the strcmp call in recursive function dm_scan_fdt_live() and also corrects a conflict with the 2 applied patches in the commit 1712ca21924b ("dm: core: Scan /firmware node by default") and in the commit 747558d01457 ("dm: fdt: scan for devices under /firmware too"): the subnodes of "/firmware" (optee for example) are bound 2 times. For example the dm tree command result on STM32MP1 is: STM32MP> dm tree Class Index Probed Driver Name ----------------------------------------------------------- root 0 [ + ] root_driver root_driver firmware 0 [ ] psci |-- psci sysreset 0 [ ] psci-sysreset | `-- psci-sysreset simple_bus 0 [ + ] generic_simple_bus |-- soc ... tee 0 [ + ] optee |-- optee ... tee 1 [ ] optee `-- optee Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Tested-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | acpi: Add support for DMARSimon Glass2020-04-161-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | The DMA Remapping Reporting (DMAR) table contains information about DMA remapping. Add a version simple version of this table with only the minimum fields filled out. i.e. no entries. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
* | acpi: Add a central location for table version numbersSimon Glass2020-04-161-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Each ACPI table has its own version number. Add the version numbers in a single function so we can keep them consistent and easily see what versions are supported. Start a new acpi_table file in a generic directory to house this function. We can move things over to this file from x86 as needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* | acpi: Add a simple sandbox testSimon Glass2020-04-162-0/+56
| | | | | | | | | | | | | | | | Add a sandbox test for the basic ACPI functionality we have so far. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
* | cpu: Support querying the address widthSimon Glass2020-04-161-0/+1
| | | | | | | | | | | | | | | | Different CPUs may support different address widths, meaning the amount of memory they can address. Add a property for this to the cpu_info struct. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* | dm: serial: Add clock member to struct serial_device_infoAndy Shevchenko2020-04-161-0/+1
|/ | | | | | | | | | | Some callers of serial_getinfo() would like to know the UART base clock speed in order to make decision what to pass to OS in some cases. In particular, ACPI SPCR table expects only certain base clock speed and thus we have to act accordingly. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Merge branch 'next'Tom Rini2020-04-136-13/+254
|\ | | | | | | | | | | | | | | | | | | | | Pull in changes that have been pending in our 'next' branch. This includes: - A large number of CI improvements including moving to gcc-9.2 for all platforms. - amlogic, xilinx, stm32, TI SoC updates - USB and i2c subsystem updtaes - Re-sync Kbuild/etc logic with v4.19 of the Linux kernel. - RSA key handling improvements
| * test/py: Allow using buildman to build U-BootSimon Glass2020-04-102-10/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is a pain to have to set the CROSS_COMPILE environment variable when using test.py's --build option. It is possible to get this using the -A option from buildman. But it seems better to just use buildman to do the build when it is available. However using buildman adds a new dependency to the test system which we want to avoid. So leave the default as is and add a flag to make it use buildman. Note that most of these changes relate to test.py and the parts of the travis/gitlab/azure scripts which relate to running test and building a suitable U-Boot to run the tests on. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
| * test/py: Update u_boot_utils.find_ram_base to bypass the low 2MiB memoryBin Meng2020-04-101-3/+4
| | | | | | | | | | | | | | On some RISC-V targets the low memory is protected that prevents S-mode U-Boot from access. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
| * Merge tag 'xilinx-for-v2020.07' of ↵Tom Rini2020-04-073-73/+511
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze into next Xilinx changes for v2020.07 common: - Align ENV_FAT_INTERFACE - Fix MAC address source print log - Improve based autodetection code xilinx: - Enable netconsole Microblaze: - Setup default ENV_OFFSET/ENV_SECT_SIZE Zynq: - Multiple DT updates/fixes - Use DEVICE_TREE environment variable for DTB selection - Switch to single zynq configuration - Enable NOR flash via DM - Minor SPL print removal - Enable i2c mux driver ZynqMP: - Print multiboot register - Enable cache commands in mini mtest - Multiple DT updates/fixes - Fix firmware probing when driver is not enabled - Specify 3rd backup RAM boot mode in SPL - Add SPL support for zcu102 v1.1 and zcu111 revA - Redesign debug uart enabling and psu_init delay - Enable full u-boot run from EL3 - Enable u-boot.itb generation without ATF with U-Boot in EL3 Versal: - Enable distro default - Enable others SPI flashes - Enable systems without DDR Drivers: - Gem: - Flush memory after freeing - Handle mdio bus separately - Watchdog: - Get rid of unused global data pointer - Enable window watchdog timer - Serial: - Change reinitialization logic in zynq serial driver Signed-off-by: Tom Rini <trini@konsulko.com>
| * \ Merge branch 'next' of git://git.denx.de/u-boot-usb into nextTom Rini2020-03-313-3/+40
| |\ \
| * | | test: add rsa_verify() unit testAKASHI Takahiro2020-03-123-0/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this patch, a very simple test is added to verify that rsa_verify() using rsa_verify_with_pkey() work correctly. To keep the code simple, all the test data, either public key and verified binary data, are embedded in the source. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
* | | | cmd: Add test and fix bugs for dm driversSean Anderson2020-04-091-0/+17
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | Add a test for the dm drivers command. Also fix a null pointer dereference revealed by said test. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | | test: vboot: Reduce fake kernel size to 500 bytesSimon Glass2020-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | We don't need 5KB to test things out. A smaller size makes it easier to look at the FIT with fdtdump. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | test: vboot: Move key creation into a functionSimon Glass2020-04-011-21/+18
| | | | | | | | | | | | | | | | | | This code is repeated so move it into a function with a parameter. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | test: vboot: Fix pylint errorsSimon Glass2020-04-011-34/+19
| | | | | | | | | | | | | | | | | | Fix various minor things noticed by pylint. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | test: vboot: Tidy up the code a littleSimon Glass2020-04-011-13/+21
| | | | | | | | | | | | | | | | | | | | | Fix some long lines and comments. Use a distinct name for the 'required key' test. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | test: vboot: Parameterise the testSimon Glass2020-04-011-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test is actually made up of five separate tests. Split them out so that they appear as separate tests. Unfortunately this restarts U-Boot multiple times which adds about a second to the already-long vboot test, about 8 seconds total on my machine. We could add a special 'teardown' test afterwards but if the tests are executed out of order that would not work. Changing test_vboot into a class causes it not to be discovered and makes it different from all other tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | test: vboot: Add a test for a forged configurationSimon Glass2020-04-012-1/+440
| | | | | | | | | | | | | | | | | | | | | Add a check to make sure that it is not possible to add a new configuration and use the hashed nodes and hash of another configuration. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | test: vboot: Drop unnecessary parameter for fit_check_signSimon Glass2020-04-011-2/+1
| | | | | | | | | | | | | | | | | | | | | This tool only uses the last -k parameter provided. Drop the earlier one since it has no effect. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | test/py: test_efi_grub_net() requires OF_CONTROLHeinrich Schuchardt2020-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | With CONFIG_OF_CONTROL environment variable $fdtcontroladdr is not defined and test_efi_grub_net() fails. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>