summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2018-12-12test: hexdump: fix misplaced returnSimon Goldschmidt
One of the hexdump tests in test/lib/hexdump.c returns right at the start of the function without testing anything. Fix this by moving the 'return 0;' statement to the end of the function. Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-10Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini
- DWC3 and UDC cleanup
2018-12-07syscon: dm: Add a new method to get a regmap from DTSJean-Jacques Hiblot
syscon_regmap_lookup_by_phandle() can be used to get the regmap of a syscon device from a reference in the DTS. It operates similarly to the linux version of the namesake function. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-07spl/tpl: change banner into upper caseHeiko Schocher
commit d6330064634a ("spl: Add a define for SPL_TPL_PROMPT") changes the SPL/TPL banner from upper case into lower case. As SPL and TPL are three-letter acronyms and they are written in upper case, change it back to upper case. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-07test: dma: add dma-uclass testGrygorii Strashko
Add a sandbox DMA driver implementation (provider) and corresponding DM test. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Álvaro Fernández Rojas <noltari@gmail.com>
2018-12-06dm: Add Hardware Spinlock classBenjamin Gaignard
This is uclass for Hardware Spinlocks. It implements two mandatory operations: lock and unlock and one optional relax operation. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
2018-12-05Merge tag 'dm-pull-5dec18' of git://git.denx.de/u-boot-dmTom Rini
Minor sandbox enhancements / fixes tpm improvements to clear up v1/v2 support buildman toolchain fixes New serial options to set/get config
2018-12-05Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini
- Various MTD fixes from Boris - Zap various unused / legacy paths. - pxa3xx NAND update from Miquel Signed-off-by: Tom Rini <trini@konsulko.com>
2018-12-05dm: serial: Introduce ->getinfo() callbackAndy Shevchenko
New callback will give a necessary information to fill up ACPI SPCR table, for example. Maybe used later for other purposes. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org> Change ADR_SPACE_SYSTEM_IO to SERIAL_ADDRESS_SPACE_IO to fix build error: Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-05dm: serial: Add ->getconfig() callbackAndy Shevchenko
In some cases it would be good to know the settings, such as parity, of current serial console. One example might be an ACPI SPCR table to generate using these parameters. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-05dm: core: add functions to get/remap I/O addresses by nameÁlvaro Fernández Rojas
This functions allow us to get and remap I/O addresses by name, which is useful when there are multiple reg addresses indexed by reg-names property. This is needed in bmips dma/eth patch series, but can also be used on many other drivers. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-05sandbox: sysreset: Update to support power-on resetSimon Glass
If U-Boot is started from SPL or TPL, then those earlier phases deal with the reset cause. On real hardware this cause may be lost once it is read. Emulate that behaviour in sandbox by reporting a warm reset when a previous phase has run since start-up. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-12-03Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini
Patch queue for efi - 2018-12-03 This release is fully packed with lots of glorious improvements in UEFI land again! - Make PE images more standards compliant - Improve sandbox support - Improve correctness - Fix RISC-V execution on virt model - Honor board defined top of ram (fixes a few boards) - Imply DM USB access when distro boot is available - Code cleanups
2018-12-03test: vboot: clean its filePhilippe Reynes
This update the its file used in vboot test to respect the new node style name defined in doc/uImage.FIT (for example: replace kernel@1 by kernel and fdt@1 by fdt-1) Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-03test: vboot: add padding pss for rsa signaturePhilippe Reynes
The padding pss is now supported for rsa signature. This add test with padding pss on vboot test. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-12-02efi_selftest: check fdt is marked as runtime dataHeinrich Schuchardt
Check that the memory area containing the device tree is marked as runtime data. Update the Python test to pass ${fdtcontroladdr} to bootefi. Update the description of the Python test. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-11-29dm: sandbox: i2c: Use new emulator parent uclassSimon Glass
Update the device tree, sandbox i2c driver and tests to use the new emulation parent to hold emulators. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-29dm: core: Add a few more specific child-finding functionsSimon Glass
Add two functions which can find a child device by uclass or by name. The first is useful with Multi-Function-Devices (MFDs) to find one of a particular type. The second is useful when only the name is known. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-29dm: core: Export uclass_find_device_by_phandle()Simon Glass
This function may be useful to code outside of the code driver-model implementation. Export it and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-29test: Add a 'make qcheck' target for quicker testingSimon Glass
At present tests are quite slow to run, over a minute on my machine. This presents a considerable barrier to bisecting for failures. The slowest tests are the filesystem ones and the buildman --fetch-arch test. Add a new 'qcheck' target that skips these tests. This reduces test time down to about 40 second, still too long, but bearable. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini
2018-11-26spl: Add support for passing handoff info to U-Boot properSimon Glass
There is some basic informaton that SPL normally wants to pass through to U-Boot, such as the SDRAM size and bank information. Mkae use of the new bloblist structure for this. Add a new 'handoff' blob which is set up in SPL and passed to U-Boot proper. Also adda test for sandbox_spl that checks that this works correctly and a new 'sb' command to show the information passed from SPL. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26sandbox: Drop the deprecated 'sb' commandSimon Glass
The old 'sb' command was deprecated in 2015 and replaced with 'host'. Remove the remaining users and the command, so that the name is available for other purposes. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26sandbox: Add an option to display of-platdata in SPLSimon Glass
At present we don't have a test that of-platdata can be accessed in SPL. Add this in as a command-line option to SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26test/py: Add a way to pass flags to sandboxSimon Glass
It is sometimes useful to restart sandbox with some particular flags to test certain functionality. Add a new method to ConsoleSandbox to handle this, without changing the existing APIs. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Stephen Warren <swarren@nvidia.com>
2018-11-26spl: Add a define for SPL_TPL_PROMPTSimon Glass
We should use a macro rather than hard-coding the SPL prompt to 'spl' since the code can be used by TPL too. Add a macro that works for both and use it in various places. This allows TPL to use the same code without printing confusing messages. Note that the string is lower case ('spl', 'tpl') which is a change from previously. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26test: Add a simple test for bloblistSimon Glass
Add a unit test for the bloblist functionality and enable bloblist for sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-26fs-test.sh: Update to use 'host' not 'sb'Tom Rini
For a long time now, 'sb' has been deprecated as a command in favor of using 'host' for the sandbox hostfs interface, switch. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-11-24test: regmap: add regmap_read_poll_timeout testNeil Armstrong
Add test to regmap_read_poll_timeout() helper to check the timeout works properly but cannot test proper condition matching since read/write calls are not executed in sandbox. Tested-by: Jerome Brunet <jbrunet@baylibre.com> Acked-by: Jagan Teki <jagan@openedev.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2018-11-20sf: Add a method to obtain the block-protect settingSimon Glass
It is useful to obtain the block-protect setting of the SPI flash, so we know whether it is fully open or (perhaps partially) write-protected. Add a method for this. Update the sandbox driver to process this operation and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-20test: sf: Add a simple SPI flash testSimon Glass
The current test is a functional test, covering all the way from the command line to the sandbox SPI driver. This is useful, but it is easier to diagnose failures with a smaller test. Add a simple test which reads and writes data and checks that it is stored and retrieved correctly. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-20misc: Update read() and write() methods to return bytes xferedSimon Glass
At present these functions return 0 on success. For some devices we want to know how many bytes were transferred. It seems useful to adjust the API to be more like the POSIX read() and write() functions. Update these two methods, a test and all users. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-11-20dm: core: Widen the dump tree to show more of the driver's name.Liviu Dudau
With drivers that have prefix names that are quite long (like 'versatile_') it is useful to have a wider column for the driver's name when dumping the device driver tree. Also update the tests to take into account the wider output format. Signed-off-by: Liviu Dudau <liviu.dudau@foss.arm.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-20dm: adc: add uclass's mask and conversion helpersFabrice Gasnier
Add two functions to ADC uclass's: - adc_raw_to_uV() to ease ADC raw value conversion to microvolts - adc_channel_mask() to get channels on consumer side Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-17dm: video: correctly set the cursor positionHeinrich Schuchardt
The terminal escape sequence ESC [ <x> ; <y> H is used to set the cursor position. According to the ECMA 48 standard the upper left corner in the escape sequences is [1, 1]. The video uclass uses [0, 0] as upper left corner. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-16test/py: test pinmux commandPatrice Chotard
Add pinmux test which test the following commands: - pinmux list - pinmux dev - pinmux status Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Mark some tests as sandbox-centric] Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2018-11-14test: dm: virtio: Add test cases for virtio uclassBin Meng
Now that we have a sandbox virtio transport driver, add some test cases to test virtio uclass driver. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-14test: dm: pci: Add cases for finding next PCI capability APIsBin Meng
Add test cases to cover the two newly added PCI APIs: dm_pci_find_next_capability() & dm_pci_find_next_ext_capability(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-14test: dm: blk: Correct blk_base test caseBin Meng
The blk_base test case creates a USB mass storage block device with the Sandbox host block device as its parent. This does not make any sense and causes potential issue, for example if the test case tries to read/write anything on the USB mass storage block device it will definitely fail as its parent is not on USB bus at all. Correct the test case by creating another Sandbox host block device instead of the USB mass storage one and adjust the case accordingly. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-14test: dm: core: Add test case for uclass driver's child_post_probe()Bin Meng
Add test case to cover uclass driver's child_post_probe() method. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-14test: regmap: Add test for regmap_{set, get}Mario Six
Add test for regmap_{set,get} functions. Reviewed-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-11-14test: regmap: Increase size of syscon0 memoryMario Six
The upcoming changes to the regmap interface will contain a proper check for plausibility when reading/writing from/to a register map. To still have the current tests pass, increase the size of the memory region for the syscon0 device, since one of the tests reads and writes beyond this range. Reviewed-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-11-14test: dm: core: Add a test case for driver marked with DM_FLAG_PRE_RELOC flagBin Meng
Now that we fixed the pre-relocation driver binding for driver marked with DM_FLAG_PRE_RELOC flag, add a test case to cover that scenario. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-11-01test: tee: fix resource leak in dm_test_tee()Jens Wiklander
Fixes possible resource leak in dm_test_tee() reported by Coverity. Reported-by: Coverity (CID: 184175) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
2018-10-22test: overlay: add missing includeHeinrich Schuchardt
Compiling the overlay unit test fails with odroid-c2_defconfig showing errors like: test/overlay/cmd_ut_overlay.c:29:8: error: unknown type name ‘fdt32_t’ Add the missing include. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-10-20test: Add test for PCI device without compat string and with DT nodeMarek Vasut
Add test which checks if a PCI device described in DT with an entry and reg = <...> property, but without compatible string results in a valid U-Boot PCI udevice with the udevice.node populated with reference to this DT node. Also check if the other PCI device without a DT node does not contain any bogus udevice.node. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2018-10-11Merge branch 'master' of git://git.denx.de/u-boot-netTom Rini
2018-10-10net: Don't overwrite waiting packets with asynchronous repliesJoe Hershberger
Peter originally sent a fix, but it breaks a number of other things. This addresses the original reported issue in a different way. That report was: > U-Boot has 1 common buffer to send Ethernet frames, pointed to by > net_tx_packet. When sending to an IP address without knowing the MAC > address, U-Boot makes an ARP request (using the arp_tx_packet buffer) > to find out the MAC address of the IP addressr. When a matching ARP > reply is received, U-Boot continues sending the frame stored in the > net_tx_packet buffer. > > However, in the mean time, if U-Boot needs to send out any network > packets (e.g. replying ping packets or ARP requests for its own IP > address etc.), it will use the net_tx_packet buffer to prepare the > new packet. Thus this buffer is no longer the original packet meant > to be transmitted after the ARP reply. The original packet will be > lost. This instead uses the ARP tx buffer to send async replies in the case where we are actively waiting for an ARP reply. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reported-by: Tran Tien Dat <peter.trantiendat@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2018-10-10test: eth: Add a test for the target being pingedJoe Hershberger
The target will respond to pings while doing other network handling. Make sure that the response happens and is correct. This currently corrupts the ongoing operation of the device if it happens to be awaiting an ARP reply of its own to whatever serverip it is attempting to communicate with. In the test, add an expectation that the user operation (ping, in this case) will fail. A later patch will address this problem. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2018-10-10test: eth: Add a test for ARP requestsJoe Hershberger
This tests that ARP requests made to this target's IP address are responded-to by the target when it is doing other networking operations. This currently corrupts the ongoing operation of the device if it happens to be awaiting an ARP reply of its own to whatever serverip it is attempting to communicate with. In the test, add an expectation that the user operation (ping, in this case) will fail. A later patch will address this problem. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>