Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. |
| 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 HIKEY_PRIVATE_H |
| 8 | #define HIKEY_PRIVATE_H |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +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 | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 11 | |
| 12 | #define RANDOM_MAX 0x7fffffffffffffff |
| 13 | #define RANDOM_MAGIC 0x9a4dbeaf |
| 14 | |
Haojian Zhuang | e18de67 | 2018-04-11 19:05:32 +0800 | [diff] [blame] | 15 | enum { |
| 16 | DDR_FREQ_150M = 150 * 1000, |
| 17 | DDR_FREQ_266M = 266 * 1000, |
| 18 | DDR_FREQ_400M = 400 * 1000, |
| 19 | DDR_FREQ_533M = 533 * 1000, |
| 20 | DDR_FREQ_800M = 800 * 1000 |
| 21 | }; |
| 22 | |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 23 | struct random_serial_num { |
| 24 | uint64_t magic; |
| 25 | uint64_t data; |
| 26 | char serialno[32]; |
| 27 | }; |
| 28 | |
| 29 | /* |
| 30 | * Function and variable prototypes |
| 31 | */ |
| 32 | void hikey_init_mmu_el1(unsigned long total_base, |
| 33 | unsigned long total_size, |
| 34 | unsigned long ro_start, |
| 35 | unsigned long ro_limit, |
| 36 | unsigned long coh_start, |
| 37 | unsigned long coh_limit); |
| 38 | void hikey_init_mmu_el3(unsigned long total_base, |
| 39 | unsigned long total_size, |
| 40 | unsigned long ro_start, |
| 41 | unsigned long ro_limit, |
| 42 | unsigned long coh_start, |
| 43 | unsigned long coh_limit); |
| 44 | |
Haojian Zhuang | e18de67 | 2018-04-11 19:05:32 +0800 | [diff] [blame] | 45 | void hikey_ddr_init(unsigned int ddr_freq); |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 46 | void hikey_io_setup(void); |
| 47 | |
Haojian Zhuang | 590188a | 2018-03-05 13:03:53 +0800 | [diff] [blame] | 48 | void hikey_sp804_init(void); |
| 49 | void hikey_gpio_init(void); |
| 50 | void hikey_pmussi_init(void); |
| 51 | void hikey_hi6553_init(void); |
| 52 | void init_mmc0_pll(void); |
| 53 | void reset_mmc0_clk(void); |
| 54 | void init_media_clk(void); |
| 55 | void init_mmc1_pll(void); |
| 56 | void reset_mmc1_clk(void); |
| 57 | void hikey_mmc_pll_init(void); |
| 58 | void hikey_rtc_init(void); |
| 59 | |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 60 | int hikey_get_partition_size(const char *arg, int left, char *response); |
| 61 | int hikey_get_partition_type(const char *arg, int left, char *response); |
| 62 | |
| 63 | int hikey_erase(const char *arg); |
| 64 | int hikey_flash(const char *arg); |
| 65 | int hikey_oem(const char *arg); |
| 66 | int hikey_reboot(const char *arg); |
Jerome Forissier | c52e55f | 2015-05-04 09:40:03 +0200 | [diff] [blame] | 67 | void hikey_security_setup(void); |
Haojian Zhuang | 5f281b3 | 2017-05-24 08:45:05 +0800 | [diff] [blame] | 68 | |
| 69 | const char *hikey_init_serialno(void); |
| 70 | int hikey_read_serialno(struct random_serial_num *serialno); |
| 71 | int hikey_write_serialno(struct random_serial_num *serialno); |
| 72 | |
| 73 | void init_acpu_dvfs(void); |
| 74 | |
Haojian Zhuang | 53e70df | 2019-09-14 19:18:01 +0800 | [diff] [blame] | 75 | int hikey_set_fip_addr(unsigned int image_id, const char *name); |
| 76 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 77 | #endif /* HIKEY_PRIVATE_H */ |