blob: 2bb38438ae4ab6848ca80e52d62aaf40d0c0d307 [file] [log] [blame]
Michal Simek38b343d2012-09-13 20:23:35 +00001/*
2 * Copyright (C) 2012 Michal Simek <monstr@monstr.eu>
3 * Copyright (C) 2012 Xilinx, Inc. All rights reserved.
4 *
Wolfgang Denk3765b3e2013-10-07 13:07:26 +02005 * SPDX-License-Identifier: GPL-2.0+
Michal Simek38b343d2012-09-13 20:23:35 +00006 */
7#include <common.h>
Michal Simek00ed3452013-02-04 12:42:25 +01008#include <asm/io.h>
Michal Simek59c651f2013-02-04 12:38:59 +01009#include <asm/arch/sys_proto.h>
Michal Simek00ed3452013-02-04 12:42:25 +010010#include <asm/arch/hardware.h>
Michal Simek38b343d2012-09-13 20:23:35 +000011
Michal Simek00ed3452013-02-04 12:42:25 +010012void lowlevel_init(void)
13{
Michal Simek262f08d2013-08-22 14:52:02 +020014}
15
16int arch_cpu_init(void)
17{
Michal Simek00ed3452013-02-04 12:42:25 +010018 zynq_slcr_unlock();
19 /* remap DDR to zero, FILTERSTART */
20 writel(0, &scu_base->filter_start);
21
22 /* Device config APB, unlock the PCAP */
23 writel(0x757BDF0D, &devcfg_base->unlock);
24 writel(0xFFFFFFFF, &devcfg_base->rom_shadow);
25
26 /* OCM_CFG, Mask out the ROM, map ram into upper addresses */
27 writel(0x1F, &slcr_base->ocm_cfg);
28 /* FPGA_RST_CTRL, clear resets on AXI fabric ports */
29 writel(0x0, &slcr_base->fpga_rst_ctrl);
30 /* TZ_DDR_RAM, Set DDR trust zone non-secure */
31 writel(0xFFFFFFFF, &slcr_base->trust_zone);
32 /* Set urgent bits with register */
33 writel(0x0, &slcr_base->ddr_urgent_sel);
34 /* Urgent write, ports S2/S3 */
35 writel(0xC, &slcr_base->ddr_urgent);
36
37 zynq_slcr_lock();
Michal Simek262f08d2013-08-22 14:52:02 +020038
39 return 0;
Michal Simek00ed3452013-02-04 12:42:25 +010040}
Michal Simek38b343d2012-09-13 20:23:35 +000041
42void reset_cpu(ulong addr)
43{
Michal Simek59c651f2013-02-04 12:38:59 +010044 zynq_slcr_cpu_reset();
Michal Simek38b343d2012-09-13 20:23:35 +000045 while (1)
46 ;
47}