Skip to content

Commit

Permalink
Adopt new qpg SDK directory structure (project-chip#13762)
Browse files Browse the repository at this point in the history
Introduce qpg_sdk_lib_dir to override the subdirectory in qpg_sdk_root
where the Qorvo platform libraries (.a) are to be found.

Add an option (qpg_sdk_include_platform_libs) to disable referencing
Qorvo platform libraries (useful to avoid missing unneeded paths when
building //config/qpg/chip-gn).

Update third_party/qpg_sdk/repo to a commit with the new directory
structure.
  • Loading branch information
q-thla authored and selissia committed Jan 28, 2022
1 parent 936da6f commit ea28aff
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 32 deletions.
2 changes: 1 addition & 1 deletion examples/lighting-app/qpg/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ qpg_executable("lighting_app") {
"${chip_root}/examples/lighting-app/lighting-common/color_format",
]

ldscript = "${qpg_sdk_root}/${qpg_target_ic}/ldscripts/chip-${qpg_target_ic}-example.ld"
ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld"

inputs = [ ldscript ]

Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/qpg/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ qpg_executable("lock_app") {

cflags = [ "-Wconversion" ]

ldscript = "${qpg_sdk_root}/${qpg_target_ic}/ldscripts/chip-${qpg_target_ic}-example.ld"
ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld"

inputs = [ ldscript ]

Expand Down
2 changes: 1 addition & 1 deletion examples/persistent-storage/qpg/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ qpg_executable("persistent_storage") {

output_dir = root_out_dir

ldscript = "${qpg_sdk_root}/${qpg_target_ic}/ldscripts/chip-${qpg_target_ic}-example.ld"
ldscript = "${qpg_sdk_root}/Libraries/Qorvo/QorvoStack/gen/QorvoStack_${qpg_target_ic}/QorvoStack_${qpg_target_ic}.ld"

inputs = [ ldscript ]

Expand Down
11 changes: 5 additions & 6 deletions src/lwip/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,13 @@ if (current_os == "zephyr" || current_os == "mbed") {

lwip_target("lwip") {
public = [
"${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/arch/cc.h",
"${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/arch/perf.h",
"${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/lwipopts.h",
"${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/lwippools.h",
"${qpg_sdk_root}/Components/ThirdParty/Lwip/arch/cc.h",
"${qpg_sdk_root}/Components/ThirdParty/Lwip/arch/perf.h",
"${qpg_sdk_root}/Components/ThirdParty/Lwip/lwipopts.h",
"${qpg_sdk_root}/Components/ThirdParty/Lwip/lwippools.h",
"freertos/arch/sys_arch.h",
]
sources =
[ "${qpg_sdk_build_root}/repo/${qpg_target_ic}/comps/lwip/sys_arch.c" ]
sources = [ "${qpg_sdk_root}/Components/ThirdParty/Lwip/sys_arch.c" ]

public_deps = [ ":lwip_buildconfig" ]
public_deps += [ "${qpg_sdk_build_root}:qpg_sdk" ]
Expand Down
4 changes: 3 additions & 1 deletion third_party/openthread/platforms/qpg/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ source_set("libopenthread-qpg") {
]
include_dirs += [ "${openthread_root}/examples/apps" ]

libs = [ "${qpg_sdk_root}/${qpg_target_ic}/lib/libOpenThreadQorvoGlue_${qpg_target_ic}_mtd.a" ]
if (qpg_sdk_include_platform_libs) {
libs = [ "${qpg_sdk_root}/${qpg_sdk_lib_dir}/OpenThreadQorvoGlue_${qpg_target_ic}_mtd/libOpenThreadQorvoGlue_${qpg_target_ic}_mtd.a" ]
}

public_deps = [
":openthread_core_config_qpg",
Expand Down
4 changes: 2 additions & 2 deletions third_party/qpg_sdk/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ group("qpg_sdk") {

config("qpg_freertos_config") {
include_dirs = [
"${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config",
"${chip_root}/third_party/qpg_sdk/repo/${qpg_target_ic}/comps/lwip",
"${qpg_sdk_root}/Applications/Matter/shared/config/inc",
"${qpg_sdk_root}/Components/ThirdParty/Lwip",
"${freertos_root}/repo/portable/GCC/ARM_CM3",
]
}
Expand Down
51 changes: 32 additions & 19 deletions third_party/qpg_sdk/qpg_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ declare_args() {
# Location of the QPG SDK.
qpg_sdk_root = "${chip_root}/third_party/qpg_sdk/repo"

# subdirectory in qpg_sdk_root where the binary library builds (.a) are to be found
# for connectedhomeip-qpg: Binaries (default)
# for matter endnodes sdk: Work
qpg_sdk_lib_dir = "Binaries"

# Target IC for QPG SDK
qpg_target_ic = "qpg6105"

# an option to disable referencing qorvo object archive files (*.a)
qpg_sdk_include_platform_libs = true
}

assert(qpg_sdk_root != "", "qpg_sdk_root must be specified")
Expand Down Expand Up @@ -57,21 +65,25 @@ template("qpg_sdk") {
}

include_dirs += [
"${qpg_sdk_root}/${qpg_target_ic}/comps/qvCHIP/inc",
"${qpg_sdk_root}/${qpg_target_ic}/comps/qvIO/inc",
"${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config",
"${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls",
"${qpg_sdk_root}/Components/Qorvo/Matter/qvCHIP/inc",
"${qpg_sdk_root}/Components/Qorvo/BSP/qvIO/inc",
"${qpg_sdk_root}/Libraries/Qorvo/mbedtls_alt/inc",
"${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt",
"${qpg_sdk_root}/Components/ThirdParty/Lwip",
"${qpg_sdk_root}/Components/ThirdParty/Lwip/arch",
"${mbedtls_root}/repo/include",
"${openthread_root}/include",
]

lib_dirs = []

libs += [
"${qpg_sdk_root}/${qpg_target_ic}/lib/libMatterQorvoGlue_${qpg_target_ic}_libbuild.a",
"${qpg_sdk_root}/${qpg_target_ic}/lib/libQorvoStack_${qpg_target_ic}.a",
"${qpg_sdk_root}/${qpg_target_ic}/lib/libmbedtls_alt_${qpg_target_ic}.a",
]
if (qpg_sdk_include_platform_libs) {
libs += [
"${qpg_sdk_root}/${qpg_sdk_lib_dir}/MatterQorvoGlue_${qpg_target_ic}_libbuild/libMatterQorvoGlue_${qpg_target_ic}_libbuild.a",
"${qpg_sdk_root}/${qpg_sdk_lib_dir}/QorvoStack_${qpg_target_ic}/libQorvoStack_${qpg_target_ic}.a",
"${qpg_sdk_root}/${qpg_sdk_lib_dir}/mbedtls_alt_${qpg_target_ic}/libmbedtls_alt_${qpg_target_ic}.a",
]
}

#MBed TLS built from third_party/mbedtls tree - OT config not used
defines = [
Expand Down Expand Up @@ -177,18 +189,19 @@ template("qpg_sdk") {
"${chip_root}/third_party/mbedtls/repo/library/x509write_crt.c",
"${chip_root}/third_party/mbedtls/repo/library/x509write_csr.c",
"${chip_root}/third_party/mbedtls/repo/library/xtea.c",
"${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config/FreeRTOSConfig.h",
"${qpg_sdk_root}/${qpg_target_ic}/comps/gpFreeRTOS/config/hooks.c",
"${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/${qpg_target_ic}-mbedtls-config.h",
"${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/aes_alt.h",
"${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/ccm_alt.h",
"${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/ecjpake_alt.h",
"${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/ecp_alt.h",
"${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/sha256_alt.h",
"${qpg_sdk_root}/${qpg_target_ic}/comps/libmbedtls/trng.c", #add this for
"${qpg_sdk_root}/Applications/Matter/shared/config/inc/FreeRTOSConfig.h",
"${qpg_sdk_root}/Applications/Matter/shared/config/src/hooks.c",
"${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/aes_alt.h",
"${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/ccm_alt.h",
"${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/ecjpake_alt.h",
"${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/ecp_alt.h",
"${qpg_sdk_root}/Components/ThirdParty/Silex/cryptosoc/mbedtls_alt/sha256_alt.h",
"${qpg_sdk_root}/Libraries/Qorvo/mbedtls_alt/inc/${qpg_target_ic}-mbedtls-config.h",
"${qpg_sdk_root}/Libraries/Qorvo/mbedtls_alt/src/trng.c",

# mbedtls_hardware_poll
"${qpg_sdk_root}/${qpg_target_ic}/comps/qvCHIP/inc/qvCHIP.h",
"${qpg_sdk_root}/Components/Qorvo/BSP/qvIO/inc/qvIO.h",
"${qpg_sdk_root}/Components/Qorvo/Matter/qvCHIP/inc/qvCHIP.h",
]

if (defined(invoker.sources)) {
Expand Down
2 changes: 1 addition & 1 deletion third_party/qpg_sdk/repo
Submodule repo updated from 6bce6f to 2b463a

0 comments on commit ea28aff

Please sign in to comment.