From 58769b7d50c923e83057793d6edee814a78c19ea Mon Sep 17 00:00:00 2001 From: Eric Biederman Date: Mon, 22 Nov 2004 21:45:24 +0000 Subject: - 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 --- util/newconfig/config.g | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'util/newconfig') diff --git a/util/newconfig/config.g b/util/newconfig/config.g index 45d24ac2d5..37dc47ec20 100644 --- a/util/newconfig/config.g +++ b/util/newconfig/config.g @@ -952,15 +952,23 @@ class partobj: self.set_path(".type=DEVICE_PATH_PCI_DOMAIN,.u={.pci_domain={ .domain = 0x%x }}" % (pci_domain)) 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)): 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)) - 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 addcpupath(self, id): + """ Add a relative path to a cpu device hanging off our parent """ + if ((id < 0) or (id > 255)): + 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): """Declare option that can be used by this part""" @@ -1044,7 +1052,7 @@ def getoption(name, image): elif (curpart): o = getdict(curpart.uses_options, name) if (o == 0): - print "curpart.uses_optins is %s\n" % curpart.uses_options + print "curpart.uses_options is %s\n" % curpart.uses_options else: o = getdict(global_uses_options, name) v = getoptionvalue(name, o, image) @@ -1552,6 +1560,7 @@ parser Config: token COMMENT: 'comment' token CONFIG: 'config' token CPU: 'cpu' + token CPU_BUS: 'cpu_bus' token CHIP: 'chip' token DEFAULT: 'default' token DEFINE: 'define' @@ -1768,15 +1777,15 @@ parser Config: HEX_NUM {{ cluster = int(HEX_NUM, 16) }} {{ if (C): partstack.tos().addapic_clusterpath(cluster) }} - rule cpu<>: CPU {{ if (C): devicepart('cpu') }} - HEX_NUM {{ id = int(HEX_NUM, 16) }} + rule cpu<>: CPU {{ if (C): devicepart('cpu') }} + HEX_NUM {{ id = int(HEX_NUM, 16) }} {{ if (C): partstack.tos().addcpupath(id) }} - rule cpu_bus<>: CPU_BUS {{ if (C): devicepart('cpu_bus') }} - HEX_NUM {{ bus = int(HEX_NUM, 16) }} - {{ if (C): partstack.tos().addcpu_buspath(bus) }} + rule cpu_bus<>: CPU_BUS {{ if (C): devicepart('cpu_bus') }} + HEX_NUM {{ id = int(HEX_NUM, 16) }} + {{ if (C): partstack.tos().addcpu_buspath(id) }} - rule dev_path<>: + rule dev_path<>: pci<> {{ return pci }} | pci_domain<> {{ return pci_domain }} | pnp<> {{ return pnp }} -- cgit v1.2.3