aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-06-23 07:06:30 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-06-23 07:06:30 +0000
commitb3406b1fb5d5c2001dd6d3f4bc22400fa058d3bc (patch)
tree84540328a5b165b9cb23903713807341ae658286
parent30b3efed8fbd8a98fb45a656d54d18d3d032b01c (diff)
parent18b46a4343af83b3c30a3082587becd972b89bcc (diff)
downloadgeneric-busytown-mac-infra-release.tar.gz
Snap for 11992377 from 18b46a4343af83b3c30a3082587becd972b89bcc to busytown-mac-infra-releasebusytown-mac-infra-release
Change-Id: Iaf81fc02bdd496dfd998ca7304f1425fd913a8d9
-rw-r--r--BUILD1
-rw-r--r--libnos/debug.cpp4
-rw-r--r--nugget/include/feature_map.h8
-rw-r--r--nugget/include/hals/avb.h71
4 files changed, 82 insertions, 2 deletions
diff --git a/BUILD b/BUILD
index c9f246f..482ebab 100644
--- a/BUILD
+++ b/BUILD
@@ -24,6 +24,7 @@ cc_library(
hdrs = [
"nugget/include/hals/common.h",
"nugget/include/hals/weaver.h",
+ "nugget/include/hals/avb.h",
],
strip_include_prefix = "nugget/include/",
visibility = ["//visibility:public"],
diff --git a/libnos/debug.cpp b/libnos/debug.cpp
index cc8a2c2..22c84fc 100644
--- a/libnos/debug.cpp
+++ b/libnos/debug.cpp
@@ -41,8 +41,8 @@ std::string StatusCodeString(uint32_t code) {
return "APP_LINE_NUMBER " + std::to_string(code - APP_LINE_NUMBER_BASE);
}
if (code >= APP_SPECIFIC_ERROR && code < APP_LINE_NUMBER_BASE) {
- return "APP_SPECIFIC_ERROR " + std::to_string(APP_LINE_NUMBER_BASE) +
- " + " + std::to_string(code - APP_LINE_NUMBER_BASE);
+ return "APP_SPECIFIC_ERROR + " +
+ std::to_string(code - APP_SPECIFIC_ERROR);
}
return "unknown";
diff --git a/nugget/include/feature_map.h b/nugget/include/feature_map.h
index 7ff697b..82b36bc 100644
--- a/nugget/include/feature_map.h
+++ b/nugget/include/feature_map.h
@@ -58,6 +58,14 @@ enum nugget_feature_list {
nugget_feature_max = FEATURE_MASK, // 24-bit FEATURE_FIELD
};
+enum avb_feature_list {
+ avb_feature_api_no_proto = 0,
+
+ /* Please do not change numbers after they've been released */
+
+ avb_feature_max = FEATURE_MASK, // 24-bit FEATURE_FIELD
+};
+
enum weaver_feature_list {
weaver_feature_api_no_proto = 0,
diff --git a/nugget/include/hals/avb.h b/nugget/include/hals/avb.h
new file mode 100644
index 0000000..47c919f
--- /dev/null
+++ b/nugget/include/hals/avb.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * 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.
+ */
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "application.h"
+#include "hals/common.h"
+
+#define AVB_CARRIER_LOCK_NAME_MAX_SIZE 256
+
+typedef uint8_t nos2_avb_carrier_lock_name_t[AVB_CARRIER_LOCK_NAME_MAX_SIZE];
+
+/****************************************************************************/
+/* The command is sent separately from any data */
+
+enum nos2_avb_cmd {
+ NOS2_AVB_CMD_GET_STATE,
+ NOS2_AVB_CMD_LOAD,
+ NOS2_AVB_CMD_STORE,
+ NOS2_AVB_CMD_GET_LOCK,
+ NOS2_AVB_CMD_CARRIER_LOCK,
+ NOS2_AVB_CMD_CARRIER_UNLOCK,
+ NOS2_AVB_CMD_SET_DEVICE_LOCK,
+ NOS2_AVB_CMD_SET_BOOT_LOCK,
+ NOS2_AVB_CMD_SET_OWNER_LOCK,
+ NOS2_AVB_CMD_SET_PRODUCTION,
+ NOS2_AVB_CMD_CARRIER_LOCK_TEST,
+ NOS2_AVB_CMD_RESET,
+ NOS2_AVB_CMD_BOOT_LOADER_DONE,
+ NOS2_AVB_CMD_GET_OWNER_KEY,
+ NOS2_AVB_CMD_GET_RESET_CHALLENGE,
+ NOS2_AVB_CMD_PRODUCTION_RESET_TEST,
+ NOS2_AVB_CMD_GET_CARRIER_LOCK_NAME,
+
+ NOS2_AVB_NUM_CMDS
+};
+
+/****************************************************************************/
+/* Request/Response data. Both are optional and depend on the command. */
+
+/** NOS2_AVB_CMD_GET_CARRIER_LOCK_NAME */
+struct nos2_avb_get_carrier_lock_name_request {
+ struct nos2_cmd_hal hal;
+};
+
+struct nos2_avb_get_carrier_lock_name_response {
+ struct nos2_cmd_hal hal;
+
+ nos2_avb_carrier_lock_name_t name;
+};
+
+/****************************************************************************/
+#ifdef __cplusplus
+}
+#endif