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> |
| 9 | #include <asm/arch/boot-device.h> |
Masahiro Yamada | c8e356d | 2014-12-19 20:20:54 +0900 | [diff] [blame] | 10 | #include <asm/arch/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 | { |
| 14 | struct boot_device_info *table; |
| 15 | u32 mode_sel, n = 0; |
| 16 | |
| 17 | mode_sel = get_boot_mode_sel(); |
| 18 | |
Masahiro Yamada | c8e356d | 2014-12-19 20:20:54 +0900 | [diff] [blame] | 19 | printf("Boot Swap: %s\n\n", boot_is_swapped() ? "ON" : "OFF"); |
| 20 | |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 21 | puts("Boot Mode Pin:\n"); |
| 22 | |
| 23 | for (table = boot_device_table; strlen(table->info); table++) { |
| 24 | printf(" %c %02x %s\n", n == mode_sel ? '*' : ' ', n, |
| 25 | table->info); |
| 26 | n++; |
| 27 | } |
| 28 | |
| 29 | return 0; |
| 30 | } |
| 31 | |
| 32 | U_BOOT_CMD( |
| 33 | pinmon, 1, 1, do_pinmon, |
| 34 | "pin monitor", |
| 35 | "" |
| 36 | ); |