1.. SPDX-License-Identifier: GPL-2.0 2.. include:: <isonum.txt> 3 4=============================================================================== 5i.MX95 System Control and Management Interface(SCMI) Vendor Protocols Extension 6=============================================================================== 7 8:Copyright: |copy| 2024 NXP 9 10:Author: Peng Fan <peng.fan@nxp.com> 11 12The System Manager (SM) is a low-level system function which runs on a System 13Control Processor (SCP) to support isolation and management of power domains, 14clocks, resets, sensors, pins, etc. on complex application processors. It often 15runs on a Cortex-M processor and provides an abstraction to many of the 16underlying features of the hardware. The primary purpose of the SM is to allow 17isolation between software running on different cores in the SoC. It does this 18by having exclusive access to critical resources such as those controlling 19power, clocks, reset, PMIC, etc. and then providing an RPC interface to those 20clients. This allows the SM to provide access control, arbitration, and 21aggregation policies for those shared critical resources. 22 23SM introduces a concept Logic Machine(LM) which is analogous to VM and each has 24its own instance of SCMI. All normal SCMI calls only apply to that LM. That 25includes boot, shutdown, reset, suspend, wake, etc. Each LM (e.g. A55 and M7) 26are completely isolated from the others and each LM has its own communication 27channels talking to the same SCMI server. 28 29This document covers all the information necessary to understand, maintain, 30port, and deploy the SM on supported processors. 31 32The SM implements an interface compliant with the Arm SCMI Specification 33with additional vendor specific extensions. 34 35System Control and Management Logical Machine Management Vendor Protocol 36======================================================================== 37 38The SM adds the concept of logical machines (LMs). These are analogous to 39VMs and each has its own instance of SCMI. All normal SCMI calls only apply 40the LM running the calling agent. That includes boot, shutdown, reset, 41suspend, wake, etc. If a caller makes the SCMI base call to get a list 42of agents, it will only get those on that LM. Each LM is completely isolated 43from the others. This is mandatory for these to operate independently. 44 45This protocol is intended to support boot, shutdown, and reset of other logical 46machines (LM). It is usually used to allow one LM(e.g. OSPM) to manage 47another LM which is usually an offload or accelerator engine. Notifications 48from this protocol can also be used to manage a communication link to another 49LM. The LMM protocol provides commands to: 50 51- Describe the protocol version. 52- Discover implementation attributes. 53- Discover all the LMs defined in the system. 54- Boot a target LM. 55- Shutdown a target LM (gracefully or forcibly). 56- Reset a target LM (gracefully or forcibly). 57- Wake a target LM from suspend. 58- Suspend a target LM (gracefully). 59- Read boot/shutdown/reset information for a target LM. 60- Get notifications when a target LM boots or shuts down (e.g. LM 'X' requested 61 notification of LM 'Y' boots or shuts down, when LM 'Y' boots or shuts down, 62 SCMI firmware will send notification to LM 'X'). 63 64'Graceful' means asking LM itself to shutdown/reset/etc (e.g. sending 65notification to Linux, Then Linux reboots or powers down itself). It is async 66command that the SUCCESS of the command just means the command successfully 67return, not means reboot/reset successfully finished. 68 69'Forceful' means the SM will force shutdown/reset/etc the LM. It is sync 70command that the SUCCESS of the command means the LM has been successfully 71shutdown/reset/etc. 72If the commands not have Graceful/Forceful flag settings, such as WAKE, SUSEND, 73it is a Graceful command. 74 75Commands: 76_________ 77 78PROTOCOL_VERSION 79~~~~~~~~~~~~~~~~ 80 81message_id: 0x0 82protocol_id: 0x80 83This command is mandatory. 84 85+---------------+--------------------------------------------------------------+ 86|Return values | 87+---------------+--------------------------------------------------------------+ 88|Name |Description | 89+---------------+--------------------------------------------------------------+ 90|int32 status | See ARM SCMI Specification for status code definitions. | 91+---------------+--------------------------------------------------------------+ 92|uint32 version | For this revision of the specification, this value must be | 93| | 0x10000. | 94+---------------+--------------------------------------------------------------+ 95 96PROTOCOL_ATTRIBUTES 97~~~~~~~~~~~~~~~~~~~ 98 99message_id: 0x1 100protocol_id: 0x80 101This command is mandatory. 102 103+------------------+-----------------------------------------------------------+ 104|Return values | 105+------------------+-----------------------------------------------------------+ 106|Name |Description | 107+------------------+-----------------------------------------------------------+ 108|int32 status | See ARM SCMI Specification for status code definitions. | 109+------------------+-----------------------------------------------------------+ 110|uint32 attributes |Protocol attributes: | 111| |Bits[31:5] Reserved, must be zero. | 112| |Bits[4:0] Number of Logical Machines | 113| |Note that due to both hardware limitations and reset reason| 114| |field limitations, the max number of LM is 16. The minimum | 115| |is 1. | 116+------------------+-----------------------------------------------------------+ 117 118PROTOCOL_MESSAGE_ATTRIBUTES 119~~~~~~~~~~~~~~~~~~~~~~~~~~~ 120 121message_id: 0x2 122protocol_id: 0x80 123This command is mandatory. 124 125+------------------+-----------------------------------------------------------+ 126|Return values | 127+------------------+-----------------------------------------------------------+ 128|Name |Description | 129+------------------+-----------------------------------------------------------+ 130|int32 status |SUCCESS: in case the message is implemented and available | 131| |to use. | 132| |NOT_FOUND: if the message identified by message_id is | 133| |invalid or not implemented | 134+------------------+-----------------------------------------------------------+ 135|uint32 attributes |Flags that are associated with a specific command in the | 136| |protocol. For all commands in this protocol, this | 137| |parameter has a value of 0 | 138+------------------+-----------------------------------------------------------+ 139 140LMM_ATTRIBUTES 141~~~~~~~~~~~~~~ 142 143message_id: 0x3 144protocol_id: 0x80 145This command is mandatory. 146 147+------------------+-----------------------------------------------------------+ 148|Parameters | 149+------------------+-----------------------------------------------------------+ 150|Name |Description | 151+------------------+-----------------------------------------------------------+ 152|uint32 lmid |ID of the Logical Machine | 153+------------------+-----------------------------------------------------------+ 154|Return values | 155+------------------+-----------------------------------------------------------+ 156|Name |Description | 157+------------------+-----------------------------------------------------------+ 158|int32 status |SUCCESS: if valid attributes are returned. | 159| |NOT_FOUND: if lmid not points to a valid logical machine. | 160| |DENIED: if the agent does not have permission to get info | 161| |for the LM specified by lmid. | 162+------------------+-----------------------------------------------------------+ 163|uint32 lmid |Identifier of the LM whose identification is requested. | 164| |This field is: Populated with the lmid of the calling | 165| |agent, when the lmid parameter passed via the command is | 166| |0xFFFFFFFF. Identical to the lmid field passed via the | 167| |calling parameters, in all other cases | 168+------------------+-----------------------------------------------------------+ 169|uint32 attributes | Bits[31:0] reserved. must be zero | 170+------------------+-----------------------------------------------------------+ 171|uint32 state | Current state of the LM | 172+------------------+-----------------------------------------------------------+ 173|uint32 errStatus | Last error status recorded | 174+------------------+-----------------------------------------------------------+ 175|char name[16] | A NULL terminated ASCII string with the LM name, of up | 176| | to 16 bytes | 177+------------------+-----------------------------------------------------------+ 178 179LMM_BOOT 180~~~~~~~~ 181 182message_id: 0x4 183protocol_id: 0x80 184This command is mandatory. 185 186+------------------+-----------------------------------------------------------+ 187|Parameters | 188+------------------+-----------------------------------------------------------+ 189|Name |Description | 190+------------------+-----------------------------------------------------------+ 191|uint32 lmid |ID of the Logical Machine | 192+------------------+-----------------------------------------------------------+ 193|Return values | 194+------------------+-----------------------------------------------------------+ 195|Name |Description | 196+------------------+-----------------------------------------------------------+ 197|int32 status |SUCCESS: if LM boots successfully started. | 198| |NOT_FOUND: if lmid not points to a valid logical machine. | 199| |INVALID_PARAMETERS: if lmid is same as the caller. | 200| |DENIED: if the agent does not have permission to manage the| 201| |the LM specified by lmid. | 202+------------------+-----------------------------------------------------------+ 203 204LMM_RESET 205~~~~~~~~~ 206 207message_id: 0x5 208protocol_id: 0x80 209This command is mandatory. 210 211+------------------+-----------------------------------------------------------+ 212|Parameters | 213+------------------+-----------------------------------------------------------+ 214|Name |Description | 215+------------------+-----------------------------------------------------------+ 216|uint32 lmid |ID of the Logical Machine | 217+------------------+-----------------------------------------------------------+ 218|uint32 flags |Reset flags: | 219| |Bits[31:1] Reserved, must be zero. | 220| |Bit[0] Graceful request: | 221| |Set to 1 if the request is a graceful request. | 222| |Set to 0 if the request is a forceful request. | 223+------------------+-----------------------------------------------------------+ 224|Return values | 225+------------------+-----------------------------------------------------------+ 226|Name |Description | 227+------------------+-----------------------------------------------------------+ 228|int32 status |SUCCESS: The LMM RESET command finished successfully in | 229| |graceful reset or LM successfully resets in forceful reset.| 230| |NOT_FOUND: if lmid not points to a valid logical machine. | 231| |INVALID_PARAMETERS: if lmid is same as the caller. | 232| |DENIED: if the agent does not have permission to manage the| 233| |the LM specified by lmid. | 234+------------------+-----------------------------------------------------------+ 235 236LMM_SHUTDOWN 237~~~~~~~~~~~~ 238 239message_id: 0x6 240protocol_id: 0x80 241This command is mandatory. 242 243+------------------+-----------------------------------------------------------+ 244|Parameters | 245+------------------+-----------------------------------------------------------+ 246|Name |Description | 247+------------------+-----------------------------------------------------------+ 248|uint32 lmid |ID of the Logical Machine | 249+------------------+-----------------------------------------------------------+ 250|uint32 flags |Reset flags: | 251| |Bits[31:1] Reserved, must be zero. | 252| |Bit[0] Graceful request: | 253| |Set to 1 if the request is a graceful request. | 254| |Set to 0 if the request is a forceful request. | 255+------------------+-----------------------------------------------------------+ 256|Return values | 257+------------------+-----------------------------------------------------------+ 258|Name |Description | 259+------------------+-----------------------------------------------------------+ 260|int32 status |SUCCESS: The LMM shutdown command finished successfully in | 261| |graceful request or LM successfully shutdown in forceful | 262| |request. | 263| |NOT_FOUND: if lmid not points to a valid logical machine. | 264| |INVALID_PARAMETERS: if lmid is same as the caller. | 265| |DENIED: if the agent does not have permission to manage the| 266| |the LM specified by lmid. | 267+------------------+-----------------------------------------------------------+ 268 269LMM_WAKE 270~~~~~~~~ 271 272message_id: 0x7 273protocol_id: 0x80 274This command is mandatory. 275 276+------------------+-----------------------------------------------------------+ 277|Parameters | 278+------------------+-----------------------------------------------------------+ 279|Name |Description | 280+------------------+-----------------------------------------------------------+ 281|uint32 lmid |ID of the Logical Machine | 282+------------------+-----------------------------------------------------------+ 283|Return values | 284+------------------+-----------------------------------------------------------+ 285|Name |Description | 286+------------------+-----------------------------------------------------------+ 287|int32 status |SUCCESS: if LM wake command successfully returns. | 288| |NOT_FOUND: if lmid not points to a valid logical machine. | 289| |INVALID_PARAMETERS: if lmid is same as the caller. | 290| |DENIED: if the agent does not have permission to manage the| 291| |the LM specified by lmid. | 292+------------------+-----------------------------------------------------------+ 293 294LMM_SUSPEND 295~~~~~~~~~~~ 296 297message_id: 0x8 298protocol_id: 0x80 299This command is mandatory. 300 301+------------------+-----------------------------------------------------------+ 302|Parameters | 303+------------------+-----------------------------------------------------------+ 304|Name |Description | 305+------------------+-----------------------------------------------------------+ 306|uint32 lmid |ID of the Logical Machine | 307+------------------+-----------------------------------------------------------+ 308|Return values | 309+------------------+-----------------------------------------------------------+ 310|Name |Description | 311+------------------+-----------------------------------------------------------+ 312|int32 status |SUCCESS: if LM suspend command successfully returns. | 313| |NOT_FOUND: if lmid not points to a valid logical machine. | 314| |INVALID_PARAMETERS: if lmid is same as the caller. | 315| |DENIED: if the agent does not have permission to manage the| 316| |the LM specified by lmid. | 317+------------------+-----------------------------------------------------------+ 318 319LMM_NOTIFY 320~~~~~~~~~~ 321 322message_id: 0x9 323protocol_id: 0x80 324This command is mandatory. 325 326+------------------+-----------------------------------------------------------+ 327|Parameters | 328+------------------+-----------------------------------------------------------+ 329|Name |Description | 330+------------------+-----------------------------------------------------------+ 331|uint32 lmid |ID of the Logical Machine | 332+------------------+-----------------------------------------------------------+ 333|uint32 flags |Notification flags: | 334| |Bits[31:3] Reserved, must be zero. | 335| |Bit[3] Wake (resume) notification: | 336| |Set to 1 to send notification. | 337| |Set to 0 if no notification. | 338| |Bit[2] Suspend (sleep) notification: | 339| |Set to 1 to send notification. | 340| |Set to 0 if no notification. | 341| |Bit[1] Shutdown (off) notification: | 342| |Set to 1 to send notification. | 343| |Set to 0 if no notification. | 344| |Bit[0] Boot (on) notification: | 345| |Set to 1 to send notification. | 346| |Set to 0 if no notification | 347+------------------+-----------------------------------------------------------+ 348|Return values | 349+------------------+-----------------------------------------------------------+ 350|Name |Description | 351+------------------+-----------------------------------------------------------+ 352|int32 status |SUCCESS: if the notification state successfully updated. | 353| |NOT_FOUND: if lmid not points to a valid logical machine. | 354| |INVALID_PARAMETERS: if input attributes flag specifies | 355| |unsupported or invalid configurations. | 356| |DENIED: if the agent does not have permission to request | 357| |the notification. | 358+------------------+-----------------------------------------------------------+ 359 360LMM_RESET_REASON 361~~~~~~~~~~~~~~~~ 362 363message_id: 0xA 364protocol_id: 0x80 365This command is mandatory. 366 367This command is to return the reset reason that caused the last reset, such as 368POR, WDOG, JTAG and etc. 369 370+---------------------+--------------------------------------------------------+ 371|Parameters | 372+---------------------+--------------------------------------------------------+ 373|Name |Description | 374+---------------------+--------------------------------------------------------+ 375|uint32 lmid |ID of the Logical Machine | 376+---------------------+--------------------------------------------------------+ 377|Return values | 378+---------------------+--------------------------------------------------------+ 379|Name |Description | 380+---------------------+--------------------------------------------------------+ 381|int32 status |SUCCESS: if the reset reason of the LM successfully | 382| |updated. | 383| |NOT_FOUND: if lmid not points to a valid logical machine| 384| |DENIED: if the agent does not have permission to request| 385| |the reset reason. | 386+---------------------+--------------------------------------------------------+ 387|uint32 bootflags |Boot reason flags. This parameter has the format: | 388| |Bits[31] Valid. | 389| |Set to 1 if the entire reason is valid. | 390| |Set to 0 if the entire reason is not valid. | 391| |Bits[30:29] Reserved, must be zero. | 392| |Bit[28] Valid origin: | 393| |Set to 1 if the origin field is valid. | 394| |Set to 0 if the origin field is not valid. | 395| |Bits[27:24] Origin. | 396| |Logical Machine(LM) ID that causes the BOOT of this LM | 397| |Bit[23] Valid err ID: | 398| |Set to 1 if the error ID field is valid. | 399| |Set to 0 if the error ID field is not valid. | 400| |Bits[22:8] Error ID(Agent ID of the system). | 401| |Bit[7:0] Reason(WDOG, POR, FCCU and etc): | 402| |See the SRESR register description in the System | 403| |Reset Controller (SRC) section in SoC reference mannual | 404| |One reason maps to BIT(reason) in SRESR | 405+---------------------+--------------------------------------------------------+ 406|uint32 shutdownflags |Shutdown reason flags. This parameter has the format: | 407| |Bits[31] Valid. | 408| |Set to 1 if the entire reason is valid. | 409| |Set to 0 if the entire reason is not valid. | 410| |Bits[30:29] Number of valid extended info words. | 411| |Bit[28] Valid origin: | 412| |Set to 1 if the origin field is valid. | 413| |Set to 0 if the origin field is not valid. | 414| |Bits[27:24] Origin. | 415| |Logical Machine(LM) ID that causes the BOOT of this LM | 416| |Bit[23] Valid err ID: | 417| |Set to 1 if the error ID field is valid. | 418| |Set to 0 if the error ID field is not valid. | 419| |Bits[22:8] Error ID(Agent ID of the System). | 420| |Bit[7:0] Reason | 421| |See the SRESR register description in the System | 422| |Reset Controller (SRC) section in SoC reference mannual | 423| |One reason maps to BIT(reason) in SRESR | 424+---------------------+--------------------------------------------------------+ 425|uint32 extinfo[3] |Array of extended info words(e.g. fault pc) | 426+---------------------+--------------------------------------------------------+ 427 428LMM_POWER_ON 429~~~~~~~~~~~~ 430 431message_id: 0xB 432protocol_id: 0x80 433This command is mandatory. 434 435+------------------+-----------------------------------------------------------+ 436|Parameters | 437+------------------+-----------------------------------------------------------+ 438|Name |Description | 439+------------------+-----------------------------------------------------------+ 440|uint32 lmid |ID of the Logical Machine | 441+------------------+-----------------------------------------------------------+ 442|Return values | 443+------------------+-----------------------------------------------------------+ 444|Name |Description | 445+------------------+-----------------------------------------------------------+ 446|int32 status |SUCCESS: if LM successfully powers on. | 447| |NOT_FOUND: if lmid not points to a valid logical machine. | 448| |INVALID_PARAMETERS: if lmid is same as the caller. | 449| |DENIED: if the agent does not have permission to manage the| 450| |the LM specified by lmid. | 451+------------------+-----------------------------------------------------------+ 452 453LMM_RESET_VECTOR_SET 454~~~~~~~~~~~~~~~~~~~~ 455 456message_id: 0xC 457protocol_id: 0x80 458This command is mandatory. 459 460+-----------------------+------------------------------------------------------+ 461|Parameters | 462+-----------------------+------------------------------------------------------+ 463|Name |Description | 464+-----------------------+------------------------------------------------------+ 465|uint32 lmid |ID of the Logical Machine | 466+-----------------------+------------------------------------------------------+ 467|uint32 cpuid |ID of the CPU inside the LM | 468+-----------------------+------------------------------------------------------+ 469|uint32 flags |Reset vector flags | 470| |Bits[31:0] Reserved, must be zero. | 471+-----------------------+------------------------------------------------------+ 472|uint32 resetVectorLow |Lower vector | 473+-----------------------+------------------------------------------------------+ 474|uint32 resetVectorHigh |Higher vector | 475+-----------------------+------------------------------------------------------+ 476|Return values | 477+-----------------------+------------------------------------------------------+ 478|Name |Description | 479+-----------------------+------------------------------------------------------+ 480|int32 status |SUCCESS: If reset vector is set successfully. | 481| |NOT_FOUND: if lmid not points to a valid logical | 482| |machine, or cpuId is not valid. | 483| |INVALID_PARAMETERS: if reset vector is invalid. | 484| |DENIED: if the agent does not have permission to set | 485| |the reset vector for the CPU in the LM. | 486+-----------------------+------------------------------------------------------+ 487 488NEGOTIATE_PROTOCOL_VERSION 489~~~~~~~~~~~~~~~~~~~~~~~~~~~ 490 491message_id: 0x10 492protocol_id: 0x80 493This command is mandatory. 494 495+--------------------+---------------------------------------------------------+ 496|Parameters | 497+--------------------+---------------------------------------------------------+ 498|Name |Description | 499+--------------------+---------------------------------------------------------+ 500|uint32 version |The negotiated protocol version the agent intends to use | 501+--------------------+---------------------------------------------------------+ 502|Return values | 503+--------------------+---------------------------------------------------------+ 504|Name |Description | 505+--------------------+---------------------------------------------------------+ 506|int32 status |SUCCESS: if the negotiated protocol version is supported | 507| |by the platform. All commands, responses, and | 508| |notifications post successful return of this command must| 509| |comply with the negotiated version. | 510| |NOT_SUPPORTED: if the protocol version is not supported. | 511+--------------------+---------------------------------------------------------+ 512 513Notifications 514_____________ 515 516LMM_EVENT 517~~~~~~~~~ 518 519message_id: 0x0 520protocol_id: 0x80 521 522+------------------+-----------------------------------------------------------+ 523|Parameters | 524+------------------+-----------------------------------------------------------+ 525|Name |Description | 526+------------------+-----------------------------------------------------------+ 527|uint32 lmid |Identifier for the LM that caused the transition. | 528+------------------+-----------------------------------------------------------+ 529|uint32 eventlm |Identifier of the LM this event refers to. | 530+------------------+-----------------------------------------------------------+ 531|uint32 flags |LM events: | 532| |Bits[31:3] Reserved, must be zero. | 533| |Bit[3] Wake (resume) event: | 534| |1 LM has awakened. | 535| |0 not a wake event. | 536| |Bit[2] Suspend (sleep) event: | 537| |1 LM has suspended. | 538| |0 not a suspend event. | 539| |Bit[1] Shutdown (off) event: | 540| |1 LM has shutdown. | 541| |0 not a shutdown event. | 542| |Bit[0] Boot (on) event: | 543| |1 LM has booted. | 544| |0 not a boot event. | 545+------------------+-----------------------------------------------------------+ 546 547SCMI_BBM: System Control and Management BBM Vendor Protocol 548============================================================== 549 550This protocol is intended provide access to the battery-backed module. This 551contains persistent storage (GPR), an RTC, and the ON/OFF button. The protocol 552can also provide access to similar functions implemented via external board 553components. The BBM protocol provides functions to: 554 555- Describe the protocol version. 556- Discover implementation attributes. 557- Read/write GPR 558- Discover the RTCs available in the system. 559- Read/write the RTC time in seconds and ticks 560- Set an alarm (per LM) in seconds 561- Get notifications on RTC update, alarm, or rollover. 562- Get notification on ON/OFF button activity. 563 564For most SoC, there is one on-chip RTC (e.g. in BBNSM) and this is RTC ID 0. 565Board code can add additional GPR and RTC. 566 567GPR are not aggregated. The RTC time is also not aggregated. Setting these 568sets for all so normally exclusive access would be granted to one agent for 569each. However, RTC alarms are maintained for each LM and the hardware is 570programmed with the next nearest alarm time. So only one agent in an LM should 571be given access rights to set an RTC alarm. 572 573Commands: 574_________ 575 576PROTOCOL_VERSION 577~~~~~~~~~~~~~~~~ 578 579message_id: 0x0 580protocol_id: 0x81 581 582+---------------+--------------------------------------------------------------+ 583|Return values | 584+---------------+--------------------------------------------------------------+ 585|Name |Description | 586+---------------+--------------------------------------------------------------+ 587|int32 status | See ARM SCMI Specification for status code definitions. | 588+---------------+--------------------------------------------------------------+ 589|uint32 version | For this revision of the specification, this value must be | 590| | 0x10000. | 591+---------------+--------------------------------------------------------------+ 592 593PROTOCOL_ATTRIBUTES 594~~~~~~~~~~~~~~~~~~~ 595 596message_id: 0x1 597protocol_id: 0x81 598 599+---------------+--------------------------------------------------------------+ 600|Return values | 601+------------------+-----------------------------------------------------------+ 602|Name |Description | 603+------------------+-----------------------------------------------------------+ 604|int32 status | See ARM SCMI Specification for status code definitions. | 605+------------------+-----------------------------------------------------------+ 606|uint32 attributes | Bits[31:8] Number of RTCs. | 607| | Bits[15:0] Number of persistent storage (GPR) words. | 608+------------------+-----------------------------------------------------------+ 609 610PROTOCOL_MESSAGE_ATTRIBUTES 611~~~~~~~~~~~~~~~~~~~~~~~~~~~ 612 613message_id: 0x2 614protocol_id: 0x81 615 616+---------------+--------------------------------------------------------------+ 617|Return values | 618+------------------+-----------------------------------------------------------+ 619|Name |Description | 620+------------------+-----------------------------------------------------------+ 621|int32 status |SUCCESS: in case the message is implemented and available | 622| |to use. | 623| |NOT_FOUND: if the message identified by message_id is | 624| |invalid or not implemented | 625+------------------+-----------------------------------------------------------+ 626|uint32 attributes |Flags that are associated with a specific function in the | 627| |protocol. For all functions in this protocol, this | 628| |parameter has a value of 0 | 629+------------------+-----------------------------------------------------------+ 630 631BBM_GPR_SET 632~~~~~~~~~~~ 633 634message_id: 0x3 635protocol_id: 0x81 636 637+------------------+-----------------------------------------------------------+ 638|Parameters | 639+------------------+-----------------------------------------------------------+ 640|Name |Description | 641+------------------+-----------------------------------------------------------+ 642|uint32 index |Index of GPR to write | 643+------------------+-----------------------------------------------------------+ 644|uint32 value |32-bit value to write to the GPR | 645+------------------+-----------------------------------------------------------+ 646|Return values | 647+------------------+-----------------------------------------------------------+ 648|Name |Description | 649+------------------+-----------------------------------------------------------+ 650|int32 status |SUCCESS: if the GPR was successfully written. | 651| |NOT_FOUND: if the index is not valid. | 652| |DENIED: if the agent does not have permission to write | 653| |the specified GPR | 654+------------------+-----------------------------------------------------------+ 655 656BBM_GPR_GET 657~~~~~~~~~~~ 658 659message_id: 0x4 660protocol_id: 0x81 661 662+------------------+-----------------------------------------------------------+ 663|Parameters | 664+------------------+-----------------------------------------------------------+ 665|Name |Description | 666+------------------+-----------------------------------------------------------+ 667|uint32 index |Index of GPR to read | 668+------------------+-----------------------------------------------------------+ 669|Return values | 670+------------------+-----------------------------------------------------------+ 671|Name |Description | 672+------------------+-----------------------------------------------------------+ 673|int32 status |SUCCESS: if the GPR was successfully read. | 674| |NOT_FOUND: if the index is not valid. | 675| |DENIED: if the agent does not have permission to read | 676| |the specified GPR. | 677+------------------+-----------------------------------------------------------+ 678|uint32 value |32-bit value read from the GPR | 679+------------------+-----------------------------------------------------------+ 680 681BBM_RTC_ATTRIBUTES 682~~~~~~~~~~~~~~~~~~ 683 684message_id: 0x5 685protocol_id: 0x81 686 687+------------------+-----------------------------------------------------------+ 688|Parameters | 689+------------------+-----------------------------------------------------------+ 690|Name |Description | 691+------------------+-----------------------------------------------------------+ 692|uint32 index |Index of RTC | 693+------------------+-----------------------------------------------------------+ 694|Return values | 695+------------------+-----------------------------------------------------------+ 696|Name |Description | 697+------------------+-----------------------------------------------------------+ 698|int32 status |SUCCESS: returned the attributes. | 699| |NOT_FOUND: Index is invalid. | 700+------------------+-----------------------------------------------------------+ 701|uint32 attributes |Bit[31:24] Bit width of RTC seconds. | 702| |Bit[23:16] Bit width of RTC ticks. | 703| |Bits[15:0] RTC ticks per second | 704+------------------+-----------------------------------------------------------+ 705|uint8 name[16] |Null-terminated ASCII string of up to 16 bytes in length | 706| |describing the RTC name | 707+------------------+-----------------------------------------------------------+ 708 709BBM_RTC_TIME_SET 710~~~~~~~~~~~~~~~~ 711 712message_id: 0x6 713protocol_id: 0x81 714 715+------------------+-----------------------------------------------------------+ 716|Parameters | 717+------------------+-----------------------------------------------------------+ 718|Name |Description | 719+------------------+-----------------------------------------------------------+ 720|uint32 index |Index of RTC | 721+------------------+-----------------------------------------------------------+ 722|uint32 flags |Bits[31:1] Reserved, must be zero. | 723| |Bit[0] RTC time format: | 724| |Set to 1 if the time is in ticks. | 725| |Set to 0 if the time is in seconds | 726+------------------+-----------------------------------------------------------+ 727|uint32 time[2] |Lower word: Lower 32 bits of the time in seconds/ticks. | 728| |Upper word: Upper 32 bits of the time in seconds/ticks. | 729+------------------+-----------------------------------------------------------+ 730|Return values | 731+------------------+-----------------------------------------------------------+ 732|Name |Description | 733+------------------+-----------------------------------------------------------+ 734|int32 status |SUCCESS: RTC time was successfully set. | 735| |NOT_FOUND: rtcId pertains to a non-existent RTC. | 736| |INVALID_PARAMETERS: time is not valid | 737| |(beyond the range of the RTC). | 738| |DENIED: the agent does not have permission to set the RTC. | 739+------------------+-----------------------------------------------------------+ 740 741BBM_RTC_TIME_GET 742~~~~~~~~~~~~~~~~ 743 744message_id: 0x7 745protocol_id: 0x81 746 747+------------------+-----------------------------------------------------------+ 748|Parameters | 749+------------------+-----------------------------------------------------------+ 750|Name |Description | 751+------------------+-----------------------------------------------------------+ 752|uint32 index |Index of RTC | 753+------------------+-----------------------------------------------------------+ 754|uint32 flags |Bits[31:1] Reserved, must be zero. | 755| |Bit[0] RTC time format: | 756| |Set to 1 if the time is in ticks. | 757| |Set to 0 if the time is in seconds | 758+------------------+-----------------------------------------------------------+ 759|Return values | 760+------------------+-----------------------------------------------------------+ 761|Name |Description | 762+------------------+-----------------------------------------------------------+ 763|int32 status |SUCCESS: RTC time was successfully get. | 764| |NOT_FOUND: rtcId pertains to a non-existent RTC. | 765+------------------+-----------------------------------------------------------+ 766|uint32 time[2] |Lower word: Lower 32 bits of the time in seconds/ticks. | 767| |Upper word: Upper 32 bits of the time in seconds/ticks. | 768+------------------+-----------------------------------------------------------+ 769 770BBM_RTC_ALARM_SET 771~~~~~~~~~~~~~~~~~ 772 773message_id: 0x8 774protocol_id: 0x81 775 776+------------------+-----------------------------------------------------------+ 777|Parameters | 778+------------------+-----------------------------------------------------------+ 779|Name |Description | 780+------------------+-----------------------------------------------------------+ 781|uint32 index |Index of RTC | 782+------------------+-----------------------------------------------------------+ 783|uint32 flags |Bits[31:1] Reserved, must be zero. | 784| |Bit[0] RTC enable flag: | 785| |Set to 1 if the RTC alarm should be enabled. | 786| |Set to 0 if the RTC alarm should be disabled | 787+------------------+-----------------------------------------------------------+ 788|uint32 time[2] |Lower word: Lower 32 bits of the time in seconds. | 789| |Upper word: Upper 32 bits of the time in seconds. | 790+------------------+-----------------------------------------------------------+ 791|Return values | 792+------------------+-----------------------------------------------------------+ 793|Name |Description | 794+------------------+-----------------------------------------------------------+ 795|int32 status |SUCCESS: RTC time was successfully set. | 796| |NOT_FOUND: rtcId pertains to a non-existent RTC. | 797| |INVALID_PARAMETERS: time is not valid | 798| |(beyond the range of the RTC). | 799| |DENIED: the agent does not have permission to set the RTC | 800| |alarm | 801+------------------+-----------------------------------------------------------+ 802 803BBM_BUTTON_GET 804~~~~~~~~~~~~~~ 805 806message_id: 0x9 807protocol_id: 0x81 808 809+------------------+-----------------------------------------------------------+ 810|Return values | 811+------------------+-----------------------------------------------------------+ 812|Name |Description | 813+------------------+-----------------------------------------------------------+ 814|int32 status |SUCCESS: if the button status was read. | 815| |Other value: ARM SCMI Specification status code definitions| 816+------------------+-----------------------------------------------------------+ 817|uint32 state |State of the ON/OFF button. 1: ON, 0: OFF | 818+------------------+-----------------------------------------------------------+ 819 820BBM_RTC_NOTIFY 821~~~~~~~~~~~~~~ 822 823message_id: 0xA 824protocol_id: 0x81 825 826+------------------+-----------------------------------------------------------+ 827|Parameters | 828+------------------+-----------------------------------------------------------+ 829|Name |Description | 830+------------------+-----------------------------------------------------------+ 831|uint32 index |Index of RTC | 832+------------------+-----------------------------------------------------------+ 833|uint32 flags |Notification flags | 834| |Bits[31:3] Reserved, must be zero. | 835| |Bit[2] Update enable: | 836| |Set to 1 to send notification. | 837| |Set to 0 if no notification. | 838| |Bit[1] Rollover enable: | 839| |Set to 1 to send notification. | 840| |Set to 0 if no notification. | 841| |Bit[0] Alarm enable: | 842| |Set to 1 to send notification. | 843| |Set to 0 if no notification | 844+------------------+-----------------------------------------------------------+ 845|Return values | 846+------------------+-----------------------------------------------------------+ 847|Name |Description | 848+------------------+-----------------------------------------------------------+ 849|int32 status |SUCCESS: notification configuration was successfully | 850| |updated. | 851| |NOT_FOUND: rtcId pertains to a non-existent RTC. | 852| |DENIED: the agent does not have permission to request RTC | 853| |notifications. | 854+------------------+-----------------------------------------------------------+ 855 856BBM_BUTTON_NOTIFY 857~~~~~~~~~~~~~~~~~ 858 859message_id: 0xB 860protocol_id: 0x81 861 862+------------------+-----------------------------------------------------------+ 863|Parameters | 864+------------------+-----------------------------------------------------------+ 865|Name |Description | 866+------------------+-----------------------------------------------------------+ 867|uint32 flags |Notification flags | 868| |Bits[31:1] Reserved, must be zero. | 869| |Bit[0] Enable button: | 870| |Set to 1 to send notification. | 871| |Set to 0 if no notification | 872+------------------+-----------------------------------------------------------+ 873|Return values | 874+------------------+-----------------------------------------------------------+ 875|Name |Description | 876+------------------+-----------------------------------------------------------+ 877|int32 status |SUCCESS: notification configuration was successfully | 878| |updated. | 879| |DENIED: the agent does not have permission to request | 880| |button notifications. | 881+------------------+-----------------------------------------------------------+ 882 883NEGOTIATE_PROTOCOL_VERSION 884~~~~~~~~~~~~~~~~~~~~~~~~~~ 885 886message_id: 0x10 887protocol_id: 0x81 888 889+--------------------+---------------------------------------------------------+ 890|Parameters | 891+--------------------+---------------------------------------------------------+ 892|Name |Description | 893+--------------------+---------------------------------------------------------+ 894|uint32 version |The negotiated protocol version the agent intends to use | 895+--------------------+---------------------------------------------------------+ 896|Return values | 897+--------------------+---------------------------------------------------------+ 898|Name |Description | 899+--------------------+---------------------------------------------------------+ 900|int32 status |SUCCESS: if the negotiated protocol version is supported | 901| |by the platform. All commands, responses, and | 902| |notifications post successful return of this command must| 903| |comply with the negotiated version. | 904| |NOT_SUPPORTED: if the protocol version is not supported. | 905+--------------------+---------------------------------------------------------+ 906 907Notifications 908_____________ 909 910BBM_RTC_EVENT 911~~~~~~~~~~~~~ 912 913message_id: 0x0 914protocol_id: 0x81 915 916+------------------+-----------------------------------------------------------+ 917|Parameters | 918+------------------+-----------------------------------------------------------+ 919|Name |Description | 920+------------------+-----------------------------------------------------------+ 921|uint32 flags |RTC events: | 922| |Bits[31:2] Reserved, must be zero. | 923| |Bit[1] RTC rollover notification: | 924| |1 RTC rollover detected. | 925| |0 no RTC rollover detected. | 926| |Bit[0] RTC alarm notification: | 927| |1 RTC alarm generated. | 928| |0 no RTC alarm generated. | 929+------------------+-----------------------------------------------------------+ 930 931BBM_BUTTON_EVENT 932~~~~~~~~~~~~~~~~ 933 934message_id: 0x1 935protocol_id: 0x81 936 937+------------------+-----------------------------------------------------------+ 938|Parameters | 939+------------------+-----------------------------------------------------------+ 940|Name |Description | 941+------------------+-----------------------------------------------------------+ 942|uint32 flags |RTC events: | 943+------------------+-----------------------------------------------------------+ 944| |Button events: | 945| |Bits[31:1] Reserved, must be zero. | 946| |Bit[0] Button notification: | 947| |1 button change detected. | 948| |0 no button change detected. | 949+------------------+-----------------------------------------------------------+ 950 951System Control and Management CPU Vendor Protocol 952================================================= 953 954This protocol allows an agent to start or stop a CPU. It is used to manage 955auxiliary CPUs in a target LM (e.g. additional cores in an AP cluster or 956Cortex-M cores). 957Note: 958 - For cores in AP cluster, PSCI should be used and PSCI firmware will use CPU 959 protocol to handle them. For cores in non-AP cluster, Operating System(e.g. 960 Linux OS) could use CPU protocols to control Cortex-M7 cores. 961 - CPU indicates the core and its auxiliary peripherals(e.g. TCM) inside 962 i.MX SoC 963 964There are cases where giving an agent full control of a CPU via the CPU 965protocol is not desired. The LMM protocol is more restricted to just boot, 966shutdown, etc. So an agent might boot another logical machine but not be 967able to directly mess the state of its CPUs. Its also the reason there is an 968LMM power on command even though that could have been done through the 969power protocol. 970 971The CPU protocol provides commands to: 972 973- Describe the protocol version. 974- Discover implementation attributes. 975- Discover the CPUs defined in the system. 976- Start a CPU. 977- Stop a CPU. 978- Set the boot and resume addresses for a CPU. 979- Set the sleep mode of a CPU. 980- Configure wake-up sources for a CPU. 981- Configure power domain reactions (LPM mode and retention mask) for a CPU. 982- The CPU IDs can be found in the CPU section of the SoC DEVICE: SM Device 983 Interface. They can also be found in the SoC RM. See the CPU Mode Control 984 (CMC) list in General Power Controller (GPC) section. 985 986CPU settings are not aggregated and setting their state is normally exclusive 987to one client. 988 989Commands: 990_________ 991 992PROTOCOL_VERSION 993~~~~~~~~~~~~~~~~ 994 995message_id: 0x0 996protocol_id: 0x82 997This command is mandatory. 998 999+---------------+--------------------------------------------------------------+ 1000|Return values | 1001+---------------+--------------------------------------------------------------+ 1002|Name |Description | 1003+---------------+--------------------------------------------------------------+ 1004|int32 status | See ARM SCMI Specification for status code definitions. | 1005+---------------+--------------------------------------------------------------+ 1006|uint32 version | For this revision of the specification, this value must be | 1007| | 0x10000. | 1008+---------------+--------------------------------------------------------------+ 1009 1010PROTOCOL_ATTRIBUTES 1011~~~~~~~~~~~~~~~~~~~ 1012 1013message_id: 0x1 1014protocol_id: 0x82 1015This command is mandatory. 1016 1017+---------------+--------------------------------------------------------------+ 1018|Return values | 1019+------------------+-----------------------------------------------------------+ 1020|Name |Description | 1021+------------------+-----------------------------------------------------------+ 1022|int32 status | See ARM SCMI Specification for status code definitions. | 1023+------------------+-----------------------------------------------------------+ 1024|uint32 attributes |Protocol attributes: | 1025| |Bits[31:16] Reserved, must be zero. | 1026| |Bits[15:0] Number of CPUs | 1027+------------------+-----------------------------------------------------------+ 1028 1029PROTOCOL_MESSAGE_ATTRIBUTES 1030~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1031 1032message_id: 0x2 1033protocol_id: 0x82 1034This command is mandatory. 1035 1036+---------------+--------------------------------------------------------------+ 1037|Return values | 1038+------------------+-----------------------------------------------------------+ 1039|Name |Description | 1040+------------------+-----------------------------------------------------------+ 1041|int32 status |SUCCESS: in case the message is implemented and available | 1042| |to use. | 1043| |NOT_FOUND: if the message identified by message_id is | 1044| |invalid or not implemented | 1045+------------------+-----------------------------------------------------------+ 1046|uint32 attributes |Flags that are associated with a specific command in the | 1047| |protocol. For all commands in this protocol, this | 1048| |parameter has a value of 0 | 1049+------------------+-----------------------------------------------------------+ 1050 1051CPU_ATTRIBUTES 1052~~~~~~~~~~~~~~ 1053 1054message_id: 0x4 1055protocol_id: 0x82 1056This command is mandatory. 1057 1058+------------------+-----------------------------------------------------------+ 1059|Parameters | 1060+------------------+-----------------------------------------------------------+ 1061|Name |Description | 1062+------------------+-----------------------------------------------------------+ 1063|uint32 cpuid |Identifier for the CPU | 1064+------------------+-----------------------------------------------------------+ 1065|Return values | 1066+------------------+-----------------------------------------------------------+ 1067|Name |Description | 1068+------------------+-----------------------------------------------------------+ 1069|int32 status |SUCCESS: if valid attributes are returned successfully. | 1070| |NOT_FOUND: if the cpuid is not valid. | 1071+------------------+-----------------------------------------------------------+ 1072|uint32 attributes |Bits[31:0] Reserved, must be zero | 1073+------------------+-----------------------------------------------------------+ 1074|char name[16] |NULL terminated ASCII string with CPU name up to 16 bytes | 1075+------------------+-----------------------------------------------------------+ 1076 1077CPU_START 1078~~~~~~~~~ 1079 1080message_id: 0x4 1081protocol_id: 0x82 1082This command is mandatory. 1083 1084+------------------+-----------------------------------------------------------+ 1085|Parameters | 1086+------------------+-----------------------------------------------------------+ 1087|Name |Description | 1088+------------------+-----------------------------------------------------------+ 1089|uint32 cpuid |Identifier for the CPU | 1090+------------------+-----------------------------------------------------------+ 1091|Return values | 1092+------------------+-----------------------------------------------------------+ 1093|Name |Description | 1094+------------------+-----------------------------------------------------------+ 1095|int32 status |SUCCESS: if the cpu is started successfully. | 1096| |NOT_FOUND: if cpuid is not valid. | 1097| |DENIED: the calling agent is not allowed to start this CPU.| 1098+------------------+-----------------------------------------------------------+ 1099 1100CPU_STOP 1101~~~~~~~~ 1102 1103message_id: 0x5 1104protocol_id: 0x82 1105This command is mandatory. 1106 1107+------------------+-----------------------------------------------------------+ 1108|Parameters | 1109+------------------+-----------------------------------------------------------+ 1110|Name |Description | 1111+------------------+-----------------------------------------------------------+ 1112|uint32 cpuid |Identifier for the CPU | 1113+------------------+-----------------------------------------------------------+ 1114|Return values | 1115+------------------+-----------------------------------------------------------+ 1116|Name |Description | 1117+------------------+-----------------------------------------------------------+ 1118|int32 status |SUCCESS: if the cpu is started successfully. | 1119| |NOT_FOUND: if cpuid is not valid. | 1120| |DENIED: the calling agent is not allowed to stop this CPU. | 1121+------------------+-----------------------------------------------------------+ 1122 1123CPU_RESET_VECTOR_SET 1124~~~~~~~~~~~~~~~~~~~~ 1125 1126message_id: 0x6 1127protocol_id: 0x82 1128This command is mandatory. 1129 1130+----------------------+-------------------------------------------------------+ 1131|Parameters | 1132+----------------------+-------------------------------------------------------+ 1133|Name |Description | 1134+----------------------+-------------------------------------------------------+ 1135|uint32 cpuid |Identifier for the CPU | 1136+----------------------+-------------------------------------------------------+ 1137|uint32 flags |Reset vector flags: | 1138| |Bit[31] Resume flag. | 1139| |Set to 1 to update the reset vector used on resume. | 1140| |Bit[30] Boot flag. | 1141| |Set to 1 to update the reset vector used for boot. | 1142| |Bits[29:1] Reserved, must be zero. | 1143| |Bit[0] Table flag. | 1144| |Set to 1 if vector is the vector table base address. | 1145+----------------------+-------------------------------------------------------+ 1146|uint32 resetVectorLow |Lower vector: | 1147| |If bit[0] of flags is 0, the lower 32 bits of the | 1148| |physical address where the CPU should execute from on | 1149| |reset. If bit[0] of flags is 1, the lower 32 bits of | 1150| |the vector table base address | 1151+----------------------+-------------------------------------------------------+ 1152|uint32 resetVectorhigh|Upper vector: | 1153| |If bit[0] of flags is 0, the upper 32 bits of the | 1154| |physical address where the CPU should execute from on | 1155| |reset. If bit[0] of flags is 1, the upper 32 bits of | 1156| |the vector table base address | 1157+----------------------+-------------------------------------------------------+ 1158|Return values | 1159+----------------------+-------------------------------------------------------+ 1160|Name |Description | 1161+----------------------+-------------------------------------------------------+ 1162|int32 status |SUCCESS: if the CPU reset vector is set successfully. | 1163| |NOT_FOUND: if cpuId does not point to a valid CPU. | 1164| |INVALID_PARAMETERS: the requested vector type is not | 1165| |supported by this CPU. | 1166| |DENIED: the calling agent is not allowed to set the | 1167| |reset vector of this CPU | 1168+----------------------+-------------------------------------------------------+ 1169 1170CPU_SLEEP_MODE_SET 1171~~~~~~~~~~~~~~~~~~ 1172 1173message_id: 0x7 1174protocol_id: 0x82 1175This command is mandatory. 1176 1177+----------------------+-------------------------------------------------------+ 1178|Parameters | 1179+----------------------+-------------------------------------------------------+ 1180|Name |Description | 1181+----------------------+-------------------------------------------------------+ 1182|uint32 cpuid |Identifier for the CPU | 1183+----------------------+-------------------------------------------------------+ 1184|uint32 flags |Sleep mode flags: | 1185| |Bits[31:1] Reserved, must be zero. | 1186| |Bit[0] IRQ mux: | 1187| |If set to 1 the wakeup mux source is the GIC, else if 0| 1188| |then the GPC | 1189+----------------------+-------------------------------------------------------+ 1190|uint32 sleepmode |target sleep mode. When CPU runs into WFI, the GPC mode| 1191| |will be triggered to be in below modes: | 1192| |RUN: (0) | 1193| |WAIT: (1) | 1194| |STOP: (2) | 1195| |SUSPEND: (3) | 1196+----------------------+-------------------------------------------------------+ 1197|Return values | 1198+----------------------+-------------------------------------------------------+ 1199|Name |Description | 1200+----------------------+-------------------------------------------------------+ 1201|int32 status |SUCCESS: if the CPU sleep mode is set successfully. | 1202| |NOT_FOUND: if cpuId does not point to a valid CPU. | 1203| |INVALID_PARAMETERS: the sleepmode or flags is invalid. | 1204| |DENIED: the calling agent is not allowed to configure | 1205| |the CPU | 1206+----------------------+-------------------------------------------------------+ 1207 1208CPU_INFO_GET 1209~~~~~~~~~~~~ 1210 1211message_id: 0xC 1212protocol_id: 0x82 1213This command is mandatory. 1214 1215+----------------------+-------------------------------------------------------+ 1216|Parameters | 1217+----------------------+-------------------------------------------------------+ 1218|Name |Description | 1219+----------------------+-------------------------------------------------------+ 1220|uint32 cpuid |Identifier for the CPU | 1221+----------------------+-------------------------------------------------------+ 1222|Return values | 1223+----------------------+-------------------------------------------------------+ 1224|Name |Description | 1225+----------------------+-------------------------------------------------------+ 1226|int32 status |SUCCESS: if valid attributes are returned successfully.| 1227| |NOT_FOUND: if the cpuid is not valid. | 1228+----------------------+-------------------------------------------------------+ 1229|uint32 runmode |Run mode for the CPU | 1230| |RUN(0):cpu started | 1231| |HOLD(1):cpu powered up and reset asserted | 1232| |STOP(2):cpu reseted and hold cpu | 1233| |SUSPEND(3):in cpuidle state | 1234+----------------------+-------------------------------------------------------+ 1235|uint32 sleepmode |Sleep mode for the CPU, see CPU_SLEEP_MODE_SET | 1236+----------------------+-------------------------------------------------------+ 1237|uint32 resetvectorlow |Reset vector low 32 bits for the CPU | 1238+----------------------+-------------------------------------------------------+ 1239|uint32 resetvecothigh |Reset vector high 32 bits for the CPU | 1240+----------------------+-------------------------------------------------------+ 1241 1242NEGOTIATE_PROTOCOL_VERSION 1243~~~~~~~~~~~~~~~~~~~~~~~~~~ 1244 1245message_id: 0x10 1246protocol_id: 0x82 1247This command is mandatory. 1248 1249+--------------------+---------------------------------------------------------+ 1250|Parameters | 1251+--------------------+---------------------------------------------------------+ 1252|Name |Description | 1253+--------------------+---------------------------------------------------------+ 1254|uint32 version |The negotiated protocol version the agent intends to use | 1255+--------------------+---------------------------------------------------------+ 1256|Return values | 1257+--------------------+---------------------------------------------------------+ 1258|Name |Description | 1259+--------------------+---------------------------------------------------------+ 1260|int32 status |SUCCESS: if the negotiated protocol version is supported | 1261| |by the platform. All commands, responses, and | 1262| |notifications post successful return of this command must| 1263| |comply with the negotiated version. | 1264| |NOT_SUPPORTED: if the protocol version is not supported. | 1265+--------------------+---------------------------------------------------------+ 1266 1267SCMI_MISC: System Control and Management MISC Vendor Protocol 1268================================================================ 1269 1270Provides miscellaneous functions. This includes controls that are miscellaneous 1271settings/actions that must be exposed from the SM to agents. They are device 1272specific and are usually define to access bit fields in various mix block 1273control modules, IOMUX_GPR, and other GPR/CSR owned by the SM. This protocol 1274supports the following functions: 1275 1276- Describe the protocol version. 1277- Discover implementation attributes. 1278- Set/Get a control. 1279- Initiate an action on a control. 1280- Obtain platform (i.e. SM) build information. 1281- Obtain ROM passover data. 1282- Read boot/shutdown/reset information for the LM or the system. 1283 1284Commands: 1285_________ 1286 1287PROTOCOL_VERSION 1288~~~~~~~~~~~~~~~~ 1289 1290message_id: 0x0 1291protocol_id: 0x84 1292 1293+---------------+--------------------------------------------------------------+ 1294|Return values | 1295+---------------+--------------------------------------------------------------+ 1296|Name |Description | 1297+---------------+--------------------------------------------------------------+ 1298|int32 status | See ARM SCMI Specification for status code definitions. | 1299+---------------+--------------------------------------------------------------+ 1300|uint32 version | For this revision of the specification, this value must be | 1301| | 0x10000. | 1302+---------------+--------------------------------------------------------------+ 1303 1304PROTOCOL_ATTRIBUTES 1305~~~~~~~~~~~~~~~~~~~ 1306 1307message_id: 0x1 1308protocol_id: 0x84 1309 1310+------------------+-----------------------------------------------------------+ 1311|Return values | 1312+------------------+-----------------------------------------------------------+ 1313|Name |Description | 1314+------------------+-----------------------------------------------------------+ 1315|int32 status | See ARM SCMI Specification for status code definitions. | 1316+------------------+-----------------------------------------------------------+ 1317|uint32 attributes |Protocol attributes: | 1318| |Bits[31:24] Reserved, must be zero. | 1319| |Bits[23:16] Number of reset reasons. | 1320| |Bits[15:0] Number of controls | 1321+------------------+-----------------------------------------------------------+ 1322 1323PROTOCOL_MESSAGE_ATTRIBUTES 1324~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1325 1326message_id: 0x2 1327protocol_id: 0x84 1328 1329+------------------+-----------------------------------------------------------+ 1330|Return values | 1331+------------------+-----------------------------------------------------------+ 1332|Name |Description | 1333+------------------+-----------------------------------------------------------+ 1334|int32 status |SUCCESS: in case the message is implemented and available | 1335| |to use. | 1336| |NOT_FOUND: if the message identified by message_id is | 1337| |invalid or not implemented | 1338+------------------+-----------------------------------------------------------+ 1339|uint32 attributes |Flags that are associated with a specific function in the | 1340| |protocol. For all functions in this protocol, this | 1341| |parameter has a value of 0 | 1342+------------------+-----------------------------------------------------------+ 1343 1344MISC_CONTROL_SET 1345~~~~~~~~~~~~~~~~ 1346 1347message_id: 0x3 1348protocol_id: 0x84 1349 1350+------------------+-----------------------------------------------------------+ 1351|Parameters | 1352+------------------+-----------------------------------------------------------+ 1353|Name |Description | 1354+------------------+-----------------------------------------------------------+ 1355|uint32 index |Index of the control | 1356+------------------+-----------------------------------------------------------+ 1357|uint32 num |Size of the value data in words | 1358+------------------+-----------------------------------------------------------+ 1359|uint32 val[8] |value data array | 1360+------------------+-----------------------------------------------------------+ 1361|Return values | 1362+------------------+-----------------------------------------------------------+ 1363|Name |Description | 1364+------------------+-----------------------------------------------------------+ 1365|int32 status |SUCCESS: if the control was set successfully. | 1366| |NOT_FOUND: if the index is not valid. | 1367| |DENIED: if the agent does not have permission to set the | 1368| |control | 1369+------------------+-----------------------------------------------------------+ 1370 1371MISC_CONTROL_GET 1372~~~~~~~~~~~~~~~~ 1373 1374message_id: 0x4 1375protocol_id: 0x84 1376 1377+------------------+-----------------------------------------------------------+ 1378|Parameters | 1379+------------------+-----------------------------------------------------------+ 1380|Name |Description | 1381+------------------+-----------------------------------------------------------+ 1382|uint32 index |Index of the control | 1383+------------------+-----------------------------------------------------------+ 1384|Return values | 1385+------------------+-----------------------------------------------------------+ 1386|Name |Description | 1387+------------------+-----------------------------------------------------------+ 1388|int32 status |SUCCESS: if the control was get successfully. | 1389| |NOT_FOUND: if the index is not valid. | 1390| |DENIED: if the agent does not have permission to get the | 1391| |control | 1392+------------------+-----------------------------------------------------------+ 1393|uint32 num |Size of the return data in words, max 8 | 1394+------------------+-----------------------------------------------------------+ 1395|uint32 | | 1396|val[0, num - 1] |value data array | 1397+------------------+-----------------------------------------------------------+ 1398 1399MISC_CONTROL_ACTION 1400~~~~~~~~~~~~~~~~~~~ 1401 1402message_id: 0x5 1403protocol_id: 0x84 1404 1405+------------------+-----------------------------------------------------------+ 1406|Parameters | 1407+------------------+-----------------------------------------------------------+ 1408|Name |Description | 1409+------------------+-----------------------------------------------------------+ 1410|uint32 index |Index of the control | 1411+------------------+-----------------------------------------------------------+ 1412|uint32 action |Action for the control | 1413+------------------+-----------------------------------------------------------+ 1414|uint32 numarg |Size of the argument data, max 8 | 1415+------------------+-----------------------------------------------------------+ 1416|uint32 | | 1417|arg[0, numarg -1] |Argument data array | 1418+------------------+-----------------------------------------------------------+ 1419|Return values | 1420+------------------+-----------------------------------------------------------+ 1421|Name |Description | 1422+------------------+-----------------------------------------------------------+ 1423|int32 status |SUCCESS: if the action was set successfully. | 1424| |NOT_FOUND: if the index is not valid. | 1425| |DENIED: if the agent does not have permission to get the | 1426| |control | 1427+------------------+-----------------------------------------------------------+ 1428|uint32 num |Size of the return data in words, max 8 | 1429+------------------+-----------------------------------------------------------+ 1430|uint32 | | 1431|val[0, num - 1] |value data array | 1432+------------------+-----------------------------------------------------------+ 1433 1434MISC_DISCOVER_BUILD_INFO 1435~~~~~~~~~~~~~~~~~~~~~~~~ 1436 1437This function is used to obtain the build commit, data, time, number. 1438 1439message_id: 0x6 1440protocol_id: 0x84 1441 1442+------------------+-----------------------------------------------------------+ 1443|Return values | 1444+------------------+-----------------------------------------------------------+ 1445|Name |Description | 1446+------------------+-----------------------------------------------------------+ 1447|int32 status |SUCCESS: if the build info was got successfully. | 1448| |NOT_SUPPORTED: if the data is not available. | 1449+------------------+-----------------------------------------------------------+ 1450|uint32 buildnum |Build number | 1451+------------------+-----------------------------------------------------------+ 1452|uint32 buildcommit|Most significant 32 bits of the git commit hash | 1453+------------------+-----------------------------------------------------------+ 1454|uint8 date[16] |Date of build. Null terminated ASCII string of up to 16 | 1455| |bytes in length | 1456+------------------+-----------------------------------------------------------+ 1457|uint8 time[16] |Time of build. Null terminated ASCII string of up to 16 | 1458| |bytes in length | 1459+------------------+-----------------------------------------------------------+ 1460 1461MISC_ROM_PASSOVER_GET 1462~~~~~~~~~~~~~~~~~~~~~ 1463 1464ROM passover data is information exported by ROM and could be used by others. 1465It includes boot device, instance, type, mode and etc. This function is used 1466to obtain the ROM passover data. The returned block of words is structured as 1467defined in the ROM passover section in the SoC RM. 1468 1469message_id: 0x7 1470protocol_id: 0x84 1471 1472+------------------+-----------------------------------------------------------+ 1473|Return values | 1474+------------------+-----------------------------------------------------------+ 1475|Name |Description | 1476+------------------+-----------------------------------------------------------+ 1477|int32 status |SUCCESS: if the data was got successfully. | 1478| |NOT_SUPPORTED: if the data is not available. | 1479+------------------+-----------------------------------------------------------+ 1480|uint32 num |Size of the passover data in words, max 13 | 1481+------------------+-----------------------------------------------------------+ 1482|uint32 | | 1483|data[0, num - 1] |Passover data array | 1484+------------------+-----------------------------------------------------------+ 1485 1486MISC_CONTROL_NOTIFY 1487~~~~~~~~~~~~~~~~~~~ 1488 1489message_id: 0x8 1490protocol_id: 0x84 1491 1492+------------------+-----------------------------------------------------------+ 1493|Parameters | 1494+------------------+-----------------------------------------------------------+ 1495|Name |Description | 1496+------------------+-----------------------------------------------------------+ 1497|uint32 index |Index of control | 1498+------------------+-----------------------------------------------------------+ 1499|uint32 flags |Notification flags, varies by control | 1500+------------------+-----------------------------------------------------------+ 1501|Return values | 1502+------------------+-----------------------------------------------------------+ 1503|Name |Description | 1504+------------------+-----------------------------------------------------------+ 1505|int32 status |SUCCESS: notification configuration was successfully | 1506| |updated. | 1507| |NOT_FOUND: control id not exists. | 1508| |INVALID_PARAMETERS: if the input attributes flag specifies | 1509| |unsupported or invalid configurations.. | 1510| |DENIED: if the calling agent is not permitted to request | 1511| |the notification. | 1512+------------------+-----------------------------------------------------------+ 1513 1514MISC_RESET_REASON_ATTRIBUTES 1515~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1516 1517message_id: 0x9 1518protocol_id: 0x84 1519 1520+------------------+-----------------------------------------------------------+ 1521|Parameters | 1522+------------------+-----------------------------------------------------------+ 1523|Name |Description | 1524+------------------+-----------------------------------------------------------+ 1525|uint32 reasonid |Identifier for the reason | 1526+------------------+-----------------------------------------------------------+ 1527|Return values | 1528+------------------+-----------------------------------------------------------+ 1529|Name |Description | 1530+------------------+-----------------------------------------------------------+ 1531|int32 status |SUCCESS: if valid reason attributes are returned | 1532| |NOT_FOUND: if reasonId pertains to a non-existent reason. | 1533+------------------+-----------------------------------------------------------+ 1534|uint32 attributes |Reason attributes. This parameter has the following | 1535| |format: Bits[31:0] Reserved, must be zero | 1536| |Bits[15:0] Number of persistent storage (GPR) words. | 1537+------------------+-----------------------------------------------------------+ 1538|uint8 name[16] |Null-terminated ASCII string of up to 16 bytes in length | 1539| |describing the reason | 1540+------------------+-----------------------------------------------------------+ 1541 1542MISC_RESET_REASON_GET 1543~~~~~~~~~~~~~~~~~~~~~ 1544 1545message_id: 0xA 1546protocol_id: 0x84 1547 1548+--------------------+---------------------------------------------------------+ 1549|Parameters | 1550+--------------------+---------------------------------------------------------+ 1551|Name |Description | 1552+--------------------+---------------------------------------------------------+ 1553|uint32 flags |Reason flags. This parameter has the following format: | 1554| |Bits[31:1] Reserved, must be zero. | 1555| |Bit[0] System: | 1556| |Set to 1 to return the system reason. | 1557| |Set to 0 to return the LM reason | 1558+--------------------+---------------------------------------------------------+ 1559|Return values | 1560+--------------------+---------------------------------------------------------+ 1561|Name |Description | 1562+--------------------+---------------------------------------------------------+ 1563|int32 status |SUCCESS: reset reason return | 1564+--------------------+---------------------------------------------------------+ 1565|uint32 bootflags |Boot reason flags. This parameter has the format: | 1566| |Bits[31] Valid. | 1567| |Set to 1 if the entire reason is valid. | 1568| |Set to 0 if the entire reason is not valid. | 1569| |Bits[30:29] Reserved, must be zero. | 1570| |Bit[28] Valid origin: | 1571| |Set to 1 if the origin field is valid. | 1572| |Set to 0 if the origin field is not valid. | 1573| |Bits[27:24] Origin. | 1574| |Bit[23] Valid err ID: | 1575| |Set to 1 if the error ID field is valid. | 1576| |Set to 0 if the error ID field is not valid. | 1577| |Bits[22:8] Error ID. | 1578| |Bit[7:0] Reason | 1579+--------------------+---------------------------------------------------------+ 1580|uint32 shutdownflags|Shutdown reason flags. This parameter has the format: | 1581| |Bits[31] Valid. | 1582| |Set to 1 if the entire reason is valid. | 1583| |Set to 0 if the entire reason is not valid. | 1584| |Bits[30:29] Number of valid extended info words. | 1585| |Bit[28] Valid origin: | 1586| |Set to 1 if the origin field is valid. | 1587| |Set to 0 if the origin field is not valid. | 1588| |Bits[27:24] Origin. | 1589| |Bit[23] Valid err ID: | 1590| |Set to 1 if the error ID field is valid. | 1591| |Set to 0 if the error ID field is not valid. | 1592| |Bits[22:8] Error ID. | 1593| |Bit[7:0] Reason | 1594+--------------------+---------------------------------------------------------+ 1595|uint32 extinfo[8] |Array of extended info words | 1596+--------------------+---------------------------------------------------------+ 1597 1598MISC_SI_INFO_GET 1599~~~~~~~~~~~~~~~~ 1600 1601message_id: 0xB 1602protocol_id: 0x84 1603 1604+--------------------+---------------------------------------------------------+ 1605|Return values | 1606+--------------------+---------------------------------------------------------+ 1607|Name |Description | 1608+--------------------+---------------------------------------------------------+ 1609|int32 status |SUCCESS: silicon info return | 1610+--------------------+---------------------------------------------------------+ 1611|uint32 deviceid |Silicon specific device ID | 1612+--------------------+---------------------------------------------------------+ 1613|uint32 sirev |Silicon specific revision | 1614+--------------------+---------------------------------------------------------+ 1615|uint32 partnum |Silicon specific part number | 1616+--------------------+---------------------------------------------------------+ 1617|uint8 siname[16] |Silicon name/revision. Null terminated ASCII string of up| 1618| |to 16 bytes in length | 1619+--------------------+---------------------------------------------------------+ 1620 1621MISC_CFG_INFO_GET 1622~~~~~~~~~~~~~~~~~ 1623 1624message_id: 0xC 1625protocol_id: 0x84 1626 1627+--------------------+---------------------------------------------------------+ 1628|Return values | 1629+--------------------+---------------------------------------------------------+ 1630|Name |Description | 1631+--------------------+---------------------------------------------------------+ 1632|int32 status |SUCCESS: config name return | 1633| |NOT_SUPPORTED: name not available | 1634+--------------------+---------------------------------------------------------+ 1635|uint32 msel |Mode selector value | 1636+--------------------+---------------------------------------------------------+ 1637|uint8 cfgname[16] |config file basename. Null terminated ASCII string of up | 1638| |to 16 bytes in length | 1639+--------------------+---------------------------------------------------------+ 1640 1641MISC_SYSLOG_GET 1642~~~~~~~~~~~~~~~ 1643 1644message_id: 0xD 1645protocol_id: 0x84 1646 1647+--------------------+---------------------------------------------------------+ 1648|Parameters | 1649+--------------------+---------------------------------------------------------+ 1650|Name |Description | 1651+--------------------+---------------------------------------------------------+ 1652|uint32 flags |Device specific flags that might impact the data returned| 1653| |or clearing of the data | 1654+--------------------+---------------------------------------------------------+ 1655|uint32 logindex |Index to the first log word. Will be the first element in| 1656| |the return array | 1657+--------------------+---------------------------------------------------------+ 1658|Return values | 1659+--------------------+---------------------------------------------------------+ 1660|Name |Description | 1661+--------------------+---------------------------------------------------------+ 1662|int32 status |SUCCESS: system log return | 1663+--------------------+---------------------------------------------------------+ 1664|uint32 numLogflags |Descriptor for the log data returned by this call. | 1665| |Bits[31:20] Number of remaining log words. | 1666| |Bits[15:12] Reserved, must be zero. | 1667| |Bits[11:0] Number of log words that are returned by this | 1668| |call | 1669+--------------------+---------------------------------------------------------+ 1670|uint32 syslog[N] |Log data array, N is defined in bits[11:0] of numLogflags| 1671+--------------------+---------------------------------------------------------+ 1672 1673NEGOTIATE_PROTOCOL_VERSION 1674~~~~~~~~~~~~~~~~~~~~~~~~~~ 1675 1676message_id: 0x10 1677protocol_id: 0x84 1678 1679+--------------------+---------------------------------------------------------+ 1680|Parameters | 1681+--------------------+---------------------------------------------------------+ 1682|Name |Description | 1683+--------------------+---------------------------------------------------------+ 1684|uint32 version |The negotiated protocol version the agent intends to use | 1685+--------------------+---------------------------------------------------------+ 1686|Return values | 1687+--------------------+---------------------------------------------------------+ 1688|Name |Description | 1689+--------------------+---------------------------------------------------------+ 1690|int32 status |SUCCESS: if the negotiated protocol version is supported | 1691| |by the platform. All commands, responses, and | 1692| |notifications post successful return of this command must| 1693| |comply with the negotiated version. | 1694| |NOT_SUPPORTED: if the protocol version is not supported. | 1695+--------------------+---------------------------------------------------------+ 1696 1697Notifications 1698_____________ 1699 1700MISC_CONTROL_EVENT 1701~~~~~~~~~~~~~~~~~~ 1702 1703message_id: 0x0 1704protocol_id: 0x81 1705 1706+------------------+-----------------------------------------------------------+ 1707|Parameters | 1708+------------------+-----------------------------------------------------------+ 1709|Name |Description | 1710+------------------+-----------------------------------------------------------+ 1711|uint32 ctrlid |Identifier for the control that caused the event. | 1712+------------------+-----------------------------------------------------------+ 1713|uint32 flags |Event flags, varies by control. | 1714+------------------+-----------------------------------------------------------+ 1715