blob: e82a1fb86bb200db2c6883647e433935da9e8622 [file] [log] [blame]
Jiafei Pan46367ad2018-03-02 07:23:30 +00001/*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <cci.h>
8#include <debug.h>
9#include <mmio.h>
10#include "plat_ls.h"
11
12static const int cci_map[] = {
13 PLAT_LS1043_CCI_CLUSTER0_SL_IFACE_IX
14};
15
16void bl1_platform_setup(void)
17{
18 NOTICE(FIRMWARE_WELCOME_STR_LS1043);
19
20 ls_bl1_platform_setup();
21
22 /*
23 * Initialize system level generic timer for Layerscape Socs.
24 */
25 ls_delay_timer_init();
26
27 /* TODO: remove these DDR code */
28 VERBOSE("CS0_BNDS = %x\n", mmio_read_32(0x1080000 + 0x000));
29 mmio_write_32(0x1080000 + 0x000, 0x7f000000);
30 VERBOSE("CS0_BNDS = %x\n", mmio_read_32(0x1080000 + 0x000));
31}
32
33/*******************************************************************************
34 * Perform any BL1 specific platform actions.
35 ******************************************************************************/
36void bl1_early_platform_setup(void)
37{
38 ls_bl1_early_platform_setup();
39
40 /*
41 * Initialize Interconnect for this cluster during cold boot.
42 * No need for locks as no other CPU is active.
43 */
44 cci_init(PLAT_LS1043_CCI_BASE, cci_map, ARRAY_SIZE(cci_map));
45
46 /*
47 * Enable coherency in Interconnect for the primary CPU's cluster.
48 */
49 cci_enable_snoop_dvm_reqs(MPIDR_AFFLVL1_VAL(read_mpidr()));
50
51}
52
53unsigned int bl1_plat_get_next_image_id(void)
54{
55 return BL2_IMAGE_ID;
56}