Lines Matching +full:line +full:- +full:name
2 # SPDX-License-Identifier: GPL-2.0+
20 name: Name of the CPU this microcode is for, including any version
26 def __init__(self, name, data):
27 self.name = name
44 3-Tuple:
49 re_date = re.compile('/\* *(.* [0-9]{4}) *\*/$')
50 re_license = re.compile('/[^-*+] *(.*)$')
56 name = None
58 for line in fd:
59 line = line.rstrip()
60 m_date = re_date.match(line)
61 m_license = re_license.match(line)
62 m_name = re_name.match(line)
64 if name:
65 microcodes[name] = Microcode(name, data)
66 name = m_name.group(1).lower()
73 data.append(line)
74 if name:
75 microcodes[name] = Microcode(name, data)
91 name = None
93 name = os.path.basename(fname).lower()
94 name = os.path.splitext(name)[0]
99 for line in fd:
100 line = line.rstrip()
102 if len(line) >= 2:
103 if line[0] == '/' and line[1] == '*':
106 if line[0] == '*' and line[1] == '/':
110 # Ignore blank line
111 if len(line) > 0:
112 license_text.append(line)
115 words = line.split(',')[:-1]
117 microcodes[name] = Microcode(name, data)
126 microcodes: Dict of Microcode objects indexed by name
137 print '%-20s: model %s' % (mcode.name, mcode.model)
147 If the model name is ambiguous we return a list of matches.
150 microcodes: Dict of Microcode objects indexed by name
151 model: String containing model name to find
157 # Allow a full name to be used
165 abbrev = model[:-i] if i else model
175 """Create a microcode file in U-Boot's .dtsi format
181 outfile: Filename to write to ('-' for stdout)
184 * ---
192 intel,header-version = <%d>;
193 intel,update-revision = <%#x>;
194 intel,date-code = <%#x>;
195 intel,processor-signature = <%#x>;
197 intel,loader-revision = <%d>;
198 intel,processor-flags = <%#x>;
200 /* The first 48-bytes are the public header which repeats the above data */
207 words += '\n/* %s */' % mcode.name
212 # Change each word so it will be little-endian in the FDT
223 for line in license_text:
224 if line[0] == '\t':
225 text += '\n *' + line
227 text += '\n * ' + line
231 if outfile == '-':
238 outfile = os.path.join(MICROCODE_DIR, mcode.name + '.dtsi')
240 ', '.join([mcode.name for mcode in mcodes]), outfile)
248 parser.add_option('-d', '--mcfile', type='string', action='store',
249 help='Name of microcode.dat file')
250 parser.add_option('-H', '--headerfile', type='string', action='append',
251 help='Name of .h file containing microcode')
252 parser.add_option('-m', '--model', type='string', action='store',
253 help="Model name to extract ('all' for all)")
254 parser.add_option('-M', '--multiple', type='string', action='store',
256 parser.add_option('-o', '--outfile', type='string', action='store',
257 help='Filename to use for output (- for stdout), default is'
258 ' %s/<name>.dtsi' % MICROCODE_DIR)
261 Process an Intel microcode file (use -h for help). Commands:
269 ./tools/microcode-tool -d microcode.dat -m 306a create
304 parser.error("Unknown model '%s' (%s) - try 'list' to list" %
307 parser.error("Ambiguous model '%s' (%s) matched %s - try 'list' "
310 ', '.join([m.name for m in mcode_list])))