tsp_plat_setup.c 1.65 KB
Newer Older
1
/*
2
 * Copyright (c) 2014-2016, ARM Limited and Contributors. All rights reserved.
3
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
6
7
8
9
10
 */

#include <bl_common.h>
#include <console.h>
#include <debug.h>
#include <plat_arm.h>
11
#include <platform_tsp.h>
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "../zynqmp_private.h"

#define BL32_END (unsigned long)(&__BL32_END__)

/*******************************************************************************
 * Initialize the UART
 ******************************************************************************/
void tsp_early_platform_setup(void)
{
	/*
	 * Initialize a different console than already in use to display
	 * messages from TSP
	 */
25
	console_init(ZYNQMP_UART_BASE, zynqmp_get_uart_clk(),
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
		     ZYNQMP_UART_BAUDRATE);

	/* Initialize the platform config for future decision making */
	zynqmp_config_setup();
}

/*******************************************************************************
 * Perform platform specific setup placeholder
 ******************************************************************************/
void tsp_platform_setup(void)
{
	plat_arm_gic_driver_init();
	plat_arm_gic_init();
}

/*******************************************************************************
 * Perform the very early platform specific architectural setup here. At the
 * moment this is only intializes the MMU
 ******************************************************************************/
void tsp_plat_arch_setup(void)
{
47
48
49
	arm_setup_page_tables(BL32_BASE,
			      BL32_END - BL32_BASE,
			      BL_CODE_BASE,
50
			      BL_CODE_END,
51
			      BL_RO_DATA_BASE,
52
			      BL_RO_DATA_END,
53
54
			      BL_COHERENT_RAM_BASE,
			      BL_COHERENT_RAM_END
55
			      );
56
	enable_mmu_el1(0);
57
}