Skip to content

Commit

Permalink
Merge branch 'master' into algorithm-identifier-openssh
Browse files Browse the repository at this point in the history
  • Loading branch information
gendx authored Apr 9, 2020
2 parents a64d5d4 + 7253dc2 commit 879d72b
Show file tree
Hide file tree
Showing 22 changed files with 93 additions and 112 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/boards_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,11 @@ jobs:
- name: Set up OpenSK
run: ./setup.sh

- name: Building board nrf52840dk
run: ./deploy.py --board=nrf52840dk --no-app --programmer=none
- name: Building board nrf52840_dongle
run: ./deploy.py --board=nrf52840_dongle --no-app --programmer=none
- name: Building board nrf52840_dongle_dfu
run: ./deploy.py --board=nrf52840_dongle_dfu --no-app --programmer=none
- name: Building board nrf52840_mdk_dfu
run: ./deploy.py --board=nrf52840_mdk_dfu --no-app --programmer=none

- name: Create a long build directory
run: mkdir this-is-a-long-build-directory-0123456789abcdefghijklmnopqrstuvwxyz && mv third_party this-is-a-long-build-directory-0123456789abcdefghijklmnopqrstuvwxyz/

- name: Building board nrf52840dk
run: make -C this-is-a-long-build-directory-0123456789abcdefghijklmnopqrstuvwxyz/third_party/tock/boards/nordic/nrf52840dk
- name: Building board nrf52840_dongle
run: make -C this-is-a-long-build-directory-0123456789abcdefghijklmnopqrstuvwxyz/third_party/tock/boards/nordic/nrf52840_dongle
1 change: 1 addition & 0 deletions .github/workflows/cargo_fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
target: thumbv7em-none-eabi
components: rustfmt
- uses: actions/setup-python@v1
with:
python-version: 3.7
Expand Down
18 changes: 18 additions & 0 deletions boards/nordic/nrf52840_dongle_dfu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "nrf52840_dongle_dfu"
version = "0.1.0"
authors = ["Tock Project Developers <[email protected]>"]
build = "build.rs"
edition = "2018"

[[bin]]
path = "../nrf52840_dongle/src/main.rs"
name = "nrf52840_dongle_dfu"

[dependencies]
components = { path = "../../components" }
cortexm4 = { path = "../../../arch/cortex-m4" }
capsules = { path = "../../../capsules" }
kernel = { path = "../../../kernel" }
nrf52840 = { path = "../../../chips/nrf52840" }
nrf52dk_base = { path = "../nrf52dk_base" }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TOCK_ARCH=cortex-m4
TARGET=thumbv7em-none-eabi
PLATFORM=nrf52840_dongle_dfu

include ../../third_party/tock/boards/Makefile.common
include ../../Makefile.common

TOCKLOADER=tockloader

Expand All @@ -20,10 +20,10 @@ TOCKLOADER_JTAG_FLAGS = --jlink --arch $(TOCK_ARCH) --board $(PLATFORM) --page-s

# Upload the kernel over JTAG
.PHONY: flash
flash: target/$(TARGET)/release/$(PLATFORM).bin
flash: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).bin
$(TOCKLOADER) $(TOCKLOADER_GENERAL_FLAGS) flash --address $(KERNEL_ADDRESS) $(TOCKLOADER_JTAG_FLAGS) $<

