xref: /aosp_15_r20/external/arm-trusted-firmware/plat/amlogic/common/aml_efuse.c (revision 54fd6939e177f8ff529b10183254802c76df6d08)
1*54fd6939SJiyong Park /*
2*54fd6939SJiyong Park  * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
3*54fd6939SJiyong Park  *
4*54fd6939SJiyong Park  * SPDX-License-Identifier: BSD-3-Clause
5*54fd6939SJiyong Park  */
6*54fd6939SJiyong Park 
7*54fd6939SJiyong Park #include <stdint.h>
8*54fd6939SJiyong Park 
9*54fd6939SJiyong Park #include "aml_private.h"
10*54fd6939SJiyong Park 
11*54fd6939SJiyong Park #define EFUSE_BASE	0x140
12*54fd6939SJiyong Park #define EFUSE_SIZE	0xC0
13*54fd6939SJiyong Park 
aml_efuse_read(void * dst,uint32_t offset,uint32_t size)14*54fd6939SJiyong Park uint64_t aml_efuse_read(void *dst, uint32_t offset, uint32_t size)
15*54fd6939SJiyong Park {
16*54fd6939SJiyong Park 	if ((uint64_t)(offset + size) > (uint64_t)EFUSE_SIZE)
17*54fd6939SJiyong Park 		return 0;
18*54fd6939SJiyong Park 
19*54fd6939SJiyong Park 	return aml_scpi_efuse_read(dst, offset + EFUSE_BASE, size);
20*54fd6939SJiyong Park }
21*54fd6939SJiyong Park 
aml_efuse_user_max(void)22*54fd6939SJiyong Park uint64_t aml_efuse_user_max(void)
23*54fd6939SJiyong Park {
24*54fd6939SJiyong Park 	return EFUSE_SIZE;
25*54fd6939SJiyong Park }
26