summaryrefslogtreecommitdiffstats
path: root/test/dm
Commit message (Collapse)AuthorAgeFilesLines
* clk: convert API to match reset/mailbox styleStephen Warren2016-06-191-33/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following changes are made to the clock API: * The concept of "clocks" and "peripheral clocks" are unified; each clock provider now implements a single set of clocks. This provides a simpler conceptual interface to clients, and better aligns with device tree clock bindings. * Clocks are now identified with a single "struct clk", rather than requiring clients to store the clock provider device and clock identity values separately. For simple clock consumers, this isolates clients from internal details of the clock API. * clk.h is split so it only contains the client/consumer API, whereas clk-uclass.h contains the provider API. This aligns with the recently added reset and mailbox APIs. * clk_ops .of_xlate(), .request(), and .free() are added so providers can customize these operations if needed. This also aligns with the recently added reset and mailbox APIs. * clk_disable() is added. * All users of the current clock APIs are updated. * Sandbox clock tests are updated to exercise clock lookup via DT, and clock enable/disable. * rkclk_get_clk() is removed and replaced with standard APIs. Buildman shows no clock-related errors for any board for which buildman can download a toolchain. test/py passes for sandbox (which invokes the dm clk test amongst others). Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
* reset: implement a reset testStephen Warren2016-06-192-0/+40
| | | | | | | | | This adds a sandbox reset implementation (provider), a test client device, instantiates them both from Sandbox's DT, and adds a DM test that excercises everything. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: test: Add GPIO open drain testsmario.six@gdsys.cc2016-06-031-0/+7
| | | | | | | | | | Add some tests for the new open drain setting feature of the GPIO uclass, and extend the capabilities of the sandbox GPIO driver accordingly. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: York Sun <york.sun@nxp.com>
* mailbox: implement a sandbox testStephen Warren2016-05-262-0/+32
| | | | | | | | | This adds a sandbox mailbox implementation (provider), a test client device, instantiates them both from Sandbox's DT, and adds a DM test that excercises everything. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org> # v1
* Rename reset to sysresetStephen Warren2016-05-263-75/+75
| | | | | | | | | | | | | | The current reset API implements a method to reset the entire system. In the near future, I'd like to introduce code that implements the device tree reset bindings; i.e. the equivalent of the Linux kernel's reset API. This controls resets to individual HW blocks or external chips with reset signals. It doesn't make sense to merge the two APIs into one since they have different semantic purposes. Resolve the naming conflict by renaming the existing reset API to sysreset instead, so the new reset API can be called just reset. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: mmc: test: Add tests for MMCSimon Glass2016-05-172-3/+20
| | | | | | | | Add a simple test which checks that a sandbox-emulated SD card can be used correctly. This tests plumbing through the MMC stack's block-device implementaion. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sandbox: mmc: Enable building MMC code for sandboxSimon Glass2016-05-171-2/+2
| | | | | | | Enable building the MMC code for sandbox. This increases build coverage for sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: sandbox: Only enable the sandbox MMC driver when validSimon Glass2016-05-171-1/+3
| | | | | | | This driver will require generic MMC and block-device support in a future commit. To avoid test errors, make this change now. Signed-off-by: Simon Glass <sjg@chromium.org>
* test/dm/core.c: Make pre-reloc test use pre-reloc structTom Rini2016-04-141-1/+1
| | | | | | | | | | | | | LLVM 3.5 noted: test/dm/core.c:41:35: warning: unused variable 'test_pdata_pre_reloc' [-Wunused-const-variable] static const struct dm_test_pdata test_pdata_pre_reloc = { And the correct fix here is that the driver_info_pre_reloc test should use the test_pdata_pre_reloc not test_pdata_manual variable Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* spmi: Add sandbox test driverMateusz Kulikowski2016-04-012-0/+115
| | | | | | | | This patch adds emulated spmi bus controller with part of pm8916 pmic on it to sandbox and tests validating SPMI uclass. Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: blk: Add tests for block devicesSimon Glass2016-03-172-0/+97
| | | | | | | Add some tests to check that block devices work as expected. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com>
* dm: usb: Clean up USB after each testSimon Glass2016-03-141-0/+2
| | | | | | | | | | | | | | | The USB subsystem has a few counters that need to be reset since they are stored in static variables rather than driver-model data. An example is usb_max_devs. Ultimately we should move this data into the USB uclass. For now, make sure that USB is reset after each test, so that the counters go back to zero. Note: this is not a perfect solution: It a USB test fails it will exit immediately and leave USB un-reset. The impact here is that it may cause subsequence test failures in the same run. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: block: Adjust device calls to go through helpers functionSimon Glass2016-03-141-1/+1
| | | | | | | | | | | | To ease conversion to driver model, add helper functions which deal with calling each block device method. With driver model we can reimplement these functions with the same arguments. Use inline functions to avoid increasing code size on some boards. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
* dm: blk: Rename get_device() to blk_get_device_by_str()Simon Glass2016-03-141-1/+1
| | | | | | | | | | The current name is too generic. The function returns a block device based on a provided string. Rename it to aid searching and make its purpose clearer. Also add a few comments. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
* dm: Drop the block_dev_desc_t typedefSimon Glass2016-03-141-1/+1
| | | | | | | | | Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
* spi: Re-enable the SPI flash testsSimon Glass2016-02-261-2/+2
| | | | | | | | These are working correctly again, so re-enable them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jteki@openedev.com> Tested-by: Jagan Teki <jteki@openedev.com>
* test/py: run all "ut" subtestsStephen Warren2016-02-151-16/+0
| | | | | | | | | | | Invoke each "ut"-based unit test as a separate pytest. Now that the DM unit test runs under test/py, remove the manual shell script that invokes it. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> # v2, on sandbox
* video: test: Adjust order of file closureSimon Glass2016-02-061-1/+1
| | | | | | | | | Close the file earlier to hopefully fix a Coverity error. Reported-by: Coverity (CID: 134901) Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* video: test: Add console tests for truetypeSimon Glass2016-01-301-0/+63
| | | | | | | This adds tests for the different character types, line wrap, scrolling and backspace. Signed-off-by: Simon Glass <sjg@chromium.org>
* video: sandbox: Enable truetype fonts for sandboxSimon Glass2016-01-301-1/+20
| | | | | | | | Enable this feature so that truetype fonts can be used on the sandbox console. Update the tests to select the normal/rotated console when needed. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Anatolij Gustschin <agust@denx.de>
* video: Handle the 'bell' characterSimon Glass2016-01-301-1/+1
| | | | | | | This can be sent when to many characters are entered. Make sure it is ignored and does not cause a character to be displayed. Signed-off-by: Simon Glass <sjg@chromium.org>
* video: Use fractional units for X coordinatesSimon Glass2016-01-301-2/+2
| | | | | | | | | | | | | | With anti-aliased fonts we need a more fine-grained horizontal position than a single pixel. Characters can be positioned to start part-way through a pixel, with anti-aliasing (greyscale edges) taking care of the visual effect. To cope with this, use fractional units (1/256 pixel) for horizontal positions in the text console. Signed-off-by: Simon Glass <sjg@chromium.org> [agust: rebased] Signed-off-by: Anatolij Gustschin <agust@denx.de>
* test/dm: clear unit test failure count each runStephen Warren2016-01-281-0/+2
| | | | | | | | | | The ut command prints a test failure count each time it is executed. This is stored in a global variable which is never reset. Consequently, the printed failure count accumulates across runs. Fix this by clearing the counter each time "ut" is invoked. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: syscon: Allow finding devices by driver dataSimon Glass2016-01-241-0/+17
| | | | | | | | We have a way to find a regmap by its syscon driver data value. Add the same for syscon itself. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* dm: video: test: Test that bitmap display works correctlySimon Glass2016-01-201-0/+54
| | | | | | | | Add a test for the 'bmp' command. Test both the uncompressed and compressed versions of the file, since they use different code paths. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>
* dm: video: test: Add tests for rotated consolesSimon Glass2016-01-201-0/+27
| | | | | | | Test that text is displayed correctly when the console is rotated. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>
* dm: video: test: Add tests for the video uclassSimon Glass2016-01-202-0/+191
| | | | | | | | | Add tests that check that the video console is working correcty. Also check that text output produces the expected result. Test coverage includes character output, wrapping and scrolling. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Anatolij Gustschin <agust@denx.de>
* block: pass block dev not num to read/write/erase()Stephen Warren2016-01-131-1/+1
| | | | | | | | | | | This will allow the implementation to make use of data in the block_dev structure beyond the base device number. This will be useful so that eMMC block devices can encompass the HW partition ID rather than treating this out-of-band. Equally, the existence of the priv field is crying out for this patch to exist. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* dm: test: Convert PCI tests to use the DM PCI APISimon Glass2016-01-121-9/+6
| | | | | | Update these tests to use driver model API functions. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: test: usb: Update the USB tests so that they all passSimon Glass2016-01-111-7/+16
| | | | | | | Due to a limitation removed in an earlier patch, USB tests were not seeing all the devices. Update the tests to pass now that all devices are visible. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Disable all SPI and SPI flash testsSimon Glass2016-01-071-2/+2
| | | | | | | | | | | This subsystem has been broken since commit: 4efad20a sf: Update status reg check in spi_flash_cmd_wait_ready There has so far been no response from the maintainer, and a release is imminent. For now, let's just disable the tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* CONFIG_NEEDS_MANUAL_RELOC: Fix warnings when not setTom Rini2015-12-071-0/+1
| | | | | | | | | Now that we may compile (but not link) code calling fixup_cmdtable when this is not set, we need to always have the declaration available. We should also make sure that anyone calling the function includes <command.h> as that's where the function declaration is. Signed-off-by: Tom Rini <trini@konsulko.com>
* dm: cmd: Relocate subcommands when MANUAL_RELOCMichal Simek2015-12-071-0/+14
| | | | | | | | Subcommands contain pointers to functions which are not updated when MANUAL_RELOC is enabled. This patch fix it. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: test: usb: sandbox: Add keyboard tests for sandboxSimon Glass2015-11-191-0/+31
| | | | | | | Add a test that verifies that USB keyboards work correctly on sandbox. This verifies some additional parts of the USB stack. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: test: usb: Add a test for device reorderingSimon Glass2015-11-191-0/+50
| | | | | | | Add tests that 'usb tree' produces the right output when a device changes order on the bus. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: test: usb: Add tests for the 'usb tree' commandSimon Glass2015-11-191-0/+156
| | | | | | | Add tests that this command produces the right output, even when a rescan results in a device disappearing from the bus. Signed-off-by: Simon Glass <sjg@chromium.org>
* test: Record and silence console in testsSimon Glass2015-11-191-0/+9
| | | | | | | | | When running sandbox tests, silence the console to avoid unwanted output. Also, record the console in case tests want to check it. The -v option can be used to enable stdout during tests. Signed-off-by: Simon Glass <sjg@chromium.org>
* Move console definitions into a new console.h fileSimon Glass2015-11-192-0/+2
| | | | | | | | The console includes a global variable and several functions that are only used by a small subset of U-Boot files. Before adding more functions, move the definitions into their own header file. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: usb: Avoid time delays in sandbox testsSimon Glass2015-11-192-0/+5
| | | | | | | Currently the USB tests take around two seconds to run. Remove these unnecessary time delays so that the tests run quickly. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: add a sandbox timer and basic testThomas Chou2015-11-192-0/+28
| | | | | | | | Add a sandbox timer which get time from host os and a basic test. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Reviewed-by: Simon Glass <sjg@chromium.org>
* sandbox: add ADC unit testsPrzemyslaw Marczak2015-11-022-0/+166
| | | | | | | | | | | | | | | | | | | | | | | | This commit adds unit tests for ADC uclass's methods using sandbox ADC. Testing proper ADC binding: - dm_test_adc_bind() - device binding - dm_test_adc_wrong_channel_selection() - checking wrong channel selection Testing ADC supply operations: - dm_test_adc_supply(): - Vdd/Vss values validating - Vdd regulator updated value validating - Vdd regulator's auto enable state validating Testing ADC operations results: - dm_test_adc_single_channel_conversion() - single channel start/data - dm_test_adc_single_channel_shot() - single channel shot - dm_test_adc_multi_channel_conversion() - multi channel start/data - dm_test_adc_multi_channel_shot() - multi channel single shot Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* Merge branch 'master' of git://git.denx.de/u-boot-netTom Rini2015-10-291-0/+64
|\
| * dm: test: Add a new test case against dm eth codes for NULL pointer accessBin Meng2015-10-291-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | U-Boot crashes when doing a 'ping' with the following test scenario: - All ethernet devices are not probed - "ethaddr" for all ethernet devices are not set - "ethact" is set to a valid ethernet device name Add a new test case 'dm_test_eth_act' to hit such scenario. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* | dm: Rename dev_get_parentdata() to dev_get_parent_priv()Simon Glass2015-10-231-13/+13
|/ | | | | | | | The current name is inconsistent with other driver model data access functions. Rename it and fix up all users. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
* test: Add basic tests for remoteprocNishanth Menon2015-10-222-0/+68
| | | | | | | | | Use the sandbox environment for the basic tests. Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Nishanth Menon <nm@ti.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: test: Show the amount of leaked memory on errorSimon Glass2015-10-051-1/+6
| | | | | | | Adjust the memory leak tests to show the amount of memory leaked. This can be a useful signal as to what is wrong. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: test: Add a new test case for dm_test_eth_rotateBin Meng2015-09-091-0/+5
| | | | | | | | | Add one more ethernet device node in the sandbox test device tree, with name 'sbe5'. This is to support a new test case for testing network device rotation. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
* devres: add debug command to dump device resourcesMasahiro Yamada2015-08-061-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new command can dump all device resources associated to each device. The fields in every line shows: - The address of the resource - The size of the resource - The name of the release function - The stage in which the resource has been acquired (BIND/PROBE) Currently, there is no driver using devres, but if such drivers are implemented, the output of this command should look like this: => dm devres - root_driver - soc - extbus - serial@54006800 bfb541e8 (8 byte) devm_kmalloc_release BIND bfb54440 (4 byte) devm_kmalloc_release PROBE bfb54460 (4 byte) devm_kmalloc_release PROBE - serial@54006900 bfb54270 (8 byte) devm_kmalloc_release BIND - gpio@55000000 - i2c@58780000 bfb5bce8 (12 byte) devm_kmalloc_release PROBE bfb5bd10 (4 byte) devm_kmalloc_release PROBE - eeprom bfb54418 (12 byte) devm_kmalloc_release BIND Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Simon Glass <sjg@chromium.org>
* test: Add a test for regmapSimon Glass2015-07-212-0/+83
| | | | | | We use syscon to test that the regmap functions work as expected. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: test: Add a test for the system controller uclassSimon Glass2015-07-212-0/+32
| | | | | | | Add a test to confirm that we can access system controllers and find their driver data. Signed-off-by: Simon Glass <sjg@chromium.org>
OpenPOWER on IntegriCloud