ARM: zynq: Enable the Neon instructions
[oweals/u-boot.git] / arch / arm / cpu / armv7 / zynq / cpu.c
1 /*
2  * Copyright (C) 2012 Michal Simek <monstr@monstr.eu>
3  * Copyright (C) 2012 Xilinx, Inc. All rights reserved.
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7 #include <common.h>
8 #include <asm/io.h>
9 #include <asm/arch/clk.h>
10 #include <asm/arch/sys_proto.h>
11 #include <asm/arch/hardware.h>
12
13
14 #define ZYNQ_SILICON_VER_MASK   0xF0000000
15 #define ZYNQ_SILICON_VER_SHIFT  28
16
17 int arch_cpu_init(void)
18 {
19         zynq_slcr_unlock();
20 #ifndef CONFIG_SPL_BUILD
21         /* Device config APB, unlock the PCAP */
22         writel(0x757BDF0D, &devcfg_base->unlock);
23         writel(0xFFFFFFFF, &devcfg_base->rom_shadow);
24
25 #if (CONFIG_SYS_SDRAM_BASE == 0)
26         /* remap DDR to zero, FILTERSTART */
27         writel(0, &scu_base->filter_start);
28
29         /* 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);
33         /* 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);
37 #endif
38 #endif
39         zynq_clk_early_init();
40         zynq_slcr_lock();
41
42         return 0;
43 }
44
45 unsigned int zynq_get_silicon_version(void)
46 {
47         unsigned int ver;
48
49         ver = (readl(&devcfg_base->mctrl) &
50                ZYNQ_SILICON_VER_MASK) >> ZYNQ_SILICON_VER_SHIFT;
51
52         return ver;
53 }
54
55 void reset_cpu(ulong addr)
56 {
57         zynq_slcr_cpu_reset();
58         while (1)
59                 ;
60 }
61
62 #ifndef CONFIG_SYS_DCACHE_OFF
63 void enable_caches(void)
64 {
65         /* Enable D-cache. I-cache is already enabled in start.S */
66         dcache_enable();
67 }
68 #endif