builder: add a parameter to pass options to BIOS Makefile

This commit is contained in:
Franck Jullien 2020-04-27 21:52:36 +02:00
parent bb70a2325a
commit e764eabda1
1 changed files with 7 additions and 1 deletions

View File

@ -49,7 +49,8 @@ class Builder:
csr_json = None, csr_json = None,
csr_csv = None, csr_csv = None,
csr_svd = None, csr_svd = None,
memory_x = None): memory_x = None,
bios_options = None):
self.soc = soc self.soc = soc
# From Python doc: makedirs() will become confused if the path # From Python doc: makedirs() will become confused if the path
@ -66,6 +67,7 @@ class Builder:
self.csr_json = csr_json self.csr_json = csr_json
self.csr_svd = csr_svd self.csr_svd = csr_svd
self.memory_x = memory_x self.memory_x = memory_x
self.bios_options = bios_options
self.software_packages = [] self.software_packages = []
for name in soc_software_packages: for name in soc_software_packages:
@ -110,6 +112,10 @@ class Builder:
for name, src_dir in self.software_packages: for name, src_dir in self.software_packages:
define(name.upper() + "_DIRECTORY", src_dir) define(name.upper() + "_DIRECTORY", src_dir)
if self.bios_options is not None:
for option in self.bios_options:
define(option, "1")
write_to_file( write_to_file(
os.path.join(self.generated_dir, "variables.mak"), os.path.join(self.generated_dir, "variables.mak"),
"".join(variables_contents)) "".join(variables_contents))