blob: 00884ebd51c7b4881e34c0c4ef74e62ffc03db97 [file] [log] [blame]
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +00001/*
Carlo Caionee5a30db2019-08-24 17:31:51 +01002 * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <stdint.h>
8
Carlo Caionee5a30db2019-08-24 17:31:51 +01009#include "aml_private.h"
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000010
11#define EFUSE_BASE 0x140
12#define EFUSE_SIZE 0xC0
13
Carlo Caionebed18972019-08-25 17:26:27 +010014uint64_t aml_efuse_read(void *dst, uint32_t offset, uint32_t size)
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000015{
16 if ((uint64_t)(offset + size) > (uint64_t)EFUSE_SIZE)
17 return 0;
18
Carlo Caione7bb83022019-08-28 10:08:24 +010019 return aml_scpi_efuse_read(dst, offset + EFUSE_BASE, size);
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000020}
21
Carlo Caionebed18972019-08-25 17:26:27 +010022uint64_t aml_efuse_user_max(void)
Antonio Nino Diaz7298c1f2018-12-05 00:09:30 +000023{
24 return EFUSE_SIZE;
25}