blob: 65f4adeb8592fdce965451d5fbc48ce8f628ce15 [file] [log] [blame]
bangzheng.liuacb070d2024-01-15 14:05:04 +08001// 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
11static int do_remapset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
12{
13 int ret = 0;
14 int dspid = 0;
bangzheng.liu9b285102024-06-11 15:30:27 +080015 int id = 0;
bangzheng.liuacb070d2024-01-15 14:05:04 +080016 int addr_0 = 0;
17 int addr_1 = 0;
18 int reg_sel = 0;
19
20 dspid = simple_strtoul(argv[1], NULL, 16);
21 addr_0 = simple_strtoul(argv[2], NULL, 16);
22 addr_1 = simple_strtoul(argv[3], NULL, 16);
23 reg_sel = simple_strtoul(argv[4], NULL, 16);
24
bangzheng.liu9b285102024-06-11 15:30:27 +080025 id = PACK_SMC_SUBID_ID(HIFI_DSP_REMAP, dspid);
26 remap_set(id, addr_0, addr_1, reg_sel);
bangzheng.liuacb070d2024-01-15 14:05:04 +080027
28 return ret;
29}
30
31U_BOOT_CMD(
32 remapset, 5, 1, do_remapset,
33 "do_remapset the address will be mapped",
34 "\narg[0]: cmd\n"
35 "arg[1]: dspid \n"
36 "arg[2]: load address!\n"
37 "arg[3]: target address!\n"
38 "arg[4]: register type select: 0: 16-bit 1: 18-bit 2: 20-bit !\n"
39);
40