1*54fd6939SJiyong ParkFirmware Update (FWU) 2*54fd6939SJiyong Park===================== 3*54fd6939SJiyong Park 4*54fd6939SJiyong ParkIntroduction 5*54fd6939SJiyong Park------------ 6*54fd6939SJiyong Park 7*54fd6939SJiyong ParkThis document describes the design of the Firmware Update (FWU) feature, which 8*54fd6939SJiyong Parkenables authenticated firmware to update firmware images from external 9*54fd6939SJiyong Parkinterfaces such as USB, UART, SD-eMMC, NAND, NOR or Ethernet to SoC Non-Volatile 10*54fd6939SJiyong Parkmemories such as NAND Flash, LPDDR2-NVM or any memory determined by the 11*54fd6939SJiyong Parkplatform. This feature functions even when the current firmware in the system 12*54fd6939SJiyong Parkis corrupt or missing; it therefore may be used as a recovery mode. It may also 13*54fd6939SJiyong Parkbe complemented by other, higher level firmware update software. 14*54fd6939SJiyong Park 15*54fd6939SJiyong ParkFWU implements a specific part of the Trusted Board Boot Requirements (TBBR) 16*54fd6939SJiyong Parkspecification, Arm DEN0006C-1. It should be used in conjunction with the 17*54fd6939SJiyong Park:ref:`Trusted Board Boot` design document, which describes the image 18*54fd6939SJiyong Parkauthentication parts of the Trusted Firmware-A (TF-A) TBBR implementation. 19*54fd6939SJiyong Park 20*54fd6939SJiyong ParkScope 21*54fd6939SJiyong Park~~~~~ 22*54fd6939SJiyong Park 23*54fd6939SJiyong ParkThis document describes the secure world FWU design. It is beyond its scope to 24*54fd6939SJiyong Parkdescribe how normal world FWU images should operate. To implement normal world 25*54fd6939SJiyong ParkFWU images, please refer to the "Non-Trusted Firmware Updater" requirements in 26*54fd6939SJiyong Parkthe TBBR. 27*54fd6939SJiyong Park 28*54fd6939SJiyong ParkFWU Overview 29*54fd6939SJiyong Park------------ 30*54fd6939SJiyong Park 31*54fd6939SJiyong ParkThe FWU boot flow is primarily mediated by BL1. Since BL1 executes in ROM, and 32*54fd6939SJiyong Parkit is usually desirable to minimize the amount of ROM code, the design allows 33*54fd6939SJiyong Parksome parts of FWU to be implemented in other secure and normal world images. 34*54fd6939SJiyong ParkPlatform code may choose which parts are implemented in which images but the 35*54fd6939SJiyong Parkgeneral expectation is: 36*54fd6939SJiyong Park 37*54fd6939SJiyong Park- BL1 handles: 38*54fd6939SJiyong Park 39*54fd6939SJiyong Park - Detection and initiation of the FWU boot flow. 40*54fd6939SJiyong Park - Copying images from non-secure to secure memory 41*54fd6939SJiyong Park - FWU image authentication 42*54fd6939SJiyong Park - Context switching between the normal and secure world during the FWU 43*54fd6939SJiyong Park process. 44*54fd6939SJiyong Park 45*54fd6939SJiyong Park- Other secure world FWU images handle platform initialization required by 46*54fd6939SJiyong Park the FWU process. 47*54fd6939SJiyong Park- Normal world FWU images handle loading of firmware images from external 48*54fd6939SJiyong Park interfaces to non-secure memory. 49*54fd6939SJiyong Park 50*54fd6939SJiyong ParkThe primary requirements of the FWU feature are: 51*54fd6939SJiyong Park 52*54fd6939SJiyong Park#. Export a BL1 SMC interface to interoperate with other FWU images executing 53*54fd6939SJiyong Park at other Exception Levels. 54*54fd6939SJiyong Park#. Export a platform interface to provide FWU common code with the information 55*54fd6939SJiyong Park it needs, and to enable platform specific FWU functionality. See the 56*54fd6939SJiyong Park :ref:`Porting Guide` for details of this interface. 57*54fd6939SJiyong Park 58*54fd6939SJiyong ParkTF-A uses abbreviated image terminology for FWU images like for other TF-A 59*54fd6939SJiyong Parkimages. See the :ref:`Image Terminology` document for an explanation of these 60*54fd6939SJiyong Parkterms. 61*54fd6939SJiyong Park 62*54fd6939SJiyong ParkThe following diagram shows the FWU boot flow for Arm development platforms. 63*54fd6939SJiyong ParkArm CSS platforms like Juno have a System Control Processor (SCP), and these 64*54fd6939SJiyong Parkuse all defined FWU images. Other platforms may use a subset of these. 65*54fd6939SJiyong Park 66*54fd6939SJiyong Park|Flow Diagram| 67*54fd6939SJiyong Park 68*54fd6939SJiyong ParkImage Identification 69*54fd6939SJiyong Park-------------------- 70*54fd6939SJiyong Park 71*54fd6939SJiyong ParkEach FWU image and certificate is identified by a unique ID, defined by the 72*54fd6939SJiyong Parkplatform, which BL1 uses to fetch an image descriptor (``image_desc_t``) via a 73*54fd6939SJiyong Parkcall to ``bl1_plat_get_image_desc()``. The same ID is also used to prepare the 74*54fd6939SJiyong ParkChain of Trust (Refer to the :ref:`Authentication Framework & Chain of Trust` 75*54fd6939SJiyong Parkdocument for more information). 76*54fd6939SJiyong Park 77*54fd6939SJiyong ParkThe image descriptor includes the following information: 78*54fd6939SJiyong Park 79*54fd6939SJiyong Park- Executable or non-executable image. This indicates whether the normal world 80*54fd6939SJiyong Park is permitted to request execution of a secure world FWU image (after 81*54fd6939SJiyong Park authentication). Secure world certificates and non-AP images are examples 82*54fd6939SJiyong Park of non-executable images. 83*54fd6939SJiyong Park- Secure or non-secure image. This indicates whether the image is 84*54fd6939SJiyong Park authenticated/executed in secure or non-secure memory. 85*54fd6939SJiyong Park- Image base address and size. 86*54fd6939SJiyong Park- Image entry point configuration (an ``entry_point_info_t``). 87*54fd6939SJiyong Park- FWU image state. 88*54fd6939SJiyong Park 89*54fd6939SJiyong ParkBL1 uses the FWU image descriptors to: 90*54fd6939SJiyong Park 91*54fd6939SJiyong Park- Validate the arguments of FWU SMCs 92*54fd6939SJiyong Park- Manage the state of the FWU process 93*54fd6939SJiyong Park- Initialize the execution state of the next FWU image. 94*54fd6939SJiyong Park 95*54fd6939SJiyong ParkFWU State Machine 96*54fd6939SJiyong Park----------------- 97*54fd6939SJiyong Park 98*54fd6939SJiyong ParkBL1 maintains state for each FWU image during FWU execution. FWU images at lower 99*54fd6939SJiyong ParkException Levels raise SMCs to invoke FWU functionality in BL1, which causes 100*54fd6939SJiyong ParkBL1 to update its FWU image state. The BL1 image states and valid state 101*54fd6939SJiyong Parktransitions are shown in the diagram below. Note that secure images have a more 102*54fd6939SJiyong Parkcomplex state machine than non-secure images. 103*54fd6939SJiyong Park 104*54fd6939SJiyong Park|FWU state machine| 105*54fd6939SJiyong Park 106*54fd6939SJiyong ParkThe following is a brief description of the supported states: 107*54fd6939SJiyong Park 108*54fd6939SJiyong Park- RESET: This is the initial state of every image at the start of FWU. 109*54fd6939SJiyong Park Authentication failure also leads to this state. A secure 110*54fd6939SJiyong Park image may yield to this state if it has completed execution. 111*54fd6939SJiyong Park It can also be reached by using ``FWU_SMC_IMAGE_RESET``. 112*54fd6939SJiyong Park 113*54fd6939SJiyong Park- COPYING: This is the state of a secure image while BL1 is copying it 114*54fd6939SJiyong Park in blocks from non-secure to secure memory. 115*54fd6939SJiyong Park 116*54fd6939SJiyong Park- COPIED: This is the state of a secure image when BL1 has completed 117*54fd6939SJiyong Park copying it to secure memory. 118*54fd6939SJiyong Park 119*54fd6939SJiyong Park- AUTHENTICATED: This is the state of an image when BL1 has successfully 120*54fd6939SJiyong Park authenticated it. 121*54fd6939SJiyong Park 122*54fd6939SJiyong Park- EXECUTED: This is the state of a secure, executable image when BL1 has 123*54fd6939SJiyong Park passed execution control to it. 124*54fd6939SJiyong Park 125*54fd6939SJiyong Park- INTERRUPTED: This is the state of a secure, executable image after it has 126*54fd6939SJiyong Park requested BL1 to resume normal world execution. 127*54fd6939SJiyong Park 128*54fd6939SJiyong ParkBL1 SMC Interface 129*54fd6939SJiyong Park----------------- 130*54fd6939SJiyong Park 131*54fd6939SJiyong ParkBL1_SMC_CALL_COUNT 132*54fd6939SJiyong Park~~~~~~~~~~~~~~~~~~ 133*54fd6939SJiyong Park 134*54fd6939SJiyong Park:: 135*54fd6939SJiyong Park 136*54fd6939SJiyong Park Arguments: 137*54fd6939SJiyong Park uint32_t function ID : 0x0 138*54fd6939SJiyong Park 139*54fd6939SJiyong Park Return: 140*54fd6939SJiyong Park uint32_t 141*54fd6939SJiyong Park 142*54fd6939SJiyong ParkThis SMC returns the number of SMCs supported by BL1. 143*54fd6939SJiyong Park 144*54fd6939SJiyong ParkBL1_SMC_UID 145*54fd6939SJiyong Park~~~~~~~~~~~ 146*54fd6939SJiyong Park 147*54fd6939SJiyong Park:: 148*54fd6939SJiyong Park 149*54fd6939SJiyong Park Arguments: 150*54fd6939SJiyong Park uint32_t function ID : 0x1 151*54fd6939SJiyong Park 152*54fd6939SJiyong Park Return: 153*54fd6939SJiyong Park UUID : 32 bits in each of w0-w3 (or r0-r3 for AArch32 callers) 154*54fd6939SJiyong Park 155*54fd6939SJiyong ParkThis SMC returns the 128-bit `Universally Unique Identifier`_ for the 156*54fd6939SJiyong ParkBL1 SMC service. 157*54fd6939SJiyong Park 158*54fd6939SJiyong ParkBL1_SMC_VERSION 159*54fd6939SJiyong Park~~~~~~~~~~~~~~~ 160*54fd6939SJiyong Park 161*54fd6939SJiyong Park:: 162*54fd6939SJiyong Park 163*54fd6939SJiyong Park Argument: 164*54fd6939SJiyong Park uint32_t function ID : 0x3 165*54fd6939SJiyong Park 166*54fd6939SJiyong Park Return: 167*54fd6939SJiyong Park uint32_t : Bits [31:16] Major Version 168*54fd6939SJiyong Park Bits [15:0] Minor Version 169*54fd6939SJiyong Park 170*54fd6939SJiyong ParkThis SMC returns the current version of the BL1 SMC service. 171*54fd6939SJiyong Park 172*54fd6939SJiyong ParkBL1_SMC_RUN_IMAGE 173*54fd6939SJiyong Park~~~~~~~~~~~~~~~~~ 174*54fd6939SJiyong Park 175*54fd6939SJiyong Park:: 176*54fd6939SJiyong Park 177*54fd6939SJiyong Park Arguments: 178*54fd6939SJiyong Park uint32_t function ID : 0x4 179*54fd6939SJiyong Park entry_point_info_t *ep_info 180*54fd6939SJiyong Park 181*54fd6939SJiyong Park Return: 182*54fd6939SJiyong Park void 183*54fd6939SJiyong Park 184*54fd6939SJiyong Park Pre-conditions: 185*54fd6939SJiyong Park if (normal world caller) synchronous exception 186*54fd6939SJiyong Park if (ep_info not EL3) synchronous exception 187*54fd6939SJiyong Park 188*54fd6939SJiyong ParkThis SMC passes execution control to an EL3 image described by the provided 189*54fd6939SJiyong Park``entry_point_info_t`` structure. In the normal TF-A boot flow, BL2 invokes 190*54fd6939SJiyong Parkthis SMC for BL1 to pass execution control to BL31. 191*54fd6939SJiyong Park 192*54fd6939SJiyong ParkFWU_SMC_IMAGE_COPY 193*54fd6939SJiyong Park~~~~~~~~~~~~~~~~~~ 194*54fd6939SJiyong Park 195*54fd6939SJiyong Park:: 196*54fd6939SJiyong Park 197*54fd6939SJiyong Park Arguments: 198*54fd6939SJiyong Park uint32_t function ID : 0x10 199*54fd6939SJiyong Park unsigned int image_id 200*54fd6939SJiyong Park uintptr_t image_addr 201*54fd6939SJiyong Park unsigned int block_size 202*54fd6939SJiyong Park unsigned int image_size 203*54fd6939SJiyong Park 204*54fd6939SJiyong Park Return: 205*54fd6939SJiyong Park int : 0 (Success) 206*54fd6939SJiyong Park : -ENOMEM 207*54fd6939SJiyong Park : -EPERM 208*54fd6939SJiyong Park 209*54fd6939SJiyong Park Pre-conditions: 210*54fd6939SJiyong Park if (image_id is invalid) return -EPERM 211*54fd6939SJiyong Park if (image_id is non-secure image) return -EPERM 212*54fd6939SJiyong Park if (image_id state is not (RESET or COPYING)) return -EPERM 213*54fd6939SJiyong Park if (secure world caller) return -EPERM 214*54fd6939SJiyong Park if (image_addr + block_size overflows) return -ENOMEM 215*54fd6939SJiyong Park if (image destination address + image_size overflows) return -ENOMEM 216*54fd6939SJiyong Park if (source block is in secure memory) return -ENOMEM 217*54fd6939SJiyong Park if (source block is not mapped into BL1) return -ENOMEM 218*54fd6939SJiyong Park if (image_size > free secure memory) return -ENOMEM 219*54fd6939SJiyong Park if (image overlaps another image) return -EPERM 220*54fd6939SJiyong Park 221*54fd6939SJiyong ParkThis SMC copies the secure image indicated by ``image_id`` from non-secure memory 222*54fd6939SJiyong Parkto secure memory for later authentication. The image may be copied in a single 223*54fd6939SJiyong Parkblock or multiple blocks. In either case, the total size of the image must be 224*54fd6939SJiyong Parkprovided in ``image_size`` when invoking this SMC for the first time for each 225*54fd6939SJiyong Parkimage; it is ignored in subsequent calls (if any) for the same image. 226*54fd6939SJiyong Park 227*54fd6939SJiyong ParkThe ``image_addr`` and ``block_size`` specify the source memory block to copy from. 228*54fd6939SJiyong ParkThe destination address is provided by the platform code. 229*54fd6939SJiyong Park 230*54fd6939SJiyong ParkIf ``block_size`` is greater than the amount of remaining bytes to copy for this 231*54fd6939SJiyong Parkimage then the former is truncated to the latter. The copy operation is then 232*54fd6939SJiyong Parkconsidered as complete and the FWU state machine transitions to the "COPIED" 233*54fd6939SJiyong Parkstate. If there is still more to copy, the FWU state machine stays in or 234*54fd6939SJiyong Parktransitions to the COPYING state (depending on the previous state). 235*54fd6939SJiyong Park 236*54fd6939SJiyong ParkWhen using multiple blocks, the source blocks do not necessarily need to be in 237*54fd6939SJiyong Parkcontiguous memory. 238*54fd6939SJiyong Park 239*54fd6939SJiyong ParkOnce the SMC is handled, BL1 returns from exception to the normal world caller. 240*54fd6939SJiyong Park 241*54fd6939SJiyong ParkFWU_SMC_IMAGE_AUTH 242*54fd6939SJiyong Park~~~~~~~~~~~~~~~~~~ 243*54fd6939SJiyong Park 244*54fd6939SJiyong Park:: 245*54fd6939SJiyong Park 246*54fd6939SJiyong Park Arguments: 247*54fd6939SJiyong Park uint32_t function ID : 0x11 248*54fd6939SJiyong Park unsigned int image_id 249*54fd6939SJiyong Park uintptr_t image_addr 250*54fd6939SJiyong Park unsigned int image_size 251*54fd6939SJiyong Park 252*54fd6939SJiyong Park Return: 253*54fd6939SJiyong Park int : 0 (Success) 254*54fd6939SJiyong Park : -ENOMEM 255*54fd6939SJiyong Park : -EPERM 256*54fd6939SJiyong Park : -EAUTH 257*54fd6939SJiyong Park 258*54fd6939SJiyong Park Pre-conditions: 259*54fd6939SJiyong Park if (image_id is invalid) return -EPERM 260*54fd6939SJiyong Park if (secure world caller) 261*54fd6939SJiyong Park if (image_id state is not RESET) return -EPERM 262*54fd6939SJiyong Park if (image_addr/image_size is not mapped into BL1) return -ENOMEM 263*54fd6939SJiyong Park else // normal world caller 264*54fd6939SJiyong Park if (image_id is secure image) 265*54fd6939SJiyong Park if (image_id state is not COPIED) return -EPERM 266*54fd6939SJiyong Park else // image_id is non-secure image 267*54fd6939SJiyong Park if (image_id state is not RESET) return -EPERM 268*54fd6939SJiyong Park if (image_addr/image_size is in secure memory) return -ENOMEM 269*54fd6939SJiyong Park if (image_addr/image_size not mapped into BL1) return -ENOMEM 270*54fd6939SJiyong Park 271*54fd6939SJiyong ParkThis SMC authenticates the image specified by ``image_id``. If the image is in the 272*54fd6939SJiyong ParkRESET state, BL1 authenticates the image in place using the provided 273*54fd6939SJiyong Park``image_addr`` and ``image_size``. If the image is a secure image in the COPIED 274*54fd6939SJiyong Parkstate, BL1 authenticates the image from the secure memory that BL1 previously 275*54fd6939SJiyong Parkcopied the image into. 276*54fd6939SJiyong Park 277*54fd6939SJiyong ParkBL1 returns from exception to the caller. If authentication succeeds then BL1 278*54fd6939SJiyong Parksets the image state to AUTHENTICATED. If authentication fails then BL1 returns 279*54fd6939SJiyong Parkthe -EAUTH error and sets the image state back to RESET. 280*54fd6939SJiyong Park 281*54fd6939SJiyong ParkFWU_SMC_IMAGE_EXECUTE 282*54fd6939SJiyong Park~~~~~~~~~~~~~~~~~~~~~ 283*54fd6939SJiyong Park 284*54fd6939SJiyong Park:: 285*54fd6939SJiyong Park 286*54fd6939SJiyong Park Arguments: 287*54fd6939SJiyong Park uint32_t function ID : 0x12 288*54fd6939SJiyong Park unsigned int image_id 289*54fd6939SJiyong Park 290*54fd6939SJiyong Park Return: 291*54fd6939SJiyong Park int : 0 (Success) 292*54fd6939SJiyong Park : -EPERM 293*54fd6939SJiyong Park 294*54fd6939SJiyong Park Pre-conditions: 295*54fd6939SJiyong Park if (image_id is invalid) return -EPERM 296*54fd6939SJiyong Park if (secure world caller) return -EPERM 297*54fd6939SJiyong Park if (image_id is non-secure image) return -EPERM 298*54fd6939SJiyong Park if (image_id is non-executable image) return -EPERM 299*54fd6939SJiyong Park if (image_id state is not AUTHENTICATED) return -EPERM 300*54fd6939SJiyong Park 301*54fd6939SJiyong ParkThis SMC initiates execution of a previously authenticated image specified by 302*54fd6939SJiyong Park``image_id``, in the other security world to the caller. The current 303*54fd6939SJiyong Parkimplementation only supports normal world callers initiating execution of a 304*54fd6939SJiyong Parksecure world image. 305*54fd6939SJiyong Park 306*54fd6939SJiyong ParkBL1 saves the normal world caller's context, sets the secure image state to 307*54fd6939SJiyong ParkEXECUTED, and returns from exception to the secure image. 308*54fd6939SJiyong Park 309*54fd6939SJiyong ParkFWU_SMC_IMAGE_RESUME 310*54fd6939SJiyong Park~~~~~~~~~~~~~~~~~~~~ 311*54fd6939SJiyong Park 312*54fd6939SJiyong Park:: 313*54fd6939SJiyong Park 314*54fd6939SJiyong Park Arguments: 315*54fd6939SJiyong Park uint32_t function ID : 0x13 316*54fd6939SJiyong Park register_t image_param 317*54fd6939SJiyong Park 318*54fd6939SJiyong Park Return: 319*54fd6939SJiyong Park register_t : image_param (Success) 320*54fd6939SJiyong Park : -EPERM 321*54fd6939SJiyong Park 322*54fd6939SJiyong Park Pre-conditions: 323*54fd6939SJiyong Park if (normal world caller and no INTERRUPTED secure image) return -EPERM 324*54fd6939SJiyong Park 325*54fd6939SJiyong ParkThis SMC resumes execution in the other security world while there is a secure 326*54fd6939SJiyong Parkimage in the EXECUTED/INTERRUPTED state. 327*54fd6939SJiyong Park 328*54fd6939SJiyong ParkFor normal world callers, BL1 sets the previously interrupted secure image state 329*54fd6939SJiyong Parkto EXECUTED. For secure world callers, BL1 sets the previously executing secure 330*54fd6939SJiyong Parkimage state to INTERRUPTED. In either case, BL1 saves the calling world's 331*54fd6939SJiyong Parkcontext, restores the resuming world's context and returns from exception into 332*54fd6939SJiyong Parkthe resuming world. If the call is successful then the caller provided 333*54fd6939SJiyong Park``image_param`` is returned to the resumed world, otherwise an error code is 334*54fd6939SJiyong Parkreturned to the caller. 335*54fd6939SJiyong Park 336*54fd6939SJiyong ParkFWU_SMC_SEC_IMAGE_DONE 337*54fd6939SJiyong Park~~~~~~~~~~~~~~~~~~~~~~ 338*54fd6939SJiyong Park 339*54fd6939SJiyong Park:: 340*54fd6939SJiyong Park 341*54fd6939SJiyong Park Arguments: 342*54fd6939SJiyong Park uint32_t function ID : 0x14 343*54fd6939SJiyong Park 344*54fd6939SJiyong Park Return: 345*54fd6939SJiyong Park int : 0 (Success) 346*54fd6939SJiyong Park : -EPERM 347*54fd6939SJiyong Park 348*54fd6939SJiyong Park Pre-conditions: 349*54fd6939SJiyong Park if (normal world caller) return -EPERM 350*54fd6939SJiyong Park 351*54fd6939SJiyong ParkThis SMC indicates completion of a previously executing secure image. 352*54fd6939SJiyong Park 353*54fd6939SJiyong ParkBL1 sets the previously executing secure image state to the RESET state, 354*54fd6939SJiyong Parkrestores the normal world context and returns from exception into the normal 355*54fd6939SJiyong Parkworld. 356*54fd6939SJiyong Park 357*54fd6939SJiyong ParkFWU_SMC_UPDATE_DONE 358*54fd6939SJiyong Park~~~~~~~~~~~~~~~~~~~ 359*54fd6939SJiyong Park 360*54fd6939SJiyong Park:: 361*54fd6939SJiyong Park 362*54fd6939SJiyong Park Arguments: 363*54fd6939SJiyong Park uint32_t function ID : 0x15 364*54fd6939SJiyong Park register_t client_cookie 365*54fd6939SJiyong Park 366*54fd6939SJiyong Park Return: 367*54fd6939SJiyong Park N/A 368*54fd6939SJiyong Park 369*54fd6939SJiyong ParkThis SMC completes the firmware update process. BL1 calls the platform specific 370*54fd6939SJiyong Parkfunction ``bl1_plat_fwu_done``, passing the optional argument ``client_cookie`` as 371*54fd6939SJiyong Parka ``void *``. The SMC does not return. 372*54fd6939SJiyong Park 373*54fd6939SJiyong ParkFWU_SMC_IMAGE_RESET 374*54fd6939SJiyong Park~~~~~~~~~~~~~~~~~~~ 375*54fd6939SJiyong Park 376*54fd6939SJiyong Park:: 377*54fd6939SJiyong Park 378*54fd6939SJiyong Park Arguments: 379*54fd6939SJiyong Park uint32_t function ID : 0x16 380*54fd6939SJiyong Park unsigned int image_id 381*54fd6939SJiyong Park 382*54fd6939SJiyong Park Return: 383*54fd6939SJiyong Park int : 0 (Success) 384*54fd6939SJiyong Park : -EPERM 385*54fd6939SJiyong Park 386*54fd6939SJiyong Park Pre-conditions: 387*54fd6939SJiyong Park if (secure world caller) return -EPERM 388*54fd6939SJiyong Park if (image in EXECUTED) return -EPERM 389*54fd6939SJiyong Park 390*54fd6939SJiyong ParkThis SMC sets the state of an image to RESET and zeroes the memory used by it. 391*54fd6939SJiyong Park 392*54fd6939SJiyong ParkThis is only allowed if the image is not being executed. 393*54fd6939SJiyong Park 394*54fd6939SJiyong Park-------------- 395*54fd6939SJiyong Park 396*54fd6939SJiyong Park*Copyright (c) 2015-2019, Arm Limited and Contributors. All rights reserved.* 397*54fd6939SJiyong Park 398*54fd6939SJiyong Park.. _Universally Unique Identifier: https://tools.ietf.org/rfc/rfc4122.txt 399*54fd6939SJiyong Park.. |Flow Diagram| image:: ../resources/diagrams/fwu_flow.png 400*54fd6939SJiyong Park.. |FWU state machine| image:: ../resources/diagrams/fwu_states.png 401