blob: 5d505dd4864e94ba684f5824d217359399be8e4a [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>
Soren Brinkmann6c3e61d2013-11-21 13:38:54 -08009#include <asm/arch/clk.h>
Michal Simek59c651f2013-02-04 12:38:59 +010010#include <asm/arch/sys_proto.h>
Michal Simek00ed3452013-02-04 12:42:25 +010011#include <asm/arch/hardware.h>
Michal Simek38b343d2012-09-13 20:23:35 +000012
Michal Simek00ed3452013-02-04 12:42:25 +010013void lowlevel_init(void)
14{
Michal Simek262f08d2013-08-22 14:52:02 +020015}
16
17int arch_cpu_init(void)
18{
Michal Simek00ed3452013-02-04 12:42:25 +010019 zynq_slcr_unlock();
Michal Simek00ed3452013-02-04 12:42:25 +010020
21 /* Device config APB, unlock the PCAP */
22 writel(0x757BDF0D, &devcfg_base->unlock);
23 writel(0xFFFFFFFF, &devcfg_base->rom_shadow);
24
Michal Simekc1824ea2013-08-28 08:26:41 +020025#if (CONFIG_SYS_SDRAM_BASE == 0)
26 /* remap DDR to zero, FILTERSTART */
27 writel(0, &scu_base->filter_start);
28
Michal Simek00ed3452013-02-04 12:42:25 +010029 /* OCM_CFG, Mask out the ROM, map ram into upper addresses */
30 writel(0x1F, &slcr_base->ocm_cfg);
31 /* FPGA_RST_CTRL, clear resets on AXI fabric ports */
32 writel(0x0, &slcr_base->fpga_rst_ctrl);
Michal Simek00ed3452013-02-04 12:42:25 +010033 /* Set urgent bits with register */
34 writel(0x0, &slcr_base->ddr_urgent_sel);
35 /* Urgent write, ports S2/S3 */
36 writel(0xC, &slcr_base->ddr_urgent);
Michal Simekc1824ea2013-08-28 08:26:41 +020037#endif
Michal Simek00ed3452013-02-04 12:42:25 +010038
Soren Brinkmann6c3e61d2013-11-21 13:38:54 -080039 zynq_clk_early_init();
Michal Simek00ed3452013-02-04 12:42:25 +010040 zynq_slcr_lock();
Michal Simek262f08d2013-08-22 14:52:02 +020041
42 return 0;
Michal Simek00ed3452013-02-04 12:42:25 +010043}
Michal Simek38b343d2012-09-13 20:23:35 +000044
45void reset_cpu(ulong addr)
46{
Michal Simek59c651f2013-02-04 12:38:59 +010047 zynq_slcr_cpu_reset();
Michal Simek38b343d2012-09-13 20:23:35 +000048 while (1)
49 ;
50}
Michal Simek673ba272014-01-03 09:32:35 +010051
52#ifndef CONFIG_SYS_DCACHE_OFF
53void enable_caches(void)
54{
55 /* Enable D-cache. I-cache is already enabled in start.S */
56 dcache_enable();
57}
58#endif