3f6f83626c
Changed scripts to explicitly use Python 3 only, to avoid maintaining Python 2. Removed deprecation notices. Signed-off-by: Louise Kilheeney <louise.kilheeney@intel.com> Signed-off-by: Kevin Laatz <kevin.laatz@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Robin Jarry <robin.jarry@6wind.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Ray Kinsella <mdr@ashroe.eu>
19 lines
582 B
Python
Executable File
19 lines
582 B
Python
Executable File
#!/usr/bin/env python3
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
# Copyright(c) 2017 Cavium, Inc
|
|
|
|
ident = []
|
|
fname = '/sys/devices/system/cpu/cpu0/regs/identification/midr_el1'
|
|
with open(fname) as f:
|
|
content = f.read()
|
|
|
|
midr_el1 = (int(content.rstrip('\n'), 16))
|
|
|
|
ident.append(hex((midr_el1 >> 24) & 0xFF)) # Implementer
|
|
ident.append(hex((midr_el1 >> 20) & 0xF)) # Variant
|
|
ident.append(hex((midr_el1 >> 16) & 0XF)) # Architecture
|
|
ident.append(hex((midr_el1 >> 4) & 0xFFF)) # Primary Part number
|
|
ident.append(hex(midr_el1 & 0xF)) # Revision
|
|
|
|
print(' '.join(ident))
|