Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 1 | /* |
| 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> |
Masahiro Yamada | 95387e2 | 2015-02-27 02:26:44 +0900 | [diff] [blame] | 9 | #include <mach/boot-device.h> |
| 10 | #include <mach/sbc-regs.h> |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 11 | |
| 12 | static int do_pinmon(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
| 13 | { |
Masahiro Yamada | b2bff68 | 2015-02-05 20:56:23 +0900 | [diff] [blame] | 14 | int mode_sel, i; |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 15 | |
Masahiro Yamada | c8e356d | 2014-12-19 20:20:54 +0900 | [diff] [blame] | 16 | printf("Boot Swap: %s\n\n", boot_is_swapped() ? "ON" : "OFF"); |
| 17 | |
Masahiro Yamada | b2bff68 | 2015-02-05 20:56:23 +0900 | [diff] [blame] | 18 | mode_sel = get_boot_mode_sel(); |
| 19 | |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 20 | puts("Boot Mode Pin:\n"); |
| 21 | |
Masahiro Yamada | e3cfe8c | 2015-02-05 20:56:24 +0900 | [diff] [blame] | 22 | for (i = 0; boot_device_table[i].info; i++) |
Masahiro Yamada | b2bff68 | 2015-02-05 20:56:23 +0900 | [diff] [blame] | 23 | printf(" %c %02x %s\n", i == mode_sel ? '*' : ' ', i, |
| 24 | boot_device_table[i].info); |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 25 | |
| 26 | return 0; |
| 27 | } |
| 28 | |
| 29 | U_BOOT_CMD( |
| 30 | pinmon, 1, 1, do_pinmon, |
| 31 | "pin monitor", |
| 32 | "" |
| 33 | ); |