summaryrefslogtreecommitdiffstats
path: root/commands/devinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'commands/devinfo.c')
-rw-r--r--commands/devinfo.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/commands/devinfo.c b/commands/devinfo.c
index cd69d2e5f8..6001b00cfa 100644
--- a/commands/devinfo.c
+++ b/commands/devinfo.c
@@ -1,26 +1,14 @@
-/*
- * Copyright (C) 2013 Sascha Hauer, Pengutronix
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+// SPDX-FileCopyrightText: © 2013 Sascha Hauer, Pengutronix
#include <command.h>
#include <common.h>
#include <complete.h>
#include <driver.h>
-static int do_devinfo_subtree(struct device_d *dev, int depth)
+static int do_devinfo_subtree(struct device *dev, int depth)
{
- struct device_d *child;
+ struct device *child;
struct cdev *cdev, *cdevl;
int i;
@@ -58,7 +46,7 @@ static int do_devinfo_subtree(struct device_d *dev, int depth)
static int do_devinfo(int argc, char *argv[])
{
- struct device_d *dev;
+ struct device *dev;
struct param_d *param;
int i;
int first;
@@ -97,6 +85,9 @@ static int do_devinfo(int argc, char *argv[])
if (dev->info)
dev->info(dev);
+ if (dev->parent && (!dev->bus || dev->bus->dev != dev->parent))
+ printf("Parent: %s\n", dev_name(dev->parent));
+
first = true;
list_for_each_entry(param, &dev->parameters, list) {
if (first) {
@@ -111,9 +102,22 @@ static int do_devinfo(int argc, char *argv[])
printf("\n");
}
#ifdef CONFIG_OFDEVICE
- if (dev->device_node) {
- printf("Device node: %s\n", dev->device_node->full_name);
- of_print_nodes(dev->device_node, 0);
+ if (dev->of_node) {
+ struct device *main_dev = dev->of_node->dev;
+
+ printf("DMA Coherent: %s%s\n",
+ dev_is_dma_coherent(dev) ? "true" : "false",
+ dev->dma_coherent == DEV_DMA_COHERENCE_DEFAULT ? " (default)" : "");
+
+ printf("Device node: %pOF", dev->of_node);
+ if (!main_dev) {
+ printf(" (unpopulated)\n");
+ } else if (main_dev != dev) {
+ printf(" (populated by %s)\n", dev_name(main_dev));
+ } else {
+ printf("\n");
+ of_print_nodes(dev->of_node, 0, ~0);
+ }
}
#endif
}