Skip to content

Commit fd497c9

Browse files
authored
Merge e330fb4 into 5b5566f
2 parents 5b5566f + e330fb4 commit fd497c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+22379
-45
lines changed

.gitmodules

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
[submodule "rimage"]
2-
path = rimage
3-
# This is a _relative_ submodule URL. In some use cases it's better than
4-
# an _absolute_ submodule URL, in other cases it's not. One size does
5-
# unfortunately not fit all.
6-
#
7-
# Among other pages, http://blog.tremily.us/posts/Relative_submodules/
8-
# has a good comparison
9-
#
10-
# If you use Zephyr you must also look at the comments in sof/west.yml.
11-
#
12-
# If you want to fork or mirror sof.git _without_ doing the same for
13-
# rimage.git then your automation may want you to change and git commit
14-
# an absolute URL in your branch. No need to git commit for interactive
15-
# use; a local and temporary edit of this file is enough for interactive
16-
# use because .gitmodules is used only once to --init[ialize]
17-
# .git/config the first time. Then .gitmodules is never used again after
18-
# cloning.
19-
url = ../rimage
1+
# This is required for non-Zephyr ("XTOS") configurations. Zephyr
2+
# configs also get it from sof/west.yml which adds the burden of keeping
3+
# both tomlc99 SHA1s synchronized but in practice this barely ever moves.
4+
[submodule "tomlc99"]
5+
path = tools/rimage/tomlc99
6+
# This is a _absolute_ submodule URL. In some use cases it's
7+
# better than an _relative_ submodule URL, in other cases it's
8+
# not. One size does unfortunately not fit all. Among other
9+
# pages, http://blog.tremily.us/posts/Relative_submodules/ has a
10+
# good comparison.
11+
#
12+
# A local and temporary edit of this url can be enough because
13+
# .gitmodules is used _only once_ to submodule --init[ialize]
14+
# .git/config the first time. Then .gitmodules is never used
15+
# again after cloning tomlc99 the first time.
16+
url = https://github.com/thesofproject/tomlc99.git
17+
branch = master

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ project(SOF C ASM)
4343
set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}")
4444
set(SOF_ROOT_BINARY_DIRECTORY "${PROJECT_BINARY_DIR}")
4545

46-
set(RIMAGE_TOP "${PROJECT_SOURCE_DIR}/rimage")
46+
set(RIMAGE_TOP "${PROJECT_SOURCE_DIR}/tools/rimage")
4747

4848
# check git hooks
4949
include(scripts/cmake/git-hooks.cmake)

rimage

Lines changed: 0 additions & 1 deletion
This file was deleted.

scripts/cmake/git-submodules.cmake

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# SPDX-License-Identifier: BSD-3-Clause
22

3-
find_package(Git)
4-
set(RIMAGE_CMAKE "${SOF_ROOT_SOURCE_DIRECTORY}/rimage/CMakeLists.txt")
3+
set(RIMAGE_SUBMODULE "${SOF_ROOT_SOURCE_DIRECTORY}/rimage")
4+
if(EXISTS "${RIMAGE_SUBMODULE}/CMakeLists.txt")
5+
message(WARNING
6+
"${RIMAGE_SUBMODULE} is deprecated and ignored"
7+
)
8+
endif()
59

10+
find_package(Git)
11+
set(TOMLC99_MAKE "${SOF_ROOT_SOURCE_DIRECTORY}/tools/rimage/tomlc99/Makefile")
612
if(GIT_FOUND AND EXISTS "${SOF_ROOT_SOURCE_DIRECTORY}/.git")
713

8-
if(EXISTS "${RIMAGE_CMAKE}")
14+
if(EXISTS "${TOMLC99_MAKE}")
915

1016
# As incredible as it sounds, some people run neither
1117
# "git status" nor "git diff" every few minutes and not
@@ -36,10 +42,10 @@ if(GIT_FOUND AND EXISTS "${SOF_ROOT_SOURCE_DIRECTORY}/.git")
3642
NOT CONFIG_LIBRARY)
3743

