2 * K2HK: secure kernel command file
4 * (C) Copyright 2012-2014
5 * Texas Instruments Incorporated, <www.ti.com>
7 * SPDX-License-Identifier: GPL-2.0+
14 asm(".arch_extension sec\n\t");
16 static int do_mon_install(cmd_tbl_t *cmdtp, int flag, int argc,
19 u32 addr, dpsc_base = 0x1E80000, freq, load_addr, size;
21 struct image_header *header;
26 freq = CONFIG_SYS_HZ_CLOCK;
28 addr = simple_strtoul(argv[1], NULL, 16);
30 header = (struct image_header *)addr;
32 if (image_get_magic(header) != IH_MAGIC) {
33 printf("## Please update monitor image\n");
37 load_addr = image_get_load(header);
38 size = image_get_data_size(header);
39 memcpy((void *)load_addr, (void *)(addr + sizeof(struct image_header)),
42 rcode = mon_install(load_addr, dpsc_base, freq);
43 printf("## installed monitor @ 0x%x, freq [%d], status %d\n",
44 load_addr, freq, rcode);
49 U_BOOT_CMD(mon_install, 2, 0, do_mon_install,
50 "Install boot kernel at 'addr'",
54 static void core_spin(void)
65 int do_mon_power(cmd_tbl_t *cmdtp, int flag, int argc,
68 int rcode = 0, core_id, on;
76 core_id = simple_strtoul(argv[1], NULL, 16);
77 on = simple_strtoul(argv[2], NULL, 16);
80 rcode = mon_power_on(core_id, fn);
82 rcode = mon_power_off(core_id);
86 printf("core %d powered on successfully\n", core_id);
88 printf("core %d power on failure\n", core_id);
90 printf("core %d powered off successfully\n", core_id);
96 U_BOOT_CMD(mon_power, 3, 0, do_mon_power,
97 "Power On/Off secondary core",
98 "mon_power <coreid> <oper>\n"
99 "- coreid (1-3) and oper (1 - ON, 0 - OFF)\n"