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 = clk_get_rate(sys_clk0_6_clk);
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)
62
int mon_power_on(int core_id, void *ep)
74
: "r" (core_id), "r" (ep)
75
: "cc", "r0", "r1", "r2", "memory");
79
int mon_power_off(int core_id)
91
: "cc", "r0", "r1", "memory");
95
int do_mon_power(cmd_tbl_t *cmdtp, int flag, int argc,
98
int rcode = 0, core_id, on;
104
return CMD_RET_USAGE;
106
core_id = simple_strtoul(argv[1], NULL, 16);
107
on = simple_strtoul(argv[2], NULL, 16);
110
rcode = mon_power_on(core_id, fn);
112
rcode = mon_power_off(core_id);
116
printf("core %d powered on successfully\n", core_id);
118
printf("core %d power on failure\n", core_id);
120
printf("core %d powered off successfully\n", core_id);
126
U_BOOT_CMD(mon_power, 3, 0, do_mon_power,
127
"Power On/Off secondary core",
128
"mon_power <coreid> <oper>\n"
129
"- coreid (1-3) and oper (1 - ON, 0 - OFF)\n"