summaryrefslogtreecommitdiff
path: root/test/dm/usb.c
AgeCommit message (Collapse)Author
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-27Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini
We have a large number of places where while we historically referenced gd in the code we no longer do, as well as cases where the code added that line "just in case" during development and never dropped it. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-10-01test: dm: usb: Update test cases for USBBin Meng
Now that we have changed to remove all devices under the root hub in usb_stop(), and corrected the USB emulator select logic, it makes no sense to do various tests based on 'usb tree' output since the order of devices is no longer fixed. Remove these USB test cases related to 'usb tree'. For the USB remove test, ideally we should remove an emulator device node from the device tree, but this is so far not working. Change to test the 'usb stop' only. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2016-03-14dm: usb: Clean up USB after each testSimon Glass
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>
2016-03-14dm: block: Adjust device calls to go through helpers functionSimon Glass
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>
2016-03-14dm: blk: Rename get_device() to blk_get_device_by_str()Simon Glass
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>
2016-03-14dm: Drop the block_dev_desc_t typedefSimon Glass
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>
2016-01-13block: pass block dev not num to read/write/erase()Stephen Warren
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>
2016-01-11dm: test: usb: Update the USB tests so that they all passSimon Glass
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>
2015-11-19dm: test: usb: sandbox: Add keyboard tests for sandboxSimon Glass
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>
2015-11-19dm: test: usb: Add a test for device reorderingSimon Glass
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>
2015-11-19dm: test: usb: Add tests for the 'usb tree' commandSimon Glass
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>
2015-11-19Move console definitions into a new console.h fileSimon Glass
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>
2015-11-19dm: usb: Avoid time delays in sandbox testsSimon Glass
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>
2015-05-21test: Generalize the unit test frameworkJoe Hershberger
Separate the ability to define tests and assert status of test functions from the dm tests so they can be used more consistently throughout all tests. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-04-18dm: usb: Add tests for the USB uclassSimon Glass
This adds a simple test for probing and a functional test using the flash stick emulator, which tests a large chunk of the USB stack. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>