summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>2024-04-03 13:56:33 -0600
committerMark Hatle <mark.hatle@amd.com>2024-04-04 15:20:05 -0500
commitc09d6fbc6f6eb486498d81aa1f191b4be4767d7a (patch)
tree3176c1e88476a1d19955f95bbbcdc8faf4293206
parentce8032d3494807793baf6f752a4de169b0ede0d0 (diff)
downloadmeta-xilinx-c09d6fbc6f6eb486498d81aa1f191b4be4767d7a.tar.gz
dfx_user_dts.bbclass: Make bit or bin or pdi as required input
1. Make bit or bin or pdi as required input for firmware recipes. If bit or bin or pdi of respective soc_family is not included then raise bitbake parse skip recipe errors. 2. Check for absolute dtbo/bin/bit path if any of these files exits in SRC_URI. 3. Skip recipe if both dtbo and dts/dtsi found in SRC_URI. 4. Fix logic to convert from bit to bin for zynqmp or zynq soc family. Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com> Signed-off-by: Mark Hatle <mark.hatle@amd.com>
-rw-r--r--meta-xilinx-core/classes-recipe/dfx_user_dts.bbclass21
1 files changed, 14 insertions, 7 deletions
diff --git a/meta-xilinx-core/classes-recipe/dfx_user_dts.bbclass b/meta-xilinx-core/classes-recipe/dfx_user_dts.bbclass
index 2b699d9d..188d594b 100644
--- a/meta-xilinx-core/classes-recipe/dfx_user_dts.bbclass
+++ b/meta-xilinx-core/classes-recipe/dfx_user_dts.bbclass
@@ -97,12 +97,15 @@ python() {
97 97
98 # Check for valid combination of input files in SRC_URI 98 # Check for valid combination of input files in SRC_URI
99 # Skip recipe if any of the below conditions are not satisfied. 99 # Skip recipe if any of the below conditions are not satisfied.
100 # 1. At least one bit or bin or pdi or dts or dtsi or dtbo should exists. 100 # 1. At least one bit or bin or pdi should exists.
101 # 2. More than one dtbo. 101 # 2. More than one dtbo.
102 # 3. More than one bit or bin or pdi. 102 # 3. More than one bit or bin or pdi.
103 # 4. More than one dts and zero dtsi. 103 # 4. More than one dts and zero dtsi.
104 # 5. More than one dtsi and zero dts. 104 # 5. More than one dtsi and zero dts
105 if dtsi_found or dtbo_found or bit_found or bin_found or pdi_found: 105 # 6. Both bit and bin exists.
106 # 7. Both bit or bin and pdi exits.
107 # 8. Both dts or dtsi and dtbo exists.
108 if bit_found or bin_found or pdi_found:
106 bb.debug(2, "dtsi or dtbo or bitstream or pdi found in SRC_URI") 109 bb.debug(2, "dtsi or dtbo or bitstream or pdi found in SRC_URI")
107 if bit_found and pdi_found : 110 if bit_found and pdi_found :
108 raise bb.parse.SkipRecipe("Both '.bit' and '.pdi' file found in SRC_URI, this is invalid use case.") 111 raise bb.parse.SkipRecipe("Both '.bit' and '.pdi' file found in SRC_URI, this is invalid use case.")
@@ -112,8 +115,11 @@ python() {
112 115
113 if bit_found and bin_found: 116 if bit_found and bin_found:
114 raise bb.parse.SkipRecipe("Both '.bit' and '.bin' file found in SRC_URI, either .bit or .bin file is supported but not both.") 117 raise bb.parse.SkipRecipe("Both '.bit' and '.bin' file found in SRC_URI, either .bit or .bin file is supported but not both.")
118
119 if dtsi_found and dtbo_found:
120 raise bb.parse.SkipRecipe("Both '.dts or dtsi' and '.dtbo' file found in SRC_URI, either .dts/dtsi or .dtbo file is supported but not both.")
115 else: 121 else:
116 raise bb.parse.SkipRecipe("Need one '.dtsi' or '.dtbo' or '.bit' or '.bin' or '.pdi' file added to SRC_URI ") 122 raise bb.parse.SkipRecipe("Need one '.bit' or '.bin' or '.pdi' file added to SRC_URI.")
117 123
118 # Check for valid combination of dtsi and dts files in SRC_URI 124 # Check for valid combination of dtsi and dts files in SRC_URI
119 # Following file combinations are not supported use case. 125 # Following file combinations are not supported use case.
@@ -177,10 +183,11 @@ python devicetree_do_compile:append() {
177 import glob, subprocess, shutil 183 import glob, subprocess, shutil
178 soc_family = d.getVar("SOC_FAMILY") 184 soc_family = d.getVar("SOC_FAMILY")
179 185
180 dtbo_count = sum(1 for f in glob.iglob((d.getVar('S') + '/*.dtbo'),recursive=True) if os.path.isfile(f)) 186 dtbo_count = sum(1 for f in glob.iglob((d.getVar('S') + '/' + (d.getVar('DTSI_PATH') or '') + '/*.dtbo'),recursive=True) if os.path.isfile(f))
181 bin_count = sum(1 for f in glob.iglob((d.getVar('S') + '/*.bin'),recursive=True) if os.path.isfile(f)) 187 bin_count = sum(1 for f in glob.iglob((d.getVar('S') + '/' + (d.getVar('BIN_PATH') or '') + '/*.bin'),recursive=True) if os.path.isfile(f))
188 bit_count = sum(1 for f in glob.iglob((d.getVar('S') + '/' + (d.getVar('BIT_PATH') or '') + '/*.bit'),recursive=True) if os.path.isfile(f))
182 # Skip devicetree do_compile task if input file is dtbo or bin in SRC_URI 189 # Skip devicetree do_compile task if input file is dtbo or bin in SRC_URI
183 if not dtbo_count and not bin_count: 190 if not dtbo_count and not bin_count and bit_count:
184 # Convert .bit to .bin format only if dtsi is input. 191 # Convert .bit to .bin format only if dtsi is input.
185 # In case of dtbo as input, bbclass doesn't know if firmware-name is .bit 192 # In case of dtbo as input, bbclass doesn't know if firmware-name is .bit
186 # or .bin format and corresponding file name. Hence we are not doing .bin 193 # or .bin format and corresponding file name. Hence we are not doing .bin