2 * Copyright (c) 2012 The Chromium OS Authors.
4 * SPDX-License-Identifier: GPL-2.0+
8 * IO space access commands.
19 * iod{.b, .w, .l} {addr}
21 int do_io_iod(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
29 size = cmd_get_data_size(argv[0], 4);
33 addr = simple_strtoul(argv[1], NULL, 16);
35 printf("%04x: ", (u16) addr);
38 printf("%08x\n", inl(addr));
40 printf("%04x\n", inw(addr));
42 printf("%02x\n", inb(addr));
47 int do_io_iow(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
55 size = cmd_get_data_size(argv[0], 4);
59 addr = simple_strtoul(argv[1], NULL, 16);
60 val = simple_strtoul(argv[2], NULL, 16);
63 outl((u32) val, addr);
65 outw((u16) val, addr);
72 /**************************************************/
73 U_BOOT_CMD(iod, 2, 0, do_io_iod,
74 "IO space display", "[.b, .w, .l] address");
76 U_BOOT_CMD(iow, 3, 0, do_io_iow,
78 "[.b, .w, .l] address value");