Skip to content

Commit

Permalink
Merge chrisguikema/zynqmp_2018_3
Browse files Browse the repository at this point in the history
  • Loading branch information
axel-h committed Jan 29, 2024
2 parents 7674cfc + 3cb1087 commit c76d58a
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 11 deletions.
25 changes: 15 additions & 10 deletions apps/Arm/vm_minimal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,24 @@ elseif("${KernelARMPlatform}" STREQUAL "zcu102")

set(dts_file "${CAMKES_VM_IMAGES_DIR}/zynqmp/${VmZynqmpPetalinuxVersion}/linux.dts")

add_custom_command(
OUTPUT linux/linux-dtb
COMMAND
dtc -q -I dts -O dtb -o linux/linux-dtb ${dts_file}
VERBATIM
DEPENDS ${dts_file}
)
# Petalinux 2018.3 can simply use the kernel device tree
if(VmZynqmpPetalinux2021_1)
add_custom_command(
OUTPUT linux/linux-dtb
COMMAND
dtc -q -I dts -O dtb -o linux/linux-dtb ${dts_file}
VERBATIM
DEPENDS ${dts_file}
)

# Create custom target for setting the dtb
add_custom_target(set_dtb DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/linux/linux-dtb")
AddToFileServer("linux-dtb" "${CMAKE_CURRENT_BINARY_DIR}/linux/linux-dtb" DEPENDS set_dtb)
# Create custom target for setting the dtb
add_custom_target(set_dtb DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/linux/linux-dtb")
AddToFileServer("linux-dtb" "${CMAKE_CURRENT_BINARY_DIR}/linux/linux-dtb" DEPENDS set_dtb)
endif()

list(APPEND cpp_includes "${CAMKES_VM_DIR}/components/VM_Arm/plat_include/zynqmp")

CAmkESAddImportPath(${KernelARMPlatform}/${VmZynqmpPetalinuxVersion})
endif()

AddCamkesCPPFlag(cpp_flags CONFIG_VARS VmEmmc2NoDMA VmVUSB Tk1DeviceFwd Tk1Insecure)
Expand Down
1 change: 0 additions & 1 deletion apps/Arm/vm_minimal/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ endif()
if(${PLATFORM} STREQUAL "zcu102")
set(AARCH64 ON CACHE BOOL "" FORCE)
set(KernelAllowSMCCalls ON CACHE BOOL "" FORCE)
set(VmZynqmpPetalinuxVersion 2021_1 CACHE STRING "" FORCE)
endif()
57 changes: 57 additions & 0 deletions apps/Arm/vm_minimal/zcu102/2018_3/devices.camkes
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright 2023, DornerWorks
*
* SPDX-License-Identifier: BSD-2-Clause
*/

#include <plat/smc.h>
#include <configurations/vm.h>

#define VM_INITRD_MAX_SIZE 0x1900000 //25 MB
#define VM_RAM_BASE 0x10000000
#define VM_RAM_SIZE 0x10000000
#define VM_ENTRY_ADDR 0x10080000
#define VM_RAM_OFFSET 0
#define VM_DTB_ADDR 0x12000000
#define VM_INITRD_ADDR 0x13000000

assembly {
composition {}
configuration {

vm0.vm_address_config = {
"ram_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_paddr_base" : VAR_STRINGIZE(VM_RAM_BASE),
"ram_size" : VAR_STRINGIZE(VM_RAM_SIZE),
"dtb_addr" : VAR_STRINGIZE(VM_DTB_ADDR),
"initrd_addr" : VAR_STRINGIZE(VM_INITRD_ADDR),
"kernel_entry_addr" : VAR_STRINGIZE(VM_ENTRY_ADDR),
};
vm0.num_vcpus = 4;

/* Extra untyped pool to allow for 256MB of RAM */
vm0.simple_untyped28_pool = 1;

vm0.vm_image_config = {
"kernel_name" : "linux",
"initrd_name" : "linux-initrd",
"kernel_bootcmdline" : "console=ttyPS0,115200 root=/dev/ram rw earlycon clk_ignore_unused",
"kernel_stdout" : "serial0:115200n8",
"generate_dtb" : true,
"provide_dtb" : false,
"map_one_to_one" : false,
"provide_initrd": true,
"clean_cache" : false,
};

vm0.dtb = dtb([{"path": "/amba/serial@ff000000"} ]);

vm0.untyped_mmios = ["0xf9060000:12"]; // Interrupt Controller Virtual CPU interface (Virtual Machine view)

vm0.plat_keep_devices = [];
vm0.plat_keep_devices_and_subtree = [];

vm0.allow_smc = false;
vm0.allowed_smc_functions = [];
}
}
File renamed without changes.

0 comments on commit c76d58a

Please sign in to comment.