# Upload the kernel over serial/bootloader
.PHONY: program
program: target/$(TARGET)/release/$(PLATFORM).hex
program: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).hex
$(error Cannot program nRF52 Dongle over USB. Use \`make flash\` and JTAG)
4 changes: 4 additions & 0 deletions boards/nordic/nrf52840_dongle_dfu/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
println!("cargo:rerun-if-changed=layout.ld");
println!("cargo:rerun-if-changed=../../kernel_layout.ld");
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ MEMORY

MPU_MIN_ALIGN = 8K;

INCLUDE ../../third_party/tock/boards/kernel_layout.ld
INCLUDE ../../kernel_layout.ld
14 changes: 14 additions & 0 deletions boards/nordic/nrf52840_mdk_dfu/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "nrf52840_mdk_dfu"
version = "0.1.0"
authors = ["Yihui Xiong <[email protected]>"]
build = "build.rs"
edition = "2018"

[dependencies]
components = { path = "../../components" }
cortexm4 = { path = "../../../arch/cortex-m4" }
capsules = { path = "../../../capsules" }
kernel = { path = "../../../kernel" }
nrf52840 = { path = "../../../chips/nrf52840" }
nrf52dk_base = { path = "../nrf52dk_base" }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TOCK_ARCH=cortex-m4
TARGET=thumbv7em-none-eabi
PLATFORM=nrf52840_mdk_dfu

include ../../third_party/tock/boards/Makefile.common
include ../../Makefile.common

TOCKLOADER=tockloader

Expand All @@ -20,10 +20,10 @@ TOCKLOADER_JTAG_FLAGS = --jlink --arch $(TOCK_ARCH) --board $(PLATFORM) --page-s

# Upload the kernel over JTAG
.PHONY: flash
flash: target/$(TARGET)/release/$(PLATFORM).bin
flash: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).bin
$(TOCKLOADER) $(TOCKLOADER_GENERAL_FLAGS) flash --address $(KERNEL_ADDRESS) $(TOCKLOADER_JTAG_FLAGS) $<

# Upload the kernel over serial/bootloader
.PHONY: program
program: target/$(TARGET)/release/$(PLATFORM).hex
$(error Cannot program nRF52 Dongle over USB. Use \`make flash\` and JTAG)
program: $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/$(PLATFORM).hex
$(error Cannot program nRF52840-MDK over USB. Use \`make flash\` and JTAG)
4 changes: 4 additions & 0 deletions boards/nordic/nrf52840_mdk_dfu/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
println!("cargo:rerun-if-changed=layout.ld");
println!("cargo:rerun-if-changed=../../kernel_layout.ld");
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ MEMORY

MPU_MIN_ALIGN = 8K;

INCLUDE ../../third_party/tock/boards/kernel_layout.ld
INCLUDE ../../kernel_layout.ld
File renamed without changes.
File renamed without changes.
30 changes: 0 additions & 30 deletions boards/nrf52840_dongle_dfu/Cargo.toml

This file was deleted.

4 changes: 0 additions & 4 deletions boards/nrf52840_dongle_dfu/build.rs

This file was deleted.

26 changes: 0 additions & 26 deletions boards/nrf52840_mdk_dfu/Cargo.toml

This file was deleted.

4 changes: 0 additions & 4 deletions boards/nrf52840_mdk_dfu/build.rs

This file was deleted.

17 changes: 10 additions & 7 deletions deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
),
"nrf52840_dongle_dfu":
OpenSKBoard(
path="boards/nrf52840_dongle_dfu",
path="third_party/tock/boards/nordic/nrf52840_dongle_dfu",
arch="thumbv7em-none-eabi",
page_size=4096,
kernel_address=0x1000,
Expand All @@ -132,7 +132,7 @@
),
"nrf52840_mdk_dfu":
OpenSKBoard(
path="boards/nrf52840_mdk_dfu",
path="third_party/tock/boards/nordic/nrf52840_mdk_dfu",
arch="thumbv7em-none-eabi",
page_size=4096,
kernel_address=0x1000,
Expand Down Expand Up @@ -304,7 +304,8 @@ def update_rustc_if_needed(self):
def build_tockos(self):
info("Building Tock OS for board {}".format(self.args.board))
props = SUPPORTED_BOARDS[self.args.board]
out_directory = os.path.join(props.path, "target", props.arch, "release")
out_directory = os.path.join("third_party", "tock", "target", props.arch,
"release")
os.makedirs(out_directory, exist_ok=True)
self.checked_command_output(["make"], cwd=props.path)

Expand Down Expand Up @@ -418,8 +419,9 @@ def get_padding(self):

def install_tock_os(self):
board_props = SUPPORTED_BOARDS[self.args.board]
kernel_file = os.path.join(board_props.path, "target", board_props.arch,
"release", "{}.bin".format(self.args.board))
kernel_file = os.path.join("third_party", "tock", "target",
board_props.arch, "release",
"{}.bin".format(self.args.board))
info("Flashing file {}.".format(kernel_file))
with open(kernel_file, "rb") as f:
kernel = f.read()
Expand Down Expand Up @@ -481,8 +483,9 @@ def create_hex_file(self, dest_file):

if self.args.tockos:
# Process kernel
kernel_path = os.path.join(board_props.path, "target", board_props.arch,
"release", "{}.bin".format(self.args.board))
kernel_path = os.path.join("third_party", "tock", "target",
board_props.arch, "release",
"{}.bin".format(self.args.board))
with open(kernel_path, "rb") as kernel:
kern_hex = intelhex.IntelHex()
kern_hex.frombytes(kernel.read(), offset=board_props.kernel_address)
Expand Down
13 changes: 13 additions & 0 deletions patches/tock/04-additional-boards.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/Cargo.toml b/Cargo.toml
index 18f4a10d..db88dc1d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,6 +13,8 @@ members = [
"boards/launchxl",
"boards/nordic/nrf52840dk",
"boards/nordic/nrf52840_dongle",
+ "boards/nordic/nrf52840_dongle_dfu",
+ "boards/nordic/nrf52840_mdk_dfu",
"boards/nordic/nrf52dk",
"boards/nucleo_f429zi",
"boards/nucleo_f446re",
21 changes: 0 additions & 21 deletions patches/tock/04-nrf52-bootloader.patch

This file was deleted.

12 changes: 10 additions & 2 deletions run_desktop_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@ make -C third_party/tock/boards/nordic/nrf52840dk
make -C third_party/tock/boards/nordic/nrf52840_dongle

echo "Checking that other boards build properly..."
make -C boards/nrf52840_dongle_dfu
make -C boards/nrf52840_mdk_dfu
make -C third_party/tock/boards/nordic/nrf52840_dongle_dfu
make -C third_party/tock/boards/nordic/nrf52840_mdk_dfu

echo "Checking deployment of supported boards..."
./deploy.py --board=nrf52840dk --no-app --programmer=none
./deploy.py --board=nrf52840_dongle --no-app --programmer=none

echo "Checking deployment of other boards..."
./deploy.py --board=nrf52840_dongle_dfu --no-app --programmer=none
./deploy.py --board=nrf52840_mdk_dfu --no-app --programmer=none

if [ -z "${TRAVIS_OS_NAME}" -o "${TRAVIS_OS_NAME}" = "linux" ]
then
Expand Down
5 changes: 5 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ EOF
exit 1
}

# Copy additional boards to the kernel.
echo -n '[-] Copying additional boards to Tock... '
cp -r boards/* third_party/tock/boards
echo $done_text

# Apply patches to kernel. Do that in a sub-shell
(
cd third_party/tock/ && \
Expand Down
2 changes: 1 addition & 1 deletion third_party/tock
Submodule tock updated 201 files

0 comments on commit 879d72b

Please sign in to comment.