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+
12 asm(".arch_extension sec\n\t");
14 static int mon_install(u32 addr, u32 dpsc, u32 freq)
18 __asm__ __volatile__ (
26 : "r" (addr), "r" (dpsc), "r" (freq)
27 : "cc", "r0", "r1", "r2", "memory");
31 static int do_mon_install(cmd_tbl_t *cmdtp, int flag, int argc,
34 u32 addr, dpsc_base = 0x1E80000, freq;
40 freq = CONFIG_SYS_HZ_CLOCK;
42 addr = simple_strtoul(argv[1], NULL, 16);
44 rcode = mon_install(addr, dpsc_base, freq);
45 printf("## installed monitor, freq [%d], status %d\n",
51 U_BOOT_CMD(mon_install, 2, 0, do_mon_install,
52 "Install boot kernel at 'addr'",
56 static void core_spin(void)
67 int mon_power_on(int core_id, void *ep)
79 : "r" (core_id), "r" (ep)
80 : "cc", "r0", "r1", "r2", "memory");
84 int mon_power_off(int core_id)
96 : "cc", "r0", "r1", "memory");
100 int do_mon_power(cmd_tbl_t *cmdtp, int flag, int argc,
103 int rcode = 0, core_id, on;
109 return CMD_RET_USAGE;
111 core_id = simple_strtoul(argv[1], NULL, 16);
112 on = simple_strtoul(argv[2], NULL, 16);
115 rcode = mon_power_on(core_id, fn);
117 rcode = mon_power_off(core_id);
121 printf("core %d powered on successfully\n", core_id);
123 printf("core %d power on failure\n", core_id);
125 printf("core %d powered off successfully\n", core_id);
131 U_BOOT_CMD(mon_power, 3, 0, do_mon_power,
132 "Power On/Off secondary core",
133 "mon_power <coreid> <oper>\n"
134 "- coreid (1-3) and oper (1 - ON, 0 - OFF)\n"