Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 1 | /* |
Carlo Caione | e5a30db | 2019-08-24 17:31:51 +0100 | [diff] [blame] | 2 | * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <stdint.h> |
| 8 | |
Carlo Caione | e5a30db | 2019-08-24 17:31:51 +0100 | [diff] [blame] | 9 | #include "aml_private.h" |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 10 | |
| 11 | #define EFUSE_BASE 0x140 |
| 12 | #define EFUSE_SIZE 0xC0 |
| 13 | |
Carlo Caione | bed1897 | 2019-08-25 17:26:27 +0100 | [diff] [blame] | 14 | uint64_t aml_efuse_read(void *dst, uint32_t offset, uint32_t size) |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 15 | { |
| 16 | if ((uint64_t)(offset + size) > (uint64_t)EFUSE_SIZE) |
| 17 | return 0; |
| 18 | |
Carlo Caione | 7bb8302 | 2019-08-28 10:08:24 +0100 | [diff] [blame] | 19 | return aml_scpi_efuse_read(dst, offset + EFUSE_BASE, size); |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 20 | } |
| 21 | |
Carlo Caione | bed1897 | 2019-08-25 17:26:27 +0100 | [diff] [blame] | 22 | uint64_t aml_efuse_user_max(void) |
Antonio Nino Diaz | 7298c1f | 2018-12-05 00:09:30 +0000 | [diff] [blame] | 23 | { |
| 24 | return EFUSE_SIZE; |
| 25 | } |