Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 1 | /* |
Sandrine Bailleux | 4a1267a | 2016-05-18 16:11:47 +0100 | [diff] [blame] | 2 | * Copyright (c) 2014-2016, ARM Limited and Contributors. All rights reserved. |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <bl_common.h> |
| 8 | #include <console.h> |
| 9 | #include <debug.h> |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 10 | #include <plat_arm.h> |
Isla Mitchell | e363146 | 2017-07-14 10:46:32 +0100 | [diff] [blame] | 11 | #include <platform_tsp.h> |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 12 | #include "../zynqmp_private.h" |
| 13 | |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 14 | #define BL32_END (unsigned long)(&__BL32_END__) |
| 15 | |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 16 | /******************************************************************************* |
| 17 | * Initialize the UART |
| 18 | ******************************************************************************/ |
| 19 | void tsp_early_platform_setup(void) |
| 20 | { |
| 21 | /* |
| 22 | * Initialize a different console than already in use to display |
| 23 | * messages from TSP |
| 24 | */ |
Soren Brinkmann | 99c0d7b | 2016-06-10 09:57:14 -0700 | [diff] [blame] | 25 | console_init(ZYNQMP_UART_BASE, zynqmp_get_uart_clk(), |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 26 | ZYNQMP_UART_BAUDRATE); |
| 27 | |
| 28 | /* Initialize the platform config for future decision making */ |
| 29 | zynqmp_config_setup(); |
| 30 | } |
| 31 | |
| 32 | /******************************************************************************* |
| 33 | * Perform platform specific setup placeholder |
| 34 | ******************************************************************************/ |
| 35 | void tsp_platform_setup(void) |
| 36 | { |
| 37 | plat_arm_gic_driver_init(); |
| 38 | plat_arm_gic_init(); |
| 39 | } |
| 40 | |
| 41 | /******************************************************************************* |
| 42 | * Perform the very early platform specific architectural setup here. At the |
| 43 | * moment this is only intializes the MMU |
| 44 | ******************************************************************************/ |
| 45 | void tsp_plat_arch_setup(void) |
| 46 | { |
Soren Brinkmann | 6d1ba58 | 2016-07-08 14:45:14 -0700 | [diff] [blame] | 47 | arm_setup_page_tables(BL32_BASE, |
| 48 | BL32_END - BL32_BASE, |
| 49 | BL_CODE_BASE, |
Masahiro Yamada | 51bef61 | 2017-01-18 02:10:08 +0900 | [diff] [blame] | 50 | BL_CODE_END, |
Soren Brinkmann | 6d1ba58 | 2016-07-08 14:45:14 -0700 | [diff] [blame] | 51 | BL_RO_DATA_BASE, |
Masahiro Yamada | 51bef61 | 2017-01-18 02:10:08 +0900 | [diff] [blame] | 52 | BL_RO_DATA_END, |
Masahiro Yamada | 0fac5af | 2016-12-28 16:11:41 +0900 | [diff] [blame] | 53 | BL_COHERENT_RAM_BASE, |
| 54 | BL_COHERENT_RAM_END |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 55 | ); |
Sandrine Bailleux | 4a1267a | 2016-05-18 16:11:47 +0100 | [diff] [blame] | 56 | enable_mmu_el1(0); |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 57 | } |