summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-05-05 11:05:51 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-05-05 11:05:51 +0200
commitf8327af20c1c2988b0d9909f403780e31cc6b59e (patch)
tree80eb52cc1160e577646e136ad9e3e4638aac5559 /commands
parentb568687bc3c48edd814c4b4546d049d859c8cc3f (diff)
parent9f556d4b6fc71d548e5c984c416f4f1b7d599d2f (diff)
downloadbarebox-f8327af20c1c2988b0d9909f403780e31cc6b59e.tar.gz
barebox-f8327af20c1c2988b0d9909f403780e31cc6b59e.tar.xz
Merge branch 'for-next/ioresource'
Diffstat (limited to 'commands')
-rw-r--r--commands/Kconfig6
-rw-r--r--commands/Makefile2
-rw-r--r--commands/iomemport.c (renamed from commands/iomem.c)19
3 files changed, 21 insertions, 6 deletions
diff --git a/commands/Kconfig b/commands/Kconfig
index cc014f30ac..ced2edb71b 100644
--- a/commands/Kconfig
+++ b/commands/Kconfig
@@ -309,10 +309,10 @@ config CMD_MEMINFO
config CMD_IOMEM
tristate
- prompt "iomem"
+ prompt "iomem/ioport"
help
- Show information about iomem usage. Pendant to 'cat /proc/iomem'
- under Linux.
+ Show information about iomem/ioport usage. Pendant to
+ 'cat /proc/iomem' and 'cat /proc/ioports' under Linux.
config CMD_MEMORY
bool
diff --git a/commands/Makefile b/commands/Makefile
index e463031455..dded48f915 100644
--- a/commands/Makefile
+++ b/commands/Makefile
@@ -76,7 +76,7 @@ obj-$(CONFIG_CMD_OFTREE) += oftree.o
obj-$(CONFIG_CMD_OF_PROPERTY) += of_property.o
obj-$(CONFIG_CMD_OF_NODE) += of_node.o
obj-$(CONFIG_CMD_MAGICVAR) += magicvar.o
-obj-$(CONFIG_CMD_IOMEM) += iomem.o
+obj-$(CONFIG_CMD_IOMEM) += iomemport.o
obj-$(CONFIG_CMD_LINUX_EXEC) += linux_exec.o
obj-$(CONFIG_CMD_AUTOMOUNT) += automount.o
obj-$(CONFIG_CMD_GLOBAL) += global.o
diff --git a/commands/iomem.c b/commands/iomemport.c
index e117c2a9f6..652708c9cd 100644
--- a/commands/iomem.c
+++ b/commands/iomemport.c
@@ -15,6 +15,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
+#include <asm/io.h>
#include <common.h>
#include <command.h>
@@ -27,8 +28,8 @@ static void __print_resources(struct resource *res, int indent)
printf(" ");
printf(PRINTF_CONVERSION_RESOURCE " - " PRINTF_CONVERSION_RESOURCE
- " (size " PRINTF_CONVERSION_RESOURCE ") %s\n", res->start,
- res->end, resource_size(res), res->name);
+ " (size " PRINTF_CONVERSION_RESOURCE ") %s\n",
+ res->start, res->end, resource_size(res), res->name);
list_for_each_entry(r, &res->children, sibling)
__print_resources(r, indent + 1);
@@ -50,3 +51,17 @@ BAREBOX_CMD_START(iomem)
.cmd = do_iomem,
.usage = "show iomem usage",
BAREBOX_CMD_END
+
+#if IO_SPACE_LIMIT > 0
+static int do_ioport(int argc, char *argv[])
+{
+ print_resources(&ioport_resource);
+
+ return 0;
+}
+
+BAREBOX_CMD_START(ioport)
+ .cmd = do_ioport,
+ .usage = "show ioport usage",
+BAREBOX_CMD_END
+#endif