added missing cpu and cpu_bus support

git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1788 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Greg Watson 2004-11-20 21:20:40 +00:00
parent 5697edee03
commit abc4a11a9a
1 changed files with 23 additions and 0 deletions

View File

@ -939,6 +939,12 @@ class partobj:
fatal("Invalid device") fatal("Invalid device")
self.set_path(".type=DEVICE_PATH_APIC,.u={.apic={ .apic_id = 0x%x }}" % (apic_id)) self.set_path(".type=DEVICE_PATH_APIC,.u={.apic={ .apic_id = 0x%x }}" % (apic_id))
def addcpupath(self, cpu_id):
""" Add a relative path to a cpu device hanging off our parent """
if ((cpu_id < 0) or (cpu_id > 255)):
fatal("Invalid device")
self.set_path(".type=DEVICE_PATH_CPU,.u={.cpu={ .id = 0x%x }}" % (cpu_id))
def addpci_domainpath(self, pci_domain): def addpci_domainpath(self, pci_domain):
""" Add a pci_domain number to a chip """ """ Add a pci_domain number to a chip """
if ((pci_domain < 0) or (pci_domain > 0xffff)): if ((pci_domain < 0) or (pci_domain > 0xffff)):
@ -951,6 +957,11 @@ class partobj:
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):
if ((bus < 0) or (bus > 15)):
fatal("Invalid cpu bus: %d is out of the range 0 to ff" % bus)
self.set_path(".type=DEVICE_PATH_CPU_BUS,.u={.cpu_bus={ .id = 0x%x }}" % (bus))
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"""
global global_options global global_options
@ -1604,6 +1615,8 @@ parser Config:
token I2C: 'i2c' token I2C: 'i2c'
token APIC: 'apic' token APIC: 'apic'
token APIC_CLUSTER: 'apic_cluster' token APIC_CLUSTER: 'apic_cluster'
token CPU: 'cpu'
token CPU_BUS: 'cpu_bus'
token PCI_DOMAIN: 'pci_domain' token PCI_DOMAIN: 'pci_domain'
@ -1755,6 +1768,14 @@ parser Config:
HEX_NUM {{ cluster = int(HEX_NUM, 16) }} HEX_NUM {{ cluster = int(HEX_NUM, 16) }}
{{ if (C): partstack.tos().addapic_clusterpath(cluster) }} {{ if (C): partstack.tos().addapic_clusterpath(cluster) }}
rule cpu<<C>>: CPU {{ if (C): devicepart('cpu') }}
HEX_NUM {{ id = int(HEX_NUM, 16) }}
{{ if (C): partstack.tos().addcpupath(id) }}
rule cpu_bus<<C>>: CPU_BUS {{ if (C): devicepart('cpu_bus') }}
HEX_NUM {{ bus = int(HEX_NUM, 16) }}
{{ if (C): partstack.tos().addcpu_buspath(bus) }}
rule dev_path<<C>>: rule dev_path<<C>>:
pci<<C>> {{ return pci }} pci<<C>> {{ return pci }}
| pci_domain<<C>> {{ return pci_domain }} | pci_domain<<C>> {{ return pci_domain }}
@ -1762,6 +1783,8 @@ parser Config:
| i2c<<C>> {{ return i2c }} | i2c<<C>> {{ return i2c }}
| apic<<C>> {{ return apic }} | apic<<C>> {{ return apic }}
| apic_cluster<<C>> {{ return apic_cluster }} | apic_cluster<<C>> {{ return apic_cluster }}
| cpu<<C>> {{ return cpu }}
| cpu_bus<<C>> {{ return cpu_bus }}
rule prtval: expr {{ return str(expr) }} rule prtval: expr {{ return str(expr) }}
| STR {{ return STR }} | STR {{ return STR }}