summaryrefslogtreecommitdiff
path: root/test/dm/cmd_dm.c
Commit message (Collapse)AuthorAgeLines
* CONFIG_NEEDS_MANUAL_RELOC: Fix warnings when not setTom Rini2015-12-07-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-07-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>
* devres: add debug command to dump device resourcesMasahiro Yamada2015-08-06-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>
* dm: Move the tree/uclass dump code into its own fileSimon Glass2015-07-21-79/+3
| | | | | | | | | | In SPL it is sometimes useful to be able to obtain a dump of the current driver model state. Since commands are not available, provide a way to directly call the functions to output this information. Adjust the existing commands to use these functions. Signed-off-by: Simon Glass <sjg@chromium.org>
* test: dm: Move the dm tests over to the ut commandJoe Hershberger2015-05-21-21/+0
| | | | | | | | Unify the command for running unit tests further by moving the "dm test" command over to "ut dm". Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: test: Allow 'dm test' to select a particular test to runSimon Glass2015-04-18-3/+8
| | | | | | | As well as running all tests, it is useful to be able to run a selected test. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
* dm: test: Correct printf() output nit in 'dm uclass'Simon Glass2015-04-18-1/+1
| | | | | | | Neither the hyphen nor the equals sign is needed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
* common: Make sure arch-specific map_sysmem() is definedJoe Hershberger2015-04-18-0/+1
| | | | | | | | | | | In the case where the arch defines a custom map_sysmem(), make sure that including just mapmem.h is sufficient to have these functions as they are when the arch does not override it. Also split the non-arch specific functions out of common.h Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: Show both allocated and requested seq numbers in 'dm uclass'Simon Glass2015-04-16-2/+2
| | | | | | | | | | Both of these values are useful for understanding what is going on, so show them both. The requested number comes from a device tree alias. The allocated one is set up when the device is activated, and is unique throughout the uclass. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm_test: improve the appearance shown by "dm tree" commandMasahiro Yamada2014-12-11-51/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The command "dm tree" lists devices in a tree-like format. This commit makes it look more like what the Unix command "tree" shows. => dm tree Class Probed Name ---------------------------------------- root [ + ] root_driver demo [ ] |-- demo_shape_drv demo [ ] |-- demo_simple_drv demo [ ] |-- demo_shape_drv demo [ ] |-- demo_simple_drv demo [ ] |-- demo_shape_drv test [ ] |-- test_drv test [ ] |-- test_drv test [ ] |-- test_drv gpio [ ] |-- gpio_sandbox serial [ ] |-- serial_sandbox serial [ + ] |-- serial demo [ ] |-- triangle demo [ ] |-- square demo [ ] |-- hexagon gpio [ ] |-- gpios spi [ ] |-- spi@0 spi_emul [ ] | `-- flash@0 cros_ec [ + ] `-- cros-ec@0 Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* dm: Display the sequence number for each deviceSimon Glass2014-07-23-0/+2
| | | | | | Add this information to 'dm tree' and 'dm uclass' commands. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Avoid activating devices in 'dm uclass' commandSimon Glass2014-07-23-3/+3
| | | | | | | | This command currently activates devices as it lists them. This is not desirable since it changes the system state. Fix it and avoid printing a newline if there are no devices in a uclass. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Move device display into its own functionSimon Glass2014-07-23-8/+19
| | | | | | | The device display for 'dm tree' and 'dm uclass' is mostly the same, so move it into a common function. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Use '*' to indicate a device is activatedSimon Glass2014-06-21-5/+6
| | | | | | | | Make both dm enumeration commands support showing whether a driver is active or not, and use a consistent indicator (an asterisk). Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Marek Vasut <marex@denx.de>
* dm: Fix printf() strings in the 'dm' commandSimon Glass2014-06-20-4/+4
| | | | | | | The values here are int, but the map_to_sysmem() call can return a long. Add a cast to deal with this. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Allow driver model tests only for sandboxSimon Glass2014-06-20-2/+9
| | | | | | | The GPIO tests require the sandbox GPIO driver, so cannot be run on other platforms. Similarly for the 'dm test' command. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: rename device struct to udeviceHeiko Schocher2014-05-27-5/+5
| | | | | | | | | | | | using UBI and DM together leads in compiler error, as both define a "struct device", so rename "struct device" in include/dm/device.h to "struct udevice", as we use linux code (MTD/UBI/UBIFS some USB code,...) and cannot change the linux "struct device" Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Marek Vasut <marex@denx.de>
* dm: Add a 'dm' command for testingSimon Glass2014-03-04-0/+133
This command is not required for driver model operation, but can be useful for testing. It provides simple dumps of internal data structures. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com> Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com> Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>