summaryrefslogtreecommitdiff
path: root/util/newconfig/config.g
diff options
context:
space:
mode:
Diffstat (limited to 'util/newconfig/config.g')
-rw-r--r--util/newconfig/config.g17
1 files changed, 13 insertions, 4 deletions
diff --git a/util/newconfig/config.g b/util/newconfig/config.g
index 4b8a27f096..6ff9c8a97a 100644
--- a/util/newconfig/config.g
+++ b/util/newconfig/config.g
@@ -1135,7 +1135,10 @@ def part(type, path, file, name):
if (type == 'cpu'):
cpudir(path)
else:
- doconfigfile(srcdir, partdir, file)
+ if (type == 'mainboard'):
+ doconfigfile(srcdir, partdir, file, 'mainboard_cfgfile')
+ else:
+ doconfigfile(srcdir, partdir, file, 'cfgfile')
def partpop():
global dirstack, partstack
@@ -1163,7 +1166,7 @@ def dodir(path, file):
fullpath = dirstack.tos()
debug.info(debug.statement, "DODIR: path %s, fullpath %s" % (path, fullpath))
dirstack.push(os.path.join(fullpath, path))
- doconfigfile(fullpath, path, file)
+ doconfigfile(fullpath, path, file, 'cfgfile')
dirstack.pop()
def lookup(name):
@@ -1195,12 +1198,12 @@ def setarch(my_arch):
setoption('ARCH', my_arch)
part('arch', my_arch, 'Config.lb', 0)
-def doconfigfile(path, confdir, file):
+def doconfigfile(path, confdir, file, rule):
rname = os.path.join(confdir, file)
loc.push(rname)
fullpath = os.path.join(path, rname)
fp = safe_open(fullpath, 'r')
- if (not parse('cfgfile', fp.read())):
+ if (not parse(rule, fp.read())):
fatal("Could not parse file")
exitiferrors()
loc.pop()
@@ -1482,6 +1485,12 @@ parser Config:
rule cfgfile: (uses<<1>>)*
(stmt<<1>>)*
EOF {{ return 1 }}
+ #mainboard config files are special, in that they can also have
+ # default values.
+ rule mainboard_cfgfile: (uses<<1>>)*
+ (defstmts<<1>>)*
+ (stmt<<1>>)*
+ EOF {{ return 1 }}
rule usesid<<C>>: ID {{ if (C): usesoption(ID) }}