From 215984802b9f74b724b0395e5235356b32a2bb5a Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Tue, 8 Mar 2022 13:20:24 -0800 Subject: fsbl-firmware: Move to explicit psu_init settings The location for psu_init is now explicitly set. If the psu_init files are not available, a warning will be presented to the user. Signed-off-by: Mark Hatle --- .../embeddedsw/fsbl-firmware_git.bbappend | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'meta-xilinx-standalone-experimental/recipes-bsp') diff --git a/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/fsbl-firmware_git.bbappend b/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/fsbl-firmware_git.bbappend index 32174711..056ad990 100644 --- a/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/fsbl-firmware_git.bbappend +++ b/meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/fsbl-firmware_git.bbappend @@ -15,23 +15,23 @@ ESW_COMPONENT_SRC:zynqmp = "/lib/sw_apps/zynqmp_fsbl/src" DEPENDS += "xilstandalone xiltimer xilffs xilsecure xilpm" -do_copy_psu_init[depends] += "device-tree:do_deploy" -python do_copy_psu_init() { - import glob, subprocess, os - - system_dt = d.getVar('SYSTEM_DTFILE') - src_dir = glob.glob(d.getVar('OECMAKE_SOURCEPATH')) - psu_init_src = os.path.dirname(system_dt) - src_file = psu_init_src + str("/psu_init.c") - hdr_file = psu_init_src + str("/psu_init.h") - if os.path.exists(src_file): - command = ["install"] + ["-m"] + ["0755"] + [src_file] + [src_dir[0]] - subprocess.run(command, check = True) - command = ["install"] + ["-m"] + ["0755"] + [hdr_file] + [src_dir[0]] - subprocess.run(command, check = True) +python() { + psu_init_path = d.getVar('PSU_INIT_PATH') + if not psu_init_path: + psu_init_path = os.path.dirname(d.getVar('SYSTEM_DTFILE')) + + psu_init_c = os.path.join(psu_init_path, 'psu_init.c') + psu_init_h = os.path.join(psu_init_path, 'psu_init.h') + + if os.path.exists(psu_init_c): + d.appendVar('SRC_URI', ' file://%s' % psu_init_c) + else: + bb.warn("Unable to find %s, using default version" % psu_init_c) + if os.path.exists(psu_init_h): + d.appendVar('SRC_URI', ' file://%s' % psu_init_h) + else: + bb.warn("Unable to find %s, using default version" % psu_init_h) } -addtask do_copy_psu_init before do_configure after do_prepare_recipe_sysroot -do_prepare_recipe_sysroot[rdeptask] = "do_unpack" do_install() { : -- cgit v1.2.3-54-g00ecf