Skip to content

Commit 7c14465

Browse files
author
Bradley Bolen
committed
soc: arm: xilinx_zynqmp: Add qemu based SoC
This commit adds support for the Zynq UltraScale+ MPSoC as a qemu based platform for Cortex-R based testing. This SoC only supports an interrupt controller and serial port for limited testing. Signed-off-by: Bradley Bolen <[email protected]>
1 parent 00144f4 commit 7c14465

File tree

9 files changed

+226
-0
lines changed

9 files changed

+226
-0
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@
188188
/dts/riscv/riscv32-fe310.dtsi @nategraff-sifive
189189
/dts/riscv/riscv32-litex-vexriscv.dtsi @mateusz-holenko @kgugala @pgielda
190190
/dts/arm/armv7-r.dtsi @bbolen
191+
/dts/arm/xilinx/ @bbolen
191192
/dts/xtensa/xtensa.dtsi @ydamigos
192193
/dts/bindings/ @galak
193194
/dts/bindings/can/ @alexanderwachter

dts/arm/xilinx/zynqmp.dtsi

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/*
2+
* Copyright (c) 2019 Lexmark International, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
*/
7+
8+
#include <mem.h>
9+
#include <arm/armv7-r.dtsi>
10+
#include <dt-bindings/interrupt-controller/arm-gic.h>
11+
12+
/ {
13+
soc {
14+
interrupt-parent = <&gic>;
15+
16+
gic: interrupt-controller@f9010000 {
17+
compatible = "arm,gic";
18+
reg = <0xf9010000 0x1000>,
19+
<0xf9020000 0x100>;
20+
interrupt-controller;
21+
#interrupt-cells = <3>;
22+
interrupt-parent = <&core_intc 0>;
23+
label = "GIC";
24+
status = "okay";
25+
};
26+
27+
flash0: flash@c0000000 {
28+
compatible = "soc-nv-flash";
29+
reg = <0xc0000000 DT_SIZE_K(64)>;
30+
};
31+
32+
sram0: memory@0 {
33+
compatible = "mmio-sram";
34+
reg = <0 DT_SIZE_K(256)>;
35+
};
36+
37+
uart0: uart@ff000000 {
38+
compatible = "xlnx,xuartps";
39+
reg = <0xff000000 0x4c>;
40+
status = "disabled";
41+
interrupts = <21 0 IRQ_TYPE_LEVEL>;
42+
interrupt-names = "irq_0";
43+
label = "UART_0";
44+
};
45+
46+
ttc0: timer@ff110000 {
47+
compatible = "cdns,ttc";
48+
status = "disabled";
49+
interrupts = <36 IRQ_DEFAULT_PRIORITY IRQ_TYPE_LEVEL>,
50+
<37 IRQ_DEFAULT_PRIORITY IRQ_TYPE_LEVEL>,
51+
<38 IRQ_DEFAULT_PRIORITY IRQ_TYPE_LEVEL>;
52+
interrupt-names = "irq_0", "irq_1", "irq_2";
53+
reg = <0xff110000 0x1000>;
54+
label = "ttc0";
55+
};
56+
57+
ttc1: timer@ff120000 {
58+
compatible = "cdns,ttc";
59+
status = "disabled";
60+
interrupts = <39 IRQ_DEFAULT_PRIORITY IRQ_TYPE_LEVEL>,
61+
<40 IRQ_DEFAULT_PRIORITY IRQ_TYPE_LEVEL>,
62+
<41 IRQ_DEFAULT_PRIORITY IRQ_TYPE_LEVEL>;
63+
interrupt-names = "irq_0", "irq_1", "irq_2";
64+
reg = <0xff120000 0x1000>;
65+
label = "ttc1";
66+
};
67+
68+
ttc2: timer@ff130000 {
69+
compatible = "cdns,ttc";
70+
status = "disabled";
71+
interrupts = <42 IRQ_DEFAULT_PRIORITY IRQ_TYPE_LEVEL>,
72+
<43 IRQ_DEFAULT_PRIORITY IRQ_TYPE_LEVEL>,
73+
<44 IRQ_DEFAULT_PRIORITY IRQ_TYPE_LEVEL>;
74+
interrupt-names = "irq_0", "irq_1", "irq_2";
75+
reg = <0xff130000 0x1000>;
76+
label = "ttc2";
77+
};
78+
79+
ttc3: timer@ff140000 {
80+
compatible = "cdns,ttc";
81+
status = "disabled";
82+
interrupts = <45 IRQ_DEFAULT_PRIORITY IRQ_TYPE_LEVEL>,
83+
<46 IRQ_DEFAULT_PRIORITY IRQ_TYPE_LEVEL>,
84+
<47 IRQ_DEFAULT_PRIORITY IRQ_TYPE_LEVEL>;
85+
interrupt-names = "irq_0", "irq_1", "irq_2";
86+
reg = <0xff140000 0x1000>;
87+
label = "ttc3";
88+
};
89+
};
90+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) 2019 Lexmark International, Inc.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
zephyr_sources(
6+
soc.c
7+
)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (c) 2019 Lexmark International, Inc.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
if SOC_XILINX_ZYNQMP
6+
7+
config SOC
8+
default "xilinx_zynqmp"
9+
10+
config NUM_IRQS
11+
int
12+
# must be >= the highest interrupt number used
13+
# - include the UART interrupts
14+
default 220
15+
16+
config 2ND_LVL_ISR_TBL_OFFSET
17+
default 1
18+
19+
config MAX_IRQ_PER_AGGREGATOR
20+
default 219
21+
22+
config NUM_2ND_LEVEL_AGGREGATORS
23+
default 1
24+
25+
config SYS_CLOCK_HW_CYCLES_PER_SEC
26+
int
27+
default 12000000
28+
29+
config FLASH_SIZE
30+
default $(dt_int_val,DT_FLASH_SIZE)
31+
32+
config FLASH_BASE_ADDRESS
33+
default $(dt_hex_val,DT_FLASH_BASE_ADDRESS)
34+
35+
endif

