summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2015-12-11 02:55:46 -0800
committerBin Meng <bmeng.cn@gmail.com>2016-01-13 12:20:14 +0800
commitaefba6f1b5681f124b5dce4908219eb6374533c9 (patch)
tree5b185ffb6d587b8b33a8b608c6f3c917a2a355ea /tools
parent394e0b662411f3aa47fb249fe8674126067dedfa (diff)
downloadu-boot-aefba6f1b5681f124b5dce4908219eb6374533c9.tar.gz
u-boot-aefba6f1b5681f124b5dce4908219eb6374533c9.tar.bz2
u-boot-aefba6f1b5681f124b5dce4908219eb6374533c9.zip
tools: microcode-tool: Support parsing header file with a license block
The microcode header files in the Intel Chief River FSP package have a license comment block. Update the microcode-tool to support parsing it and extract the license text to the .dtsi file. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/microcode-tool.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/microcode-tool.py b/tools/microcode-tool.py
index 71c2e91566..790c27e459 100755
--- a/tools/microcode-tool.py
+++ b/tools/microcode-tool.py
@@ -95,9 +95,23 @@ def ParseHeaderFiles(fname_list):
name = os.path.splitext(name)[0]
data = []
with open(fname) as fd:
+ license_start = False
+ license_end = False
for line in fd:
line = line.rstrip()
+ if len(line) >= 2:
+ if line[0] == '/' and line[1] == '*':
+ license_start = True
+ continue
+ if line[0] == '*' and line[1] == '/':
+ license_end = True
+ continue
+ if license_start and not license_end:
+ # Ignore blank line
+ if len(line) > 0:
+ license_text.append(line)
+ continue
# Omit anything after the last comma
words = line.split(',')[:-1]
data += [word + ',' for word in words]