1 /* 2 * Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef UNIPHIER_H 8 #define UNIPHIER_H 9 10 #include <stdint.h> 11 #include <string.h> 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 28 #define UNIPHIER_BOOT_DEVICE_USB 3 29 #define UNIPHIER_BOOT_DEVICE_RSV 0xffffffff 30 31 unsigned 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 37 void uniphier_console_setup(void); 38 39 struct io_block_dev_spec; 40 int uniphier_emmc_init(struct io_block_dev_spec **block_dev_spec); 41 int uniphier_nand_init(struct io_block_dev_spec **block_dev_spec); 42 int uniphier_usb_init(unsigned int soc, 43 struct io_block_dev_spec **block_dev_spec); 44 45 int uniphier_io_setup(unsigned int soc, uintptr_t mem_base); 46 47 void uniphier_init_image_descs(uintptr_t mem_base); 48 struct image_info; 49 struct image_info *uniphier_get_image_info(unsigned int image_id); 50 51 int uniphier_scp_is_running(void); 52 void uniphier_scp_start(uint32_t scp_base); 53 void uniphier_scp_open_com(void); 54 void uniphier_scp_system_off(void); 55 void uniphier_scp_system_reset(void); 56 57 void uniphier_mmap_setup(void); 58 59 void uniphier_cci_init(unsigned int soc); 60 void uniphier_cci_enable(void); 61 void uniphier_cci_disable(void); 62 63 void uniphier_gic_driver_init(unsigned int soc); 64 void uniphier_gic_init(void); 65 void uniphier_gic_cpuif_enable(void); 66 void uniphier_gic_cpuif_disable(void); 67 void uniphier_gic_pcpu_init(void); 68 69 unsigned int uniphier_calc_core_pos(u_register_t mpidr); 70 71 #endif /* UNIPHIER_H */ 72