summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@xilinx.com>2022-03-08 13:20:24 -0800
committerMark Hatle <mark.hatle@xilinx.com>2022-03-28 13:55:03 -0700
commit215984802b9f74b724b0395e5235356b32a2bb5a (patch)
tree94f6875c7f898cb44318ee4c25109708edc74c7d
parentc3124e085ccb3466f2528cb47f84f01f43b74913 (diff)
downloadmeta-xilinx-215984802b9f74b724b0395e5235356b32a2bb5a.tar.gz
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 <mark.hatle@xilinx.com>
-rw-r--r--meta-xilinx-standalone-experimental/recipes-bsp/embeddedsw/fsbl-firmware_git.bbappend32
-rwxr-xr-xmeta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh37
2 files changed, 51 insertions, 18 deletions
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"
15 15
16DEPENDS += "xilstandalone xiltimer xilffs xilsecure xilpm" 16DEPENDS += "xilstandalone xiltimer xilffs xilsecure xilpm"
17 17
18do_copy_psu_init[depends] += "device-tree:do_deploy" 18python() {
19python do_copy_psu_init() { 19 psu_init_path = d.getVar('PSU_INIT_PATH')
20 import glob, subprocess, os 20 if not psu_init_path:
21 21 psu_init_path = os.path.dirname(d.getVar('SYSTEM_DTFILE'))
22 system_dt = d.getVar('SYSTEM_DTFILE') 22
23 src_dir = glob.glob(d.getVar('OECMAKE_SOURCEPATH')) 23 psu_init_c = os.path.join(psu_init_path, 'psu_init.c')
24 psu_init_src = os.path.dirname(system_dt) 24 psu_init_h = os.path.join(psu_init_path, 'psu_init.h')
25 src_file = psu_init_src + str("/psu_init.c") 25
26 hdr_file = psu_init_src + str("/psu_init.h") 26 if os.path.exists(psu_init_c):
27 if os.path.exists(src_file): 27 d.appendVar('SRC_URI', ' file://%s' % psu_init_c)
28 command = ["install"] + ["-m"] + ["0755"] + [src_file] + [src_dir[0]] 28 else:
29 subprocess.run(command, check = True) 29 bb.warn("Unable to find %s, using default version" % psu_init_c)
30 command = ["install"] + ["-m"] + ["0755"] + [hdr_file] + [src_dir[0]] 30 if os.path.exists(psu_init_h):
31 subprocess.run(command, check = True) 31 d.appendVar('SRC_URI', ' file://%s' % psu_init_h)
32 else:
33 bb.warn("Unable to find %s, using default version" % psu_init_h)
32} 34}
33addtask do_copy_psu_init before do_configure after do_prepare_recipe_sysroot
34do_prepare_recipe_sysroot[rdeptask] = "do_unpack"
35 35
36do_install() { 36do_install() {
37 : 37 :
diff --git a/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh b/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh
index d7c37173..e44f1e83 100755
--- a/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh
+++ b/meta-xilinx-standalone-experimental/recipes-core/meta/files/dt-processor.sh
@@ -39,6 +39,7 @@ $0
39 [-o <overlay_dtb>] Generate overlay dts 39 [-o <overlay_dtb>] Generate overlay dts
40 [-e <external_fpga>] Apply a partial overlay 40 [-e <external_fpga>] Apply a partial overlay
41 [-m <machine>] zynqmp or versal 41 [-m <machine>] zynqmp or versal
42 [-p <psu_init_path>] Path to psu_init files, defaults to system_dtb path
42 [-l <config_file>] write local.conf changes to this file 43 [-l <config_file>] write local.conf changes to this file
43 44
44EOF 45EOF
@@ -56,6 +57,7 @@ parse_args() {
56 d) domain_file=$OPTARG ;; 57 d) domain_file=$OPTARG ;;
57 e) external_fpga=$OPTARG ;; 58 e) external_fpga=$OPTARG ;;
58 m) machine=$OPTARG ;; 59 m) machine=$OPTARG ;;
60 p) psu_init_path=$OPTARG ;;
59 l) localconf=$OPTARG ;; 61 l) localconf=$OPTARG ;;
60 h) usage ;; 62 h) usage ;;
61 :) error "Missing argument for -$OPTARG" ;; 63 :) error "Missing argument for -$OPTARG" ;;
@@ -65,6 +67,9 @@ parse_args() {
65 67
66 [ -f "${config_dir}/local.conf" ] || error "Invalid config dir: ${config_dir}" 68 [ -f "${config_dir}/local.conf" ] || error "Invalid config dir: ${config_dir}"
67 [ -f "${system_dtb}" ] || error "Unable to find: ${system_dtb}" 69 [ -f "${system_dtb}" ] || error "Unable to find: ${system_dtb}"
70 if [ -z "$psu_init_path" ]; then
71 psu_init_path=$(dirname ${system_dtb})
72 fi
68} 73}
69 74
70detect_machine() { 75detect_machine() {
@@ -195,7 +200,21 @@ cortex_a53_baremetal() {
195 mv libxil.conf "${libxil}" 200 mv libxil.conf "${libxil}"
196 mv distro.conf "${distro}" 201 mv distro.conf "${distro}"
197 202
198 cat <<EOF >"${conf_file}" 203 if [ "$1" = "fsbl" ]; then
204 if [ ! -e "${psu_init_path}/psu_init.c" ]; then
205 warn "Warning: Unable to find psu_init.c in ${psu_init_path}"
206 fi
207 if [ ! -e "${psu_init_path}/psu_init.h" ]; then
208 warn "Warning: Unable to find psu_init.h in ${psu_init_path}"
209 fi
210
211 cat <<EOF >"${conf_file}"
212PSU_INIT_PATH = "${psu_init_path}"
213EOF
214 else
215 cat /dev/null >"${conf_file}"
216 fi
217 cat <<EOF >>"${conf_file}"
199CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" 218CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}"
200ESW_MACHINE = "cortexa53-${machine}" 219ESW_MACHINE = "cortexa53-${machine}"
201DEFAULTTUNE = "cortexa53" 220DEFAULTTUNE = "cortexa53"
@@ -472,7 +491,21 @@ cortex_r5_baremetal() {
472 mv libxil.conf "${libxil}" 491 mv libxil.conf "${libxil}"
473 mv distro.conf "${distro}" 492 mv distro.conf "${distro}"
474 493
475 cat <<EOF >"${conf_file}" 494 if [ "$1" = "fsbl" ]; then
495 if [ ! -e "${psu_init_path}/psu_init.c" ]; then
496 warn "Warning: Unable to find psu_init.c in ${psu_init_path}"
497 fi
498 if [ ! -e "${psu_init_path}/psu_init.h" ]; then
499 warn "Warning: Unable to find psu_init.h in ${psu_init_path}"
500 fi
501
502 cat <<EOF >"${conf_file}"
503PSU_INIT_PATH = "${psu_init_path}"
504EOF
505 else
506 cat /dev/null >"${conf_file}"
507 fi
508 cat <<EOF >>"${conf_file}"
476CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}" 509CONFIG_DTFILE = "\${TOPDIR}/conf/dtb/${dtb_file}"
477ESW_MACHINE = "cortexr5-${machine}" 510ESW_MACHINE = "cortexr5-${machine}"
478DEFAULTTUNE = "cortexr5" 511DEFAULTTUNE = "cortexr5"