Skip to content

Commit

Permalink
Merge #1971
Browse files Browse the repository at this point in the history
1971: Use mainline QEMU r=ppannuto a=alistair23

### Pull Request Overview

Instead of cloning a fork QEMU let's instead clone mainline.

This also applies two patches from #1938 but updates them to refer to mainline QEMU instead of the old fork.

### Testing Strategy

Running the CI.

### TODO or Help Wanted

### Documentation Updated

- [X] Updated the relevant files in `/docs`, or no updates are required.

### Formatting

- [X] Ran `make prepush`.


Co-authored-by: Pat Pannuto <pat.pannuto@gmail.com>
Co-authored-by: Alistair Francis <alistair.francis@wdc.com>
  • Loading branch information
3 people committed Jul 10, 2020
2 parents f2b110d + 9b69764 commit a3b9a8c
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 30 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,5 @@ doc/rustdoc
# are manually included for releases.
Cargo.lock

# Used to build QEMU for emulation testing
tools/qemu

# Python scripts
__pycache__
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tools/qemu"]
path = tools/qemu
url = https://git.qemu.org/git/qemu.git
18 changes: 8 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -492,16 +492,12 @@ ci-job-miri: ci-setup-miri
### ci-runner-github-qemu jobs:

define ci_setup_qemu_riscv
$(call banner,CI-Setup: Install Tock QEMU port)
$(call banner,CI-Setup: Build QEMU)
@# Use the latest QEMU as it has OpenTitan support
@printf "Building QEMU, this could take a few minutes\n\n"
# Download Tock qemu fork if needed
if ! bash -c 'cd tools/qemu && [[ $$(git rev-parse --short HEAD) == "7ff5b84" ]]'; then \
rm -rf tools/qemu; \
cd tools; git clone https://github.com/alistair23/qemu.git --depth 1 -b riscv-tock.next; \
cd qemu; ./configure --target-list=riscv32-softmmu; \
fi
# Build qemu
@git submodule sync; git submodule update --init
@cd tools/qemu; ./configure --target-list=riscv32-softmmu;
@# Build qemu
@$(MAKE) -C "tools/qemu" || (echo "You might need to install some missing packages" || exit 127)
endef

