builder: add a parameter to pass options to BIOS Makefile
authorFranck Jullien <franck.jullien@gmail.com>
Mon, 27 Apr 2020 19:52:36 +0000 (21:52 +0200)
committerFranck Jullien <franck.jullien@gmail.com>
Fri, 1 May 2020 10:10:50 +0000 (12:10 +0200)
litex/soc/integration/builder.py

index 745eb75e921dc6d7e023ead7fee0427fd6fca1b7..4fd1b2330347d3044acf14e50a71368c4267f618 100644 (file)
@@ -49,7 +49,8 @@ class Builder:
         csr_json         = None,
         csr_csv          = None,
         csr_svd          = None,
-        memory_x         = None):
+        memory_x         = None,
+        bios_options     = None):
         self.soc = soc
 
         # From Python doc: makedirs() will become confused if the path
@@ -66,6 +67,7 @@ class Builder:
         self.csr_json = csr_json
         self.csr_svd  = csr_svd
         self.memory_x = memory_x
+        self.bios_options = bios_options
 
         self.software_packages = []
         for name in soc_software_packages:
@@ -110,6 +112,10 @@ class Builder:
             for name, src_dir in self.software_packages:
                 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(
                 os.path.join(self.generated_dir, "variables.mak"),
                 "".join(variables_contents))