diff options
author | Michel Stam <m.stam@fugro.nl> | 2014-04-07 12:01:20 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-04-08 08:17:55 +0200 |
commit | 4d94f56c6c5ba00d35d6b3e3a1862439b2ced3f0 (patch) | |
tree | b3efb2fad02e4abe18ca0d0baefee5ebae6a3875 /commands | |
parent | 0a5529d0edcd8c00a679c485f7266548851c6948 (diff) | |
download | barebox-4d94f56c6c5ba00d35d6b3e3a1862439b2ced3f0.tar.gz barebox-4d94f56c6c5ba00d35d6b3e3a1862439b2ced3f0.tar.xz |
common: Allow for I/O mapped I/O
Rework the current framework so that I/O mapped I/O resources are
also possible.
Signed-off-by: Michel Stam <michel@reverze.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/Kconfig | 6 | ||||
-rw-r--r-- | commands/Makefile | 2 | ||||
-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 |