]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - test/image/test-fit.py
tools/imagetool: remove linker script
[karo-tx-uboot.git] / test / image / test-fit.py
index aad9f59019ae1c4d842a750d07876f561526e69b..e9e756a064d25fdd63f7fc4ea4c4b70213af83da 100755 (executable)
@@ -4,20 +4,7 @@
 #
 # Sanity check of the FIT handling in U-Boot
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
+# SPDX-License-Identifier:     GPL-2.0+
 #
 # To run this:
 #
@@ -33,6 +20,9 @@ import struct
 import sys
 import tempfile
 
+# Enable printing of all U-Boot output
+DEBUG = True
+
 # The 'command' library in patman is convenient for running commands
 base_path = os.path.dirname(sys.argv[0])
 patman = os.path.join(base_path, '../../tools/patman')
@@ -106,16 +96,20 @@ base_fdt = '''
 # then do the 'bootm' command, then save out memory from the places where
 # we expect 'bootm' to write things. Then quit.
 base_script = '''
-sb load host 0 %(fit_addr)x %(fit)s
+sb load hostfs 0 %(fit_addr)x %(fit)s
 fdt addr %(fit_addr)x
 bootm start %(fit_addr)x
 bootm loados
-sb save host 0 %(kernel_out)s %(kernel_addr)x %(kernel_size)x
-sb save host 0 %(fdt_out)s %(fdt_addr)x %(fdt_size)x
-sb save host 0 %(ramdisk_out)s %(ramdisk_addr)x %(ramdisk_size)x
+sb save hostfs 0 %(kernel_addr)x %(kernel_out)s %(kernel_size)x
+sb save hostfs 0 %(fdt_addr)x %(fdt_out)s %(fdt_size)x
+sb save hostfs 0 %(ramdisk_addr)x %(ramdisk_out)s %(ramdisk_size)x
 reset
 '''
 
+def debug_stdout(stdout):
+    if DEBUG:
+        print stdout
+
 def make_fname(leaf):
     """Make a temporary filename
 
@@ -341,6 +335,7 @@ def run_fit_test(mkimage, u_boot):
     # We could perhaps reduce duplication with some loss of readability
     set_test('Kernel load')
     stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd)
+    debug_stdout(stdout)
     if read_file(kernel) != read_file(kernel_out):
         fail('Kernel not loaded', stdout)
     if read_file(control_dtb) == read_file(fdt_out):
@@ -365,6 +360,7 @@ def run_fit_test(mkimage, u_boot):
     params['fdt_load'] = 'load = <%#x>;' % params['fdt_addr']
     fit = make_fit(mkimage, params)
     stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd)
+    debug_stdout(stdout)
     if read_file(kernel) != read_file(kernel_out):
         fail('Kernel not loaded', stdout)
     if read_file(control_dtb) != read_file(fdt_out):
@@ -378,6 +374,7 @@ def run_fit_test(mkimage, u_boot):
     params['ramdisk_load'] = 'load = <%#x>;' % params['ramdisk_addr']
     fit = make_fit(mkimage, params)
     stdout = command.Output(u_boot, '-d', control_dtb, '-c', cmd)
+    debug_stdout(stdout)
     if read_file(ramdisk) != read_file(ramdisk_out):
         fail('Ramdisk not loaded', stdout)