Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 1 | /* |
Arthur Cassegrain | 97d4d81 | 2021-11-26 16:39:12 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2022, ARM Limited and Contributors. All rights reserved. |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 7 | #ifndef HIKEY960_PRIVATE_H |
| 8 | #define HIKEY960_PRIVATE_H |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 9 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 10 | #include <common/bl_common.h> |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 11 | |
Arthur Cassegrain | 97d4d81 | 2021-11-26 16:39:12 +0100 | [diff] [blame] | 12 | /* Fastboot serial number */ |
| 13 | #define HIKEY960_SERIAL_NUMBER_LBA (UFS_BASE + 20) |
| 14 | #define HIKEY960_SERIAL_NUMBER_SIZE 16 |
| 15 | |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 16 | /* |
| 17 | * Function and variable prototypes |
| 18 | */ |
| 19 | void hikey960_init_mmu_el1(unsigned long total_base, |
| 20 | unsigned long total_size, |
| 21 | unsigned long ro_start, |
| 22 | unsigned long ro_limit, |
| 23 | unsigned long coh_start, |
| 24 | unsigned long coh_limit); |
| 25 | void hikey960_init_mmu_el3(unsigned long total_base, |
| 26 | unsigned long total_size, |
| 27 | unsigned long ro_start, |
| 28 | unsigned long ro_limit, |
| 29 | unsigned long coh_start, |
| 30 | unsigned long coh_limit); |
| 31 | void hikey960_io_setup(void); |
| 32 | int hikey960_read_boardid(unsigned int *id); |
Haojian Zhuang | 32052ab | 2019-09-14 18:43:51 +0800 | [diff] [blame] | 33 | int hikey960_set_fip_addr(unsigned int image_id, const char *name); |
Arthur Cassegrain | 97d4d81 | 2021-11-26 16:39:12 +0100 | [diff] [blame] | 34 | int hikey960_load_serialno(uint64_t *serno); |
Haojian Zhuang | d82e29d | 2018-03-05 13:20:33 +0800 | [diff] [blame] | 35 | void hikey960_clk_init(void); |
| 36 | void hikey960_pmu_init(void); |
| 37 | void hikey960_regulator_enable(void); |
| 38 | void hikey960_tzc_init(void); |
| 39 | void hikey960_peri_init(void); |
| 40 | void hikey960_pinmux_init(void); |
Kaihua Zhong | 39ff2ee | 2018-07-16 17:33:48 +0800 | [diff] [blame] | 41 | void hikey960_gpio_init(void); |
Haojian Zhuang | 1b5c225 | 2017-06-01 15:20:46 +0800 | [diff] [blame] | 42 | void set_retention_ticks(unsigned int val); |
| 43 | void clr_retention_ticks(unsigned int val); |
| 44 | void clr_ex(void); |
| 45 | void nop(void); |
Haojian Zhuang | 602362d | 2017-06-01 12:15:14 +0800 | [diff] [blame] | 46 | |
Arthur Cassegrain | 97d4d81 | 2021-11-26 16:39:12 +0100 | [diff] [blame] | 47 | /******************************************************************************* |
| 48 | * Struct for parameters received from BL2 |
| 49 | ******************************************************************************/ |
| 50 | typedef struct plat_params_from_bl2 { |
| 51 | /* Fastboot serial number gathered from UFS */ |
| 52 | uint64_t fastboot_serno; |
| 53 | } plat_params_from_bl2_t; |
| 54 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 55 | #endif /* HIKEY960_PRIVATE_H */ |