Esempio n. 1
0
def autodetect_chipset():
    pci_dev = chipset.intel_get_pci_device()
    devid = chipset.pcidev_to_devid(pci_dev)
    if chipset.is_sandybridge(devid):
        return open('sandybridge', 'r')
    elif chipset.is_ivybridge(devid):
        return open('ivybridge', 'r')
    elif chipset.is_cherryview(devid):
        return open('cherryview', 'r')
    elif chipset.is_valleyview(devid):
        return open('valleyview', 'r')
    elif chipset.is_haswell(devid):
        return open('haswell', 'r')
    elif chipset.is_broadwell(devid):
        return open('broadwell', 'r')
    elif chipset.is_skylake(devid):
        return open('skylake', 'r')
    else:
        print("Autodetect of devid " + hex(devid) + " failed")
        return None
Esempio n. 2
0
def autodetect_chipset():
    pci_dev = chipset.intel_get_pci_device()
    devid = chipset.pcidev_to_devid(pci_dev)
    if chipset.is_sandybridge(devid):
        return open('sandybridge', 'r')
    elif chipset.is_ivybridge(devid):
        return open('ivybridge', 'r')
    elif chipset.is_cherryview(devid):
        return open('cherryview', 'r')
    elif chipset.is_valleyview(devid):
        return open('valleyview', 'r')
    elif chipset.is_haswell(devid):
        return open('haswell', 'r')
    elif chipset.is_broadwell(devid):
        return open('broadwell', 'r')
    elif chipset.is_skylake(devid):
        return open('skylake', 'r')
    else:
        print("Autodetect of devid " + hex(devid) + " failed")
        return None
Esempio n. 3
0
	sys.exit()

# Put us where the script is
os.chdir(os.path.dirname(sys.argv[0]))

#parse anything named base_ these are assumed to apply for all gens.
if args.baseless == False:
	for root, dirs, files in os.walk('.'):
		for name in files:
			if name.startswith(("base_")):
				file = open(name.rstrip(), 'r')
				parse_file(file)

if args.autodetect:
	pci_dev = chipset.intel_get_pci_device()
	devid = chipset.pcidev_to_devid(pci_dev)
	if chipset.is_sandybridge(devid):
		args.profile = open('sandybridge', 'r')
	elif chipset.is_ivybridge(devid):
		args.profile = open('ivybridge', 'r')
	elif chipset.is_valleyview(devid):
		args.profile = open('valleyview', 'r')
	elif chipset.is_haswell(devid):
		args.profile = open('haswell', 'r')
	else:
		print("Autodetect of devid " + hex(devid) + " failed")

if args.profile == None:
	sys.exit()

for extra in args.profile:
Esempio n. 4
0
    sys.exit()

# Put us where the script is
os.chdir(os.path.dirname(sys.argv[0]))

#parse anything named base_ these are assumed to apply for all gens.
if args.baseless == False:
    for root, dirs, files in os.walk('.'):
        for name in files:
            if name.startswith(("base_")):
                file = open(name.rstrip(), 'r')
                parse_file(file)

if args.autodetect:
    pci_dev = chipset.intel_get_pci_device()
    devid = chipset.pcidev_to_devid(pci_dev)
    if chipset.is_sandybridge(devid):
        args.profile = open('sandybridge', 'r')
    elif chipset.is_ivybridge(devid):
        args.profile = open('ivybridge', 'r')
    elif chipset.is_valleyview(devid):
        args.profile = open('valleyview', 'r')
    else:
        print("Autodetect of %x " + devid + " failed")

if args.profile == None:
    sys.exit()

for extra in args.profile:
    extra_file = open(extra.rstrip(), 'r')
    parse_file(extra_file)