📄 fw-calling.txt
字号:
This page describes how to make calls to the firmware api.How to call===========The preferred calling convention is known as the firmware mailbox. Themailboxes are basically a fixed length array that serves as the call-stack.Firmware mailboxes can be located by searching the encoder and decoder memoryfor a 16 byte signature. That signature will be located on a 256-byte boundary.Signature:0x78, 0x56, 0x34, 0x12, 0x12, 0x78, 0x56, 0x34,0x34, 0x12, 0x78, 0x56, 0x56, 0x34, 0x12, 0x78The firmware implements 20 mailboxes of 20 32-bit words. The first 10 arereserved for API calls. The second 10 are used by the firmware for eventnotification. Index Name ----- ---- 0 Flags 1 Command 2 Return value 3 Timeout 4-19 Parameter/ResultThe flags are defined in the following table. The direction is from theperspective of the firmware. Bit Direction Purpose --- --------- ------- 2 O Firmware has processed the command. 1 I Driver has finished setting the parameters. 0 I Driver is using this mailbox.The command is a 32-bit enumerator. The API specifics may be found in thefw-*-api.txt documents.The return value is a 32-bit enumerator. Only two values are currently defined:0=success and -1=command undefined.There are 16 parameters/results 32-bit fields. The driver populates these fieldswith values for all the parameters required by the call. The driver overwritesthese fields with result values returned by the call. The API specifics may befound in the fw-*-api.txt documents.The timeout value protects the card from a hung driver thread. If the driverdoesn't handle the completed call within the timeout specified, the firmwarewill reset that mailbox.To make an API call, the driver iterates over each mailbox looking for thefirst one available (bit 0 has been cleared). The driver sets that bit, fillsin the command enumerator, the timeout value and any required parameters. Thedriver then sets the parameter ready bit (bit 1). The firmware scans themailboxes for pending commands, processes them, sets the result code, populatesthe result value array with that call's return values and sets the callcomplete bit (bit 2). Once bit 2 is set, the driver should retrieve the resultsand clear all the flags. If the driver does not perform this task within thetime set in the timeout register, the firmware will reset that mailbox.Event notifications are sent from the firmware to the host. The host tells thefirmware which events it is interested in via an API call. That call tells thefirmware which notification mailbox to use. The firmware signals the host viaan interrupt. Only the 16 Results fields are used, the Flags, Command, Returnvalue and Timeout words are not used.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -