Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jczhang777 committed May 17, 2024
1 parent cb9a6fb commit a8dd074
Show file tree
Hide file tree
Showing 125 changed files with 35,499 additions and 2 deletions.
6 changes: 6 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
# Set this to true to enable bl602 builds by default.
enable_bl602_builds = false

# Set this to true to enable qcc743 builds by default.
enable_qcc743_builds = false

# Set this to true to enable bl702 builds by default.
enable_bl702_builds = false

Expand Down Expand Up @@ -402,6 +405,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
# Build the bl602 lighting app example.
enable_bl602_lighting_app_build = enable_bl602_builds

# Build the qcc743 lighting app example.
enable_qcc743_lighting_app_build = enable_qcc743_builds

# Build the bl702 lighting app example.
enable_bl702_lighting_app_build = enable_bl702_builds

Expand Down
19 changes: 19 additions & 0 deletions build_overrides/qcc74x_iot_sdk.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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() {
qcc74x_iot_sdk_build_root = "//third_party/qcc74x/"

qcc74x_sdk_root = "/opt/qcc74x_sdk"
}
19 changes: 19 additions & 0 deletions config/qcc74x/args.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2022 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.

# Options from standalone-chip.mk that differ from configure defaults. These
# options are used from examples/.

custom_toolchain =
"//third_party/connectedhomeip/config/qcc74x/toolchain:riscv_gcc"
46 changes: 46 additions & 0 deletions config/qcc74x/common/lib/pw_rpc/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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")

config("pw_string_config") {
defines = [
"_GLIBCXX_USE_C99_MATH_TR1",
"_LDBL_EQ_DBL",
]
}

pw_source_set("pw_string_dep") {
public_configs = [ ":pw_string_config" ]
}

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/qcc74x/common/rpc/pw_sys_io:pw_sys_io",
dir_pw_assert,
dir_pw_checksum,
dir_pw_hdlc,
dir_pw_log,
]

output_dir = "${root_out_dir}/lib"
}
31 changes: 31 additions & 0 deletions config/qcc74x/common/lib/pw_rpc/pw_rpc.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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/qcc74x/common/rpc/pw_sys_io:pw_sys_io"

pw_string_CONFIG =
"${chip_root}/config/qcc74x/common/lib/pw_rpc:pw_string_dep"

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

dir_pw_third_party_nanopb = "${chip_root}/third_party/nanopb/repo"
20 changes: 20 additions & 0 deletions config/qcc74x/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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 = {
}
}
48 changes: 48 additions & 0 deletions config/qcc74x/toolchain/riscv_toolchain.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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_overrides/qcc74x_iot_sdk.gni")
import("${build_root}/toolchain/gcc_toolchain.gni")
import("${chip_root}/src/platform/device.gni")

template("riscv_toolchain") {
gcc_toolchain(target_name) {
_tool_name_root = ""

if ("linux" == host_os) {
if (chip_device_platform == "qcc743") {
_tool_name_root = "${qcc74x_sdk_root}/toolchain/t-head-riscv/gcc_t-head_v2.6.1/bin/riscv64-unknown-elf-"
} else {
_tool_name_root = "${qcc74x_sdk_root}/toolchain/riscv/Linux/bin/riscv64-unknown-elf-"
}
} else if ("mac" == host_os || "darwin" == host_os) {
_tool_name_root = "${qcc74x_sdk_root}/toolchain/riscv/Darwin/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, "*")
}
}
}
20 changes: 20 additions & 0 deletions examples/build_overrides/qcc74x_sdk.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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() {
qcc74x_iot_sdk_build_root =
"//third_party/connectedhomeip/third_party/qcc74x"

qcc74x_sdk_root = "/opt/qcc74x_sdk"
}
Loading

0 comments on commit a8dd074

Please sign in to comment.