summaryrefslogtreecommitdiffstats
path: root/commands/devinfo.c
Commit message (Collapse)AuthorAgeFilesLines
* of: populate new device_d::dma_coherent attributeAhmad Fatoum2024-01-111-0/+4
| | | | | | | | | | | | | | | | | | | | So far, whether device DMA is coherent was a one-time global decision. This is insufficient, because some platforms: - are cache coherent, while the architecture isn't in general, e.g. barebox support for ARM with CONFIG_MMU=y assumes non-coherent DMA, but LS1046A can be fully coherent. - have a mix of devices that snoop caches and devices that don't (StarFive JH7100). To enable dev_dma_(map|unmap)_single to take the correct device-specific action with regards to cache maintenance, provide dev_is_dma_coherent() with semantics similar to what Linux provides. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240110160112.4134162-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devinfo: indicate if device tree nodes are differently populatedAhmad Fatoum2023-12-051-2/+11
| | | | | | | | | | We don't preclude multiple devices pointing at the same device tree node. It would be useful information for the user to indicate when that's the case, so extend devinfo to show the information. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231127063559.2205776-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Print device nodes with %pOFSascha Hauer2023-07-031-1/+1
| | | | | | | We have the %pOF format specifier for printing device nodes. Use it where appropriate. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct device_d to deviceSascha Hauer2023-01-101-3/+3
| | | | | | | | | | | | | The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename device_d::device_node to device_d::of_nodeSascha Hauer2023-01-101-3/+3
| | | | | | | | | | | | | | | | | | | | Linux struct device has the member of_node for the device_node pointer. Rename this in barebox accordingly to minimize the necessary changes when porting Linux code. This was done with the semantic patch: @@ struct device_d E; @@ - E.device_node + E.of_node @@ struct device_d *E; @@ - E->device_node + E->of_node Plus some manual adjustments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: of_dump: support limiting size of printed propertiesAhmad Fatoum2022-08-081-1/+1
| | | | | | | | | | FIT images can have properties with very long values. Make it possible to use of_dump to inspect them by adding a -P option that restricts how much of the value is printed. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220808065639.453483-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: devinfo: Omit parent if direct descendent of busAhmad Fatoum2021-11-301-1/+1
| | | | | | | | In that case parentage adds no extra info, so we can just omit it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20211129080356.2025369-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devinfo: print device parent along with device infoAhmad Fatoum2020-06-231-0/+3
| | | | | | | | | | | | Especially for "virtual" devices (e.g. wdog0 or mmc2), it is often useful to know the corresponding hardware device. Instead of always having to search through plain devinfo, just include this information in the output when running `devinfo device`. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/*: Replace license and copyright boilerplate by SPDX identfiersUwe Kleine-König2020-04-271-14/+2
| | | | | | | | | | | | | While at it also drop references to the non-existing CREDITS file and do some small rearrangements for some uniform formatting. (SPDX-License-Identifier first, then copyright texts and then an empty line.) The advantage is that these specifiers are machine-parseable which helps license conformance. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* parameter: Give device parameters typesSascha Hauer2017-04-101-1/+2
| | | | | | | | This adds a variable type enum and adds this to the device parameters. This information gives the user a hint which values a parameter expects and also helps to organize the parameters better internally. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Convert users of PRINTF_CONVERSION_RESOURCE to %paSascha Hauer2016-01-151-3/+5
| | | | | | | | printf now supports printing resource_size_t directly, convert all users of the previously used PRINTF_CONVERSION_RESOURCE over to %pa. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: Add symlink supportSascha Hauer2016-01-081-2/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devinfo: fix return valueSascha Hauer2015-06-231-5/+2
| | | | | | | | | | | | | | | devinfo on a non existing device prints: no such device: blah devinfo: Operation not permitted The second message comes because devinfo returns -1 which is -EPERM. Just return -ENODEV which will print: devinfo: No such device Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: remove doxygen documentationSascha Hauer2014-06-261-28/+0
| | | | | | | The doxygen documentation is long outdated. Remove it. It will be replaced with sphinx based documentation later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2014-06-041-1/+2
|\ | | | | | | | | Conflicts: commands/devinfo.c
| * devinfo: add human readable size after memory rangeFranck Jullien2014-05-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not always easy to know what is the size of a parition. This patch adds the size of a memory range in human readable format. We now have for example: `---- cfi_flash0 `---- nor0 `---- 0x00000000-0x00ffffff ( 16 MiB): /dev/nor0 `---- 0x00000000-0x0001ffff ( 128 KiB): /dev/env0 `---- 0x00020000-0x0011ffff ( 1 MiB): /dev/fpga0 `---- 0x00120000-0x0019ffff ( 512 KiB): /dev/self0 `---- 0x001a0000-0x00d9ffff ( 12 MiB): /dev/linux `---- 0x00da0000-0x00ffffff ( 2.4 MiB): /dev/elf Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | devinfo: reduce indentationHolger Schurig2014-06-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | This patch reduces the indentation of "devinfo", to reduce the amount of overly long lines. And while we're at it, also remove the fixed-size of the human-readable area. As entries didn't align anyway (because of indentation), this was just eating more space without giving much more readability. Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | devinfo: make the output of "devinfo DEVICE" nicerHolger Schurig2014-06-021-17/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * some output sections started with "foo: bar", some with "foo = bar". Unify this. * there was a fixed size to the "foo =" parameters, which wasn't fitting, this was especially visible at "devinfo global" * don't output "resources:", "driver:" and "bus:" lines if there are none resources, drivers or busses involved. * remove some empty lines * harmonize differentiation between headlines (e.g. "resources:") and values by indenting values slightly * uppercase some texts Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | drvlist: factor the driver list out of 'devinfo'Holger Schurig2014-06-021-7/+2
| | | | | | | | | | | | | | | | | | The command 'devinfo' was first spitting out all devices, and then also all drivers. This patch separates them into two commands, 'devinfo' as before, and also the new command 'drvinfo' Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: harmonize in-barebox documentationHolger Schurig2014-05-141-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does probably too much, but it's hard (and very cumbersome/time consuming) to break it out. What is does is this: * each command has one short description, e.g. "list MUX configuration" * made sure the short descriptions start lowercase * each command has one usage. That string contains just the options, e.g. "[-npn]". It's not part of the long help text. * that is, it doesn't say "[OPTIONS]" anymore, every usable option is listed by character in this (short) option string (the long description is in the long help text, as before) * help texts have been reworked, to make them - sometimes smaller - sometimes describe the options better - more often present themselves in a nicer format * all long help texts are now created with BUSYBOX_CMD_HELP_ macros, no more 'static const __maybe_unused char cmd_foobar_help[]' * made sure the long help texts starts uppercase * because cmdtp->name and cmdtp->opts together provide the new usage, all "Usage: foobar" texts have been removed from the long help texts * BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this is nicer in the source code * BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself * made sure no line gets longer than 77 characters * delibertely renamed cmdtp->usage, so that we can get compile-time errors (e.g. in out-of-tree modules that use register_command() * the 'help' command can now always emit the usage, even without compiled long help texts * 'help -v' gives a list of commands with their short description, this is similar like the old "help" command before my patchset * 'help -a' gives out help of all commands Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: group 'help' outputHolger Schurig2014-05-141-0/+1
|/ | | | | | | | | | | | | | | | | | | The old output of "help" was just producing a long list, that usually scrolled of the screen (even on a X11 terminal). This list is more compact, and also sorted by groups. The old output format (plus grouping) is now available with 'help -v'. Example: Information commands: ?, devinfo, help, iomem, meminfo, version Boot commands: boot, bootm, go, loadb, loads, loadx, loady, saves, uimage ... Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move devinfo command to its own fileSascha Hauer2013-09-271-0/+158
Just like nearly all other commands are in individual files. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>