Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 1 | /* |
Masahiro Yamada | 75bfecb | 2017-12-19 11:56:05 +0900 | [diff] [blame] | 2 | * Copyright (c) 2017-2018, 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 |
| 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 | int uniphier_emmc_init(uintptr_t *block_dev_spec); |
| 40 | int uniphier_nand_init(uintptr_t *block_dev_spec); |
| 41 | int uniphier_usb_init(unsigned int soc, uintptr_t *block_dev_spec); |
| 42 | |
| 43 | int uniphier_io_setup(unsigned int soc); |
Masahiro Yamada | 4c91c80 | 2018-02-01 21:37:40 +0900 | [diff] [blame] | 44 | |
| 45 | struct image_info; |
| 46 | struct image_info *uniphier_get_image_info(unsigned int image_id); |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 47 | |
| 48 | int uniphier_scp_is_running(void); |
| 49 | void uniphier_scp_start(void); |
| 50 | void uniphier_scp_open_com(void); |
| 51 | void uniphier_scp_system_off(void); |
| 52 | void uniphier_scp_system_reset(void); |
| 53 | |
| 54 | struct mmap_region; |
| 55 | void uniphier_mmap_setup(uintptr_t total_base, size_t total_size, |
| 56 | const struct mmap_region *mmap); |
| 57 | |
| 58 | void uniphier_cci_init(unsigned int soc); |
| 59 | void uniphier_cci_enable(void); |
| 60 | void uniphier_cci_disable(void); |
| 61 | |
| 62 | void uniphier_gic_driver_init(unsigned int soc); |
| 63 | void uniphier_gic_init(void); |
| 64 | void uniphier_gic_cpuif_enable(void); |
| 65 | void uniphier_gic_cpuif_disable(void); |
| 66 | void uniphier_gic_pcpu_init(void); |
| 67 | |
| 68 | unsigned int uniphier_calc_core_pos(u_register_t mpidr); |
| 69 | |
| 70 | #define UNIPHIER_NS_DRAM_BASE 0x84000000 |
Masahiro Yamada | 75bfecb | 2017-12-19 11:56:05 +0900 | [diff] [blame] | 71 | #define UNIPHIER_NS_DRAM_LIMIT 0x85000000 |
| 72 | #define UNIPHIER_NS_DRAM_SIZE ((UNIPHIER_NS_DRAM_LIMIT) - \ |
| 73 | (UNIPHIER_NS_DRAM_BASE)) |
Masahiro Yamada | 574388c | 2016-09-03 11:37:40 +0900 | [diff] [blame] | 74 | |
| 75 | #define UNIPHIER_BL33_BASE (UNIPHIER_NS_DRAM_BASE) |
| 76 | #define UNIPHIER_BL33_MAX_SIZE 0x00100000 |
| 77 | |
| 78 | #define UNIPHIER_SCP_BASE ((UNIPHIER_BL33_BASE) + \ |
| 79 | (UNIPHIER_BL33_MAX_SIZE)) |
| 80 | #define UNIPHIER_SCP_MAX_SIZE 0x00020000 |
| 81 | |
Masahiro Yamada | 75bfecb | 2017-12-19 11:56:05 +0900 | [diff] [blame] | 82 | #define UNIPHIER_BLOCK_BUF_BASE ((UNIPHIER_SCP_BASE) + \ |
| 83 | (UNIPHIER_SCP_MAX_SIZE)) |
Masahiro Yamada | 4ff71af | 2018-01-26 11:42:01 +0900 | [diff] [blame] | 84 | #define UNIPHIER_BLOCK_BUF_SIZE 0x00100000 |
| 85 | |
| 86 | #define UNIPHIER_IMAGE_BUF_BASE ((UNIPHIER_BLOCK_BUF_BASE) + \ |
| 87 | (UNIPHIER_BLOCK_BUF_SIZE)) |
| 88 | #define UNIPHIER_IMAGE_BUF_SIZE ((UNIPHIER_NS_DRAM_LIMIT) - \ |
| 89 | (UNIPHIER_IMAGE_BUF_BASE)) |
Masahiro Yamada | 75bfecb | 2017-12-19 11:56:05 +0900 | [diff] [blame] | 90 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 91 | #endif /* UNIPHIER_H */ |