Skip to content

Commit

Permalink
Remove references to bbl/pk
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryz123 committed Mar 10, 2023
1 parent 90caf22 commit 0fa461b
Show file tree
Hide file tree
Showing 26 changed files with 14 additions and 199 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions boards/chipyard/base-workloads/br-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"config" : "linux-config"
},
"firmware" : {
"use-bbl" : false,
"bbl-src" : "../../firmware/riscv-pk",
"opensbi-src" : "../../firmware/opensbi"
}
}
9 changes: 2 additions & 7 deletions boards/default/installers/prototype/prototype.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 0 additions & 2 deletions boards/firechip/base-workloads/br-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
}
},
"firmware" : {
"use-bbl" : false,
"bbl-src" : "../../firmware/riscv-pk",
"opensbi-src" : "../../firmware/opensbi"
},
"host-init" : "host-init.sh",
Expand Down
2 changes: 0 additions & 2 deletions boards/firechip/base-workloads/fedora-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
}
},
"firmware" : {
"use-bbl" : false,
"bbl-src" : "../../firmware/riscv-pk",
"opensbi-src" : "../../firmware/opensbi"
}
}
3 changes: 0 additions & 3 deletions boards/prototype/base-workloads/br-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 2 additions & 2 deletions docs/source/internal/Build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions docs/source/marshalConfig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 0 additions & 20 deletions docs/source/workloadConfig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions images/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion init-submodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 0 additions & 4 deletions scripts/fullTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -88,7 +85,6 @@
'overlay',
'post_run_hook',
'simArgs',
'bbl'
],

# A hopefully minimal and fast(ish) set of tests to make sure nothing
Expand Down
13 changes: 0 additions & 13 deletions test/bbl-args.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions test/bbl-src.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions test/bbl.yaml

This file was deleted.

1 change: 0 additions & 1 deletion test/bbl/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions test/bbl/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions test/bbl/bblArgsOutput/bbl-args/uartlog

This file was deleted.

1 change: 0 additions & 1 deletion test/bbl/bblOutput/bbl/uartlog

This file was deleted.

1 change: 0 additions & 1 deletion test/bbl/bblSrcOutput/bbl-src/uartlog

This file was deleted.

7 changes: 0 additions & 7 deletions test/bbl/copy-src.sh

This file was deleted.

12 changes: 0 additions & 12 deletions test/bbl/test.patch

This file was deleted.

26 changes: 2 additions & 24 deletions wlutil/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
32 changes: 8 additions & 24 deletions wlutil/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
configDeprecated = [
'linux-config',
'linux-src',
'pk-src'
]

# This is a comprehensive list of all options set during config parsing
Expand All @@ -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
Expand All @@ -131,8 +130,6 @@
'runSpec',
'files',
'outputs',
'bbl-src',
'bbl-build-args',
'opensbi-src',
'opensbi-build-args',
'builder',
Expand Down Expand Up @@ -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.
]
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()

Expand All @@ -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):
Expand Down
Loading

0 comments on commit 0fa461b

Please sign in to comment.