Skip to content

Commit

Permalink
Merge branch 'master' into tizen-sanitizers
Browse files Browse the repository at this point in the history
  • Loading branch information
woody-apple authored Apr 5, 2022
2 parents 72c76f4 + 913aca0 commit 52d3a95
Show file tree
Hide file tree
Showing 371 changed files with 18,213 additions and 1,376 deletions.
2 changes: 2 additions & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,7 @@ VSCode
WaitNewInputEvent
WakeOnLan
WantedBy
watchdogTimeout
webpage
wget
whde
Expand Down Expand Up @@ -1451,3 +1452,4 @@ localedef
nameserver
nmcli
tsan
bouffalolab
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,7 @@
[submodule "third_party/efr32_sdk/wiseconnect-wifi-bt-sdk"]
path = third_party/efr32_sdk/wiseconnect-wifi-bt-sdk
url = https://github.com/SiliconLabs/wiseconnect-wifi-bt-sdk
[submodule "third_party/bouffalolab/bl602"]
path = third_party/bouffalolab/bl602_sdk/repo
url = https://github.com/bouffalolab/bl_iot_sdk_matter.git
branch = bl602_release
6 changes: 6 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {

# Set this to true to enable k32w builds by default.
enable_k32w_builds = false

# Set this to true to enable bl602 builds by default.
enable_bl602_builds = false
}

declare_args() {
Expand Down Expand Up @@ -274,6 +277,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
# Build the k32w shell app example.
enable_k32w_shell_app_build = enable_k32w_builds

# Build the bl602 lighting app example.
enable_bl602_lighting_app_build = enable_bl602_builds

enable_fake_tests = enable_default_builds && host_os == "linux"
}

Expand Down
2 changes: 2 additions & 0 deletions build/config/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ if (_chip_defaults.custom_toolchain != "") {
} else if (target_os == "freertos") {
if (target_cpu == "arm") {
_default_toolchain = "${_build_overrides.build_root}/toolchain/arm_gcc"
} else if (target_cpu == "riscv") {
_default_toolchain = "${_build_overrides.build_root}/toolchain/riscv_gcc"
} else {
assert(false, "Unsupported target_cpu: ${target_cpu}")
}
Expand Down
22 changes: 22 additions & 0 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ if (current_cpu == "arm" || current_cpu == "arm64") {
import("${build_root}/config/arm.gni")
} else if (current_cpu == "x86" || current_cpu == "x86_64") {
import("${build_root}/config/x86.gni")
} else if (current_cpu == "riscv") {
import("${build_root}/config/riscv.gni")
}

config("release") {
Expand Down Expand Up @@ -122,6 +124,26 @@ config("abi_default") {
]
}
}
if (current_cpu == "riscv") {
if (riscv_arch != "") {
cflags += [ "-march=${riscv_arch}" ]
}
if (riscv_cpu != "") {
cflags += [ "-mcpu=${riscv_cpu}" ]
}
if (riscv_tune != "") {
cflags += [ "-mtune=${riscv_tune}" ]
}
if (riscv_abi != "") {
cflags += [ "-mabi=${riscv_abi}" ]
}
if (riscv_fpu != "") {
cflags += [ "-mfpu=${riscv_fpu}" ]
}
if (riscv_float_abi != "") {
cflags += [ "-mfloat-abi=${riscv_float_abi}" ]
}
}
}

asmflags = cflags
Expand Down
64 changes: 64 additions & 0 deletions build/config/riscv.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")

if (current_cpu == "riscv") {
declare_args() {
# Build file to import for RISCV defaults.
riscv_platform_config = ""
}

# Allow platforms to override how RISCV architecture flags are chosen by
# providing a file to import.
if (riscv_platform_config != "") {
_platform_defaults = {
import(riscv_platform_config)
}
}

_defaults = {
riscv_arch = ""
riscv_cpu = ""
riscv_tune = ""
riscv_fpu = ""
riscv_float_abi = ""
riscv_abi = ""

# Update defaults with platform values, if any.
if (riscv_platform_config != "") {
forward_variables_from(_platform_defaults, "*")
}
}

declare_args() {
# RISCV architecture (value for -march flag).
riscv_arch = _defaults.riscv_arch

# RISCV CPU (value for -mcpu flag).
riscv_cpu = _defaults.riscv_cpu

# RISCV tuning (value for -mtune flag).
riscv_tune = _defaults.riscv_tune

# RISCV FPU (value for -mfpu flag).
riscv_fpu = _defaults.riscv_fpu

# RISCV float ABI (value for -mfloat-abi flag).
riscv_float_abi = _defaults.riscv_float_abi

# RISCV ABI (value for -mabi flag).
riscv_abi = _defaults.riscv_abi
}
}
21 changes: 21 additions & 0 deletions build/toolchain/riscv_gcc/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2021 The Pigweed Authors
# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("riscv_toolchain.gni")

riscv_toolchain("riscv_gcc") {
toolchain_args = {
}
}
35 changes: 35 additions & 0 deletions build/toolchain/riscv_gcc/riscv_toolchain.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/bl602_sdk.gni")
import("//build_overrides/build.gni")

import("${build_root}/toolchain/gcc_toolchain.gni")

