2011-12-01 20:47:23 +00:00
|
|
|
/*
|
|
|
|
* iomem.c - barebox iomem command
|
|
|
|
*
|
|
|
|
* Copyright (c) 2011 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
|
|
|
|
*
|
|
|
|
* See file CREDITS for list of people who contributed to this
|
|
|
|
* project.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2014-04-07 10:01:20 +00:00
|
|
|
#include <asm/io.h>
|
2011-12-01 20:47:23 +00:00
|
|
|
#include <common.h>
|
|
|
|
#include <command.h>
|
|
|
|
|
|
|
|
static void __print_resources(struct resource *res, int indent)
|
|
|
|
{
|
|
|
|
struct resource *r;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < indent; i++)
|
|
|
|
printf(" ");
|
|
|
|
|
2012-06-25 11:06:03 +00:00
|
|
|
printf(PRINTF_CONVERSION_RESOURCE " - " PRINTF_CONVERSION_RESOURCE
|
2014-04-07 10:01:20 +00:00
|
|
|
" (size " PRINTF_CONVERSION_RESOURCE ") %s\n",
|
|
|
|
res->start, res->end, resource_size(res), res->name);
|
2011-12-01 20:47:23 +00:00
|
|
|
|
|
|
|
list_for_each_entry(r, &res->children, sibling)
|
|
|
|
__print_resources(r, indent + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void print_resources(struct resource *res)
|
|
|
|
{
|
|
|
|
__print_resources(res, 0);
|
|
|
|
}
|
|
|
|
|
2011-12-21 13:18:57 +00:00
|
|
|
static int do_iomem(int argc, char *argv[])
|
2011-12-01 20:47:23 +00:00
|
|
|
{
|
|
|
|
print_resources(&iomem_resource);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
BAREBOX_CMD_START(iomem)
|
|
|
|
.cmd = do_iomem,
|
|
|
|
.usage = "show iomem usage",
|
commands: group 'help' output
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>
2014-05-13 14:14:05 +00:00
|
|
|
BAREBOX_CMD_GROUP(CMD_GRP_INFO)
|
2011-12-01 20:47:23 +00:00
|
|
|
BAREBOX_CMD_END
|
2014-04-07 10:01:20 +00:00
|
|
|
|
|
|
|
#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",
|
commands: group 'help' output
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>
2014-05-13 14:14:05 +00:00
|
|
|
BAREBOX_CMD_GROUP(CMD_GRP_INFO)
|
2014-04-07 10:01:20 +00:00
|
|
|
BAREBOX_CMD_END
|
|
|
|
#endif
|