John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 1 | description: > |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 2 | Implement the Hoth command control interface. |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 3 | |
| 4 | methods: |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 5 | - name: SendHostCommand |
| 6 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame^] | 7 | Send a host command to Hoth and return the response. This will block |
| 8 | on Hoth completing its internal operations. Critical host commands |
| 9 | like LoadTokens are banned. This method should be called from the IPMI |
| 10 | HostCommand passthrough. |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 11 | parameters: |
| 12 | - name: Command |
| 13 | type: array[byte] |
| 14 | description: > |
| 15 | Data to write to Hoth SPI host command offset. |
| 16 | returns: |
| 17 | - name: Response |
| 18 | type: array[byte] |
| 19 | description: > |
| 20 | Data read from Hoth SPI host command offset. |
| 21 | errors: |
| 22 | - self.Error.CommandFailure |
| 23 | - self.Error.ResponseFailure |
| 24 | - self.Error.InterfaceError |
| 25 | - xyz.openbmc_project.Common.Error.Timeout |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 26 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 27 | - name: SendTrustedHostCommand |
| 28 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame^] | 29 | Send a host command to Hoth and return the response. This will block |
| 30 | on Hoth completing its internal operations. Critical host commands |
| 31 | like LoadTokens are allowed. This method should be called from the |
| 32 | BMC. |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 33 | parameters: |
| 34 | - name: Command |
| 35 | type: array[byte] |
| 36 | description: > |
| 37 | Data to write to Hoth SPI host command offset. |
| 38 | returns: |
| 39 | - name: Response |
| 40 | type: array[byte] |
| 41 | description: > |
| 42 | Data read from Hoth SPI host command offset. |
| 43 | errors: |
| 44 | - self.Error.CommandFailure |
| 45 | - self.Error.ResponseFailure |
| 46 | - self.Error.InterfaceError |
| 47 | - xyz.openbmc_project.Common.Error.Timeout |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 48 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 49 | - name: SendHostCommandAsync |
| 50 | description: > |
| 51 | Send a host command to Hoth and immediately return without waiting for |
| 52 | response. Caller can either poll with calls to GetHostCommandResponse |
| 53 | until retrieving the response, or wait for a ResponseReady signal. |
| 54 | parameters: |
| 55 | - name: Command |
| 56 | type: array[byte] |
| 57 | description: > |
| 58 | Data to write to Hoth SPI host command offset. |
| 59 | returns: |
| 60 | - name: CallToken |
| 61 | type: uint64 |
| 62 | description: > |
| 63 | The representation for the call made |
| 64 | errors: |
| 65 | - self.Error.CommandFailure |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 66 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 67 | - name: GetHostCommandResponse |
| 68 | description: > |
| 69 | Read the response from Hoth mailbox. |
| 70 | parameters: |
| 71 | - name: CallToken |
| 72 | type: uint64 |
| 73 | description: > |
| 74 | The token returned from SendHostCommandAsync() |
| 75 | returns: |
| 76 | - name: Response |
| 77 | type: array[byte] |
| 78 | description: > |
| 79 | Data read from Hoth SPI host command offset |
| 80 | errors: |
| 81 | - self.Error.ResponseFailure |
| 82 | - self.Error.ResponseNotFound |
| 83 | - self.Error.InterfaceError |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 84 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 85 | - name: UpdateFirmware |
| 86 | description: > |
| 87 | Write given firmware data to the Hoth firmware partition in EEPROM. |
| 88 | parameters: |
| 89 | - name: FirmwareData |
| 90 | type: array[byte] |
| 91 | description: > |
| 92 | Hoth firmware image |
| 93 | errors: |
| 94 | - self.Error.FirmwareFailure |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 95 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 96 | - name: GetFirmwareUpdateStatus |
| 97 | description: > |
| 98 | Get the status of the firmware update process. |
| 99 | returns: |
| 100 | - name: Status |
| 101 | type: enum[self.FirmwareUpdateStatus] |
| 102 | description: > |
| 103 | Status of the firmware update |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 104 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 105 | - name: InitiatePayload |
| 106 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame^] | 107 | Initiates erasure of the EEPROM staging area. Note that this will lock |
| 108 | up access to Hoth for an extended time and may go over the kernel's |
| 109 | SPI write timeout. Calling multiple small ErasePayload is recommended. |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 110 | errors: |
| 111 | - self.Error.CommandFailure |
| 112 | - self.Error.ResponseFailure |
| 113 | - self.Error.InterfaceError |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 114 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 115 | - name: GetInitiatePayloadStatus |
| 116 | description: > |
| 117 | Get the status of the payload initiation process. |
| 118 | returns: |
| 119 | - name: Status |
| 120 | type: enum[self.FirmwareUpdateStatus] |
| 121 | description: > |
| 122 | Status of the payload initiation |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 123 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 124 | - name: ErasePayload |
| 125 | description: > |
| 126 | Erases the given size starting at the specified offset of the staging |
| 127 | partition. |
| 128 | parameters: |
| 129 | - name: Offset |
| 130 | type: uint32 |
| 131 | description: > |
| 132 | Offset of the staging partition to start erasing from. |
| 133 | - name: Size |
| 134 | type: uint32 |
| 135 | description: > |
| 136 | Size of the staging partition to erase. |
| 137 | errors: |
| 138 | - self.Error.CommandFailure |
| 139 | - self.Error.ResponseFailure |
| 140 | - self.Error.InterfaceError |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 141 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 142 | - name: SendPayload |
| 143 | description: > |
| 144 | Chunk and send the binary specified in the image path |
| 145 | parameters: |
| 146 | - name: ImagePath |
| 147 | type: string |
| 148 | description: > |
| 149 | Firmware image path |
| 150 | errors: |
| 151 | - self.Error.FirmwareFailure |
| 152 | - self.Error.InterfaceError |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 153 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 154 | - name: GetSendPayloadStatus |
| 155 | description: > |
| 156 | Get the status of the send payload process. |
| 157 | returns: |
| 158 | - name: Status |
| 159 | type: enum[self.FirmwareUpdateStatus] |
| 160 | description: > |
| 161 | Status of the send payload process. |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 162 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 163 | - name: VerifyPayload |
| 164 | description: > |
| 165 | Initiates the verification process without activating the staging area |
| 166 | errors: |
| 167 | - self.Error.InterfaceError |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 168 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 169 | - name: GetVerifyPayloadStatus |
| 170 | description: > |
| 171 | Get the status of the payload verification process. |
| 172 | returns: |
| 173 | - name: Status |
| 174 | type: enum[self.FirmwareUpdateStatus] |
| 175 | description: > |
| 176 | Status of the payload verification |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 177 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 178 | - name: ActivatePayload |
| 179 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame^] | 180 | Activates the staging area as persistent or non-persistent for next |
| 181 | boot if verification was successful. |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 182 | parameters: |
| 183 | - name: MakePersistent |
| 184 | type: boolean |
| 185 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame^] | 186 | Flag to determine whether to activate the staged image as |
| 187 | persistent or non-persistent for next boot. |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 188 | errors: |
| 189 | - self.Error.CommandFailure |
| 190 | - self.Error.ResponseFailure |
| 191 | - self.Error.InterfaceError |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 192 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 193 | - name: GetPayloadSize |
| 194 | description: > |
| 195 | Determines the max size of the payload region. |
| 196 | returns: |
| 197 | - name: Size |
| 198 | type: uint32 |
| 199 | description: > |
| 200 | The size of the payload region |
| 201 | errors: |
| 202 | - self.Error.CommandFailure |
| 203 | - self.Error.ResponseFailure |
| 204 | - self.Error.InterfaceError |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 205 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 206 | - name: Confirm |
| 207 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame^] | 208 | Prevents hoth from rolling back and using the previous image. When an |
| 209 | image can be comfirmed to be working well, this command is given, |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 210 | which disarms the hoth watchdog. |
| 211 | errors: |
| 212 | - self.Error.CommandFailure |
| 213 | - self.Error.ResponseFailure |
| 214 | - self.Error.InterfaceError |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 215 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 216 | - name: GetTotalBootTime |
| 217 | description: > |
| 218 | Get total time spending from reset to HVNGOOD. |
| 219 | returns: |
| 220 | - name: Time |
| 221 | type: uint32 |
| 222 | description: > |
| 223 | Time in microseconds. |
| 224 | errors: |
| 225 | - self.Error.ResponseFailure |
| 226 | - self.Error.ExpectedInfoNotFound |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 227 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 228 | - name: GetFirmwareUpdateTime |
| 229 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame^] | 230 | Get time spending in the self update routine. Since a proper self |
| 231 | update involves a reset, this time is always expected to be low. |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 232 | returns: |
| 233 | - name: Time |
| 234 | type: uint32 |
| 235 | description: > |
| 236 | Time in microseconds. |
| 237 | errors: |
| 238 | - self.Error.ResponseFailure |
| 239 | - self.Error.ExpectedInfoNotFound |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 240 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 241 | - name: GetFirmwareMirroringTime |
| 242 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame^] | 243 | Get time spending in mirroing the self-update. This time is a |
| 244 | reasonable proxy for the total self update time. |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 245 | returns: |
| 246 | - name: Time |
| 247 | type: uint32 |
| 248 | description: > |
| 249 | Time in microseconds. |
| 250 | errors: |
| 251 | - self.Error.ResponseFailure |
| 252 | - self.Error.ExpectedInfoNotFound |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 253 | |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 254 | - name: GetPayloadValidationTime |
| 255 | description: > |
Patrick Williams | a134741 | 2022-12-06 10:56:22 -0600 | [diff] [blame^] | 256 | Get time spending in validating the payload, copying mutable regions |
| 257 | and/or dealing with failsafe fallback. |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 258 | returns: |
| 259 | - name: Time |
| 260 | type: uint32 |
| 261 | description: > |
| 262 | Time in microseconds. |
| 263 | errors: |
| 264 | - self.Error.ResponseFailure |
| 265 | - self.Error.ExpectedInfoNotFound |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 266 | |
| 267 | signals: |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 268 | - name: HostCommandResponseReady |
| 269 | description: > |
| 270 | This signal is broadcast when a response is ready for the call that |
| 271 | returned CallToken. |
| 272 | properties: |
| 273 | - name: CallToken |
| 274 | type: uint64 |
| 275 | description: > |
| 276 | The token returned from SendHostCommandAsync() |
John Edward Broadbent | 2b2784a | 2022-02-03 19:54:34 -0800 | [diff] [blame] | 277 | |
| 278 | enumerations: |
Patrick Williams | 8da396c | 2022-03-14 14:21:02 -0500 | [diff] [blame] | 279 | - name: FirmwareUpdateStatus |
| 280 | description: > |
| 281 | The status of a firmware update through hothd |
| 282 | values: |
| 283 | - name: "None" |
| 284 | description: > |
| 285 | No update initiated |
| 286 | - name: "InProgress" |
| 287 | description: > |
| 288 | Update still in progress |
| 289 | - name: "Error" |
| 290 | description: > |
| 291 | Update has failed |
| 292 | - name: "Done" |
| 293 | description: > |
| 294 | Update has completed successfully |