template("riscv_toolchain") {
gcc_toolchain(target_name) {
_tool_name_root = "${root_build_dir}/../../third_party/bouffalolab/bl602_sdk/repo/toolchain/riscv/Linux/bin/riscv64-unknown-elf-"
ar = _tool_name_root + "ar"
cc = _tool_name_root + "gcc"
cxx = _tool_name_root + "g++"

toolchain_args = {
current_cpu = "riscv"
current_os = invoker.current_os
is_clang = false

forward_variables_from(invoker.toolchain_args, "*")
}
}
}
18 changes: 18 additions & 0 deletions build_overrides/bl602_sdk.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

declare_args() {
# Root directory for bl602 SDK build files.
bl602_sdk_build_root = "//third_party/bouffalolab/bl602_sdk"
}
36 changes: 36 additions & 0 deletions config/bouffalolab/bl602/lib/pw_rpc/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/target_types.gni")

static_library("pw_rpc") {
output_name = "libPwRpc"

public_configs = [ "${dir_pigweed}/pw_hdlc:default_config" ]

public_deps = [
"$dir_pw_rpc:server",
"$dir_pw_rpc/nanopb:echo_service",
"${chip_root}/examples/platform/bl602/pw_sys_io:pw_sys_io_bl602",
"${dir_pigweed}/pw_hdlc:pw_rpc",
dir_pw_assert,
dir_pw_checksum,
dir_pw_hdlc,
dir_pw_log,
]

output_dir = "${root_out_dir}/lib"
}
28 changes: 28 additions & 0 deletions config/bouffalolab/bl602/lib/pw_rpc/pw_rpc.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/chip.gni")
import("//build_overrides/pigweed.gni")

pw_log_BACKEND = "$dir_pw_log_basic"
pw_assert_BACKEND = "$dir_pw_assert_log"
pw_sys_io_BACKEND =
"${chip_root}/examples/platform/bl602/pw_sys_io:pw_sys_io_bl602"

pw_build_LINK_DEPS = [
"$dir_pw_assert:impl",
"$dir_pw_log:impl",
]

dir_pw_third_party_nanopb = "${chip_root}/third_party/nanopb/repo"
39 changes: 39 additions & 0 deletions config/bouffalolab/bl602/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

import("${build_root}/toolchain/riscv_gcc/riscv_toolchain.gni")

riscv_toolchain("bl602_lock_app") {
toolchain_args = {
current_os = "freertos"
import("${chip_root}/examples/lock-app/bl602/args.gni")
}
}

riscv_toolchain("bl602_lighting_app") {
toolchain_args = {
current_os = "freertos"
import("${chip_root}/examples/lighting-app/bl602/args.gni")
}
}

riscv_toolchain("bl602_window_app") {
toolchain_args = {
current_os = "freertos"
import("${chip_root}/examples/window-app/bl602/args.gni")
}
}
2 changes: 1 addition & 1 deletion config/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ if (CONFIG_CHIP_OTA_REQUESTOR)

target_sources(${APP_TARGET} PRIVATE
${CHIP_ROOT}/examples/platform/mbed/ota/OTARequestorDriverImpl.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/OTARequestor.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/DefaultOTARequestorStorage.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/GenericOTARequestorDriver.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/BDXDownloader.cpp
Expand Down
14 changes: 14 additions & 0 deletions config/nrfconnect/chip-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ chip_gn_arg_bool ("chip_error_logging" CONFIG_MATTER_LOG_LE
chip_gn_arg_bool ("chip_progress_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 3)
chip_gn_arg_bool ("chip_detail_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 4)
chip_gn_arg_bool ("chip_automation_logging" "false")
chip_gn_arg_bool ("chip_malloc_sys_heap" CONFIG_CHIP_MALLOC_SYS_HEAP)

if (CONFIG_CHIP_ROTATING_DEVICE_ID)
chip_gn_arg_bool("chip_enable_rotating_device_id" "true")
Expand Down Expand Up @@ -305,6 +306,19 @@ if (CONFIG_CHIP_LIB_SHELL)
target_link_options(chip INTERFACE -Wl,--whole-archive -lCHIPShell -Wl,--no-whole-archive)
endif()

if (CONFIG_CHIP_MALLOC_SYS_HEAP_OVERRIDE)
target_link_options(chip INTERFACE
-Wl,--wrap=malloc
-Wl,--wrap=calloc
-Wl,--wrap=realloc
-Wl,--wrap=free
-Wl,--wrap=_malloc_r
-Wl,--wrap=_calloc_r
-Wl,--wrap=_realloc_r
-Wl,--wrap=_free_r
)
endif()

target_link_libraries(chip INTERFACE -Wl,--start-group ${CHIP_LIBRARIES} -Wl,--end-group)

add_dependencies(chip chip-gn)
Expand Down
1 change: 1 addition & 0 deletions config/qpg/chip-gn/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ qpg_sdk("sdk") {
static_library("qpg") {
deps = [
"//src/app/server",
"//src/controller",
"//src/lib",
]

Expand Down
1 change: 1 addition & 0 deletions config/qpg/chip-gn/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ chip_build_tests = false
chip_monolithic_tests = false
chip_inet_config_enable_tcp_endpoint = false
chip_build_libshell = false
chip_enable_ota_requestor = true
qpg_ar = "arm-none-eabi-ar"
qpg_cc = "arm-none-eabi-gcc"
qpg_cxx = "arm-none-eabi-g++"
Expand Down
Loading

0 comments on commit 52d3a95

Please sign in to comment.