mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
17f72adc13
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>
38 lines
878 B
C
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
|