fvp_bl1_setup.c 1.57 KB
Newer Older
1
/*
2
 * Copyright (c) 2013-2019, 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
#include <common/tbbr/tbbr_img_def.h>
8
#include <drivers/arm/smmu_v3.h>
9
#include <drivers/arm/sp805.h>
10
#include <plat/arm/common/arm_config.h>
11
#include <plat/arm/common/plat_arm.h>
12
#include <plat/arm/common/arm_def.h>
13
14
#include <plat/common/platform.h>
#include "fvp_private.h"
15
16
17
18
19
20

/*******************************************************************************
 * Perform any BL1 specific platform actions.
 ******************************************************************************/
void bl1_early_platform_setup(void)
{
21
	arm_bl1_early_platform_setup();
22

23
	/* Initialize the platform config for future decision making */
24
	fvp_config_setup();
25

26
	/*
27
	 * Initialize Interconnect for this cluster during cold boot.
28
29
	 * No need for locks as no other CPU is active.
	 */
30
	fvp_interconnect_init();
31
	/*
32
	 * Enable coherency in Interconnect for the primary CPU's cluster.
33
	 */
34
	fvp_interconnect_enable();
35
}
36
37
38
39
40
41
42
43
44
45

void plat_arm_secure_wdt_start(void)
{
	sp805_start(ARM_SP805_TWDG_BASE, ARM_TWDG_LOAD_VAL);
}

void plat_arm_secure_wdt_stop(void)
{
	sp805_stop(ARM_SP805_TWDG_BASE);
}
46
47
48
49
50
51
52
53
54

void bl1_platform_setup(void)
{
	arm_bl1_platform_setup();

	/* On FVP RevC, initialize SMMUv3 */
	if ((arm_config.flags & ARM_CONFIG_FVP_HAS_SMMUV3) != 0U)
		smmuv3_security_init(PLAT_FVP_SMMUV3_BASE);
}
55
56
57
58
59
60
61
62
63

__dead2 void bl1_plat_fwu_done(void *client_cookie, void *reserved)
{
	/* Setup the watchdog to reset the system as soon as possible */
	sp805_refresh(ARM_SP805_TWDG_BASE, 1U);

	while (1)
		wfi();
}