diff mbox

[U-Boot,v4,06/11] binman: Add support for building x86 images with FSP/CMC

Message ID 1475787582-32106-7-git-send-email-sjg@chromium.org
State Accepted
Commit da229090733cf9161e9e26a70f6f9ff9238a41cf
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Oct. 6, 2016, 8:59 p.m. UTC
Add support for two more from the inexhaustible supply of x86 binary blob
types.

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

Changes in v4:
- Add new patch to support building x86 images with FSP/CMC

Changes in v3: None
Changes in v2: None

 tools/binman/etype/intel_cmc.py    | 17 +++++++++++++++++
 tools/binman/etype/intel_fsp.py    | 17 +++++++++++++++++
 tools/binman/func_test.py          | 14 ++++++++++++++
 tools/binman/test/42_intel-fsp.dts | 13 +++++++++++++
 tools/binman/test/43_intel-cmc.dts | 13 +++++++++++++
 5 files changed, 74 insertions(+)
 create mode 100644 tools/binman/etype/intel_cmc.py
 create mode 100644 tools/binman/etype/intel_fsp.py
 create mode 100644 tools/binman/test/42_intel-fsp.dts
 create mode 100644 tools/binman/test/43_intel-cmc.dts
diff mbox

Patch

diff --git a/tools/binman/etype/intel_cmc.py b/tools/binman/etype/intel_cmc.py
new file mode 100644
index 0000000..9bce8ae
--- /dev/null
+++ b/tools/binman/etype/intel_cmc.py
@@ -0,0 +1,17 @@ 
+# Copyright (c) 2016 Google, Inc
+# Written by Simon Glass <sjg@chromium.org>
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+# Entry-type module for Intel Chip Microcode binary blob
+#
+
+from entry import Entry
+from blob import Entry_blob
+
+class Entry_intel_cmc(Entry_blob):
+    def __init__(self, image, etype, node):
+        Entry_blob.__init__(self, image, etype, node)
+
+    def GetDefaultFilename(self):
+        return 'cmc.bin'
diff --git a/tools/binman/etype/intel_fsp.py b/tools/binman/etype/intel_fsp.py
new file mode 100644
index 0000000..d75be5b
--- /dev/null
+++ b/tools/binman/etype/intel_fsp.py
@@ -0,0 +1,17 @@ 
+# Copyright (c) 2016 Google, Inc
+# Written by Simon Glass <sjg@chromium.org>
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+# Entry-type module for Intel Firmware Support Package binary blob
+#
+
+from entry import Entry
+from blob import Entry_blob
+
+class Entry_intel_fsp(Entry_blob):
+    def __init__(self, image, etype, node):
+        Entry_blob.__init__(self, image, etype, node)
+
+    def GetDefaultFilename(self):
+        return 'fsp.bin'
diff --git a/tools/binman/func_test.py b/tools/binman/func_test.py
index 3202947..fa30cce 100644
--- a/tools/binman/func_test.py
+++ b/tools/binman/func_test.py
@@ -36,6 +36,8 @@  VGA_DATA            = 'vga'
 U_BOOT_DTB_DATA     = 'udtb'
 X86_START16_DATA    = 'start16'
 U_BOOT_NODTB_DATA   = 'nodtb with microcode pointer somewhere in here'
+FSP_DATA            = 'fsp'
+CMC_DATA            = 'cmc'
 
 class TestFunctional(unittest.TestCase):
     """Functional tests for binman
@@ -70,6 +72,8 @@  class TestFunctional(unittest.TestCase):
         TestFunctional._MakeInputFile('u-boot.dtb', U_BOOT_DTB_DATA)
         TestFunctional._MakeInputFile('u-boot-x86-16bit.bin', X86_START16_DATA)
         TestFunctional._MakeInputFile('u-boot-nodtb.bin', U_BOOT_NODTB_DATA)
+        TestFunctional._MakeInputFile('fsp.bin', FSP_DATA)
+        TestFunctional._MakeInputFile('cmc.bin', CMC_DATA)
         self._output_setup = False
 
         # ELF file with a '_dt_ucode_base_size' symbol
@@ -761,3 +765,13 @@  class TestFunctional(unittest.TestCase):
             self._DoReadFile('41_unknown_pos_size.dts', True)
         self.assertIn("Image '/binman': Unable to set pos/size for unknown "
                 "entry 'invalid-entry'", str(e.exception))
+
+    def testPackFsp(self):
+        """Test that an image with a FSP binary can be created"""
+        data = self._DoReadFile('42_intel-fsp.dts')
+        self.assertEqual(FSP_DATA, data[:len(FSP_DATA)])
+
+    def testPackCmc(self):
+        """Test that an image with a FSP binary can be created"""
+        data = self._DoReadFile('43_intel-cmc.dts')
+        self.assertEqual(CMC_DATA, data[:len(CMC_DATA)])
diff --git a/tools/binman/test/42_intel-fsp.dts b/tools/binman/test/42_intel-fsp.dts
new file mode 100644
index 0000000..e0a1e76
--- /dev/null
+++ b/tools/binman/test/42_intel-fsp.dts
@@ -0,0 +1,13 @@ 
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		size = <16>;
+
+		intel-fsp {
+		};
+	};
+};
diff --git a/tools/binman/test/43_intel-cmc.dts b/tools/binman/test/43_intel-cmc.dts
new file mode 100644
index 0000000..26c456d
--- /dev/null
+++ b/tools/binman/test/43_intel-cmc.dts
@@ -0,0 +1,13 @@ 
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		size = <16>;
+
+		intel-cmc {
+		};
+	};
+};