summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>2023-03-16 18:03:15 -0600
committerMark Hatle <mark.hatle@amd.com>2023-03-17 11:45:20 -0500
commit99736a9c7e612ab4a1466d9231da05641250e268 (patch)
treeabbae907f9e3bc85b51e994954422f403f54a944
parent9453122a77763873cd43ef2484260c279449d30f (diff)
downloadmeta-xilinx-99736a9c7e612ab4a1466d9231da05641250e268.tar.gz
fpgamanager_custom: Rename bootgen generated bit bin file
In case of Zynq-7000, using both "-process_bitstream bin" and "-o" in bootgen flag to convert bit file to bin format, "-o" option will not be effective and generated output file name is ${S}+${BIT_PATH}/<bit_file_name>.bit.bin file which causes build errors. Hence we need to rename this file from <bit_file_name>.bit.bin to ${PN}.bit.bin which matches the firmware name in dtbo and move ${PN}.bit.bin to ${B} directory. Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com> Signed-off-by: Mark Hatle <mark.hatle@amd.com> (cherry picked from commit c9a98fe32be99654cae69dab524a744d898bf7a9) Signed-off-by: Mark Hatle <mark.hatle@amd.com>
-rw-r--r--meta-xilinx-core/classes/fpgamanager_custom.bbclass18
1 files changed, 15 insertions, 3 deletions
diff --git a/meta-xilinx-core/classes/fpgamanager_custom.bbclass b/meta-xilinx-core/classes/fpgamanager_custom.bbclass
index 179169af..e5255783 100644
--- a/meta-xilinx-core/classes/fpgamanager_custom.bbclass
+++ b/meta-xilinx-core/classes/fpgamanager_custom.bbclass
@@ -19,7 +19,7 @@ PROVIDES = ""
19do_fetch[cleandirs] = "${B}" 19do_fetch[cleandirs] = "${B}"
20 20
21DT_PADDING_SIZE = "0x1000" 21DT_PADDING_SIZE = "0x1000"
22BOOTGEN_FLAGS ?= " -arch ${SOC_FAMILY} ${@bb.utils.contains('SOC_FAMILY','zynqmp','-w','-process_bitstream bin',d)}" 22BOOTGEN_FLAGS ?= " -arch ${SOC_FAMILY} -w ${@bb.utils.contains('SOC_FAMILY','zynqmp','','-process_bitstream bin',d)}"
23 23
24S ?= "${WORKDIR}" 24S ?= "${WORKDIR}"
25FW_DIR ?= "" 25FW_DIR ?= ""
@@ -94,7 +94,7 @@ python do_configure() {
94} 94}
95 95
96python devicetree_do_compile:append() { 96python devicetree_do_compile:append() {
97 import glob, subprocess 97 import glob, subprocess, shutil
98 soc_family = d.getVar("SOC_FAMILY") 98 soc_family = d.getVar("SOC_FAMILY")
99 99
100 # Convert .bit to bit.bin format only if dtsi is input. 100 # Convert .bit to bit.bin format only if dtsi is input.
@@ -112,8 +112,20 @@ python devicetree_do_compile:append() {
112 bootgenargs += ["-image", biffile, "-o", pn + ".bit.bin"] 112 bootgenargs += ["-image", biffile, "-o", pn + ".bit.bin"]
113 subprocess.run(bootgenargs, check = True) 113 subprocess.run(bootgenargs, check = True)
114 114
115 # In Zynq7k using both "-process_bitstream bin" and "-o" in bootgen flag,
116 # to convert bit file to bin format, "-o" option will not be effective
117 # and generated output file name is ${S}+${BIT_PATH}/<bit_file_name>.bit.bin
118 # file, Hence we need to rename this file from <bit_file_name>.bit.bin to
119 # ${PN}.bit.bin which matches the firmware name in dtbo and move
120 # ${PN}.bit.bin to ${B} directory.
121 if soc_family == 'zynq':
122 src_bitbin_file = glob.glob(d.getVar('S') + (d.getVar('BIT_PATH') or '') + '/*.bit.bin')[0]
123 dst_bitbin_file = d.getVar('B') + '/' + pn + '.bit.bin'
124 shutil.move(src_bitbin_file, dst_bitbin_file)
125
115 if not os.path.isfile(pn + ".bit.bin"): 126 if not os.path.isfile(pn + ".bit.bin"):
116 bb.fatal("bootgen failed. Enable -log debug with bootgen and check logs") 127 bb.fatal("Couldn't find %s file, Enable '-log trace' in BOOTGEN_FLAGS" \
128 "and check bootgen_log.txt" % (d.getVar('B') + '/' + pn + '.bit.bin'))
117} 129}
118 130
119do_install() { 131do_install() {