blob: 3c1b32597646b94a8c7f20be000a4feaff3eb750 [file] [log] [blame]
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +09001/*
2 * Copyright (C) 2014 Panasonic Corporation
3 * Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#include <common.h>
9#include <asm/arch/boot-device.h>
Masahiro Yamadac8e356d2014-12-19 20:20:54 +090010#include <asm/arch/sbc-regs.h>
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090011
12static int do_pinmon(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
13{
Masahiro Yamadab2bff682015-02-05 20:56:23 +090014 int mode_sel, i;
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090015
Masahiro Yamadac8e356d2014-12-19 20:20:54 +090016 printf("Boot Swap: %s\n\n", boot_is_swapped() ? "ON" : "OFF");
17
Masahiro Yamadab2bff682015-02-05 20:56:23 +090018 mode_sel = get_boot_mode_sel();
19
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090020 puts("Boot Mode Pin:\n");
21
Masahiro Yamadae3cfe8c2015-02-05 20:56:24 +090022 for (i = 0; boot_device_table[i].info; i++)
Masahiro Yamadab2bff682015-02-05 20:56:23 +090023 printf(" %c %02x %s\n", i == mode_sel ? '*' : ' ', i,
24 boot_device_table[i].info);
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090025
26 return 0;
27}
28
29U_BOOT_CMD(
30 pinmon, 1, 1, do_pinmon,
31 "pin monitor",
32 ""
33);