Mailbox
Mailboxes 是 ARM Cores 與 VideoCore GPU 間溝通的橋樑,透過 Mailboxes 可以設定 framebuffer 或是設定一些周邊元件。
mbox.c
傳送訊息至 Mailbox 的流程:
- Combine the message address (upper 28 bits) with channel number (lower 4 bits)
- Check if Mailbox 0 status register’s full flag is set.
- If not, then you can write to Mailbox 1 Read/Write register.
- Check if Mailbox 0 status register’s empty flag is set.
- If not, then you can read from Mailbox 0 Read/Write register.
- Check if the value is the same as you wrote in step 1.
| |
使用範例
透過 Channel 8, 9 並搭配不同的 tag number 來進行不同的 operation。
- Channel 8: Request from ARM for response by VC
- Channel 9: Request from VC for response by ARM (none currently defined)
參考 https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface 取得更多資訊。
Get Board Revision
注意 aligned(16),因為 mbox_call 在定址時會需要在後方放上 channel number
| |
Get VC Memory
| |
Reference
https://github.com/raspberrypi/firmware/wiki/Mailboxes
https://github.com/raspberrypi/documentation/tree/JamesH65-mailbox_docs/configuration/mailboxes