blob: 6a980d6ea6c8dd6259cdd1d0ddfadba901eb99a6 [file] [log] [blame]
TracyMg_Li734d5772023-12-25 11:21:34 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2023, Phytium Technology Co., Ltd.
4 * lixinde <lixinde@phytium.com.cn>
5 * weichangzheng <weichangzheng@phytium.com.cn>
6 */
7
8#include <stdio.h>
9#include <string.h>
10#include <linux/arm-smccc.h>
11#include <init.h>
12#include "cpu.h"
13
14struct common_config {
15 u32 magic;
16 u32 version;
17 u32 size;
18 u8 rev1[4];
19 u64 core_bit_map;
20} __attribute((aligned(4)));
21
22struct common_config const common_base_info = {
23 .magic = PARAMETER_COMMON_MAGIC,
24 .version = 0x1,
25 .core_bit_map = 0x3333,
26};
27
28void sec_init(void)
29{
30 u8 buffer[0x100];
31 struct arm_smccc_res res;
32
33 memcpy(buffer, &common_base_info, sizeof(common_base_info));
34 arm_smccc_smc(CPU_INIT_SEC_SVC, 0, (u64)buffer, 0, 0, 0, 0, 0, &res);
35 if (res.a0 != 0)
36 panic("SEC init failed :0x%lx\n", res.a0);
37}