blob: 729dc5caad0501b83e77ccfb9c8db011d5a01663 [file] [log] [blame]
Masahiro Yamada574388c2016-09-03 11:37:40 +09001/*
Masahiro Yamadae44b8c62020-01-17 13:46:02 +09002 * Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved.
Masahiro Yamada574388c2016-09-03 11:37:40 +09003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef UNIPHIER_H
8#define UNIPHIER_H
Masahiro Yamada574388c2016-09-03 11:37:40 +09009
10#include <stdint.h>
Antonio Nino Diaz4b32e622018-08-16 16:52:57 +010011#include <string.h>
Masahiro Yamada574388c2016-09-03 11:37:40 +090012
13unsigned int uniphier_get_soc_type(void);
14unsigned int uniphier_get_soc_model(void);
15unsigned int uniphier_get_soc_revision(void);
16unsigned int uniphier_get_soc_id(void);
17
18#define UNIPHIER_SOC_LD11 0
19#define UNIPHIER_SOC_LD20 1
20#define UNIPHIER_SOC_PXS3 2
21#define UNIPHIER_SOC_UNKNOWN 0xffffffff
22
23unsigned int uniphier_get_boot_device(unsigned int soc);
24
25#define UNIPHIER_BOOT_DEVICE_EMMC 0
26#define UNIPHIER_BOOT_DEVICE_NAND 1
27#define UNIPHIER_BOOT_DEVICE_NOR 2
28#define UNIPHIER_BOOT_DEVICE_USB 3
29#define UNIPHIER_BOOT_DEVICE_RSV 0xffffffff
30
31unsigned int uniphier_get_boot_master(unsigned int soc);
32
33#define UNIPHIER_BOOT_MASTER_THIS 0
34#define UNIPHIER_BOOT_MASTER_SCP 1
35#define UNIPHIER_BOOT_MASTER_EXT 2
36
37void uniphier_console_setup(void);
38
Masahiro Yamada229e2112020-01-17 13:46:13 +090039struct io_block_dev_spec;
40int uniphier_emmc_init(struct io_block_dev_spec **block_dev_spec);
41int uniphier_nand_init(struct io_block_dev_spec **block_dev_spec);
42int uniphier_usb_init(unsigned int soc,
43 struct io_block_dev_spec **block_dev_spec);
Masahiro Yamada574388c2016-09-03 11:37:40 +090044
Masahiro Yamada542ed412020-01-17 13:46:48 +090045int uniphier_io_setup(unsigned int soc, uintptr_t mem_base);
Masahiro Yamada4c91c802018-02-01 21:37:40 +090046
Masahiro Yamada542ed412020-01-17 13:46:48 +090047void uniphier_init_image_descs(uintptr_t mem_base);
Masahiro Yamada4c91c802018-02-01 21:37:40 +090048struct image_info;
49struct image_info *uniphier_get_image_info(unsigned int image_id);
Masahiro Yamada574388c2016-09-03 11:37:40 +090050
51int uniphier_scp_is_running(void);
Masahiro Yamada2d7fa422020-01-17 13:46:23 +090052void uniphier_scp_start(uint32_t scp_base);
Masahiro Yamada574388c2016-09-03 11:37:40 +090053void uniphier_scp_open_com(void);
54void uniphier_scp_system_off(void);
55void uniphier_scp_system_reset(void);
56
Masahiro Yamadae30ec7f2020-01-17 13:46:38 +090057void uniphier_mmap_setup(void);
Masahiro Yamada574388c2016-09-03 11:37:40 +090058
59void uniphier_cci_init(unsigned int soc);
60void uniphier_cci_enable(void);
61void uniphier_cci_disable(void);
62
63void uniphier_gic_driver_init(unsigned int soc);
64void uniphier_gic_init(void);
65void uniphier_gic_cpuif_enable(void);
66void uniphier_gic_cpuif_disable(void);
67void uniphier_gic_pcpu_init(void);
68
69unsigned int uniphier_calc_core_pos(u_register_t mpidr);
70
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000071#endif /* UNIPHIER_H */