Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 1 | /* |
Masahiro Yamada | e44b8c6 | 2020-01-17 13:46:02 +0900 | [diff] [blame] | 2 | * Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved. |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 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 UNIPHIER_H |
| 8 | #define UNIPHIER_H |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 9 | |
| 10 | #include <stdint.h> |
Antonio Nino Diaz | 4b32e62 | 2018-08-16 16:52:57 +0100 | [diff] [blame] | 11 | #include <string.h> |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 12 | |
| 13 | unsigned int uniphier_get_soc_type(void); |
| 14 | unsigned int uniphier_get_soc_model(void); |
| 15 | unsigned int uniphier_get_soc_revision(void); |
| 16 | unsigned 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 | |
| 23 | unsigned 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 Yamada | 3d436a9 | 2020-02-03 19:28:13 +0900 | [diff] [blame] | 28 | #define UNIPHIER_BOOT_DEVICE_SD 3 |
| 29 | #define UNIPHIER_BOOT_DEVICE_USB 4 |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 30 | #define UNIPHIER_BOOT_DEVICE_RSV 0xffffffff |
| 31 | |
| 32 | unsigned 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 Yamada | ca971b5 | 2020-02-03 19:45:16 +0900 | [diff] [blame] | 38 | void uniphier_console_setup(unsigned int soc); |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 39 | |
Masahiro Yamada | 229e211 | 2020-01-17 13:46:13 +0900 | [diff] [blame] | 40 | struct io_block_dev_spec; |
Masahiro Yamada | 24782e2 | 2020-02-03 19:30:11 +0900 | [diff] [blame] | 41 | int uniphier_emmc_init(unsigned int soc, |
| 42 | struct io_block_dev_spec **block_dev_spec); |
Masahiro Yamada | 6ebf638 | 2020-02-03 19:30:27 +0900 | [diff] [blame] | 43 | int uniphier_nand_init(unsigned int soc, |
| 44 | struct io_block_dev_spec **block_dev_spec); |
Masahiro Yamada | 229e211 | 2020-01-17 13:46:13 +0900 | [diff] [blame] | 45 | int uniphier_usb_init(unsigned int soc, |
| 46 | struct io_block_dev_spec **block_dev_spec); |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 47 | |
Masahiro Yamada | 542ed41 | 2020-01-17 13:46:48 +0900 | [diff] [blame] | 48 | int uniphier_io_setup(unsigned int soc, uintptr_t mem_base); |
Masahiro Yamada | 4c91c80 | 2018-02-01 21:37:40 +0900 | [diff] [blame] | 49 | |
Masahiro Yamada | 542ed41 | 2020-01-17 13:46:48 +0900 | [diff] [blame] | 50 | void uniphier_init_image_descs(uintptr_t mem_base); |
Masahiro Yamada | 4c91c80 | 2018-02-01 21:37:40 +0900 | [diff] [blame] | 51 | struct image_info; |
| 52 | struct image_info *uniphier_get_image_info(unsigned int image_id); |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 53 | |
| 54 | int uniphier_scp_is_running(void); |
Masahiro Yamada | 2d7fa42 | 2020-01-17 13:46:23 +0900 | [diff] [blame] | 55 | void uniphier_scp_start(uint32_t scp_base); |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 56 | void uniphier_scp_open_com(void); |
| 57 | void uniphier_scp_system_off(void); |
| 58 | void uniphier_scp_system_reset(void); |
| 59 | |
Masahiro Yamada | 1a741d9 | 2020-02-03 19:46:15 +0900 | [diff] [blame] | 60 | void uniphier_mmap_setup(unsigned int soc); |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 61 | |
| 62 | void uniphier_cci_init(unsigned int soc); |
| 63 | void uniphier_cci_enable(void); |
| 64 | void uniphier_cci_disable(void); |
| 65 | |
| 66 | void uniphier_gic_driver_init(unsigned int soc); |
| 67 | void uniphier_gic_init(void); |
| 68 | void uniphier_gic_cpuif_enable(void); |
| 69 | void uniphier_gic_cpuif_disable(void); |
| 70 | void uniphier_gic_pcpu_init(void); |
| 71 | |
Masahiro Yamada | 4e37140 | 2020-02-03 19:46:00 +0900 | [diff] [blame] | 72 | void uniphier_psci_init(unsigned int soc); |
| 73 | |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 74 | unsigned int uniphier_calc_core_pos(u_register_t mpidr); |
| 75 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 76 | #endif /* UNIPHIER_H */ |