aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2018-12-05dm: serial: Introduce ->getinfo() callbackAndy Shevchenko1-0/+5
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 Shevchenko1-0/+7
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 Rojas1-2/+80
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 Glass1-2/+2
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 Rini1-4/+6
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 Reynes9-69/+69
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 Reynes5-5/+187
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 Schuchardt1-4/+6
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 Glass2-5/+6
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 Glass1-0/+27
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 Glass1-0/+20
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 Glass6-3/+17
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 Rini1-2/+2
2018-11-26spl: Add support for passing handoff info to U-Boot properSimon Glass2-1/+16
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 Glass3-8/+8
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 Glass1-1/+30
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 Glass1-0/+18
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 Glass1-1/+1
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 Glass3-0/+191
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 Rini1-7/+7
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-20sf: Add a method to obtain the block-protect settingSimon Glass1-0/+9
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 Glass1-2/+44
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 Glass1-3/+3
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 Dudau1-14/+14
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 Gasnier1-0/+35
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 Schuchardt1-2/+2
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 Chotard1-0/+66
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 Meng2-0/+123
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 Meng1-0/+20
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 Meng1-16/+11
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 Meng2-2/+50
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 Six1-0/+28
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 Six1-1/+1
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 Meng2-4/+27
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 Wiklander1-9/+26
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 Schuchardt1-0/+1
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 Vasut1-0/+5
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 Rini1-0/+170
2018-10-10net: Don't overwrite waiting packets with asynchronous repliesJoe Hershberger1-4/+2
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 Hershberger1-0/+86
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 Hershberger1-0/+86
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>
2018-10-09sysreset: Add a way to find the last resetSimon Glass1-0/+20
We have a method to return the last reset as a string for humans, but not a method that allows it to be used programmatically. Add a new method that returns the last reset as an enum. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09sysreset: Tidy up a few comments and loggingSimon Glass1-1/+0
Some comments are incorrect or missing pieces. Fix these and use logging to print the error. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09panel: Expand the backlight supportSimon Glass1-0/+29
At present the panel can be turned on but not off, and the brightness cannot be controlled at run-time. Add a new API function to both the panel and backlight uclasses to handle this. Enhance the PWM backlight driver to deal with custom levels properly and allow the backlight to be turned on and off. Update the test to cover thes new features. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09test: panel: Add a test for the panel uclassSimon Glass2-0/+51
At present this uclass has no tests. Add a simple one which checks the PWM configuration, regulator and GPIO. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09dm: core: Update ofnode to read binman-style flash entrySimon Glass1-0/+16
At present ofnode_read_fmap_entry() reads a flash map entry in a format which is not supported by binman. To allow use to use binman-format descriptions, update this function. Also add a simple test. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09dm: core: Add a function to find the first inactive childSimon Glass1-0/+31
Some devices have children and want to press an existing inactive child into service when needed. Add a function to help with this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-09sandbox: video: Speed up video outputSimon Glass1-1/+1
At present there are many situations where sandbox syncs the display to the SDL frame buffer. This is a very expensive operation but is only needed every now and then. Update video_sync() so that we can specify whether this operation is really needed. At present this flag is not used on other architectures. It could also be used for reducing writeback-cache flushes but the benefit of that would need to be investigated. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2018-10-09log: Add helpers for common log levelsSimon Glass2-0/+19
At present to output a log message you need something like: log(UCLASS_SPI, LOCL_INFO, "message1"); log(UCLASS_SPI, LOCL_INFO, "message2"); but many files use the same category throughout. Also it is helpful to shorten the length of log names, providing helpers for common logging levels. Add some macros so that it is possible to do: (top of file, before #includes) #define LOG_CATEGORY UCLASS_SPI (later in the file) log_info("message1"); log_debug("message2"); log_err("message3"); Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-08binman: Run tests concurrentlySimon Glass1-0/+1
At present the tests run one after the other using a single CPU. This is not very efficient. Bring in the concurrencytest module and run the tests concurrently, using one process for each CPU by default. A -P option allows this to be overridden, which is necessary for code-coverage to function correctly. This requires fixing a few tests which are currently not fully independent. At some point we might consider doing this across all pytests in U-Boot. There is a pytest version that supports specifying the number of processes to use, but it did not work for me. Signed-off-by: Simon Glass <sjg@chromium.org>