binman: Add a test for x86-start16-spl
authorSimon Glass <sjg@chromium.org>
Mon, 13 Nov 2017 04:52:26 +0000 (21:52 -0700)
committerSimon Glass <sjg@chromium.org>
Thu, 23 Nov 2017 01:05:38 +0000 (18:05 -0700)
This allows us to put the 16-bit x86 start-up code in SPL. Add a test for
it.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/ftest.py
tools/binman/test/48_x86-start16-spl.dts [new file with mode: 0644]

index 4e6aaad9d6b91a735cd13af4afd41feb1204a2d6..c381a7003111e09cda76feaf35d7d7d0257452e1 100644 (file)
@@ -34,6 +34,7 @@ ME_DATA             = '0abcd'
 VGA_DATA            = 'vga'
 U_BOOT_DTB_DATA     = 'udtb'
 X86_START16_DATA    = 'start16'
+X86_START16_SPL_DATA = 'start16spl'
 U_BOOT_NODTB_DATA   = 'nodtb with microcode pointer somewhere in here'
 FSP_DATA            = 'fsp'
 CMC_DATA            = 'cmc'
@@ -74,6 +75,8 @@ class TestFunctional(unittest.TestCase):
         TestFunctional._MakeInputFile('vga.bin', VGA_DATA)
         TestFunctional._MakeInputFile('u-boot.dtb', U_BOOT_DTB_DATA)
         TestFunctional._MakeInputFile('u-boot-x86-16bit.bin', X86_START16_DATA)
+        TestFunctional._MakeInputFile('spl/u-boot-x86-16bit-spl.bin',
+                                      X86_START16_SPL_DATA)
         TestFunctional._MakeInputFile('u-boot-nodtb.bin', U_BOOT_NODTB_DATA)
         TestFunctional._MakeInputFile('fsp.bin', FSP_DATA)
         TestFunctional._MakeInputFile('cmc.bin', CMC_DATA)
@@ -677,7 +680,7 @@ class TestFunctional(unittest.TestCase):
 
         # Check that the microcode appears immediately after the Fdt
         # This matches the concatenation of the data properties in
-        # the /microcode/update@xxx nodes in x86_ucode.dts.
+        # the /microcode/update@xxx nodes in 34_x86_ucode.dts.
         ucode_data = struct.pack('>4L', 0x12345678, 0x12345679, 0xabcd0000,
                                  0x78235609)
         self.assertEqual(ucode_data, third[:len(ucode_data)])
@@ -823,6 +826,11 @@ class TestFunctional(unittest.TestCase):
         data = self._DoReadFile('47_spl_bss_pad.dts')
         self.assertEqual(U_BOOT_SPL_DATA + (chr(0) * 10) + U_BOOT_DATA, data)
 
+    def testPackStart16Spl(self):
+        """Test that an image with an x86 start16 region can be created"""
+        data = self._DoReadFile('48_x86-start16-spl.dts')
+        self.assertEqual(X86_START16_SPL_DATA, data[:len(X86_START16_SPL_DATA)])
+
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/tools/binman/test/48_x86-start16-spl.dts b/tools/binman/test/48_x86-start16-spl.dts
new file mode 100644 (file)
index 0000000..e2009f1
--- /dev/null
@@ -0,0 +1,13 @@
+/dts-v1/;
+
+/ {
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       binman {
+               size = <16>;
+
+               x86-start16-spl {
+               };
+       };
+};