blob: 93223cc2413a09e80b4d12090f30514d7514821b [file] [log] [blame]
Varun Wadekarb316e242015-05-19 16:48:04 +05301/*
Anthony Zhou59fd6152017-03-13 15:34:08 +08002 * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
Varun Wadekarb316e242015-05-19 16:48:04 +05303 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Varun Wadekarb316e242015-05-19 16:48:04 +05305 */
6
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef TEGRA_PRIVATE_H
8#define TEGRA_PRIVATE_H
Varun Wadekarb316e242015-05-19 16:48:04 +05309
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000010#include <platform_def.h>
11
Varun Wadekara78bb1b2015-08-07 10:03:00 +053012#include <arch.h>
Varun Wadekar9f4a7d32018-10-19 11:42:28 -070013#include <arch_helpers.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000014#include <lib/psci/psci.h>
15#include <lib/xlat_tables/xlat_tables_v2.h>
16
Varun Wadekar9f4a7d32018-10-19 11:42:28 -070017#include <tegra_gic.h>
Varun Wadekarb316e242015-05-19 16:48:04 +053018
Varun Wadekar7a269e22015-06-10 14:04:32 +053019/*******************************************************************************
20 * Tegra DRAM memory base address
21 ******************************************************************************/
Varun Wadekar761ca732017-04-24 14:17:12 -070022#define TEGRA_DRAM_BASE ULL(0x80000000)
23#define TEGRA_DRAM_END ULL(0x27FFFFFFF)
Varun Wadekar7a269e22015-06-10 14:04:32 +053024
Varun Wadekarb7b45752015-12-28 14:55:41 -080025/*******************************************************************************
26 * Struct for parameters received from BL2
27 ******************************************************************************/
Varun Wadekarb316e242015-05-19 16:48:04 +053028typedef struct plat_params_from_bl2 {
Varun Wadekar6bb62462015-10-06 12:49:31 +053029 /* TZ memory size */
Varun Wadekarb316e242015-05-19 16:48:04 +053030 uint64_t tzdram_size;
Varun Wadekar6bb62462015-10-06 12:49:31 +053031 /* TZ memory base */
32 uint64_t tzdram_base;
Varun Wadekard2014c62015-10-29 10:37:28 +053033 /* UART port ID */
34 int uart_id;
Varun Wadekarb316e242015-05-19 16:48:04 +053035} plat_params_from_bl2_t;
36
Varun Wadekardc799302015-12-28 16:36:42 -080037/*******************************************************************************
Antonio Nino Diaz6bf7c6b2018-09-24 17:16:05 +010038 * Struct describing parameters passed to bl31
39 ******************************************************************************/
40struct tegra_bl31_params {
41 param_header_t h;
42 image_info_t *bl31_image_info;
43 entry_point_info_t *bl32_ep_info;
44 image_info_t *bl32_image_info;
45 entry_point_info_t *bl33_ep_info;
46 image_info_t *bl33_image_info;
47};
48
Varun Wadekar254441d2015-07-23 10:07:54 +053049/* Declarations for plat_psci_handlers.c */
Varun Wadekara78bb1b2015-08-07 10:03:00 +053050int32_t tegra_soc_validate_power_state(unsigned int power_state,
51 psci_power_state_t *req_state);
Varun Wadekar254441d2015-07-23 10:07:54 +053052
Varun Wadekarb316e242015-05-19 16:48:04 +053053/* Declarations for plat_setup.c */
54const mmap_region_t *plat_get_mmio_map(void);
Varun Wadekard2014c62015-10-29 10:37:28 +053055uint32_t plat_get_console_from_id(int id);
Varun Wadekarb7b45752015-12-28 14:55:41 -080056void plat_gic_setup(void);
Antonio Nino Diaz6bf7c6b2018-09-24 17:16:05 +010057struct tegra_bl31_params *plat_get_bl31_params(void);
Varun Wadekard22d4ad2016-05-23 11:41:07 -070058plat_params_from_bl2_t *plat_get_bl31_plat_params(void);
Varun Wadekarb316e242015-05-19 16:48:04 +053059
60/* Declarations for plat_secondary.c */
61void plat_secondary_setup(void);
62int plat_lock_cpu_vectors(void);
63
Varun Wadekardc799302015-12-28 16:36:42 -080064/* Declarations for tegra_fiq_glue.c */
65void tegra_fiq_handler_setup(void);
66int tegra_fiq_get_intr_context(void);
67void tegra_fiq_set_ns_entrypoint(uint64_t entrypoint);
68
Varun Wadekarb316e242015-05-19 16:48:04 +053069/* Declarations for tegra_security.c */
70void tegra_security_setup(void);
71void tegra_security_setup_videomem(uintptr_t base, uint64_t size);
72
73/* Declarations for tegra_pm.c */
Vignesh Radhakrishnanb4a72942017-03-03 10:58:05 -080074extern uint8_t tegra_fake_system_suspend;
75
Varun Wadekarb316e242015-05-19 16:48:04 +053076void tegra_pm_system_suspend_entry(void);
77void tegra_pm_system_suspend_exit(void);
78int tegra_system_suspended(void);
79
80/* Declarations for tegraXXX_pm.c */
81int tegra_prepare_cpu_suspend(unsigned int id, unsigned int afflvl);
82int tegra_prepare_cpu_on_finish(unsigned long mpidr);
83
84/* Declarations for tegra_bl31_setup.c */
85plat_params_from_bl2_t *bl31_get_plat_params(void);
Varun Wadekar7a269e22015-06-10 14:04:32 +053086int bl31_check_ns_address(uint64_t base, uint64_t size_in_bytes);
Varun Wadekar3f0a8ad2016-03-28 15:56:47 -070087void plat_early_platform_setup(void);
Varun Wadekarb316e242015-05-19 16:48:04 +053088
Varun Wadekarbc74fec2015-07-16 15:47:03 +053089/* Declarations for tegra_delay_timer.c */
90void tegra_delay_timer_init(void);
91
Varun Wadekar93bed2a2016-03-18 13:07:33 -070092void tegra_secure_entrypoint(void);
93void tegra186_cpu_reset_handler(void);
94
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000095#endif /* TEGRA_PRIVATE_H */