uniphier.h 2.12 KB
Newer Older
1
/*
2
 * Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved.
3
4
5
6
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

7
8
#ifndef UNIPHIER_H
#define UNIPHIER_H
9
10

#include <stdint.h>
11
#include <string.h>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

unsigned int uniphier_get_soc_type(void);
unsigned int uniphier_get_soc_model(void);
unsigned int uniphier_get_soc_revision(void);
unsigned int uniphier_get_soc_id(void);

#define UNIPHIER_SOC_LD11		0
#define UNIPHIER_SOC_LD20		1
#define UNIPHIER_SOC_PXS3		2
#define UNIPHIER_SOC_UNKNOWN		0xffffffff

unsigned int uniphier_get_boot_device(unsigned int soc);

#define UNIPHIER_BOOT_DEVICE_EMMC	0
#define UNIPHIER_BOOT_DEVICE_NAND	1
#define UNIPHIER_BOOT_DEVICE_NOR	2
28
29
#define UNIPHIER_BOOT_DEVICE_SD		3
#define UNIPHIER_BOOT_DEVICE_USB	4
30
31
32
33
34
35
36
37
#define UNIPHIER_BOOT_DEVICE_RSV	0xffffffff

unsigned int uniphier_get_boot_master(unsigned int soc);

#define UNIPHIER_BOOT_MASTER_THIS	0
#define UNIPHIER_BOOT_MASTER_SCP	1
#define UNIPHIER_BOOT_MASTER_EXT	2

38
void uniphier_console_setup(unsigned int soc);
39

40
struct io_block_dev_spec;
41
42
int uniphier_emmc_init(unsigned int soc,
		       struct io_block_dev_spec **block_dev_spec);
43
44
int uniphier_nand_init(unsigned int soc,
		       struct io_block_dev_spec **block_dev_spec);
45
46
int uniphier_usb_init(unsigned int soc,
		      struct io_block_dev_spec **block_dev_spec);
47

48
int uniphier_io_setup(unsigned int soc, uintptr_t mem_base);
49

50
void uniphier_init_image_descs(uintptr_t mem_base);
51
52
struct image_info;
struct image_info *uniphier_get_image_info(unsigned int image_id);
53
54

int uniphier_scp_is_running(void);
55
void uniphier_scp_start(uint32_t scp_base);
56
57
58
59
void uniphier_scp_open_com(void);
void uniphier_scp_system_off(void);
void uniphier_scp_system_reset(void);

60
void uniphier_mmap_setup(unsigned int soc);
61
62
63
64
65
66
67
68
69
70
71

void uniphier_cci_init(unsigned int soc);
void uniphier_cci_enable(void);
void uniphier_cci_disable(void);

void uniphier_gic_driver_init(unsigned int soc);
void uniphier_gic_init(void);
void uniphier_gic_cpuif_enable(void);
void uniphier_gic_cpuif_disable(void);
void uniphier_gic_pcpu_init(void);

72
73
void uniphier_psci_init(unsigned int soc);

74
75
unsigned int uniphier_calc_core_pos(u_register_t mpidr);

76
#endif /* UNIPHIER_H */