if val.startswith('@'):
if not self._fdts:
return
- if not self._fit_default_dt:
+ default_dt = self._fit_default_dt
+ if not default_dt:
self.Raise("Generated 'default' node requires default-dt entry argument")
- if self._fit_default_dt not in self._fdts:
- self.Raise(
- f"default-dt entry argument '{self._fit_default_dt}' "
- f"not found in fdt list: {', '.join(self._fdts)}")
- seq = self._fdts.index(self._fit_default_dt)
+ if default_dt not in self._fdts:
+ if self._fdt_dir:
+ default_dt = os.path.basename(default_dt)
+ if default_dt not in self._fdts:
+ self.Raise(
+ f"default-dt entry argument '{self._fit_default_dt}' "
+ f"not found in fdt list: {', '.join(self._fdts)}")
+ seq = self._fdts.index(default_dt)
val = val[1:].replace('DEFAULT-SEQ', str(seq + 1))
fsw.property_string(pname, val)
return
# Add data for 'images' nodes (but not 'config')
if depth == 1 and in_images:
if fdt_phase:
+ leaf = os.path.basename(fdt_fname)
phase_fname = tools.get_output_filename(
- f'{fdt_fname}-{fdt_phase}.dtb')
+ f'{leaf}-{fdt_phase}.dtb')
self._run_fdtgrep(fname, fdt_phase, phase_fname)
data = tools.read_file(phase_fname)
else:
data = self._DoReadFile('172_scp.dts')
self.assertEqual(SCP_DATA, data[:len(SCP_DATA)])
- def CheckFitFdt(self, dts='170_fit_fdt.dts', use_fdt_list=True):
+ def CheckFitFdt(self, dts='170_fit_fdt.dts', use_fdt_list=True,
+ default_dt=None):
"""Check an image with an FIT with multiple FDT images"""
def _CheckFdt(seq, expected_data):
"""Check the FDT nodes
}
if use_fdt_list:
entry_args['of-list'] = 'test-fdt1 test-fdt2'
+ if default_dt:
+ entry_args['default-dt'] = default_dt
data = self._DoReadFileDtb(
dts,
entry_args=entry_args,
finally:
os.chdir(old_dir)
+ def testFitFdtListDirDefault(self):
+ """Test an FIT fit,fdt-list-dir where the default DT in is a subdir"""
+ old_dir = os.getcwd()
+ try:
+ os.chdir(self._indir)
+ self.CheckFitFdt('333_fit_fdt_dir.dts', False,
+ default_dt='rockchip/test-fdt2')
+ finally:
+ os.chdir(old_dir)
+
def testFitFdtCompat(self):
"""Test an image with an FIT with compatible in the config nodes"""
entry_args = {