Expand All @@ -521,8 +517,10 @@ endef
.PHONY: ci-setup-qemu
ci-setup-qemu:
$(call ci_setup_helper,\
cd tools/qemu && [[ $$(git rev-parse --short HEAD) == "1ef6d40" ]] && [ -x riscv32-softmmu ] && echo yes,\
Clone QEMU fork (with riscv fixes) and run its build scripts,\
status=$$(git submodule status -- tools/qemu); \
[[ "$${status:0:1}" != "" ]] && \
cd tools/qemu && make -q riscv32-softmmu && echo yes,\
Clone QEMU and run its build scripts,\
ci_setup_qemu_riscv,\
CI_JOB_QEMU_RISCV)
$(call ci_setup_helper,\
Expand Down
34 changes: 17 additions & 17 deletions boards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ Platforms Supported by Tock
The `/boards` directory contains the physical hardware platforms
that Tock supports.

| Board | Architecture | MCU | Interface | App deployment |
|----------------------------------------------------------------------|-----------------|----------------|------------|----------------|
| [Hail](hail/README.md) | ARM Cortex-M4 | SAM4LC8BA | Bootloader | tockloader |
| [Imix](imix/README.md) | ARM Cortex-M4 | SAM4LC8CA | Bootloader | tockloader |
| [Nordic nRF52-DK](nordic/nrf52dk/README.md) | ARM Cortex-M4 | nRF52832 | jLink | tockloader |
| [Nordic nRF52840-DK](nordic/nrf52840dk/README.md) | ARM Cortex-M4 | nRF52840 | jLink | tockloader |
| [Nordic nRF52840-Dongle](nordic/nrf52840_dongle/README.md) | ARM Cortex-M4 | nRF52840 | jLink | tockloader |
| [ACD52832](acd52832/README.md) | ARM Cortex-M4 | nRF52832 | jLink | tockloader |
| [Nano 33 BLE](nano33ble/README.md) | ARM Cortex-M4 | nRF52840 | BOSSA | bossac |
| [ST Nucleo F446RE](nucleo_f446re/README.md) | ARM Cortex-M4 | STM32F446 | openocd | custom |
| [ST Nucleo F429ZI](nucleo_f429zi/README.md) | ARM Cortex-M4 | STM32F429 | openocd | custom |
| [STM32F3Discovery kit](stm32f3discovery/README.md) | ARM Cortex-M4 | STM32F303VCT6 | openocd | custom |
| [STM32F412G Discovery kit](stm32f412gdiscovery/README.md) | ARM Cortex-M4 | STM32F412G | openocd | custom |
| [SparkFun RedBoard Artemis Nano](redboard_artemis_nano/README.md) | ARM Cortex-M4 | Apollo3 | custom | custom |
| [SiFive HiFive1](hifive1/README.md) | RISC-V | FE310-G000 | openocd | tockloader |
| [Digilent Arty A-7 100T](arty_e21/README.md) | RISC-V RV32IMAC | SiFive E21 | openocd | tockloader |
| [Nexys Video OpenTitan](opentitan/README.md) | RISC-V RV32IMC | EarlGrey | custom | custom |
| Board | Architecture | MCU | Interface | App deployment | QEMU Support? |
|----------------------------------------------------------------------|-----------------|----------------|------------|----------------|-------------------|
| [Hail](hail/README.md) | ARM Cortex-M4 | SAM4LC8BA | Bootloader | tockloader | No |
| [Imix](imix/README.md) | ARM Cortex-M4 | SAM4LC8CA | Bootloader | tockloader | No |
| [Nordic nRF52-DK](nordic/nrf52dk/README.md) | ARM Cortex-M4 | nRF52832 | jLink | tockloader | No |
| [Nordic nRF52840-DK](nordic/nrf52840dk/README.md) | ARM Cortex-M4 | nRF52840 | jLink | tockloader | No |
| [Nordic nRF52840-Dongle](nordic/nrf52840_dongle/README.md) | ARM Cortex-M4 | nRF52840 | jLink | tockloader | No |
| [ACD52832](acd52832/README.md) | ARM Cortex-M4 | nRF52832 | jLink | tockloader | No |
| [Nano 33 BLE](nano33ble/README.md) | ARM Cortex-M4 | nRF52840 | BOSSA | bossac | No |
| [ST Nucleo F446RE](nucleo_f446re/README.md) | ARM Cortex-M4 | STM32F446 | openocd | custom | #1827 |
| [ST Nucleo F429ZI](nucleo_f429zi/README.md) | ARM Cortex-M4 | STM32F429 | openocd | custom | #1827 |
| [STM32F3Discovery kit](stm32f3discovery/README.md) | ARM Cortex-M4 | STM32F303VCT6 | openocd | custom | #1827 |
| [STM32F412G Discovery kit](stm32f412gdiscovery/README.md) | ARM Cortex-M4 | STM32F412G | openocd | custom | #1827 |
| [SparkFun RedBoard Artemis Nano](redboard_artemis_nano/README.md) | ARM Cortex-M4 | Apollo3 | custom | custom | No |
| [SiFive HiFive1](hifive1/README.md) | RISC-V | FE310-G000 | openocd | tockloader | [Yes (5.1)][qemu] |
| [Digilent Arty A-7 100T](arty_e21/README.md) | RISC-V RV32IMAC | SiFive E21 | openocd | tockloader | No |
| [Nexys Video OpenTitan](opentitan/README.md) | RISC-V RV32IMC | EarlGrey | custom | custom | [Yes (5.1)][qemu] |
5 changes: 5 additions & 0 deletions doc/Getting_Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ developing Tock.
the options with `tockloader` support to load applications, as that
is the configuration that most examples and tutorials assume.

**Note:** QEMU support in Tock is in the early stages. Please be
sure to check whether and how QEMU is supported for a board based on
the table in the [`boards/` subdirectory](../boards/README.md).
The `make ci-job-qemu` target is the authority on QEMU support.

* Info about testing Tock on QEMU
* 01/08/2020 : Among the boards supported by Tock, [SiFive HiFive1 RISC-V Board](../boards/hifive1/#running-in-qemu) can be tested in QEMU.

Expand Down
34 changes: 34 additions & 0 deletions doc/Qemu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Qemu and Tock
=============

Tock is experimenting with QEMU.

**All things QEMU are in early stages and rough edges are to be expected.**

That said, please do file PRs or issues if you run into trouble or find things
confusing. The long-term goal is to integrate QEMU as a core part of CI for Tock.

<!-- npm i -g markdown-toc; markdown-toc -i Qemu.md -->

<!-- toc -->

- [Supported Boards](#supported-boards)
- [Building QEMU](#building-qemu)

<!-- tocstop -->

## Supported Boards

QEMU support for embedded platforms is limited. Please check the the table in
the [`boards/` subdirectory](../boards/README.md) for an up-to-date list of
supported boards.

## Building QEMU

Tock requires the master branch of QEMU. The `make ci-setup-qemu` Make target
will build this for you. If you would prefer to build it yourself or you need
more help look at the QEMU wiki: https://wiki.qemu.org/Hosts

Although both Tock and QEMU have automated testing it's possible that the version
of QEMU and Tock will become out of sync and will no longer work. If you are having
problems try older versions of QEMU and/or Tock.
1 change: 1 addition & 0 deletions tools/qemu
Submodule qemu added at 171199

0 comments on commit a3b9a8c

Please sign in to comment.