1// Copyright 2021 The ChromiumOS Authors 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5syntax = "proto3"; 6 7package chromiumos.build.api; 8 9option go_package = "go.chromium.org/chromiumos/config/go/build/api"; 10 11import "chromiumos/build/api/portage.proto"; 12import "chromiumos/storage_path.proto"; 13 14// The type of a firmware binary. 15message FirmwareType { 16 enum Type { 17 UNKNOWN = 0; 18 MAIN = 1; 19 EC = 2; 20 PD = 3; 21 ISH = 4; 22 } 23} 24 25// Specifies the version of a firmware binary. 26message Version { 27 int32 major = 1; 28 int32 minor = 2; 29 int32 patch = 3; 30} 31 32// Specifies the location of a firmware binary. 33message FirmwarePayload { 34 reserved 1; 35 36 // The path to the firmware build artifact 37 oneof firmware_image { 38 // Path to the firmware artifact (either local or GS path) 39 StoragePath firmware_image_path = 5; 40 41 // NOTE: Deprecated (use firmware_image_path instead) 42 // 43 // Image path in BCS format: "bcs://Coral.10068.118.0.tbz2" 44 // 45 // TODO(shapiroc): Migrate to use fimware_image_path instead so 46 // that local provisioning can be supported also via provision_service 47 string firmware_image_name = 2 [ deprecated = true ]; 48 } 49 50 FirmwareType.Type type = 3; 51 52 Version version = 4; 53} 54 55// Specifies optional hash for the payload. 56message FirmwarePayloadHash { 57 // Enumeration of different hash algorithms. 58 enum Algorithm { 59 MD5SUM = 0; 60 } 61 62 // Hash algorithm in use. 63 Algorithm algorithm = 1; 64 65 // Hash digest. 66 string digest = 2; 67} 68 69// Specifies different firmware payloads to use. This is used in the following 70// contexts: 71// 72// - OS images that specify BCS payloads. 73// - In the factory to flash the RO firmware. 74// - F20 firmware provisioning. 75// 76// Building firmware is configured with the FirmwareBuildConfig message. 77// 78// TODO(crbug.com/1071918): Rename to FirmwarePayloadConfig. 79message FirmwareConfig { 80 // The main firmware image. Updates both RO and RW sections. 81 FirmwarePayload main_ro_payload = 1; 82 83 // The main firmware image. Updates only RW section. 84 // 85 // main_rw image is flashed after main_ro image, which allows to reproduce 86 // the setup of real devices in a single request by setting RO to some old 87 // version, that the device was shipped with, and setting RW to latest. 88 FirmwarePayload main_rw_payload = 2; 89 90 // The embedded controller (EC) read-only (RO) firmware. 91 // Will not update EC RW; you can flash EC RW as part of main image. 92 FirmwarePayload ec_ro_payload = 3; 93 94 reserved 4; 95 96 // The PD read-only firmware. 97 FirmwarePayload pd_ro_payload = 5; 98 99 // The embedded controller (EC) read-write (RW) firmware. 100 FirmwarePayload ec_rw_payload = 6; 101 102 // Optional hash for main_rw FW_MAIN_A by replacing ec_rw in main_rw_payload 103 // with the one from ec_rw_payload. 104 FirmwarePayloadHash main_rw_a_hash = 7; 105 106 // Whether the embedded controller (EC) component manifest is enabled. It 107 // should always be enabled on new projects for EC component probing. 108 bool has_ec_component_manifest = 8; 109 110 // The ISH firmware. 111 FirmwarePayload ish_payload = 9; 112} 113 114// Config for building firmware components. This is used in the following 115// contexts: 116// 117// - Firmware builders. 118// - Local development when building from source (i.e. cros_workon start). 119// - New projects that don't yet specify BCS payloads. 120// 121// When building OS images, firmware payloads are usually pulled from BCS, as 122// specified by the FirmwareConfig message. 123message Firmware { 124 // Build targets for building firmware components. 125 message BuildTargets { 126 // Build target for coreboot. 127 string coreboot = 1; 128 129 // Build target for depthcharge. 130 string depthcharge = 2; 131 132 // Build target for EC firmware. 133 string ec = 3; 134 135 // Extra EC build targets to build/include in the EC firmware. 136 repeated string ec_extras = 4; 137 138 // Build target for libpayload. 139 string libpayload = 5; 140 141 // Firmware builds currently use portage, but this could change over time 142 // as pieces become more decoupled. 143 Portage.BuildTarget portage_build_target = 6; 144 145 // Build target for zephyr_ec. 146 string zephyr_ec = 7; 147 148 // Build target for chromeos-bmpblk. 149 string bmpblk = 8; 150 151 // Build target for chromeos-ish. 152 string ish = 9; 153 154 // Build target for Zephyr EC detachable base. 155 string zephyr_detachable_base = 10; 156 } 157 158 BuildTargets build_targets = 1; 159} 160 161// TODO(shapiroc): Remove once SoftwareConfig is migrated to 162// Firmware.build_targets 163message FirmwareBuildConfig { Firmware.BuildTargets build_targets = 1; } 164