2 * (C) Copyright 2014 - 2015 Xilinx, Inc.
3 * Michal Simek <michal.simek@xilinx.com>
5 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/arch/hardware.h>
10 #include <asm/arch/sys_proto.h>
11 #include <asm/armv8/mmu.h>
14 #define ZYNQ_SILICON_VER_MASK 0xF000
15 #define ZYNQ_SILICON_VER_SHIFT 12
17 DECLARE_GLOBAL_DATA_PTR;
19 static struct mm_region zynqmp_mem_map[] = {
24 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
30 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
32 PTE_BLOCK_PXN | PTE_BLOCK_UXN
37 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
39 PTE_BLOCK_PXN | PTE_BLOCK_UXN
44 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
47 .virt = 0x400000000UL,
48 .phys = 0x400000000UL,
49 .size = 0x200000000UL,
50 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
52 PTE_BLOCK_PXN | PTE_BLOCK_UXN
54 .virt = 0x600000000UL,
55 .phys = 0x600000000UL,
56 .size = 0x800000000UL,
57 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
60 .virt = 0xe00000000UL,
61 .phys = 0xe00000000UL,
62 .size = 0xf200000000UL,
63 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
65 PTE_BLOCK_PXN | PTE_BLOCK_UXN
71 struct mm_region *mem_map = zynqmp_mem_map;
73 u64 get_page_table_size(void)
78 static unsigned int zynqmp_get_silicon_version_secure(void)
82 ver = readl(&csu_base->version);
83 ver &= ZYNQMP_SILICON_VER_MASK;
84 ver >>= ZYNQMP_SILICON_VER_SHIFT;
89 unsigned int zynqmp_get_silicon_version(void)
91 if (current_el() == 3)
92 return zynqmp_get_silicon_version_secure();
94 gd->cpu_clk = get_tbclk();
96 switch (gd->cpu_clk) {
98 return ZYNQMP_CSU_VERSION_VELOCE;
100 return ZYNQMP_CSU_VERSION_QEMU;
102 return ZYNQMP_CSU_VERSION_EP108;
105 return ZYNQMP_CSU_VERSION_SILICON;