aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2019-09-20test: add tests for u16_str<n>cmp()AKASHI Takahiro
New seven test cases for u16_str<n>cmp() are added under Unicode unit test, which should be executed by "ut unicode" command. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-09-03dm: cache: Add enable and disable ops for sandbox and testRick Chen
Add cache enable and disable ops for test coverage. Signed-off-by: Rick Chen <rick@andestech.com> Cc: KC Lin <kclin@andestech.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-08-22sandbox: clk: add clk enable/disable test codePeng Fan
Since we added clk enable_count and prograte clk child enabling operation to clk parent, so add a new function sandbox_clk_enable_count to get enable_count for test usage. And add test code to get the enable_count after we enable/disable the device clk. Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-08-22test/py: Add cmd_memory dependency back to test_mmc_wrMichal Simek
Based on discussion with Stephen Warren there was recommendation to list both memory and random command dependencies just in case that dependency is not properly handled by Kconfig. Fixes: a09c1f7e1c1b ("test/py: Fix MMC/SD block write test dependency") Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Stephen Warren <swarren@nvidia.com>
2019-08-12Merge branch '2019-08-11-ti-imports'Tom Rini
- More DaVinci updates and fixes - PCIe support on am65x - Watchdog converted to DM - Assorted other bugfixes
2019-08-12dm: core: add support for getting register address and sizeSekhar Nori
Current dev_read_*() API lacks support to get address and size of a "reg" property by name or index. Add support for the same. Livetree support has been added but not tested on real hardware. The existing unit tests testing reading address from device-tree have been updated to test address as well as size. Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
2019-08-12clk: add support for clk_is_match()Sekhar Nori
Add support for clk_is_match() which is required to know if two clock pointers point to the same exact physical clock. Also add a unit test for the new API. Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
2019-08-11env: Drop the ACTION typedefSimon Glass
Avoid using a typedef here which is unnecessary. Add an 'env_' prefix to both the enum and its members to make it clear that these are related to the environment. Add an ENV prefix to these two flags so that it is clear what they relate to. Also move them to env.h since they are part of the public API. Use an enum rather than a #define to tie them together. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11env: Drop the ENTRY typedefSimon Glass
U-Boot is not supposed to use typedef for structs anymore. Also this name is the same as the ENTRY() macro used in assembler files, and 'entry' itself is widely used in U-Boot (>8k matches). Drop the typedef and rename the struct to env_entry to reduce confusion. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-08-11env: Move env_set() to env.hSimon Glass
Move env_set() over to the new header file. Acked-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2019-08-11common: Move gzip functions into a new gzip headerSimon Glass
As part of the effort to remove things from common.h, create a new header for the gzip functions. Move the function declarations to it and add missing documentation. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-08-09test/py: Fix MMC/SD block write test dependencyMichal Simek
Test is using random command which has own Kconfig symbol CMD_RANDOM which already depends on CMD_MEMORY. That's why replace cmd_memory by cmd_random. Fixes: 09da18deab8b ("test/py: add MMC/SD block write test") Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-08-07test/py: avb: Move AVB test to android dirSam Protsenko
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2019-08-07fit: Do not automatically decompress ramdisk imagesJulius Werner
The Linux ramdisk should always be decompressed by the kernel itself, not by U-Boot. Therefore, the 'compression' node in the FIT image should always be set to "none" for ramdisk images, since the only point of using that node is if you want U-Boot to do the decompression itself. Yet some systems populate the node to the compression algorithm used by the kernel instead. This used to be ignored, but now that we support decompression of all image types it becomes a problem. Since ramdisks should never be decompressed by U-Boot anyway, this patch adds a special exception for them to avoid these issues. Still, setting the 'compression' node like that is wrong in the first place, so we still want to print out a warning so that third-party distributions doing this can notice and fix it. Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de> Tested-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-08-02Merge https://gitlab.denx.de/u-boot/custodians/u-boot-clkTom Rini
- Port more CCF code to work with i.MX8 devices.
2019-07-31test/py: add MMC/SD block write testJean-Jacques Hiblot
Add a standalone MMC block write test. This allows direct testing of MMC access rather than relying on doing so as a side-effect of e.g. DFU or UMS testing, which may not be enabled on all platforms. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Stephen Warren <swarren@nvidia.com>
2019-07-31test: dm: clk_ccf: test composite clkPeng Fan
Test composite clk with dm ccf Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-07-29fit: Support compression for non-kernel components (e.g. FDT)Julius Werner
This patch adds support for compressing non-kernel image nodes in a FIT image (kernel nodes could already be compressed previously). This can reduce the size of FIT images and therefore improve boot times (especially when an image bundles many different kernel FDTs). The images will automatically be decompressed on load. This patch does not support extracting compatible strings from compressed FDTs, so it's not very helpful in conjunction with CONFIG_FIT_BEST_MATCH yet, but it can already be used in environments that select the configuration to load explicitly. Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
2019-07-29common: Move bootm_decomp_image() to image.c (as image_decomp())Julius Werner
Upcoming patches want to add decompression to use cases that are no longer directly related to booting. It makes sense to retain a single decompression routine, but it should no longer be in bootm.c (which is not compiled for all configurations). This patch moves bootm_decomp_image() to image.c and renames it to image_decomp() in preparation of those upcoming patches. Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> [trini: Fix warning around handle_decomp_error being unused] Signed-off-by: Tom Rini <trini@konsulko.com>
2019-07-27Merge tag 'u-boot-imx-20190719' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20190719 - CCF for i.MX6 - nandbcb command to write SPL into NAND - Switch to DM (i.MX28) - Boards: Toradex, engicam, DH - Fixes for i.MX8 - Fixes for i.MX7ULP Travis: https://travis-ci.org/sbabic/u-boot-imx/builds/561147504
2019-07-24Merge tag 'dm-pull-24jul19-take3' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-dm Minor driver-model fixes and tweaks A few device-tree fixes Binman support for extracting files from an image
2019-07-24binman: Convert to use ArgumentParserSimon Glass
This class is the new way to handle arguments in Python. Convert binman over to use it. At the same time, introduce commands so that we can separate out the different parts of binman functionality. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Pass the toolpath to testsSimon Glass
Tools like ifwitool may not be available in the PATH, but are available in the build. These tools may be needed by tests, so allow tests to use the --toolpath flag. Also use this flag with travis. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24test/py: Add base test case for A/B updatesRuslan Trofymenko
Add sandbox test for 'ab_select' command. Test: ./test/py/test.py --bd sandbox --build -k test_ab Signed-off-by: Ruslan Trofymenko <ruslan.trofymenko@linaro.org> Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Alistair Strachan <astrachan@google.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-24treewide: Fix stale references of Android docsEugeniu Rosca
Commit 9bdf0e8fef86 ("doc: relocate/rename Android README and add BCB overview") left some obsolete references of Android documents/paths. This has been pointed out by Sam (thanks!) in: https://patchwork.ozlabs.org/patch/1104245/#2208134 Fixes: 9bdf0e8fef86 ("doc: relocate/rename Android README and add BCB overview") Reported-by: Sam Protsenko <semen.protsenko@linaro.org> Suggested-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com> Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
2019-07-23Merge tag 'efi-2019-10-rc1-2' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for v2019.10-rc1 (2) * Implement the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event. * Address errors of type -Werror=address-of-packed-member when building with GCC9.1 * Fix an error when adding memory add addres 0x00000000. * Rework some code comments for Sphinx compliance.
2019-07-23Merge tag 'u-boot-stm32-20190723' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-stm - add rtc driver for stm32mp1 - add remoteproc driver for stm32mp1 - use kernel qspi compatible string for stm32
2019-07-22remoteproc: add elf file load supportFabien Dessenne
The current implementation supports only binary file load. Add helpers to support ELF32 format (sanity check, and load). Note that since an ELF32 image is built for the remote processor, the load function uses the device_to_virt ops to translate the addresses. Implement a basic translation for sandbox_testproc. Add related tests. Test result: => ut dm remoteproc_elf Test: dm_test_remoteproc_elf: remoteproc.c Test: dm_test_remoteproc_elf: remoteproc.c (flat tree) Failures: 0 Signed-off-by: Loic Pallardy <loic.pallardy@st.com> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
2019-07-22dm: core: Introduce xxx_translate_dma_address()Fabien Dessenne
Add the following functions to translate DMA address to CPU address: - dev_translate_dma_address() - ofnode_translate_dma_address() - of_translate_dma_address() - fdt_translate_dma_address() These functions work the same way as xxx_translate_address(), with the difference that the translation relies on the "dma-ranges" property instead of the "ranges" property. Add related test. Test report: => ut dm fdt_translation Test: dm_test_fdt_translation: test-fdt.c Test: dm_test_fdt_translation: test-fdt.c (flat tree) Failures: 0 Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
2019-07-19clk: sandbox: Add sandbox test code for Common Clock Framework [CCF]Lukasz Majewski
This patch provides code to implement the CCF clock tree in sandbox. It uses all the introduced primitives; some generic ones are reused, some sandbox specific were developed. In that way (after introducing the real CCF tree in sandbox) the recently added to clk-uclass.c: clk_get_by_id() and clk_get_parent_rate() are tested in their natural work environment. Usage (sandbox_defconfig and sandbox_flattree_defconfig): ./u-boot --fdt arch/sandbox/dts/test.dtb --command "ut dm clk_ccf" Signed-off-by: Lukasz Majewski <lukma@denx.de>
2019-07-18Merge branch 'master' of git://git.denx.de/u-boot-netTom Rini
2019-07-18test: dm: add a test for MDIO MUX DM uclassAlex Marginean
Adds a test using a makeshift MDIO MUX. The test is based on the existing MDIO test. It uses the last emulated PHY register to verify MUX selection. Signed-off-by: Alex Marginean <alexm.osslist@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-18test: dm_mdio: add a 2nd register to the emulated PHYAlex Marginean
This 2nd register is used by the follow-up MDIO MUX test. Signed-off-by: Alex Marginean <alexm.osslist@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-07-18test/py: gpt: Use long options for sgdiskSam Protsenko
sgdisk 0.8.10.2 from AOSP doesn't support short options, failing with errors like this: sgdisk: invalid option -- 'U' Test fails due to that error. Let's use long options to make the test work with any sgdisk version. Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> Acked-by: Stephen Warren <swarren@nvidia.com>
2019-07-16test: unit test for u16_strlen()Heinrich Schuchardt
Provide a unit test for u16_strlen(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-07-15test: dm: add MDIO testAlex Marginean
A very simple test for DM_MDIO, mimicks a register write/read through the sandbox bus to a dummy PHY. Signed-off-by: Alex Marginean <alexm.osslist@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2019-07-12test: dm: usb: use the real device namePeng Fan
"keyb" is not the real device name, "keyb@3" is. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-12test: dm: adc: use the real device namePeng Fan
"adc" is not the real device name, "adc@0" is. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-11Merge tag 'dm-pull-9jul19-take2' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-dm - Sandbox improvements including .dts refactor - Minor tracing and PCI improvements - Various other minor fixes - Conversion of patman, dtoc and binman to support Python 3
2019-07-11test: pci_ep: add basic pci_ep testsRamon Fried
Add basic PCI endpoint sandbox testing. Signed-off-by: Ramon Fried <ramon.fried@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-10test: dm: Add a test for PCI Enhanced AllocationAlex Marginean
This test is built on top of the existing swap_case driver. It adds EA capability structure support to swap_case and uses that to map BARs. BAR1 works as it used to, swapping upper/lower case. BARs 2,4 map to a couple of magic values. Signed-off-by: Alex Marginean <alexm.osslist@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-10test: check u-boot properties in SPL device treePatrick Delaunay
Add a test to check the management of the U-boot relocation properties for device tree SPL generation (fdtgrep result) and platdata: - 'dm-pre-proper' and 'dm-tpl' not included in SPL - 'dm-pre-reloc' and 'dm-spl' included in SPL Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-08Merge tag 'efi-2019-10-rc1' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for v2019.10-rc1 Fix a possible overflow for GUID partition tables. For some runtime services we only have implementations valid at boottime. So we replace them when leaving boottime. Move this from SetVirtualAddressMap() to ExitBootServices() as SetVirtualAddressMap() is not called by all operating systems. Adjust the Python tests accordingly. Bump the supported UEFI specification version to 2.8.
2019-07-06test/py: not all boards support UEFI runtime resetHeinrich Schuchardt
As not all boards support resets at runtime do not test for it in the Python tests. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-07-06test/py: error message test_efi_selftest_device_treeHeinrich Schuchardt
Correct the error message in test_efi_selftest_device_tree(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-07-05dm: Add a No-op uclassJean-Jacques Hiblot
This uclass is intended for devices that do not need any features from the uclass, including binding children. This will typically be used by devices that are used to bind child devices but do not use dm_scan_fdt_dev() to do it. That is for example the case of several USB wrappers that have 2 child devices (1 for device and 1 for host) but bind only one at a any given time. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-06-07lib/vsprintf: allow printing upper case GUIDsHeinrich Schuchardt
In the UEFI context GUIDs are expected to be rendered in upper case. The patch uses the formerly unused bit 1 of the parameter str_format of function uuid_bin_to_str() to indicate if we need upper or lower case output. Function uuid_string() in vsprint.c is adjusted to correctly set the bit depending on the print format code. %pUb: 01020304-0506-0708-090a-0b0c0d0e0f10 %pUB: 01020304-0506-0708-090A-0B0C0D0E0F10 %pUl: 04030201-0605-0807-090a-0b0c0d0e0f10 %pUL: 04030201-0605-0807-090A-0B0C0D0E0F10 Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is concerned by the change. Further patches are needed to adjust the UEFI subsystem. A unit test is provided inside the ut_print command. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-05-20video: Factor out vidconsole_put_string()Marek Vasut
Pull the vidconsole_put_string() function from DM tests, make it available to e.g. boards that want to display information on the LCD on boot. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Anatolij Gustschin <agust@denx.de> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2019-05-09test/py: don't use mmc_rd config for other mmc testsStephen Warren
Fix test_mmc_dev(), test_mmc_rescan(), test_mmc_info() not to use the same configuration data that test_mmc_rd() does. Doing so causes the following issues: * The new code uncondtionally expects certain keys to exist in the configuration data. These keys do not exist in existing configuration data since they were not previously required, and there was no notification re: a requirement to add these new keys. This causes test failures due to thrown exceptions when accessing the non-existent keys. * The new tests logically operate on different objects. test_mmc_rd() operates on ranges of sectors on an MMC device (which may be the entire set of sectors of a device, or a part of a device), whereas all the new tests operate solely on entire devices. These are separate things, and it's entirely likely that the user will wish to runs the two types of tests on different sets of data; see the example configuration data that this commit adds. Ideally, the new tests would have been added to a separate Python file, since they aren' closely related to the existing tests. FIXME: Marek, can you please replace the "???" in this patch with some reasonable looking data? Thanks. Cc: Marek Vasut <marek.vasut@gmail.com> Fixes: 4ffec8cdf512 ("test/py: mmc: Add 'mmc info' test") Fixes: ce4b2cafa79c ("test/py: mmc: Add 'mmc rescan' test") Fixes: 86dfd152c917 ("test/py: mmc: Add 'mmc dev' test") Signed-off-by: Stephen Warren <swarren@nvidia.com>
2019-05-08Merge branch 'master' of git://git.denx.de/u-boot-sunxiTom Rini
- H6 Beelink GS1 board (Clément) - Olimex A64-Teres-I board (Jonas) - sunxi build fix for CONFIG_CMD_PXE|DHCP (Ondrej) - Change include order (Jagan) - EPHY clock changes (Jagan) - EMAC enablement on Cubietruck Plus, BPI-M3 (Chen-Yu Tsai)