summaryrefslogtreecommitdiff
path: root/test/dm/regmap.c
AgeCommit message (Collapse)AuthorFilesLines
2020-05-19common: Drop log.h from common headerSimon Glass1-0/+1
Move this header out of the common header. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-06dm: core: Require users of devres to include the headerSimon Glass1-0/+1
At present devres.h is included in all files that include dm.h but few make use of it. Also this pulls in linux/compat which adds several more headers. Drop the automatic inclusion and require files to include devres themselves. This provides a good indication of which files use devres. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
2019-10-27test: regmap: check the values read from the regmapJean-Jacques Hiblot1-3/+16
The test did reads after writes but didn't check the value. It probably was because the sandbox didn't implement the writeX/readX functions. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Updated to use sandbox_set_enable_memio(): Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
2019-01-15test: dm: regmap: Fix the long test delaySimon Glass1-3/+4
At present one of the regmap tests takes 5 seconds to run since it waits for a timeout. This should be handled using sandbox_timer_add_offset() which advances time for test purposes. This requires a little change to make the regmap_read_poll_timeout() testable. Update the macro and the test. Fixes: ebe3497c9c ("test: regmap: add regmap_read_poll_timeout test") Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-24test: regmap: add regmap_read_poll_timeout testNeil Armstrong1-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>
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-05-08test: regmap: add read/modify/write testNeil Armstrong1-0/+25
Add calls to regmap_read/modify_bits/write even if the proper memory read/write calls are not executed in sandbox. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-07test: regmap: test Linux-compatible syscon_node_to_regmap()Masahiro Yamada1-0/+17
Like Linux, syscon_node_to_regmap() allows a node to work as a syscon provider without binding it to a syscon driver. Test this. Requested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-07regmap: clean up regmap allocationMasahiro Yamada1-8/+5
Putting zero length array at the end of struct is a common technique to embed arbitrary length of members. There is no good reason to let regmap_alloc_count() branch by "if (count <= 1)". As far as I understood the code, regmap->base is an alias of regmap->ranges[0].start, but it is not helpful but make the code just ugly. Rename regmap_alloc_count() to regmap_alloc() because the _count suffix seems pointless. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: fixup cpu_info-rcar.c] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini1-2/+1
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-29test: dm: regmap: fix license headerMasahiro Yamada1-1/+1
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-04-27Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini1-2/+0
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>
2015-07-22test: Add a test for regmapSimon Glass1-0/+82
We use syscon to test that the regmap functions work as expected. Signed-off-by: Simon Glass <sjg@chromium.org>