blob: ee520ad23f16be9a0821853e0b32e1cef877cf1c [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
Masahiro Yamada3d436a92020-02-03 19:28:13 +090028#define UNIPHIER_BOOT_DEVICE_SD 3
29#define UNIPHIER_BOOT_DEVICE_USB 4
Masahiro Yamada574388c2016-09-03 11:37:40 +090030#define UNIPHIER_BOOT_DEVICE_RSV 0xffffffff
31
32unsigned int uniphier_get_boot_master(unsigned int soc);
33
34#define UNIPHIER_BOOT_MASTER_THIS 0
35#define UNIPHIER_BOOT_MASTER_SCP 1
36#define UNIPHIER_BOOT_MASTER_EXT 2
37
Masahiro Yamadaca971b52020-02-03 19:45:16 +090038void uniphier_console_setup(unsigned int soc);
Masahiro Yamada574388c2016-09-03 11:37:40 +090039
Masahiro Yamada229e2112020-01-17 13:46:13 +090040struct io_block_dev_spec;
Masahiro Yamada24782e22020-02-03 19:30:11 +090041int uniphier_emmc_init(unsigned int soc,
42 struct io_block_dev_spec **block_dev_spec);
Masahiro Yamada6ebf6382020-02-03 19:30:27 +090043int uniphier_nand_init(unsigned int soc,
44 struct io_block_dev_spec **block_dev_spec);
Masahiro Yamada229e2112020-01-17 13:46:13 +090045int uniphier_usb_init(unsigned int soc,
46 struct io_block_dev_spec **block_dev_spec);
Masahiro Yamada574388c2016-09-03 11:37:40 +090047
Masahiro Yamada542ed412020-01-17 13:46:48 +090048int uniphier_io_setup(unsigned int soc, uintptr_t mem_base);
Masahiro Yamada4c91c802018-02-01 21:37:40 +090049
Masahiro Yamada542ed412020-01-17 13:46:48 +090050void uniphier_init_image_descs(uintptr_t mem_base);
Masahiro Yamada4c91c802018-02-01 21:37:40 +090051struct image_info;
52struct image_info *uniphier_get_image_info(unsigned int image_id);
Masahiro Yamada574388c2016-09-03 11:37:40 +090053
54int uniphier_scp_is_running(void);
Masahiro Yamada2d7fa422020-01-17 13:46:23 +090055void uniphier_scp_start(uint32_t scp_base);
Masahiro Yamada574388c2016-09-03 11:37:40 +090056void uniphier_scp_open_com(void);
57void uniphier_scp_system_off(void);
58void uniphier_scp_system_reset(void);
59
Masahiro Yamada1a741d92020-02-03 19:46:15 +090060void uniphier_mmap_setup(unsigned int soc);
Masahiro Yamada574388c2016-09-03 11:37:40 +090061
62void uniphier_cci_init(unsigned int soc);
63void uniphier_cci_enable(void);
64void uniphier_cci_disable(void);
65
66void uniphier_gic_driver_init(unsigned int soc);
67void uniphier_gic_init(void);
68void uniphier_gic_cpuif_enable(void);
69void uniphier_gic_cpuif_disable(void);
70void uniphier_gic_pcpu_init(void);
71
Masahiro Yamada4e371402020-02-03 19:46:00 +090072void uniphier_psci_init(unsigned int soc);
73
Masahiro Yamada574388c2016-09-03 11:37:40 +090074unsigned int uniphier_calc_core_pos(u_register_t mpidr);
75
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000076#endif /* UNIPHIER_H */