Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 7 | #include <debug.h> |
Antonio Nino Diaz | 09a00ef | 2019-01-11 13:12:58 +0000 | [diff] [blame^] | 8 | #include <drivers/arm/arm_gic.h> |
| 9 | #include <drivers/arm/pl011.h> |
| 10 | #include <drivers/console.h> |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 11 | #include <io_storage.h> |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 12 | #include <plat_arm.h> |
| 13 | #include <platform.h> |
| 14 | #include <platform_def.h> |
| 15 | |
| 16 | #pragma weak tftf_platform_setup |
| 17 | |
| 18 | void arm_platform_setup(void) |
| 19 | { |
| 20 | #if USE_NVM |
| 21 | int ret; |
| 22 | |
| 23 | ret = arm_io_setup(); |
| 24 | if (ret != IO_SUCCESS) |
| 25 | WARN("IO setup failed : 0x%x\n", ret); |
| 26 | #endif |
| 27 | |
| 28 | #if IMAGE_NS_BL2U |
| 29 | /* NS_BL2U is not expecting interrupts. */ |
| 30 | return; |
| 31 | #endif |
| 32 | |
| 33 | plat_arm_gic_init(); |
| 34 | |
| 35 | arm_gic_setup_global(); |
| 36 | arm_gic_setup_local(); |
| 37 | } |
| 38 | |
| 39 | void tftf_platform_setup(void) |
| 40 | { |
| 41 | arm_platform_setup(); |
| 42 | } |
| 43 | |
| 44 | void tftf_plat_arch_setup(void) |
| 45 | { |
| 46 | tftf_plat_configure_mmu(); |
| 47 | } |
| 48 | |
| 49 | void tftf_early_platform_setup(void) |
| 50 | { |
| 51 | console_init(PLAT_ARM_UART_BASE, PLAT_ARM_UART_CLK_IN_HZ, |
| 52 | PL011_BAUDRATE); |
| 53 | } |