diff --git a/.gitmodules b/.gitmodules index 2b09509d..6fe1d7d8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,6 @@ [submodule "riscv-linux"] path = boards/default/linux url = https://github.com/firesim/linux.git -[submodule "riscv-pk"] - path = boards/default/firmware/riscv-pk - url = https://github.com/riscv/riscv-pk.git [submodule "opensbi"] path = boards/default/firmware/opensbi url = https://github.com/riscv/opensbi.git diff --git a/boards/chipyard/base-workloads/br-base.json b/boards/chipyard/base-workloads/br-base.json index 5dc9db29..0fe5b158 100644 --- a/boards/chipyard/base-workloads/br-base.json +++ b/boards/chipyard/base-workloads/br-base.json @@ -11,8 +11,6 @@ "config" : "linux-config" }, "firmware" : { - "use-bbl" : false, - "bbl-src" : "../../firmware/riscv-pk", "opensbi-src" : "../../firmware/opensbi" } } diff --git a/boards/default/installers/prototype/prototype.py b/boards/default/installers/prototype/prototype.py index 51e93038..5067f442 100644 --- a/boards/default/installers/prototype/prototype.py +++ b/boards/default/installers/prototype/prototype.py @@ -12,11 +12,6 @@ def install(targetCfg, opts): nodiskPath = str(targetCfg['bin']) + '-nodisk' outputPath = nodiskPath + '-flat' - if targetCfg['firmware']['use-bbl'] == False: - wlutil.run(['riscv64-unknown-elf-objcopy', '-S', '-O', 'binary', '--change-addresses', '-0x80000000', - nodiskPath, outputPath]) - else: - print("Copy BBL's flattened binary to " + outputPath) - shutil.copy(str(targetCfg['firmware']['bbl-src']) + '/build/bbl.bin', outputPath) - + wlutil.run(['riscv64-unknown-elf-objcopy', '-S', '-O', 'binary', '--change-addresses', '-0x80000000', + nodiskPath, outputPath]) log.info("Workload flattened and \"installed\" to " + outputPath) diff --git a/boards/firechip/base-workloads/br-base.json b/boards/firechip/base-workloads/br-base.json index eee879fe..d1fbc25b 100644 --- a/boards/firechip/base-workloads/br-base.json +++ b/boards/firechip/base-workloads/br-base.json @@ -16,8 +16,6 @@ } }, "firmware" : { - "use-bbl" : false, - "bbl-src" : "../../firmware/riscv-pk", "opensbi-src" : "../../firmware/opensbi" }, "host-init" : "host-init.sh", diff --git a/boards/firechip/base-workloads/fedora-base.json b/boards/firechip/base-workloads/fedora-base.json index bcb20347..20d6168b 100644 --- a/boards/firechip/base-workloads/fedora-base.json +++ b/boards/firechip/base-workloads/fedora-base.json @@ -15,8 +15,6 @@ } }, "firmware" : { - "use-bbl" : false, - "bbl-src" : "../../firmware/riscv-pk", "opensbi-src" : "../../firmware/opensbi" } } diff --git a/boards/prototype/base-workloads/br-base.json b/boards/prototype/base-workloads/br-base.json index d0ab8e9c..d25c98fa 100644 --- a/boards/prototype/base-workloads/br-base.json +++ b/boards/prototype/base-workloads/br-base.json @@ -12,9 +12,6 @@ "config" : "linux-config" }, "firmware" : { - "use-bbl" : false, - "bbl-src" : "../../firmware/riscv-pk", - "bbl-build-args" : "--enable-logo", "opensbi-src" : "../../firmware/opensbi" } } diff --git a/docs/source/internal/Build.rst b/docs/source/internal/Build.rst index d2a0bf5b..0de9040b 100644 --- a/docs/source/internal/Build.rst +++ b/docs/source/internal/Build.rst @@ -92,8 +92,8 @@ Linux Kernel Generation and Linking ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ With all of the dependencies finished, we can finally compile the Linux kernel and link it with the bootloader. While each workload can use a custom kernel -source, all workloads use the same bootloader (for now), located at -``riscv-pk/``. The final linked bbl+linux+initramfs is coppied into +source, all workloads use the same bootloader. +The final linked sbi+linux+initramfs is coppied into ``images/workloadName-bin``. Build Rootfs diff --git a/docs/source/marshalConfig.rst b/docs/source/marshalConfig.rst index 89fa6d5f..6f614ffb 100644 --- a/docs/source/marshalConfig.rst +++ b/docs/source/marshalConfig.rst @@ -70,11 +70,6 @@ your workload configuration directly (see :ref:`workload-linux-src`). ^^^^^^^^^^^^^^^^^^^ Location of the firesim repository to use for the :ref:`command-install` command. -``pk-dir`` -^^^^^^^^^^^^^^^^^ -Default proxy-kernel source directory. The RISC-V proxy kernel repository -provides code for the Berkeley Boot Loader ('bbl'). - ``log-dir`` ^^^^^^^^^^^^^^^^^^^ Default directory to use when writing logs from FireMarshal runs. diff --git a/docs/source/workloadConfig.rst b/docs/source/workloadConfig.rst index 16bffede..7d27829f 100644 --- a/docs/source/workloadConfig.rst +++ b/docs/source/workloadConfig.rst @@ -162,10 +162,6 @@ The specified module directory must contain a Makefile that can be invoked as: It outputs one or more .ko files to be loaded. See test/kmod/ for an example. -pk-src (Deprecated) -^^^^^^^^^^^^^^^^^^^^ -See the ‘firmware/bbl-src’ option for the new equivalent. - firmware ^^^^^^^^^^^^^^^^^^^ Firmware-related options @@ -179,22 +175,6 @@ opensbi-build-args +++++++++++++++++++++ Additional command line arguments to the 'make' command used to build opensbi. -bbl-src -++++++++++++++++++ -Path to riscv-pk source directory to use for this workload. This provides the -bootloader (bbl). Defaults to the riscv-pk source included with the board. - -bbl-build-args -++++++++++++++++++ -Additional arguments to be passed to the configure script for bbl. Arguments -will be appended to any system defaults. - -use-bbl -++++++++++++++++++ -Use BBL as the firmware rather than the default OpenSBI. If you specified -'bbl-src', that will be used, otherwise the default implementation from the -board will be used. - host-init ^^^^^^^^^^^^^^ A script to run natively on your host (i.e., the machine where you diff --git a/images/.gitignore b/images/.gitignore deleted file mode 100644 index d4770bf8..00000000 --- a/images/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# This is just a working directory meant to hold images and binaries that shouldn't be tracked by git -* -!.gitignore diff --git a/init-submodules.sh b/init-submodules.sh index f23b21f1..63391c22 100755 --- a/init-submodules.sh +++ b/init-submodules.sh @@ -7,7 +7,6 @@ git submodule update --init \ boards/default/linux \ - boards/default/firmware/riscv-pk \ boards/default/firmware/opensbi \ wlutil/busybox \ boards/default/distros/br/buildroot \ diff --git a/scripts/fullTest.py b/scripts/fullTest.py index 382e27f9..70bf096d 100755 --- a/scripts/fullTest.py +++ b/scripts/fullTest.py @@ -46,9 +46,6 @@ # These is the most complete 'general' tests and is the way most people # will use Marshal "qemu": [ - 'bbl', - 'bbl-src', - 'bbl-args', 'opensbi-src', 'opensbi-args', 'command', @@ -88,7 +85,6 @@ 'overlay', 'post_run_hook', 'simArgs', - 'bbl' ], # A hopefully minimal and fast(ish) set of tests to make sure nothing diff --git a/test/bbl-args.yaml b/test/bbl-args.yaml deleted file mode 100644 index 27ac07f3..00000000 --- a/test/bbl-args.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name" : "bbl-args", - "workdir" : "bbl", - "base" : "br-base.json", - "firmware" : { - "use-bbl" : true, - "bbl-build-args" : "--enable-logo" - }, - "command" : "echo marshal bbl-args test", - "testing" : { - "refDir" : "bblArgsOutput" - } -} diff --git a/test/bbl-src.yaml b/test/bbl-src.yaml deleted file mode 100644 index f7a241bc..00000000 --- a/test/bbl-src.yaml +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name" : "bbl-src", - "workdir" : "bbl", - "base" : "br-base.json", - "host-init" : "copy-src.sh", - "firmware" : { - "bbl-src" : "riscv-pk", - "use-bbl" : true - }, - "command" : "echo bbl-src test", - "testing" : { - "refDir" : "bblSrcOutput" - } -} - - diff --git a/test/bbl.yaml b/test/bbl.yaml deleted file mode 100644 index 25f212f1..00000000 --- a/test/bbl.yaml +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name" : "bbl", - "base" : "br-base.json", - "firmware" : { - "use-bbl" : true - }, - "command" : "echo Global: using bbl", - "testing" : { - "refDir" : "bblOutput" - } -} diff --git a/test/bbl/.gitignore b/test/bbl/.gitignore deleted file mode 100644 index 230a808b..00000000 --- a/test/bbl/.gitignore +++ /dev/null @@ -1 +0,0 @@ -riscv-pk diff --git a/test/bbl/README.md b/test/bbl/README.md deleted file mode 100644 index 269ab07f..00000000 --- a/test/bbl/README.md +++ /dev/null @@ -1,2 +0,0 @@ -This test uses the legacy bootloader 'bbl'. For the moment, BBL will hang on -poweroff in Qemu. Only spike simulation is fully supported. diff --git a/test/bbl/bblArgsOutput/bbl-args/uartlog b/test/bbl/bblArgsOutput/bbl-args/uartlog deleted file mode 100644 index 97c01873..00000000 --- a/test/bbl/bblArgsOutput/bbl-args/uartlog +++ /dev/null @@ -1,21 +0,0 @@ - vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - vvvvvvvvvvvvvvvvvvvvvvvvvvvv -rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvvvv -rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv -rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv -rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv -rrrrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvvvv -rrrrrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv -rrrrrrrrrrrrr vvvvvvvvvvvvvvvvvvvvvv -rr vvvvvvvvvvvvvvvvvvvvvv -rr vvvvvvvvvvvvvvvvvvvvvvvv rr -rrrr vvvvvvvvvvvvvvvvvvvvvvvvvv rrrr -rrrrrr vvvvvvvvvvvvvvvvvvvvvv rrrrrr -rrrrrrrr vvvvvvvvvvvvvvvvvv rrrrrrrr -rrrrrrrrrr vvvvvvvvvvvvvv rrrrrrrrrr -rrrrrrrrrrrr vvvvvvvvvv rrrrrrrrrrrr -rrrrrrrrrrrrrr vvvvvv rrrrrrrrrrrrrr -rrrrrrrrrrrrrrrr vv rrrrrrrrrrrrrrrr -rrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrr -rrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrr -rrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrr diff --git a/test/bbl/bblOutput/bbl/uartlog b/test/bbl/bblOutput/bbl/uartlog deleted file mode 100644 index 811ed2da..00000000 --- a/test/bbl/bblOutput/bbl/uartlog +++ /dev/null @@ -1 +0,0 @@ -Global: using bbl diff --git a/test/bbl/bblSrcOutput/bbl-src/uartlog b/test/bbl/bblSrcOutput/bbl-src/uartlog deleted file mode 100644 index b8baed47..00000000 --- a/test/bbl/bblSrcOutput/bbl-src/uartlog +++ /dev/null @@ -1 +0,0 @@ -MARSHAL BBL-SRC TEST diff --git a/test/bbl/copy-src.sh b/test/bbl/copy-src.sh deleted file mode 100755 index 2cebb610..00000000 --- a/test/bbl/copy-src.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -set -e - -if [ ! -d linux ]; then - rsync --exclude ".git" -r ../../boards/firechip/firmware/riscv-pk . - patch riscv-pk/bbl/bbl.c < test.patch -fi diff --git a/test/bbl/test.patch b/test/bbl/test.patch deleted file mode 100644 index 4963206a..00000000 --- a/test/bbl/test.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git bbl/bbl.c bbl/bbl.c -index 3b92fc1..ae3437e 100644 ---- bbl/bbl.c -+++ bbl/bbl.c -@@ -129,6 +129,7 @@ void boot_loader(uintptr_t dtb) - #ifdef PK_PRINT_DEVICE_TREE - fdt_print(dtb_output()); - #endif -+ putstring("\nMARSHAL BBL-SRC TEST\n"); - mb(); - /* Use optional FDT preloaded external payload if present */ - entry_point = kernel_start ? kernel_start : PAYLOAD_START; diff --git a/wlutil/build.py b/wlutil/build.py index f4c1bb12..7eacfa94 100644 --- a/wlutil/build.py +++ b/wlutil/build.py @@ -208,7 +208,7 @@ def addDep(loader, config): else: targets = [str(config['bin'])] - moddeps = [config.get('pk-src')] + moddeps = [] if 'firmware' in config: moddeps.append(config['firmware']['source']) @@ -481,25 +481,6 @@ def makeModules(cfg): wlutil.run(['depmod', '-b', str(wlutil.getOpt('initramfs-dir') / "drivers"), kernelVersion]) -def makeBBL(config, nodisk=False): - # BBL doesn't seem to detect changes in its configuration and won't rebuild if the payload path changes - bblBuild = config['firmware']['source'] / 'build' - if bblBuild.exists(): - shutil.rmtree(bblBuild) - bblBuild.mkdir() - - configureArgs = ['--host=riscv64-unknown-elf', - '--with-payload=' + str(config['linux']['source'] / 'vmlinux')] - - if 'bbl-build-args' in config['firmware']: - configureArgs += config['firmware']['bbl-build-args'] - - wlutil.run(['../configure'] + configureArgs, cwd=bblBuild) - wlutil.run(['make', '-j' + str(wlutil.getOpt('jlevel'))], cwd=bblBuild) - - return bblBuild / 'bbl' - - def makeOpenSBI(config, nodisk=False): payload = config['linux']['source'] / 'arch' / 'riscv' / 'boot' / 'Image' size = payload.stat().st_size @@ -586,10 +567,7 @@ def makeBin(config, nodisk=False): shutil.copy(config['linux']['source'] / '.config', config['out-dir'] / 'linux_config') shutil.copy(wlutil.getOpt('busybox-dir') / '.config', config['out-dir'] / 'busybox_config') - if 'use-bbl' in config.get('firmware', {}) and config['firmware']['use-bbl']: - fw = makeBBL(config, nodisk) - else: - fw = makeOpenSBI(config, nodisk) + fw = makeOpenSBI(config, nodisk) config['bin'].parent.mkdir(parents=True, exist_ok=True) config['dwarf'].parent.mkdir(parents=True, exist_ok=True) diff --git a/wlutil/config.py b/wlutil/config.py index 8eaab630..57d91ead 100644 --- a/wlutil/config.py +++ b/wlutil/config.py @@ -96,7 +96,6 @@ configDeprecated = [ 'linux-config', 'linux-src', - 'pk-src' ] # This is a comprehensive list of all options set during config parsing @@ -105,22 +104,22 @@ 'out-dir', # Path to outputs (filesystem images, binaries, extra metadata) 'img', # Path to output filesystem image 'img-sz', # Desired size of image in bytes (optional) - 'bin', # Path to output binary (e.g. bbl-vmlinux) - 'dwarf', # Additional debugging symbols for the kernel (bbl strips them from 'bin') + 'bin', # Path to output binary + 'dwarf', # Additional debugging symbols for the kernel 'base-img', # The filesystem image to use when building this workload 'base-format', # The format of base-img 'cfg-file', # Path to this workloads raw config file 'initramfs', # boolean: should we use an initramfs with this config? 'jobs', # After parsing, jobs is a collections.OrderedDict containing 'Config' objects for each job. 'base-deps', # A list of tasks that this workload needs from its base (a potentially empty list) - 'firmware-src', # A convenience field that points to whatever firmware is configured (see 'use-bbl' to determine which it is) + 'firmware-src', # A convenience field that points to whatever firmware is configured 'use-parent-bin', # Child would build the exact same binary as the parent, just copy it instead of rebuilding. 'img-hardcoded', # The workload hard-coded an image, we will blindly use it. ] # These are the user-defined options that should be converted to absolute # paths (from workload-relative). Derived options are already absolute. -configToAbs = ['overlay', 'bbl-src', 'cfg-file', 'bin', 'img', 'spike', 'qemu'] +configToAbs = ['overlay', 'cfg-file', 'bin', 'img', 'spike', 'qemu'] # These are the options that should be inherited from base configs (if not @@ -131,8 +130,6 @@ 'runSpec', 'files', 'outputs', - 'bbl-src', - 'bbl-build-args', 'opensbi-src', 'opensbi-build-args', 'builder', @@ -169,9 +166,6 @@ # Members of the 'firmware' option configFirmware = [ - "use-bbl", # Use bbl as firmware instead of openSBI - "bbl-src", # Alternative source directory for bbl - "bbl-build-args", # Additional arguments to configure script for bbl. User provides string, cannonical form is list. "opensbi-src", # Alternative source directory for openSBI "opensbi-build-args", # Additional arguments to make for openSBI. User provides string, cannonical form is list. ] @@ -279,13 +273,6 @@ def translateDeprecated(config): elif 'linux-config' in config or 'linux-src' in config: log.warning("The deprecated 'linux-config' and 'linux-src' options are mutually exclusive with the 'linux' option; ignoring") - # Firmware stuff - if 'pk-src' in config: - if 'firmware' not in config: - config['firmware'] = {'bbl-src': config['pk-src']} - else: - log.warning("The deprecated 'pk-src' option is mutually exclusive with the 'firmware' option; ignoring") - # Now that they're translated, remove all deprecated options from config for opt in configDeprecated: config.pop(opt, None) @@ -371,11 +358,11 @@ def initFirmwareOpts(config): if 'firmware' not in config: return - for opt in ['bbl-src', 'opensbi-src']: + for opt in ['opensbi-src']: if opt in config['firmware']: config['firmware'][opt] = cleanPath(config['firmware'][opt], config['workdir']) - for opt in ['bbl-build-args', 'opensbi-build-args']: + for opt in ['opensbi-build-args']: if opt in config['firmware']: config['firmware'][opt] = config['firmware'][opt].split() @@ -389,14 +376,11 @@ def inheritFirmwareOpts(config, baseCfg): for k, v in baseCfg['firmware'].items(): if k not in config['firmware']: config['firmware'][k] = copy.copy(v) - elif k in ['bbl-build-args', 'opensbi-build-args']: + elif k in ['opensbi-build-args']: config['firmware'][k] = baseCfg['firmware'][k] + config['firmware'][k] if 'firmware' in config: - if config['firmware'].get('use-bbl', False): - config['firmware']['source'] = config['firmware']['bbl-src'] - else: - config['firmware']['source'] = config['firmware']['opensbi-src'] + config['firmware']['source'] = config['firmware']['opensbi-src'] class Config(collections.abc.MutableMapping): diff --git a/wlutil/default-config.yaml b/wlutil/default-config.yaml index 1adf59ce..2cfd1d5a 100644 --- a/wlutil/default-config.yaml +++ b/wlutil/default-config.yaml @@ -8,12 +8,6 @@ board-dir : '../boards/firechip' # Stores all outputs (binaries and images) image-dir : '../images' -# Default linux source -# linux-dir : '../riscv-linux' -# -# # Default pk source -# pk-dir : '../boards/default/firmware/opensbi' - # Runtime Logs log-dir : '../logs' diff --git a/wlutil/wlutil.py b/wlutil/wlutil.py index 3666360e..901024fd 100644 --- a/wlutil/wlutil.py +++ b/wlutil/wlutil.py @@ -49,7 +49,6 @@ def sigIntHandler(signum, frame): # List of marshal submodules (those enabled by init-submodules.sh) marshalSubmods = [ 'linux-dir', - 'bbl-dir', 'opensbi-dir', 'busybox-dir', 'buildroot-dir', @@ -128,7 +127,6 @@ def cleanPaths(opts, baseDir=pathlib.Path('.')): 'image-dir', 'linux-dir', 'firesim-dir', - 'bbl-dir', 'opensbi-dir', 'log-dir', 'res-dir', @@ -205,9 +203,6 @@ def clean(path): # Linux source to use by default (can be overwritten by user config). Derived from board-dir. 'linux-dir', - # Default pk/bbl source to use by default (can be overwritten by user config). Derived from board-dir. - 'bbl-dir', - # Default OpenSBI source to use by default (can be overwritten by user config). Derived from board-dir. 'opensbi-dir', @@ -339,7 +334,6 @@ def deriveOpts(self): self['rootfs-margin'] = humanfriendly.parse_size(str(self['rootfs-margin'])) self['driver-dirs'] = list(self['board-dir'].glob('drivers/*')) - self['bbl-dir'] = self['board-dir'] / 'firmware' / 'riscv-pk' self['opensbi-dir'] = self['board-dir'] / 'firmware' / 'opensbi' self['linux-dir'] = self['board-dir'] / 'linux' self['installers'] = self['board-dir'] / 'installers'