Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zcu102 platform support. #91

Open
wants to merge 24 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e795ead
xlnx-zcu102: add xuartps driver for hvisor
enkerewpo Dec 7, 2024
f95942f
disable xuartps init for now
enkerewpo Dec 10, 2024
e8df0ad
support FIT image packing and qemu boot using FIT
enkerewpo Dec 10, 2024
14a6ede
update fit source and platform config for root zone
enkerewpo Dec 10, 2024
ca019b7
add commands for uboot to load root vmlinux.bin into memory
enkerewpo Dec 11, 2024
7c0bbc5
ok to see zone 0 xlnx-linux earlycon, but need gicv2 support
enkerewpo Dec 11, 2024
57aa23e
add default zcu102 xlnx-linux dts
enkerewpo Dec 12, 2024
11914f8
update zcu102_aarch64.rs to match dts memory range
enkerewpo Dec 12, 2024
726900e
enable CPU0 only for xlnx-linux for debugging
enkerewpo Dec 12, 2024
032230c
Run linux with smp successfully.
ForeverYolo Dec 5, 2024
38a34fc
GICV2 module code optimization.
ForeverYolo Dec 5, 2024
1494f59
Compatible with gic versions 2 and 3
ForeverYolo Dec 6, 2024
9bcf4bb
config zcu102 uart.
ForeverYolo Dec 10, 2024
b7c5fce
Change MMU layout.
ForeverYolo Jan 1, 2025
e037ccf
Add SMC Call to support ZCU102 Firmware.
ForeverYolo Jan 1, 2025
fd7e091
Adjust gicc base address.
ForeverYolo Jan 1, 2025
826bbba
Adjust ivc.rs code to support gicv2 and gicv3.
ForeverYolo Jan 1, 2025
fecf191
Fix rebase bug.
ForeverYolo Jan 1, 2025
65d6b16
fix. sync FIT its's root linux dtb load addr with platform definition
enkerewpo Jan 1, 2025
5eb9c76
Optimized the makefile compilation logic and added file information t…
ForeverYolo Jan 2, 2025
2186d4d
The issue that the root interrupt is invalid when starting nonroot is…
ForeverYolo Jan 8, 2025
d965edd
Add a maintenance mechanism for gicv2 to handle LR overflows.
ForeverYolo Jan 8, 2025
b27a73d
Config zcu102 to run nonroot, Done.
ForeverYolo Jan 8, 2025
3fe1e9f
Add ZCU102 nonroot dts.
ForeverYolo Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ Image*
*.ext4
*.qcow2
*.dtb
.DS_Store
.DS_Store
temp-fit.its
fitImage
sd.img
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
// "rust-analyzer.cargo.target": "riscv64gc-unknown-none-elf",
// "rust-analyzer.cargo.target": "loongarch64-unknown-none",
"rust-analyzer.checkOnSave.allTargets": false,
// "rust-analyzer.cargo.features": [
// "board_qemu"
// ]
"rust-analyzer.cargo.features": [
"platform_zcu102"
]
}
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ loongArch64 = "0.2.4"
[features]
platform_qemu = []
platform_imx8mp = []
platform_zcu102 = []
gicv3 = []
gicv2 = []

[profile.dev]
panic = "abort"
Expand Down
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ PORT ?= 2333
MODE ?= debug
OBJCOPY ?= rust-objcopy --binary-architecture=$(ARCH)
KDIR ?= ../../linux
FEATURES ?= platform_qemu
FEATURES ?= platform_zcu102,gicv2
BOARD ?= zcu102

ifeq ($(ARCH),aarch64)
RUSTC_TARGET := aarch64-unknown-none
Expand Down Expand Up @@ -38,7 +39,6 @@ build_args += --target $(RUSTC_TARGET)
build_args += -Z build-std=core,alloc
build_args += -Z build-std-features=compiler-builtins-mem


ifeq ($(MODE), release)
build_args += --release
endif
Expand Down Expand Up @@ -78,8 +78,6 @@ cp: all
clean:
cargo clean

ifeq ($(ARCH),loongarch64)
include scripts/3a5000-loongarch64.mk
else
include scripts/qemu-$(ARCH).mk
endif
# set the BOARD variable to "3a5000"/qemu/zcu102/imx8mp to
# include the corresponding script under the ./scripts directory
include scripts/${BOARD}-${ARCH}.mk
Binary file added images/aarch64/bootloader/u-boot-v2.bin
Binary file not shown.
97 changes: 97 additions & 0 deletions images/aarch64/devicetree/linux1-v2.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/dts-v1/;

