Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 1 | /* |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 2 | * Copyright (C) 2014-2015 Masahiro Yamada <yamada.masahiro@socionext.com> |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Masahiro Yamada | efdf340 | 2016-01-09 01:51:13 +0900 | [diff] [blame] | 8 | |
| 9 | #include "../sbc/sbc-regs.h" |
| 10 | #include "../soc-info.h" |
| 11 | #include "boot-device.h" |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 12 | |
| 13 | static int do_pinmon(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
| 14 | { |
Masahiro Yamada | c8e356d | 2014-12-19 20:20:54 +0900 | [diff] [blame] | 15 | printf("Boot Swap: %s\n\n", boot_is_swapped() ? "ON" : "OFF"); |
| 16 | |
Masahiro Yamada | 3164905 | 2017-01-21 18:05:26 +0900 | [diff] [blame^] | 17 | switch (uniphier_get_soc_id()) { |
Masahiro Yamada | 53c59ae | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 18 | #if defined(CONFIG_ARCH_UNIPHIER_SLD3) |
Masahiro Yamada | 3164905 | 2017-01-21 18:05:26 +0900 | [diff] [blame^] | 19 | case UNIPHIER_SLD3_ID: |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 20 | uniphier_sld3_boot_mode_show(); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 21 | break; |
| 22 | #endif |
Masahiro Yamada | 53c59ae | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 23 | #if defined(CONFIG_ARCH_UNIPHIER_LD4) || defined(CONFIG_ARCH_UNIPHIER_PRO4) || \ |
| 24 | defined(CONFIG_ARCH_UNIPHIER_SLD8) |
Masahiro Yamada | 3164905 | 2017-01-21 18:05:26 +0900 | [diff] [blame^] | 25 | case UNIPHIER_LD4_ID: |
| 26 | case UNIPHIER_PRO4_ID: |
| 27 | case UNIPHIER_SLD8_ID: |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 28 | uniphier_ld4_boot_mode_show(); |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 29 | break; |
| 30 | #endif |
Masahiro Yamada | 53c59ae | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 31 | #if defined(CONFIG_ARCH_UNIPHIER_PRO5) |
Masahiro Yamada | 3164905 | 2017-01-21 18:05:26 +0900 | [diff] [blame^] | 32 | case UNIPHIER_PRO5_ID: |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 33 | uniphier_pro5_boot_mode_show(); |
Masahiro Yamada | d5167d5 | 2015-09-22 00:27:40 +0900 | [diff] [blame] | 34 | break; |
| 35 | #endif |
Masahiro Yamada | 53c59ae | 2016-03-18 16:41:43 +0900 | [diff] [blame] | 36 | #if defined(CONFIG_ARCH_UNIPHIER_PXS2) || defined(CONFIG_ARCH_UNIPHIER_LD6B) |
Masahiro Yamada | 3164905 | 2017-01-21 18:05:26 +0900 | [diff] [blame^] | 37 | case UNIPHIER_PXS2_ID: |
| 38 | case UNIPHIER_LD6B_ID: |
Masahiro Yamada | 9890569 | 2016-03-30 20:17:02 +0900 | [diff] [blame] | 39 | uniphier_pxs2_boot_mode_show(); |
Masahiro Yamada | 1fe65d3 | 2015-09-22 00:27:41 +0900 | [diff] [blame] | 40 | break; |
| 41 | #endif |
Masahiro Yamada | 8bbbcbd | 2016-05-24 21:14:01 +0900 | [diff] [blame] | 42 | #if defined(CONFIG_ARCH_UNIPHIER_LD11) || defined(CONFIG_ARCH_UNIPHIER_LD20) |
Masahiro Yamada | 3164905 | 2017-01-21 18:05:26 +0900 | [diff] [blame^] | 43 | case UNIPHIER_LD11_ID: |
| 44 | case UNIPHIER_LD20_ID: |
Masahiro Yamada | 063eb1e | 2016-04-21 14:43:18 +0900 | [diff] [blame] | 45 | uniphier_ld20_boot_mode_show(); |
| 46 | break; |
| 47 | #endif |
Masahiro Yamada | 75f16f8 | 2015-09-22 00:27:39 +0900 | [diff] [blame] | 48 | default: |
| 49 | break; |
| 50 | } |
Masahiro Yamada | bb2ff9d | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 51 | |
| 52 | return 0; |
| 53 | } |
| 54 | |
| 55 | U_BOOT_CMD( |
| 56 | pinmon, 1, 1, do_pinmon, |
| 57 | "pin monitor", |
| 58 | "" |
| 59 | ); |