From eaa1751dcc2ab712a8180d071315300394c893d6 Mon Sep 17 00:00:00 2001 From: Thomas Langewouters Date: Wed, 21 Sep 2022 16:45:21 +0200 Subject: [PATCH] Add Qorvo factory data --- examples/lighting-app/qpg/BUILD.gn | 35 ++++++++++++++++++++++++++++++ third_party/qpg_sdk/BUILD.gn | 21 ------------------ third_party/qpg_sdk/qpg_sdk.gni | 21 ++++++++++++++++++ 3 files changed, 56 insertions(+), 21 deletions(-) diff --git a/examples/lighting-app/qpg/BUILD.gn b/examples/lighting-app/qpg/BUILD.gn index 4745c5d1f26f55..39c41260993025 100644 --- a/examples/lighting-app/qpg/BUILD.gn +++ b/examples/lighting-app/qpg/BUILD.gn @@ -62,6 +62,7 @@ qpg_executable("lighting_app") { ] deps = [ + ":factorydata_lib", ":sdk", "${chip_root}/examples/lighting-app/lighting-common", "${chip_root}/examples/lighting-app/lighting-common:color-format", @@ -153,3 +154,37 @@ group("qpg") { group("default") { deps = [ ":qpg" ] } + +qpg_make_build("factorydata") { + make_sources = [ "${qpg_sdk_root}/Components/Qorvo" ] + make_output = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/FactoryData/libFactoryData_example_base.a" ] + work_dir = rebase_path(target_gen_dir, root_build_dir) + + "/${qpg_sdk_lib_dir}/FactoryData" + make_args = [ + "-f", + rebase_path(qpg_sdk_root, root_build_dir) + + "/Libraries/Qorvo/FactoryData/Makefile.FactoryData_example_base", + "WORKDIR=" + work_dir, + "Q_DAC_CERT=" + rebase_path(chip_root, root_build_dir) + + "/src/platform/qpg/examples/qorvo_dac_cert_0.der", + "Q_DAC_KEY=" + rebase_path(chip_root, root_build_dir) + + "/src/platform/qpg/examples/qorvo_dac_key_0.der", + "Q_PAI_CERT=" + rebase_path(chip_root, root_build_dir) + + "/src/platform/qpg/examples/qorvo_pai_cert.der", + "Q_CERTIFICATION_DECLARATION=" + rebase_path(chip_root, root_build_dir) + + "/src/platform/qpg/examples/qorvo_cd.bin", + ] +} + +static_library("factorydata_lib") { + deps = [ ":factorydata" ] + libs = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/FactoryData/libFactoryData_example_base.a" ] + public_configs = [ ":qpg_retain_factorydata" ] +} + +config("qpg_retain_factorydata") { + ldflags = [ + "-Wl,-u_binary_factory_data_bin_start", + "-Wl,-u_binary_factory_data_start", + ] +} diff --git a/third_party/qpg_sdk/BUILD.gn b/third_party/qpg_sdk/BUILD.gn index 41be3ac8219c12..a0c9f2c1e535ae 100755 --- a/third_party/qpg_sdk/BUILD.gn +++ b/third_party/qpg_sdk/BUILD.gn @@ -47,27 +47,6 @@ freertos_target("freertos") { public_configs = [ ":qpg_freertos_config" ] } -template("qpg_make_build") { - forward_variables_from(invoker, - [ - "make_sources", - "make_args", - "make_output", - ]) - action(target_name) { - script = "make.py" - sources = make_sources - outputs = make_output - args = [ - "-s", - - #use PATH variable lookup for compiler - "TOOLCHAIN=", - ] - args += make_args - } -} - qpg_make_build("qpg_mbedtls_alt") { make_sources = [ "${qpg_sdk_root}/Components/ThirdParty/Silex" ] make_output = [ "${target_gen_dir}/${qpg_sdk_lib_dir}/mbedtls_alt_${qpg_target_ic}/libmbedtls_alt_${qpg_target_ic}.a" ] diff --git a/third_party/qpg_sdk/qpg_sdk.gni b/third_party/qpg_sdk/qpg_sdk.gni index f52cbf7a75142a..9e9f85a4359461 100644 --- a/third_party/qpg_sdk/qpg_sdk.gni +++ b/third_party/qpg_sdk/qpg_sdk.gni @@ -162,3 +162,24 @@ template("qpg_sdk") { } } } + +template("qpg_make_build") { + forward_variables_from(invoker, + [ + "make_sources", + "make_args", + "make_output", + ]) + action(target_name) { + script = "${chip_root}/third_party/qpg_sdk/make.py" + sources = make_sources + outputs = make_output + args = [ + "-s", + + #use PATH variable lookup for compiler + "TOOLCHAIN=", + ] + args += make_args + } +}