summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* test: bootcount: add bootcount-uclass testPhilipp Tomsich2019-01-142-0/+31
| | | | | | | | Add a test for the bootcount uclass, which uses the RTC bootcount backend (i.e. drivers/bootcount/rtc.c is implictly also tested). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: video: fix test failures with enabled default TrueType fontAnatolij Gustschin2018-12-291-3/+3
| | | | | | | | With enabled default Nimbus font dm_test_video_truetype* tests fail. Update expected expressions to fix them. Signed-off-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* tests: enable DT overlay tests by defaultHeinrich Schuchardt2018-12-261-4/+3
| | | | | | | | | | Enable device tree overlay tests by default if unit tests are selected and the runtime is configured via device tree. Overlays have been mainlined in the device tree compiler so there is no reason anymore to disable the tests by default. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* cmd: Move the "dm" command from test/dm/ to cmd/Tom Rini2018-12-152-89/+0
| | | | | | | The "dm" command under CONFIG_CMD_DM should live under cmd/ rather than test/dm/ so move it. Signed-off-by: Tom Rini <trini@konsulko.com>
* dm: sound: Complete migration to driver modelSimon Glass2018-12-131-3/+3
| | | | | | | All users of sound are converted to use driver model. Drop the old code and the CONFIG_DM_SOUND option. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Add a function to read into a unsigned intSimon Glass2018-12-131-0/+35
| | | | | | | | | | | The current dev_read...() functions use s32 and u32 which are convenient for device tree but not so useful for normal code, which often wants to use normal integers for values. Add a helper which supports returning an unsigned int. Also add signed versions of the unsigned readers. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sound: Create a uclass for soundSimon Glass2018-12-132-0/+35
| | | | | | | | | | | The sound driver pulls together the audio codec and i2s drivers in order to actually make sounds. It supports setup() and play() methods. The sound_find_codec_i2s() function allows locating the linked codec and i2s devices. They can be referred to from uclass-private data. Add a uclass and a test for sound. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sound: Create a uclass for i2sSimon Glass2018-12-132-0/+33
| | | | | | | | | | | The i2s bus is commonly used with audio codecs. It provides a way to stream digital data sychronously in both directions. U-Boot only supports audio output, so this uclass is very simple, with a single tx_data() method. Add a uclass and a test for i2s. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sound: Create a uclass for audio codecsSimon Glass2018-12-132-0/+35
| | | | | | | | An audio codec provides a way to convert digital data to sound and vice versa. Add a simple uclass which just supports setting the parameters for the codec. Signed-off-by: Simon Glass <sjg@chromium.org>
* test: overlay: NULL passed as fdtHeinrich Schuchardt2018-12-121-19/+9
| | | | | | | | | | | The uts created in do_ut_overlay() is not the one used in cmd_ut_category(). Currently all tests are therefore called with uts->priv = NULL and fail. Using a static variable is the easiest fix here. Fixes: e93232e15ec9 ("test: overlay: Use cmd_ut_category()") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* test: hexdump: fix misplaced returnSimon Goldschmidt2018-12-121-2/+2
| | | | | | | | | | 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>
* Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini2018-12-101-0/+29
|\ | | | | | | - DWC3 and UDC cleanup
| * syscon: dm: Add a new method to get a regmap from DTSJean-Jacques Hiblot2018-12-071-0/+29
| | | | | | | | | | | | | | | | | | 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>
* | spl/tpl: change banner into upper caseHeiko Schocher2018-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | test: dma: add dma-uclass testGrygorii Strashko2018-12-072-0/+124
| | | | | | | | | | | | | | | | | | | | 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>
* | dm: Add Hardware Spinlock classBenjamin Gaignard2018-12-062-0/+41
|/ | | | | | | | | | 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>
* Merge tag 'dm-pull-5dec18' of git://git.denx.de/u-boot-dmTom Rini2018-12-053-4/+94
|\ | | | | | | | | | | | | Minor sandbox enhancements / fixes tpm improvements to clear up v1/v2 support buildman toolchain fixes New serial options to set/get config
| * dm: serial: Introduce ->getinfo() callbackAndy Shevchenko2018-12-051-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>
| * dm: serial: Add ->getconfig() callbackAndy Shevchenko2018-12-051-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>
| * dm: core: add functions to get/remap I/O addresses by nameÁlvaro Fernández Rojas2018-12-051-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>
| * sandbox: sysreset: Update to support power-on resetSimon Glass2018-12-051-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>
* | Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini2018-12-051-0/+26
|\ \ | |/ |/| | | | | | | | | | | - Various MTD fixes from Boris - Zap various unused / legacy paths. - pxa3xx NAND update from Miquel Signed-off-by: Tom Rini <trini@konsulko.com>
| * test: regmap: add regmap_read_poll_timeout testNeil Armstrong2018-11-241-0/+26
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini2018-12-031-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
| * | efi_selftest: check fdt is marked as runtime dataHeinrich Schuchardt2018-12-021-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>
* | | test: vboot: clean its filePhilippe Reynes2018-12-039-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>
* | | test: vboot: add padding pss for rsa signaturePhilippe Reynes2018-12-035-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>
* | dm: sandbox: i2c: Use new emulator parent uclassSimon Glass2018-11-292-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>
* | dm: core: Add a few more specific child-finding functionsSimon Glass2018-11-291-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>
* | dm: core: Export uclass_find_device_by_phandle()Simon Glass2018-11-291-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>
* | test: Add a 'make qcheck' target for quicker testingSimon Glass2018-11-296-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>
* | Merge branch 'master' of git://git.denx.de/u-boot-videoTom Rini2018-11-261-2/+2
|\ \
| * | dm: video: correctly set the cursor positionHeinrich Schuchardt2018-11-171-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>
* | | spl: Add support for passing handoff info to U-Boot properSimon Glass2018-11-262-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>
* | | sandbox: Drop the deprecated 'sb' commandSimon Glass2018-11-263-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>
* | | sandbox: Add an option to display of-platdata in SPLSimon Glass2018-11-261-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>
* | | test/py: Add a way to pass flags to sandboxSimon Glass2018-11-261-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>
* | | spl: Add a define for SPL_TPL_PROMPTSimon Glass2018-11-261-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>
* | | test: Add a simple test for bloblistSimon Glass2018-11-263-0/+191
| | | | | | | | | | | | | | | | | | | | | Add a unit test for the bloblist functionality and enable bloblist for sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
* | | fs-test.sh: Update to use 'host' not 'sb'Tom Rini2018-11-261-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>
* | | sf: Add a method to obtain the block-protect settingSimon Glass2018-11-201-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>
* | | test: sf: Add a simple SPI flash testSimon Glass2018-11-201-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>
* | | misc: Update read() and write() methods to return bytes xferedSimon Glass2018-11-201-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>
* | | dm: core: Widen the dump tree to show more of the driver's name.Liviu Dudau2018-11-201-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>
* | dm: adc: add uclass's mask and conversion helpersFabrice Gasnier2018-11-201-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>
* | test/py: test pinmux commandPatrice Chotard2018-11-161-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>
* test: dm: virtio: Add test cases for virtio uclassBin Meng2018-11-142-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>
* test: dm: pci: Add cases for finding next PCI capability APIsBin Meng2018-11-141-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>
* test: dm: blk: Correct blk_base test caseBin Meng2018-11-141-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>
* test: dm: core: Add test case for uclass driver's child_post_probe()Bin Meng2018-11-142-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>