blob: 7ca32c3d3b95b8f53b66db660dfada38533ea8b1 [file] [log] [blame]
Varun Wadekar08438e22015-05-19 16:48:04 +05301/*
Anthony Zhou50e91632017-03-13 15:34:08 +08002 * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
Varun Wadekar08438e22015-05-19 16:48:04 +05303 *
dp-arm82cb2c12017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Varun Wadekar08438e22015-05-19 16:48:04 +05305 */
6
Antonio Nino Diazc3cf06f2018-11-08 10:20:19 +00007#ifndef TEGRA_PRIVATE_H
8#define TEGRA_PRIVATE_H
Varun Wadekar08438e22015-05-19 16:48:04 +05309
Varun Wadekar71cb26e2015-08-07 10:03:00 +053010#include <arch.h>
Varun Wadekar80c50ee2018-10-19 11:42:28 -070011#include <arch_helpers.h>
Varun Wadekar08438e22015-05-19 16:48:04 +053012#include <platform_def.h>
Yatharth Kocharca8b7d52015-12-09 14:22:47 +000013#include <psci.h>
Varun Wadekar80c50ee2018-10-19 11:42:28 -070014#include <tegra_gic.h>
Andreas Färber28db3e92018-02-17 06:02:32 +010015#include <xlat_tables_v2.h>
Varun Wadekar08438e22015-05-19 16:48:04 +053016
Varun Wadekar9a964512015-06-10 14:04:32 +053017/*******************************************************************************
18 * Tegra DRAM memory base address
19 ******************************************************************************/
Varun Wadekar70cb6922017-04-24 14:17:12 -070020#define TEGRA_DRAM_BASE ULL(0x80000000)
21#define TEGRA_DRAM_END ULL(0x27FFFFFFF)
Varun Wadekar9a964512015-06-10 14:04:32 +053022
Varun Wadekard3360302015-12-28 14:55:41 -080023/*******************************************************************************
24 * Struct for parameters received from BL2
25 ******************************************************************************/
Varun Wadekar08438e22015-05-19 16:48:04 +053026typedef struct plat_params_from_bl2 {
Varun Wadekare0d41582015-10-06 12:49:31 +053027 /* TZ memory size */
Varun Wadekar08438e22015-05-19 16:48:04 +053028 uint64_t tzdram_size;
Varun Wadekare0d41582015-10-06 12:49:31 +053029 /* TZ memory base */
30 uint64_t tzdram_base;
Varun Wadekare1084212015-10-29 10:37:28 +053031 /* UART port ID */
32 int uart_id;
Varun Wadekar08438e22015-05-19 16:48:04 +053033} plat_params_from_bl2_t;
34
Varun Wadekar78e2bd102015-12-28 16:36:42 -080035/*******************************************************************************
Antonio Nino Diazfdcc1122018-09-24 17:16:05 +010036 * Struct describing parameters passed to bl31
37 ******************************************************************************/
38struct tegra_bl31_params {
39 param_header_t h;
40 image_info_t *bl31_image_info;
41 entry_point_info_t *bl32_ep_info;
42 image_info_t *bl32_image_info;
43 entry_point_info_t *bl33_ep_info;
44 image_info_t *bl33_image_info;
45};
46
Varun Wadekar93eafbc2015-07-23 10:07:54 +053047/* Declarations for plat_psci_handlers.c */
Varun Wadekar71cb26e2015-08-07 10:03:00 +053048int32_t tegra_soc_validate_power_state(unsigned int power_state,
49 psci_power_state_t *req_state);
Varun Wadekar93eafbc2015-07-23 10:07:54 +053050
Varun Wadekar08438e22015-05-19 16:48:04 +053051/* Declarations for plat_setup.c */
52const mmap_region_t *plat_get_mmio_map(void);
Varun Wadekare1084212015-10-29 10:37:28 +053053uint32_t plat_get_console_from_id(int id);
Varun Wadekard3360302015-12-28 14:55:41 -080054void plat_gic_setup(void);
Antonio Nino Diazfdcc1122018-09-24 17:16:05 +010055struct tegra_bl31_params *plat_get_bl31_params(void);
Varun Wadekar8ab06d22016-05-23 11:41:07 -070056plat_params_from_bl2_t *plat_get_bl31_plat_params(void);
Varun Wadekar08438e22015-05-19 16:48:04 +053057
58/* Declarations for plat_secondary.c */
59void plat_secondary_setup(void);
60int plat_lock_cpu_vectors(void);
61
Varun Wadekar78e2bd102015-12-28 16:36:42 -080062/* Declarations for tegra_fiq_glue.c */
63void tegra_fiq_handler_setup(void);
64int tegra_fiq_get_intr_context(void);
65void tegra_fiq_set_ns_entrypoint(uint64_t entrypoint);
66
Varun Wadekar08438e22015-05-19 16:48:04 +053067/* Declarations for tegra_security.c */
68void tegra_security_setup(void);
69void tegra_security_setup_videomem(uintptr_t base, uint64_t size);
70
71/* Declarations for tegra_pm.c */
Vignesh Radhakrishnana9e02602017-03-03 10:58:05 -080072extern uint8_t tegra_fake_system_suspend;
73
Varun Wadekar08438e22015-05-19 16:48:04 +053074void tegra_pm_system_suspend_entry(void);
75void tegra_pm_system_suspend_exit(void);
76int tegra_system_suspended(void);
77
78/* Declarations for tegraXXX_pm.c */
79int tegra_prepare_cpu_suspend(unsigned int id, unsigned int afflvl);
80int tegra_prepare_cpu_on_finish(unsigned long mpidr);
81
82/* Declarations for tegra_bl31_setup.c */
83plat_params_from_bl2_t *bl31_get_plat_params(void);
Varun Wadekar9a964512015-06-10 14:04:32 +053084int bl31_check_ns_address(uint64_t base, uint64_t size_in_bytes);
Varun Wadekar5ea0b022016-03-28 15:56:47 -070085void plat_early_platform_setup(void);
Varun Wadekar08438e22015-05-19 16:48:04 +053086
Varun Wadekarc8961322015-07-16 15:47:03 +053087/* Declarations for tegra_delay_timer.c */
88void tegra_delay_timer_init(void);
89
Varun Wadekar68c7de62016-03-18 13:07:33 -070090void tegra_secure_entrypoint(void);
91void tegra186_cpu_reset_handler(void);
92
Antonio Nino Diazc3cf06f2018-11-08 10:20:19 +000093#endif /* TEGRA_PRIVATE_H */