soc/arm/xilinx_zynqmp/Kconfig.soc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2019 Lexmark International, Inc.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
config SOC_XILINX_ZYNQMP
6+
bool "Xilinx ZynqMP"
7+
select CPU_CORTEX_R5
8+
select GIC
9+
select MULTI_LEVEL_INTERRUPTS
10+
select 2ND_LEVEL_INTERRUPTS

soc/arm/xilinx_zynqmp/dts_fixup.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2019 Lexmark International, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
*/
7+
8+
#undef DT_INST_0_XLNX_XUARTPS_IRQ_0
9+
#define DT_INST_0_XLNX_XUARTPS_IRQ_0 ((DT_INST_0_XLNX_XUARTPS_IRQ_IRQ_0 + 1) << 8)
10+
11+
#undef DT_INST_0_CDNS_TTC_IRQ_0
12+
#define DT_INST_0_CDNS_TTC_IRQ_0 ((DT_INST_0_CDNS_TTC_IRQ_IRQ_0 + 1) << 8)
13+
#undef DT_INST_0_CDNS_TTC_IRQ_1
14+
#define DT_INST_0_CDNS_TTC_IRQ_1 ((DT_INST_0_CDNS_TTC_IRQ_IRQ_1 + 1) << 8)
15+
#undef DT_INST_0_CDNS_TTC_IRQ_2
16+
#define DT_INST_0_CDNS_TTC_IRQ_2 ((DT_INST_0_CDNS_TTC_IRQ_IRQ_2 + 1) << 8)

soc/arm/xilinx_zynqmp/linker.ld

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright (c) 2019 Lexmark International, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
*/
7+
8+
#include <arch/arm/cortex_r/scripts/linker.ld>

soc/arm/xilinx_zynqmp/soc.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2019 Lexmark International, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
*/
7+
8+
#include <kernel.h>
9+
#include <device.h>
10+
#include <init.h>
11+
12+
#include <arch/cpu.h>
13+
/**
14+
*
15+
* @brief Perform basic hardware initialization
16+
*
17+
* @return 0
18+
*/
19+
20+
static int soc_init(struct device *arg)
21+
{
22+
ARG_UNUSED(arg);
23+
24+
/* Install default handler that simply resets the CPU
25+
* if configured in the kernel, NOP otherwise
26+
*/
27+
NMI_INIT();
28+
return 0;
29+
}
30+
31+
SYS_INIT(soc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

soc/arm/xilinx_zynqmp/soc.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2019 Lexmark International, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
*/
7+
8+
#ifndef _BOARD__H_
9+
#define _BOARD__H_
10+
11+
#include <misc/util.h>
12+
13+
#ifdef __cplusplus
14+
extern "C" {
15+
#endif
16+
17+
#ifndef _ASMLANGUAGE
18+
19+
#include <device.h>
20+
#include <misc/util.h>
21+
22+
#endif /* !_ASMLANGUAGE */
23+
24+
#ifdef __cplusplus
25+
}
26+
#endif
27+
28+
#endif /* _BOARD__H_ */

0 commit comments

Comments
 (0)