bangzheng.liu | acb070d | 2024-01-15 14:05:04 +0800 | [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/amlogic/arch/bl31_apis.h> |
| 9 | #include <serial.h> |
| 10 | |
| 11 | static int do_remapset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
| 12 | { |
| 13 | int ret = 0; |
| 14 | int dspid = 0; |
| 15 | int addr_0 = 0; |
| 16 | int addr_1 = 0; |
| 17 | int reg_sel = 0; |
| 18 | |
| 19 | dspid = simple_strtoul(argv[1], NULL, 16); |
| 20 | addr_0 = simple_strtoul(argv[2], NULL, 16); |
| 21 | addr_1 = simple_strtoul(argv[3], NULL, 16); |
| 22 | reg_sel = simple_strtoul(argv[4], NULL, 16); |
| 23 | |
| 24 | remap_set(dspid, addr_0, addr_1, reg_sel); |
| 25 | |
| 26 | return ret; |
| 27 | } |
| 28 | |
| 29 | U_BOOT_CMD( |
| 30 | remapset, 5, 1, do_remapset, |
| 31 | "do_remapset the address will be mapped", |
| 32 | "\narg[0]: cmd\n" |
| 33 | "arg[1]: dspid \n" |
| 34 | "arg[2]: load address!\n" |
| 35 | "arg[3]: target address!\n" |
| 36 | "arg[4]: register type select: 0: 16-bit 1: 18-bit 2: 20-bit !\n" |
| 37 | ); |
| 38 | |