Skip to content

Commit

Permalink
Add Qorvo factory data
Browse files Browse the repository at this point in the history
  • Loading branch information
q-thla committed Oct 11, 2022
1 parent 00e8427 commit eaa1751
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 21 deletions.
35 changes: 35 additions & 0 deletions examples/lighting-app/qpg/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
]
}
21 changes: 0 additions & 21 deletions third_party/qpg_sdk/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
21 changes: 21 additions & 0 deletions third_party/qpg_sdk/qpg_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

0 comments on commit eaa1751

Please sign in to comment.