3844
message(FATAL_ERROR
39-
"${RIMAGE_CMAKE} not found. You should have used 'git clone --recursive'. \
45+
"${TOMLC99_MAKE} not found. You should have used 'git clone --recursive'. \
4046
To fix this existing git clone run:
41-
git submodule update --init --merge --recursive
47+
git submodule update --init --merge tools/rimage/tomlc99
4248
")
43-
endif() # rimage/CMakeLists.txt
49+
endif() # tomlc99/Makefile
4450

4551
endif() # .git/

scripts/xtensa-build-zephyr.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ def clean_staging(platform):
512512
# for now we must stick to `sof/rimage/[tomlc99]` for
513513
# backwards-compatibility with XTOS platforms and git submodules, see more
514514
# detailed comments in west.yml
515-
RIMAGE_SOURCE_DIR = west_top / "sof" / "rimage"
515+
RIMAGE_SOURCE_DIR = west_top / "sof" / "tools" / "rimage"
516516

517517

518518
def rimage_west_configuration(platform_dict, dest_dir):
@@ -563,14 +563,11 @@ def rimage_west_configuration(platform_dict, dest_dir):
563563

564564
def build_rimage():
565565

566-
# Detect non-west rimage duplicates, example: git submdule
567-
# SOF_TOP/rimage = sof2/rimage
568-
nested_rimage = pathlib.Path(SOF_TOP, "rimage")
569-
if nested_rimage.is_dir() and not nested_rimage.samefile(RIMAGE_SOURCE_DIR):
570-
raise RuntimeError(
571-
f"""Two rimage source directories found.
572-
Move non-west {nested_rimage} out of west workspace {west_top}.
573-
See output of 'west list'."""
566+
old_rimage_loc = SOF_TOP / "rimage"
567+
# Don't warn on empty directories
568+
if ( old_rimage_loc / "CMakeLists.txt" ).exists():
569+
warnings.warn(f"""{old_rimage_loc} is now ignored,
570+
new location is {RIMAGE_SOURCE_DIR}"""
574571
)
575572
rimage_dir_name = RIMAGE_BUILD_DIR.name
576573
# CMake build rimage module

smex/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ target_link_options(smex PRIVATE
2828

2929
target_include_directories(smex PRIVATE
3030
"${SOF_ROOT_SOURCE_DIRECTORY}/src/include"
31-
"${SOF_ROOT_SOURCE_DIRECTORY}/rimage/src/include"
31+
"${SOF_ROOT_SOURCE_DIRECTORY}/tools/rimage/src/include"
3232
)
3333

3434
# TODO: smex should not need RTOS headers: FIX.

tools/logger/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ target_compile_options(sof-logger PRIVATE
3535

3636
target_include_directories(sof-logger PRIVATE
3737
"${SOF_ROOT_SOURCE_DIRECTORY}/src/include"
38-
"${SOF_ROOT_SOURCE_DIRECTORY}/rimage/src/include"
38+
"${SOF_ROOT_SOURCE_DIRECTORY}/tools/rimage/src/include"
3939
"${SOF_ROOT_SOURCE_DIRECTORY}"
4040
)
4141

tools/rimage/.checkpatch.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
--codespell
2+
--codespellfile scripts/spelling.txt
3+
--ignore C99_COMMENT_TOLERANCE
4+
--no-tree
5+
--strict
6+
-g
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
# Basic build test
3+
4+
name: build
5+
6+
# yamllint disable-line rule:truthy
7+
on: [pull_request, push, workflow_dispatch]
8+
9+
env:
10+
CMAKE_C_FLAGS: "-Werror -Wall -Wmissing-prototypes\
11+
-Wimplicit-fallthrough=3 -Wpointer-arith"
12+
13+
jobs:
14+
build-test:
15+
runs-on: ubuntu-22.04
16+
steps:
17+
- uses: actions/checkout@v3
18+
with: {fetch-depth: 50, submodules: recursive}
19+
20+
- name: install tools
21+
run: sudo apt update && sudo apt install -y ninja-build
22+
23+
- name: build
24+
run: cmake -B build/ -G Ninja
25+
- run: cmake --build build/
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
# SPDX-License-Identifier: BSD-3-Clause
3+
# Tools that can save round-trips to github and a lot of time:
4+
#
5+
# yamllint -f parsable this.yml
6+
# pip3 install ruamel.yaml.cmd
7+
# yaml merge-expand this.yml exp.yml && diff -w -u this.yml exp.yml
8+
#
9+
# github.com also has a powerful web editor that can be used without
10+
# committing.
11+
12+
name: cppcheck
13+
14+
# yamllint disable-line rule:truthy
15+
on: [pull_request, push]
16+
17+
jobs:
18+
cppcheck:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
with: {fetch-depth: 50, submodules: recursive}
23+
24+
- name: apt install cppcheck
25+
run: sudo apt update && sudo apt-get -y install cppcheck
26+
27+
# TODO enable more types of checks as they are fixed
28+
- name: run cppcheck
29+
run: cppcheck --platform=unix32 --force --max-configs=1024
30+
--inconclusive --quiet --inline-suppr .

0 commit comments

Comments
 (0)