summaryrefslogtreecommitdiff
path: root/tools/binman/ftest.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-08-24 07:22:48 -0600
committerSimon Glass <sjg@chromium.org>2019-10-15 08:40:02 -0600
commit2250ee6ee681564115d82f9f9c63497ccfb5fdd7 (patch)
treeb991315ca7bfdbf6317f215aad47d2151e05ed6a /tools/binman/ftest.py
parent3da9ce8dd44399dfca4b0639101f5154dbbaa93f (diff)
downloadu-boot-2250ee6ee681564115d82f9f9c63497ccfb5fdd7.tar.gz
binman: Add support for an x86 'reset' section
At present binman has a single entry type for the 16-bit code code needed to start up an x86 processor. This entry is intended to include both the reset vector itself as well as the code to move to 32-bit mode. However this is not very flexible since in some cases other data needs to be included at the top of the SPI flash, in between these two pieces. For example Intel requires that a FIT (Firmware Image Table) pointer be placed 0x40 bytes before the end of the ROM. To deal with this, add a new reset entry for just the reset vector. A subsequent change will adjust the existing 'start16' entry. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/ftest.py')
-rw-r--r--tools/binman/ftest.py30
1 files changed, 29 insertions, 1 deletions
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index acf361fa84..77445814a7 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -49,6 +49,9 @@ U_BOOT_TPL_DTB_DATA = b'tpldtb'
X86_START16_DATA = b'start16'
X86_START16_SPL_DATA = b'start16spl'
X86_START16_TPL_DATA = b'start16tpl'
+X86_RESET16_DATA = b'reset16'
+X86_RESET16_SPL_DATA = b'reset16spl'
+X86_RESET16_TPL_DATA = b'reset16tpl'
PPC_MPC85XX_BR_DATA = b'ppcmpc85xxbr'
U_BOOT_NODTB_DATA = b'nodtb with microcode pointer somewhere in here'
U_BOOT_SPL_NODTB_DATA = b'splnodtb with microcode pointer somewhere in here'
@@ -114,12 +117,22 @@ class TestFunctional(unittest.TestCase):
TestFunctional._MakeInputFile('me.bin', ME_DATA)
TestFunctional._MakeInputFile('vga.bin', VGA_DATA)
cls._ResetDtbs()
- TestFunctional._MakeInputFile('u-boot-x86-16bit.bin', X86_START16_DATA)
+
TestFunctional._MakeInputFile('u-boot-br.bin', PPC_MPC85XX_BR_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('tpl/u-boot-x86-16bit-tpl.bin',
X86_START16_TPL_DATA)
+
+ TestFunctional._MakeInputFile('u-boot-x86-reset16.bin',
+ X86_RESET16_DATA)
+ TestFunctional._MakeInputFile('spl/u-boot-x86-reset16-spl.bin',
+ X86_RESET16_SPL_DATA)
+ TestFunctional._MakeInputFile('tpl/u-boot-x86-reset16-tpl.bin',
+ X86_RESET16_TPL_DATA)
+
TestFunctional._MakeInputFile('u-boot-nodtb.bin', U_BOOT_NODTB_DATA)
TestFunctional._MakeInputFile('spl/u-boot-spl-nodtb.bin',
U_BOOT_SPL_NODTB_DATA)
@@ -3236,6 +3249,21 @@ class TestFunctional(unittest.TestCase):
self.assertIn('Must specify exactly one entry path to write with -f',
str(e.exception))
+ def testPackReset16(self):
+ """Test that an image with an x86 reset16 region can be created"""
+ data = self._DoReadFile('144_x86_reset16.dts')
+ self.assertEqual(X86_RESET16_DATA, data[:len(X86_RESET16_DATA)])
+
+ def testPackReset16Spl(self):
+ """Test that an image with an x86 reset16-spl region can be created"""
+ data = self._DoReadFile('145_x86_reset16_spl.dts')
+ self.assertEqual(X86_RESET16_SPL_DATA, data[:len(X86_RESET16_SPL_DATA)])
+
+ def testPackReset16Tpl(self):
+ """Test that an image with an x86 reset16-tpl region can be created"""
+ data = self._DoReadFile('146_x86_reset16_tpl.dts')
+ self.assertEqual(X86_RESET16_TPL_DATA, data[:len(X86_RESET16_TPL_DATA)])
+
if __name__ == "__main__":
unittest.main()