- Add the cpu path support. Oops I failed to commit this earlier

git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1790 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Eric Biederman 2004-11-22 21:45:24 +00:00
parent e5c0ca30a2
commit 58769b7d50
1 changed files with 21 additions and 12 deletions

View File

@ -952,15 +952,23 @@ class partobj:
self.set_path(".type=DEVICE_PATH_PCI_DOMAIN,.u={.pci_domain={ .domain = 0x%x }}" % (pci_domain)) self.set_path(".type=DEVICE_PATH_PCI_DOMAIN,.u={.pci_domain={ .domain = 0x%x }}" % (pci_domain))
def addapic_clusterpath(self, cluster): def addapic_clusterpath(self, cluster):
""" Add a pci_domain number to a chip """ """ Add an apic cluster to a chip """
if ((cluster < 0) or (cluster > 15)): if ((cluster < 0) or (cluster > 15)):
fatal("Invalid apic cluster: %d is out of the range 0 to ff" % cluster) fatal("Invalid apic cluster: %d is out of the range 0 to ff" % cluster)
self.set_path(".type=DEVICE_PATH_APIC_CLUSTER,.u={.apic_cluster={ .cluster = 0x%x }}" % (cluster)) self.set_path(".type=DEVICE_PATH_APIC_CLUSTER,.u={.apic_cluster={ .cluster = 0x%x }}" % (cluster))
def addcpu_buspath(self, bus): def addcpupath(self, id):
if ((bus < 0) or (bus > 15)): """ Add a relative path to a cpu device hanging off our parent """
fatal("Invalid cpu bus: %d is out of the range 0 to ff" % bus) if ((id < 0) or (id > 255)):
self.set_path(".type=DEVICE_PATH_CPU_BUS,.u={.cpu_bus={ .id = 0x%x }}" % (bus)) fatal("Invalid device")
self.set_path(".type=DEVICE_PATH_CPU,.u={.cpu={ .id = 0x%x }}" % (id))
def addcpu_buspath(self, id):
""" Add a cpu_bus to a chip """
if ((id < 0) or (id > 255)):
fatal("Invalid device")
self.set_path(".type=DEVICE_PATH_CPU_BUS,.u={.cpu_bus={ .id = 0x%x }}" % (id))
def usesoption(self, name): def usesoption(self, name):
"""Declare option that can be used by this part""" """Declare option that can be used by this part"""
@ -1044,7 +1052,7 @@ def getoption(name, image):
elif (curpart): elif (curpart):
o = getdict(curpart.uses_options, name) o = getdict(curpart.uses_options, name)
if (o == 0): if (o == 0):
print "curpart.uses_optins is %s\n" % curpart.uses_options print "curpart.uses_options is %s\n" % curpart.uses_options
else: else:
o = getdict(global_uses_options, name) o = getdict(global_uses_options, name)
v = getoptionvalue(name, o, image) v = getoptionvalue(name, o, image)
@ -1552,6 +1560,7 @@ parser Config:
token COMMENT: 'comment' token COMMENT: 'comment'
token CONFIG: 'config' token CONFIG: 'config'
token CPU: 'cpu' token CPU: 'cpu'
token CPU_BUS: 'cpu_bus'
token CHIP: 'chip' token CHIP: 'chip'
token DEFAULT: 'default' token DEFAULT: 'default'
token DEFINE: 'define' token DEFINE: 'define'
@ -1773,8 +1782,8 @@ parser Config:
{{ if (C): partstack.tos().addcpupath(id) }} {{ if (C): partstack.tos().addcpupath(id) }}
rule cpu_bus<<C>>: CPU_BUS {{ if (C): devicepart('cpu_bus') }} rule cpu_bus<<C>>: CPU_BUS {{ if (C): devicepart('cpu_bus') }}
HEX_NUM {{ bus = int(HEX_NUM, 16) }} HEX_NUM {{ id = int(HEX_NUM, 16) }}
{{ if (C): partstack.tos().addcpu_buspath(bus) }} {{ if (C): partstack.tos().addcpu_buspath(id) }}
rule dev_path<<C>>: rule dev_path<<C>>:
pci<<C>> {{ return pci }} pci<<C>> {{ return pci }}