WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
security_unified_porting.h
浏览该文件的文档.
1
8#ifndef SECURITY_UNIFIED_PORTING_H
9#define SECURITY_UNIFIED_PORTING_H
10
11/* Timer. */
12#define crypto_udelay(us) uapi_tcxo_delay_us(us)
13#define crypto_msleep(ms) uapi_tcxo_delay_ms(ms)
14
15/* Register Base Addr. */
16#define SEC_SUBSYS_BASE_ADDR 0x44100000
17
18#define KM_REG_BASE_ADDR (SEC_SUBSYS_BASE_ADDR + 0x12000)
19#define KM_REG_SIZE (0x2000)
20
21#define PKE_REG_BASE_ADDR (SEC_SUBSYS_BASE_ADDR + 0x10000)
22#define PKE_REG_SIZE (0x2000)
23
24#define TRNG_REG_BASE_ADDR (SEC_SUBSYS_BASE_ADDR + 0x14000)
25#define TRNG_REG_SIZE (0x1000)
26
27#define SPACC_REG_BASE_ADDR (SEC_SUBSYS_BASE_ADDR)
28#define SPACC_REG_SIZE (0x10000)
29
30#define FAPC_REG_BASE_ADDR (0x48000000)
31#define FAPC_REG_SIZE (0x2000)
32
33/* define micro related to memory pool. */
34#define MAX_PROCESS_NUM 1
35#define CRYPTO_HASH_VIRT_CHN_NUM 4
36#define CRYPTO_SYMC_VIRT_CHN_NUM 4
37
38/* symc hard channel num. */
39#define CRYPTO_SYMC_HARD_CHANNEL_MAX 3
40#define CRYPTO_SYMC_HARD_CHANNEL_MASK (0xFFFE)
41
42/* hash hard channel num. */
43#define CRYPTO_HASH_HARD_CHN_CNT 3
44#define CRYPTO_HASH_HARD_CHN_MASK (0xFFFE)
45
46#define CRYPTO_DRV_DMA_SIZE (128)
47#define CRYPTO_DRV_AAD_SIZE (128)
48#define CRYPTO_HASH_DRV_BUFFER_SIZE (256)
49
50/* Define the time out us */
51#define PKE_TIME_OUT_US 10000000
52#define PKE_MAX_TIMES 3000
53
54#define HASH_TIME_OUT_US 10000000
55#define CRYPTO_HAL_HASH_CALC_TIMEOUT 6000
56
57#define CRYPTO_SYMC_CLEAR_TIMEOUT 6000
58#define CRYPTO_SYMC_WAIT_TIMEOUT 6000
59
60#define KSLOT_TIMEOUT 1000000
61#define HKL_LOCK_TIMEOUT 10000
62#define KLAD_CLR_ROUTE_TIMEOUT 1000000
63#define KLAD_COM_ROUTE_TIMEOUT 1000000
64#define RKP_LOCK_TIMEOUT_IN_US 1000000
65#define RKP_WAIT_TIMEOUT_IN_US 1000000
66
67/* PKE related defines */
68/* define PKE rom lib related register micro. */
69#ifdef DEBUG_IN_RAM
70#define PKE_ROM_LIB_START_ADDR ((uintptr_t)g_instr_rom) /* the instr start address */
71#else
72#define PKE_ROM_LIB_START_ADDR (0xc00000) /* the instr start address */
73#endif
74#define PKE_ROM_LIB_INVALID_ADDR 0xFFFFFFFF
75#define ROM_LIB_INSTR_NUM 646 /* define the instr number, that put in the ROM. */
76
77/* for romable code patch */
78#ifdef CRYPTO_ROM_ENABLE
79#define CRYPTO_STATIC
80#else
81#define CRYPTO_STATIC static
82#endif
83
84#endif