Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 1 | /* |
Anthony Zhou | 59fd615 | 2017-03-13 15:34:08 +0800 | [diff] [blame] | 2 | * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __TEGRA_PRIVATE_H__ |
| 8 | #define __TEGRA_PRIVATE_H__ |
| 9 | |
Varun Wadekar | a78bb1b | 2015-08-07 10:03:00 +0530 | [diff] [blame] | 10 | #include <arch.h> |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 11 | #include <platform_def.h> |
Yatharth Kochar | 33f5c41 | 2015-12-09 14:22:47 +0000 | [diff] [blame] | 12 | #include <psci.h> |
Varun Wadekar | a78bb1b | 2015-08-07 10:03:00 +0530 | [diff] [blame] | 13 | #include <xlat_tables.h> |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 14 | |
Varun Wadekar | 7a269e2 | 2015-06-10 14:04:32 +0530 | [diff] [blame] | 15 | /******************************************************************************* |
| 16 | * Tegra DRAM memory base address |
| 17 | ******************************************************************************/ |
Varun Wadekar | 761ca73 | 2017-04-24 14:17:12 -0700 | [diff] [blame] | 18 | #define TEGRA_DRAM_BASE ULL(0x80000000) |
| 19 | #define TEGRA_DRAM_END ULL(0x27FFFFFFF) |
Varun Wadekar | 7a269e2 | 2015-06-10 14:04:32 +0530 | [diff] [blame] | 20 | |
Varun Wadekar | b7b4575 | 2015-12-28 14:55:41 -0800 | [diff] [blame] | 21 | /******************************************************************************* |
| 22 | * Struct for parameters received from BL2 |
| 23 | ******************************************************************************/ |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 24 | typedef struct plat_params_from_bl2 { |
Varun Wadekar | 6bb6246 | 2015-10-06 12:49:31 +0530 | [diff] [blame] | 25 | /* TZ memory size */ |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 26 | uint64_t tzdram_size; |
Varun Wadekar | 6bb6246 | 2015-10-06 12:49:31 +0530 | [diff] [blame] | 27 | /* TZ memory base */ |
| 28 | uint64_t tzdram_base; |
Varun Wadekar | d2014c6 | 2015-10-29 10:37:28 +0530 | [diff] [blame] | 29 | /* UART port ID */ |
| 30 | int uart_id; |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 31 | } plat_params_from_bl2_t; |
| 32 | |
Varun Wadekar | dc79930 | 2015-12-28 16:36:42 -0800 | [diff] [blame] | 33 | /******************************************************************************* |
| 34 | * Per-CPU struct describing FIQ state to be stored |
| 35 | ******************************************************************************/ |
| 36 | typedef struct pcpu_fiq_state { |
| 37 | uint64_t elr_el3; |
| 38 | uint64_t spsr_el3; |
| 39 | } pcpu_fiq_state_t; |
| 40 | |
Varun Wadekar | c6c386d | 2016-05-20 16:21:22 -0700 | [diff] [blame] | 41 | /******************************************************************************* |
| 42 | * Struct describing per-FIQ configuration settings |
| 43 | ******************************************************************************/ |
| 44 | typedef struct irq_sec_cfg { |
| 45 | /* IRQ number */ |
| 46 | unsigned int irq; |
| 47 | /* Target CPUs servicing this interrupt */ |
| 48 | unsigned int target_cpus; |
| 49 | /* type = INTR_TYPE_S_EL1 or INTR_TYPE_EL3 */ |
| 50 | uint32_t type; |
| 51 | } irq_sec_cfg_t; |
| 52 | |
Varun Wadekar | 254441d | 2015-07-23 10:07:54 +0530 | [diff] [blame] | 53 | /* Declarations for plat_psci_handlers.c */ |
Varun Wadekar | a78bb1b | 2015-08-07 10:03:00 +0530 | [diff] [blame] | 54 | int32_t tegra_soc_validate_power_state(unsigned int power_state, |
| 55 | psci_power_state_t *req_state); |
Varun Wadekar | 254441d | 2015-07-23 10:07:54 +0530 | [diff] [blame] | 56 | |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 57 | /* Declarations for plat_setup.c */ |
| 58 | const mmap_region_t *plat_get_mmio_map(void); |
Varun Wadekar | d2014c6 | 2015-10-29 10:37:28 +0530 | [diff] [blame] | 59 | uint32_t plat_get_console_from_id(int id); |
Varun Wadekar | b7b4575 | 2015-12-28 14:55:41 -0800 | [diff] [blame] | 60 | void plat_gic_setup(void); |
Varun Wadekar | d22d4ad | 2016-05-23 11:41:07 -0700 | [diff] [blame] | 61 | bl31_params_t *plat_get_bl31_params(void); |
| 62 | plat_params_from_bl2_t *plat_get_bl31_plat_params(void); |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 63 | |
| 64 | /* Declarations for plat_secondary.c */ |
| 65 | void plat_secondary_setup(void); |
| 66 | int plat_lock_cpu_vectors(void); |
| 67 | |
Varun Wadekar | dc79930 | 2015-12-28 16:36:42 -0800 | [diff] [blame] | 68 | /* Declarations for tegra_fiq_glue.c */ |
| 69 | void tegra_fiq_handler_setup(void); |
| 70 | int tegra_fiq_get_intr_context(void); |
| 71 | void tegra_fiq_set_ns_entrypoint(uint64_t entrypoint); |
| 72 | |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 73 | /* Declarations for tegra_gic.c */ |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 74 | void tegra_gic_cpuif_deactivate(void); |
Varun Wadekar | ca87293 | 2017-05-25 18:06:59 -0700 | [diff] [blame] | 75 | void tegra_gic_setup(const irq_sec_cfg_t *irq_sec_ptr, uint32_t num_irqs); |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 76 | |
| 77 | /* Declarations for tegra_security.c */ |
| 78 | void tegra_security_setup(void); |
| 79 | void tegra_security_setup_videomem(uintptr_t base, uint64_t size); |
| 80 | |
| 81 | /* Declarations for tegra_pm.c */ |
Vignesh Radhakrishnan | b4a7294 | 2017-03-03 10:58:05 -0800 | [diff] [blame] | 82 | extern uint8_t tegra_fake_system_suspend; |
| 83 | |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 84 | void tegra_pm_system_suspend_entry(void); |
| 85 | void tegra_pm_system_suspend_exit(void); |
| 86 | int tegra_system_suspended(void); |
| 87 | |
| 88 | /* Declarations for tegraXXX_pm.c */ |
| 89 | int tegra_prepare_cpu_suspend(unsigned int id, unsigned int afflvl); |
| 90 | int tegra_prepare_cpu_on_finish(unsigned long mpidr); |
| 91 | |
| 92 | /* Declarations for tegra_bl31_setup.c */ |
| 93 | plat_params_from_bl2_t *bl31_get_plat_params(void); |
Varun Wadekar | 7a269e2 | 2015-06-10 14:04:32 +0530 | [diff] [blame] | 94 | int bl31_check_ns_address(uint64_t base, uint64_t size_in_bytes); |
Varun Wadekar | 3f0a8ad | 2016-03-28 15:56:47 -0700 | [diff] [blame] | 95 | void plat_early_platform_setup(void); |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 96 | |
Varun Wadekar | bc74fec | 2015-07-16 15:47:03 +0530 | [diff] [blame] | 97 | /* Declarations for tegra_delay_timer.c */ |
| 98 | void tegra_delay_timer_init(void); |
| 99 | |
Varun Wadekar | 93bed2a | 2016-03-18 13:07:33 -0700 | [diff] [blame] | 100 | void tegra_secure_entrypoint(void); |
| 101 | void tegra186_cpu_reset_handler(void); |
| 102 | |
Varun Wadekar | b316e24 | 2015-05-19 16:48:04 +0530 | [diff] [blame] | 103 | #endif /* __TEGRA_PRIVATE_H__ */ |