Lines Matching +full:line +full:- +full:name
5 # SPDX-License-Identifier: GPL-2.0+
21 name: Name of the CPU this microcode is for, including any version
27 def __init__(self, name, data): argument
28 self.name = name
45 3-Tuple:
50 re_date = re.compile('/\* *(.* [0-9]{4}) *\*/$')
51 re_license = re.compile('/[^-*+] *(.*)$')
57 name = None
59 for line in fd:
60 line = line.rstrip()
61 m_date = re_date.match(line)
62 m_license = re_license.match(line)
63 m_name = re_name.match(line)
65 if name:
66 microcodes[name] = Microcode(name, data)
67 name = m_name.group(1).lower()
74 data.append(line)
75 if name:
76 microcodes[name] = Microcode(name, data)
92 name = None
94 name = os.path.basename(fname).lower()
95 name = os.path.splitext(name)[0]
100 for line in fd:
101 line = line.rstrip()
103 if len(line) >= 2:
104 if line[0] == '/' and line[1] == '*':
107 if line[0] == '*' and line[1] == '/':
111 # Ignore blank line
112 if len(line) > 0:
113 license_text.append(line)
116 words = line.split(',')[:-1]
118 microcodes[name] = Microcode(name, data)
127 microcodes: Dict of Microcode objects indexed by name
138 print '%-20s: model %s' % (mcode.name, mcode.model)
148 If the model name is ambiguous we return a list of matches.
151 microcodes: Dict of Microcode objects indexed by name
152 model: String containing model name to find
158 # Allow a full name to be used
166 abbrev = model[:-i] if i else model
176 """Create a microcode file in U-Boot's .dtsi format
182 outfile: Filename to write to ('-' for stdout)
185 * ---
193 intel,header-version = <%d>;
194 intel,update-revision = <%#x>;
195 intel,date-code = <%#x>;
196 intel,processor-signature = <%#x>;
198 intel,loader-revision = <%d>;
199 intel,processor-flags = <%#x>;
201 /* The first 48-bytes are the public header which repeats the above data */
208 words += '\n/* %s */' % mcode.name
213 # Change each word so it will be little-endian in the FDT
224 for line in license_text:
225 if line[0] == '\t':
226 text += '\n *' + line
228 text += '\n * ' + line
232 if outfile == '-':
239 outfile = os.path.join(MICROCODE_DIR, mcode.name + '.dtsi')
241 ', '.join([mcode.name for mcode in mcodes]), outfile)
249 parser.add_option('-d', '--mcfile', type='string', action='store',
250 help='Name of microcode.dat file')
251 parser.add_option('-H', '--headerfile', type='string', action='append',
252 help='Name of .h file containing microcode')
253 parser.add_option('-m', '--model', type='string', action='store',
254 help="Model name to extract ('all' for all)")
255 parser.add_option('-M', '--multiple', type='string', action='store',
257 parser.add_option('-o', '--outfile', type='string', action='store',
258 help='Filename to use for output (- for stdout), default is'
259 ' %s/<name>.dtsi' % MICROCODE_DIR)
262 Process an Intel microcode file (use -h for help). Commands:
270 ./tools/microcode-tool -d microcode.dat -m 306a create
305 parser.error("Unknown model '%s' (%s) - try 'list' to list" %
308 parser.error("Ambiguous model '%s' (%s) matched %s - try 'list' "
311 ', '.join([m.name for m in mcode_list])))