/ {
#size-cells = <0x02>;
#address-cells = <0x02>;
interrupt-parent = <0x01>;
model = "linux,dummy-virt";
compatible = "linux,dummy-virt";

cpus {
#size-cells = <0x00>;
#address-cells = <0x01>;

cpu@0 {
phandle = <0x8010>;
reg = <0x00>;
enable-method = "psci";
compatible = "arm,cortex-a53";
device_type = "cpu";
};

cpu@1 {
phandle = <0x800f>;
reg = <0x01>;
enable-method = "psci";
compatible = "arm,cortex-a53";
device_type = "cpu";
};
};

psci {
compatible = "arm,psci-0.2";
method = "smc";
};

memory@50000000 {
device_type = "memory";
reg = <0x00 0x50000000 0x00 0x80000000>;
};

intc@8000000 {
phandle = <0x01>;
interrupts = <0x01 0x09 0x04>;
reg = <0x00 0x8000000 0x00 0x10000 0x00 0x8010000 0x00 0x10000 0x00 0x8030000 0x00 0x10000 0x00 0x8040000 0x00 0x10000>;
compatible = "arm,cortex-a15-gic";
ranges;
#size-cells = <0x02>;
#address-cells = <0x02>;
interrupt-controller;
#interrupt-cells = <0x03>;
};

apb-pclk {
phandle = <0x8000>;
clock-output-names = "clk24mhz";
clock-frequency = <0x16e3600>;
#clock-cells = <0x00>;
compatible = "fixed-clock";
};

pl011@9000000 {
clock-names = "uartclk\0apb_pclk";
clocks = <0x8000 0x8000>;
interrupt-parent = <0x01>;
interrupts = <0x00 0x01 0x04>;
reg = <0x00 0x9000000 0x00 0x1000>;
compatible = "arm,pl011\0arm,primecell";
};

timer {
interrupt-parent = <0x01>;
interrupts = <0x01 0x0d 0xf04 0x01 0x0e 0xf04 0x01 0x0b 0xf04 0x01 0x0a 0xf04>;
always-on;
compatible = "arm,armv8-timer\0arm,armv7-timer";
};

virtio_mmio@a003a00 {
dma-coherent;
interrupt-parent = <0x01>;
interrupts = <0x00 0x2d 0x01>;
reg = <0x00 0xa003a00 0x00 0x200>;
compatible = "virtio,mmio";
};

virtio_mmio@a003e00 {
dma-coherent;
interrupt-parent = <0x01>;
interrupts = <0x00 0x2f 0x01>;
reg = <0x00 0xa003e00 0x00 0x200>;
compatible = "virtio,mmio";
};

chosen {
bootargs = "earlycon console=ttyAMA0 root=/dev/vda mem=768M rw";
stdout-path = "/pl011@9000000";
};
};
6 changes: 0 additions & 6 deletions images/aarch64/devicetree/linux1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,4 @@
interrupt-parent = <0x01>;
interrupts = <0x00 0x20 0x01>;
};

hvisor_ivc_device {
compatible = "hvisor";
interrupt-parent = <0x01>;
interrupts = <0x00 0x21 0x01>;
};
};
126 changes: 126 additions & 0 deletions images/aarch64/devicetree/zcu102-nonroot-aarch64.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
/dts-v1/;

/ {
compatible = "xlnx,zynqmp-zcu102-revB\0xlnx,zynqmp-zcu102\0xlnx,zynqmp";
#address-cells = <0x02>;
#size-cells = <0x02>;
model = "ZynqMP ZCU102 RevB";

cpus {
#address-cells = <0x01>;
#size-cells = <0x00>;

cpu@2 {
compatible = "arm,cortex-a53";
device_type = "cpu";
enable-method = "psci";
reg = <0x02>;
operating-points-v2 = <0x01>;
cpu-idle-states = <0x02>;
next-level-cache = <0x03>;
phandle = <0x08>;
};

cpu@3 {
compatible = "arm,cortex-a53";
device_type = "cpu";
enable-method = "psci";
reg = <0x03>;
operating-points-v2 = <0x01>;
cpu-idle-states = <0x02>;
next-level-cache = <0x03>;
phandle = <0x09>;
};

l2-cache {
compatible = "cache";
cache-level = <0x02>;
phandle = <0x03>;
};

idle-states {
entry-method = "psci";

cpu-sleep-0 {
compatible = "arm,idle-state";
arm,psci-suspend-param = <0x40000000>;
local-timer-stop;
entry-latency-us = <0x12c>;
exit-latency-us = <0x258>;
min-residency-us = <0x2710>;
phandle = <0x02>;
};
};
};

pmu {
compatible = "arm,armv8-pmuv3";
interrupt-parent = <0x05>;
interrupts = <0x00 0x8f 0x04 0x00 0x90 0x04 0x00 0x91 0x04 0x00 0x92 0x04>;
interrupt-affinity = <0x06 0x07 0x08 0x09>;
};

psci {
compatible = "arm,psci-0.2";
method = "smc";
};

memory@0 {
device_type = "memory";
reg = <0x00 0x50000000 0x00 0x25000000>;
};

timer {
compatible = "arm,armv8-timer";
interrupt-parent = <0x05>;
interrupts = <0x01 0x0d 0xf08 0x01 0x0e 0xf08 0x01 0x0b 0xf08 0x01 0x0a 0xf08>;
};

axi {
compatible = "simple-bus";
bootph-all;
#address-cells = <0x02>;
#size-cells = <0x02>;
ranges;
phandle = <0x58>;

interrupt-controller@f9010000 {
compatible = "arm,gic-400";
#interrupt-cells = <0x03>;
reg = <0x00 0xf9010000 0x00 0x10000 0x00 0xf9020000 0x00 0x20000 0x00 0xf9040000 0x00 0x20000 0x00 0xf9060000 0x00 0x20000>;
interrupt-controller;
interrupt-parent = <0x05>;
interrupts = <0x01 0x09 0xf04>;
num_cpus = <0x02>;
num_interrupts = <0x60>;
phandle = <0x05>;
};
};


aliases {
};

// virtio blk
virtio_mmio@ff9d0000 {
dma-coherent;
interrupt-parent = <0x05>;
interrupts = <0x0 0x2e 0x1>;
reg = <0x0 0xff9d0000 0x0 0x200>;
compatible = "virtio,mmio";
};

// virtio serial
virtio_mmio@ff9e0000 {
dma-coherent;
interrupt-parent = <0x05>;
interrupts = <0x0 0x2c 0x1>;
reg = <0x0 0xff9e0000 0x0 0x200>;
compatible = "virtio,mmio";
};

chosen {
bootargs = "earlycon=virtio,mmio,0xff9e0000 console=hvc0 root=/dev/vda rootwait rw";
stdout-path = "/virtio_mmio@0xff9e0000";
};
};
Loading