Files
kernel_common_drivers/drivers/efuse_unifykey/normal_key.h
T
wanwei.jiang 17f72adc13 efuse_unifykey: porting efuse_unifykey driver [1/1]
PD#SWPL-69066

Problem:
porting efuse_unifykey driver

Solution:
1. porting efuse_unifykey driver
2. pfn_valid -> pfn_is_map_memory
3. use secmon driver interface in efuse_api.c
4. add <linux/compat.h> for compat_ptr
5. add <crypto/sha256_base.h> for SHA256_DIGEST_SIZE
6. reduce the print level in the probe function

Verify:
s4d

Change-Id: Ia9833a2ad0d0bc0f751624c65ccefd92bdc3276b
Signed-off-by: wanwei.jiang <wanwei.jiang@amlogic.com>
2022-01-04 14:07:33 +08:00

38 lines
878 B
C

/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
/*
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
*/
#ifndef _AML_NORMAL_KEY_H_
#define _AML_NORMAL_KEY_H_
#define MAX_OBJ_NAME_LEN 80
/*Attribute*/
#define OBJ_ATTR_SECURE BIT(0)
#define OBJ_ATTR_OTP BIT(1)
#define OBJ_ATTR_ENC BIT(8)
/* Type */
#define OBJ_TYPE_GENERIC 0xA00000BF
struct storage_object {
char name[MAX_OBJ_NAME_LEN];
u32 namesize;
u32 attribute; /*secure, OTP*/
u32 type; /*AES, RSA, GENERIC, ...*/
u32 datasize;
u8 *dataptr;
u8 hashptr[32];
};
int normalkey_init(void);
void normalkey_deinit(void);
struct storage_object *normalkey_get(const u8 *name);
int normalkey_add(const u8 *name, u8 *buffer, u32 len, u32 attr);
int normalkey_del(const u8 *name);
int normalkey_readfromblock(void *block, unsigned long size);
int normalkey_writetoblock(void *block, unsigned long size);
#endif