blob: da98734955362e6ef7573bd0edac8ec3ac316436 [file] [log] [blame]
Haojian Zhuang5f281b32017-05-24 08:45:05 +08001/*
2 * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef __HIKEY_PRIVATE_H__
8#define __HIKEY_PRIVATE_H__
9
10#include <bl_common.h>
11
12#define RANDOM_MAX 0x7fffffffffffffff
13#define RANDOM_MAGIC 0x9a4dbeaf
14
15struct random_serial_num {
16 uint64_t magic;
17 uint64_t data;
18 char serialno[32];
19};
20
21/*
22 * Function and variable prototypes
23 */
24void hikey_init_mmu_el1(unsigned long total_base,
25 unsigned long total_size,
26 unsigned long ro_start,
27 unsigned long ro_limit,
28 unsigned long coh_start,
29 unsigned long coh_limit);
30void hikey_init_mmu_el3(unsigned long total_base,
31 unsigned long total_size,
32 unsigned long ro_start,
33 unsigned long ro_limit,
34 unsigned long coh_start,
35 unsigned long coh_limit);
36
37void hikey_ddr_init(void);
38void hikey_io_setup(void);
39
40int hikey_get_partition_size(const char *arg, int left, char *response);
41int hikey_get_partition_type(const char *arg, int left, char *response);
42
43int hikey_erase(const char *arg);
44int hikey_flash(const char *arg);
45int hikey_oem(const char *arg);
46int hikey_reboot(const char *arg);
Jerome Forissierc52e55f2015-05-04 09:40:03 +020047void hikey_security_setup(void);
Haojian Zhuang5f281b32017-05-24 08:45:05 +080048
49const char *hikey_init_serialno(void);
50int hikey_read_serialno(struct random_serial_num *serialno);
51int hikey_write_serialno(struct random_serial_num *serialno);
52
53void init_acpu_dvfs(void);
54
55#endif /* __HIKEY_PRIVATE_H__ */