diff mbox series

[U-Boot,24/26] binman: Add add test for using an Intel MRC binary

Message ID 20171113045231.15911-25-sjg@chromium.org
State Accepted
Commit ca4f4ff7cf5acb230cf1948268b60efc5e54a977
Delegated to: Simon Glass
Headers show
Series test: Include Python tools in test coverage | expand

Commit Message

Simon Glass Nov. 13, 2017, 4:52 a.m. UTC
MRC (Memory Reference Code) is a binary blob used to set up the SDRAM
controller on some Intel boards. Add a test for this feature.

With this test coverage on binman is back up to 100%.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/binman/ftest.py              |  7 +++++++
 tools/binman/test/50_intel_mrc.dts | 13 +++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 tools/binman/test/50_intel_mrc.dts

Comments

Simon Glass Nov. 24, 2017, 1:46 a.m. UTC | #1
MRC (Memory Reference Code) is a binary blob used to set up the SDRAM
controller on some Intel boards. Add a test for this feature.

With this test coverage on binman is back up to 100%.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/binman/ftest.py              |  7 +++++++
 tools/binman/test/50_intel_mrc.dts | 13 +++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 tools/binman/test/50_intel_mrc.dts

Applied to u-boot-dm thanks!
diff mbox series

Patch

diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index dff7448f08f..9083143894f 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -40,6 +40,7 @@  U_BOOT_SPL_NODTB_DATA = 'splnodtb with microcode pointer somewhere in here'
 FSP_DATA              = 'fsp'
 CMC_DATA              = 'cmc'
 VBT_DATA              = 'vbt'
+MRC_DATA              = 'mrc'
 
 class TestFunctional(unittest.TestCase):
     """Functional tests for binman
@@ -84,6 +85,7 @@  class TestFunctional(unittest.TestCase):
         TestFunctional._MakeInputFile('fsp.bin', FSP_DATA)
         TestFunctional._MakeInputFile('cmc.bin', CMC_DATA)
         TestFunctional._MakeInputFile('vbt.bin', VBT_DATA)
+        TestFunctional._MakeInputFile('mrc.bin', MRC_DATA)
         self._output_setup = False
 
         # ELF file with a '_dt_ucode_base_size' symbol
@@ -855,6 +857,11 @@  class TestFunctional(unittest.TestCase):
         self.assertEqual('splnodtb with microc' + pos_and_size +
                          'ter somewhere in here', first)
 
+    def testPackMrc(self):
+        """Test that an image with an MRC binary can be created"""
+        data = self._DoReadFile('50_intel_mrc.dts')
+        self.assertEqual(MRC_DATA, data[:len(MRC_DATA)])
+
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/tools/binman/test/50_intel_mrc.dts b/tools/binman/test/50_intel_mrc.dts
new file mode 100644
index 00000000000..54cd52a2b71
--- /dev/null
+++ b/tools/binman/test/50_intel_mrc.dts
@@ -0,0 +1,13 @@ 
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		size = <16>;
+
+		intel-mrc {
+		};
+	};
+};