Bo Lv | 72d0e90 | 2023-01-02 14:27:34 +0000 | [diff] [blame] | 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| 2 | /* |
| 3 | * Copyright (c) 2019 Amlogic, Inc. All rights reserved. |
| 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include <command.h> |
| 8 | #include <asm/arch/oscring.h> |
| 9 | |
| 10 | static int do_ringmsr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
| 11 | { |
| 12 | int index = 0xff; |
| 13 | |
| 14 | if (argc < 2) { |
| 15 | return CMD_RET_USAGE; |
| 16 | } |
| 17 | |
| 18 | if (argc == 2) |
| 19 | index = simple_strtoul(argv[1], NULL, 16); |
| 20 | ring_msr(index); |
| 21 | return 0; |
| 22 | } |
| 23 | |
| 24 | static char ringmsr_help_text[] = |
| 25 | "ringmsr x\n" |
| 26 | " - for get chip ring info\n" |
| 27 | " - x: \n" |
| 28 | " G12A/G12B/TL1:\n" |
| 29 | " 0 : print all ring info and msr ring set voltage \n" |
| 30 | " 1-7: ee9 ee1 ee0 cpu1 cpu0 iddee iddcpu\n" |
| 31 | " ff : print all ring info and msr ring no set voltage"; |
| 32 | |
| 33 | U_BOOT_CMD( |
| 34 | ringmsr, 2, 1, do_ringmsr, |
| 35 | "Amlogic measure ring", |
| 36 | ringmsr_help_text |
| 37 | ); |