Difference between revisions of "Unit PlatformRPi2"

From Ultibo.org
Jump to: navigation, search
 
(14 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
'''Ultibo Platform interface unit for Raspberry Pi 2'''
+
'''Ultibo Platform Interface unit for Raspberry Pi 2'''
  
 
The RPi2 B has the Power LED connected to GPIO Pin 35 (Activity LED is now on GPIO Pin 47).
 
The RPi2 B has the Power LED connected to GPIO Pin 35 (Activity LED is now on GPIO Pin 47).
Line 12: Line 12:
  
 
The RPi3 B+ has the Activity LED connected to GPIO Pin 29 (Power LED is only accessible via the GPIO expander driver).
 
The RPi3 B+ has the Activity LED connected to GPIO Pin 29 (Power LED is only accessible via the GPIO expander driver).
 +
 +
The RPi Zero2W has the Activity LED connected to GPIO Pin 29.
  
 
=== Constants ===
 
=== Constants ===
Line 45: Line 47:
 
|-
 
|-
 
| <code>RPI2_SECURE_BOOT = $00000001;</code>
 
| <code>RPI2_SECURE_BOOT = $00000001;</code>
| If 1 then startup will attempt to switch back to secure world during boot process
+
| If 1 then startup will attempt to switch back to secure world during boot process (Moved to ARMSecureBoot)
 +
|-
 +
| <code>RPI2_SECURE_BOOT_OFFSET = $000000D4;</code>
 +
| The address of the Secure Boot marker in the ARM boot stub
 +
|-
 +
| <code>RPI2_SECURE_BOOT_MARKER = $58495052;</code>
 +
| The Secure Boot marker (ASCII "RPIX")
 
|-
 
|-
 
|}
 
|}
Line 56: Line 64:
 
|-
 
|-
 
| <code>RPI2_STARTUP_ADDRESS = $00008000;</code>
 
| <code>RPI2_STARTUP_ADDRESS = $00008000;</code>
| style="width: 50%;"|&nbsp;
+
| Address of StartupHandler on Reset (Obtain from linker)
 
|-
 
|-
 
|}
 
|}
Line 174: Line 182:
 
| <code>RPI2_KERNEL_COMMAND = 'cmdline.txt';</code>
 
| <code>RPI2_KERNEL_COMMAND = 'cmdline.txt';</code>
 
| &nbsp;
 
| &nbsp;
 +
|-
 +
|colspan="2"|<code>RPI2_FIRMWARE_FILES = 'bootcode.bin,start.elf,fixup.dat,armstub32-rpi2.bin,armstub32-rpi3.bin';</code>
 +
|-
 +
|colspan="2"|<code>RPI2_DTB_FILES = 'bcm2709-rpi-2-b.dtb,bcm2709-rpi-cm2.dtb,bcm2710-rpi-2-b.dtb,bcm2710-rpi-3-b.dtb,bcm2710-rpi-3-b-plus.dtb,bcm2710-rpi-cm3.dtb,bcm2710-rpi-zero-2.dtb,bcm2710-rpi-zero-2-w.dtb';</code>
 
|-
 
|-
 
|}
 
|}
Line 345: Line 357:
 
|-
 
|-
 
| <code>Mailbox0Registers:PBCM2836Mailbox0Registers;</code>
 
| <code>Mailbox0Registers:PBCM2836Mailbox0Registers;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>Mailbox1Registers:PBCM2836Mailbox1Registers;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 359: Line 377:
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
|-
 
|-
| <code>InterruptEntries:array[0..(BCM2836_GPU_IRQ_COUNT + BCM2836_ARM_IRQ_COUNT - 1)] of TInterruptEntry;</code>
+
| <code>InterruptEntries:array[0..(BCM2836_GPU_IRQ_COUNT + BCM2836_ARM_IRQ_COUNT - 1)] of PInterruptEntry;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 365: Line 383:
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
|-
 
|-
| <code>LocalInterruptEntries:array[RPI2_IRQ_LOCAL_START..(BCM2836_IRQ_COUNT - 1),0..(RPI2_CPU_COUNT - 1)] of TInterruptEntry;</code>
+
| <code>LocalInterruptEntries:array[RPI2_IRQ_LOCAL_START..(BCM2836_IRQ_COUNT - 1),0..(RPI2_CPU_COUNT - 1)] of PInterruptEntry;</code>
 
| style="width: 40%;"|
 
| style="width: 40%;"|
 
|-
 
|-
Line 395: Line 413:
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
|-
 
|-
| <code>IRQLocalEnabled:array[0..(RPI2_CPU_COUNT - 1)] of LongWord;</code>
+
| <code>LocalIRQEnabled:array[0..(RPI2_CPU_COUNT - 1)] of LongWord;</code>
 
| style="width: 40%;"|1 group of local IRQs to Enable/Disable per CPU (See: TBCM2836ARMLocalRegisters)
 
| style="width: 40%;"|1 group of local IRQs to Enable/Disable per CPU (See: TBCM2836ARMLocalRegisters)
 
|-
 
|-
Line 401: Line 419:
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 
|-
 
|-
| <code>FIQLocalEnabled:array[0..(RPI2_CPU_COUNT - 1)] of LongWord;</code>
+
| <code>LocalFIQEnabled:array[0..(RPI2_CPU_COUNT - 1)] of LongWord;</code>
 
| style="width: 40%;"|1 group of local FIQs to Enable/Disable per CPU (See: TBCM2836ARMLocalRegisters)
 
| style="width: 40%;"|1 group of local FIQs to Enable/Disable per CPU (See: TBCM2836ARMLocalRegisters)
 
|-
 
|-
Line 760: Line 778:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2RequestExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2MailboxPropertyTag(Tag:LongWord; Data:Pointer; Size:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Request registration of the supplied handler to the specified IRQ number</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Request a property tag (Get/Set) from the mailbox property channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! CPUID
+
! Data
| CPU to route IRQ to
+
| Data does not need to include mailbox property channel header or footer. Data pointer does not need any specific alignment or caching attributes.
 
|-
 
|-
! Number
+
! Size
| IRQ number to register
+
| Size must be a multiple of 4 bytes. Size must include the size of the request and response which use the same buffer.
 
|-
 
|-
! Handler
+
|}
| Interrupt handler function to register
+
</div></div>
|-
+
<br />
! HandlerEx
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
| Extended Interrupt handler function to register
+
<pre style="border: 0; padding-bottom:0px;">function RPi2RequestExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Request registration of the supplied handler to the specified IRQ number</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
 
! Note
 
! Note
| Only one of Handler or HandlerEx can be specified
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 788: Line 809:
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
|-
 
! CPUID
 
| CPU to route IRQ to
 
|-
 
! Number
 
| IRQ number to deregister
 
|-
 
! Handler
 
| Interrupt handler function to deregister
 
|-
 
! HandlerEx
 
| Extended Interrupt handler function to deregister
 
 
|-
 
|-
 
! Note
 
! Note
| Only one of Handler or HandlerEx can be specified
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 812: Line 821:
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
|-
 
! CPUID
 
| CPU to route FIQ to
 
|-
 
! Number
 
| FIQ number to register
 
|-
 
! Handler
 
| Interrupt handler function to register
 
|-
 
! HandlerEx
 
| Extended Interrupt handler function to register
 
 
|-
 
|-
 
! Note
 
! Note
| Only one of Handler or HandlerEx can be specified
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 837: Line 834:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! CPUID
+
! Note
| CPU to route FIQ to
+
| None documented
 
|-
 
|-
! Number
+
|}
| FIQ number to deregister
+
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function RPi2RegisterInterrupt(Number,Mask,Priority,Flags:LongWord; Handler:TSharedInterruptHandler; Parameter:Pointer):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Handler
+
! Note
| Interrupt handler function to deregister
+
| None documented
 
|-
 
|-
! HandlerEx
+
|}
| Extended Interrupt handler function to deregister
+
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function RPi2DeregisterInterrupt(Number,Mask,Priority,Flags:LongWord; Handler:TSharedInterruptHandler; Parameter:Pointer):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
 
! Note
 
! Note
| Only one of Handler or HandlerEx can be specified
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 860: Line 869:
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
|-
 
! CPUID
 
| The CPU Id to register the System Call against (or CPU_ID_ALL)
 
|-
 
! Number
 
| The System Call number to be registered
 
|-
 
! Handler
 
| The handler function to be registered
 
|-
 
! HandlerEx
 
| The extended handler function to be registered
 
 
|-
 
|-
 
! Note
 
! Note
| Only one of Handler or HandlerEx can be specified
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 884: Line 881:
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
|-
 
! CPUID
 
| The CPU Id to deregister the System Call from (or CPU_ID_ALL)
 
|-
 
! Number
 
| The System Call number to be deregistered
 
|-
 
! Handler
 
| The handler function to be deregistered
 
|-
 
! HandlerEx
 
| The extended handler function to be deregistered
 
 
|-
 
|-
 
! Note
 
! Note
| Only one of Handler or HandlerEx can be specified
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 904: Line 889:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2GetInterruptEntry(Number:LongWord):TInterruptEntry;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2GetInterruptEntry(Number,Instance:LongWord; var Interrupt:TInterruptEntry):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the interrupt entry for the specified interrupt number</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the interrupt entry for the specified interrupt number and instance</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 916: Line 901:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2GetLocalInterruptEntry(CPUID,Number:LongWord):TInterruptEntry;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2GetLocalInterruptEntry(CPUID,Number,Instance:LongWord; var Interrupt:TInterruptEntry):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the local interrupt entry for the specified interrupt number</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the local interrupt entry for the specified interrupt number and instance</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 976: Line 961:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2CPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2CPUGetMemory(var Address:PtrUInt; var Length:UInt64):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the CPU Memory from the Mailbox property tags channel</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the CPU Memory from the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
Line 1,000: Line 985:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2GPUGetMemory(var Address:PtrUInt; var Length:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2GPUGetMemory(var Address:PtrUInt; var Length:UInt64):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the GPU Memory from the Mailbox property tags channel</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the GPU Memory from the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
Line 1,062: Line 1,047:
 
<pre style="border: 0; padding-bottom:0px;">function RPi2FirmwareGetRevision:LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function RPi2FirmwareGetRevision:LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Firmware Revision from the Mailbox property tags channel</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Firmware Revision from the Mailbox property tags channel</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function RPi2FirmwareGetThrottled:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Firmware Throttling state from the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 1,722: Line 1,719:
 
<pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferTestPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferTestPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Test Framebuffer Palette from the Mailbox property tags channel</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Test Framebuffer Palette from the Mailbox property tags channel</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferGetLayer(var Layer:LongInt):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get Framebuffer Layer from the Mailbox property tags channel</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferSetLayer(var Layer:LongInt):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Framebuffer Layer from the Mailbox property tags channel</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferTestLayer(var Layer:LongInt):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Test Framebuffer Layer from the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 1,768: Line 1,801:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2TouchGetBuffer(var Address:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferGetNumDisplays(var NumDisplays:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Touchscreen buffer from the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the number of displays from the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
 
! Note
 
! Note
| On current firmware versions calling TouchGetBuffer will allocate a buffer from GPU memory and render subsequent calls to TouchSetBuffer ineffective. After an initial call to TouchSetBuffer calls to TouchGetBuffer will always return the CPU allocated buffer.
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,780: Line 1,813:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2TouchSetBuffer(Address:PtrUInt):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferGetDisplayId(DisplayNum:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the Touchscreen buffer in the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the display id for the specified display number from the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 1,792: Line 1,825:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2VirtualGPIOGetBuffer(var Address:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferSetDisplayNum(DisplayNum:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Virtual GPIO buffer from the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the display number that all framebuffer requests will refer to using the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 1,804: Line 1,837:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2VirtualGPIOSetBuffer(Address:PtrUInt):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferGetDisplaySettings(DisplayNum:LongWord; var DisplaySettings:TDisplaySettings):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the Virtual GPIO buffer in the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the display settings for the specified display number from the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 1,816: Line 1,849:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2CursorSetDefault:LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferDisplayIdToName(DisplayId:LongWord):String;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Cursor Default (Pixels) from the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the name for the specified display id</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 1,828: Line 1,861:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2CursorSetInfo(Width,Height,HotspotX,HotspotY:LongWord; Pixels:Pointer; Length:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2TouchGetBuffer(var Address:PtrUInt):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Cursor Info (Pixels) from the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Touchscreen buffer from the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
 
! Note
 
! Note
| None documented
+
| On current firmware versions calling TouchGetBuffer will allocate a buffer from GPU memory and render subsequent calls to TouchSetBuffer ineffective. After an initial call to TouchSetBuffer calls to TouchGetBuffer will always return the CPU allocated buffer.
 
|-
 
|-
 
|}
 
|}
Line 1,840: Line 1,873:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2CursorSetState(Enabled:Boolean; X,Y:LongWord; Relative:Boolean):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2TouchSetBuffer(Address:PtrUInt):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Cursor State (Enable, X, Y) from the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the Touchscreen buffer in the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Relative
+
! Note
| X, Y is relative to Display (Virtual) not Framebuffer (Physical).
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 1,852: Line 1,885:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2DMAGetChannels:LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2VirtualGPIOGetBuffer(var Address:PtrUInt):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the available DMA Channels from the Mailbox property tags channel</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the Virtual GPIO buffer from the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 1,864: Line 1,897:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2VirtualGPIOAllocate:Boolean;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2VirtualGPIOSetBuffer(Address:PtrUInt):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate the Virtual GPIO buffer either from memory or from the firmware</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the Virtual GPIO buffer in the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 1,876: Line 1,909:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2VirtualGPIOInputGet(Pin:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2CursorSetDefault:LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Cursor Default (Pixels) from the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 1,888: Line 1,921:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2VirtualGPIOOutputSet(Pin,Level:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2CursorSetInfo(Width,Height,HotspotX,HotspotY:LongWord; Pixels:Pointer; Length:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Cursor Info (Pixels) from the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 1,900: Line 1,933:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2VirtualGPIOFunctionSelect(Pin,Mode:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2CursorSetState(Enabled:Boolean; X,Y:LongWord; Relative:Boolean):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set Cursor State (Enable, X, Y) from the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! Note
+
! Relative
| None documented
+
| X, Y is relative to Display (Virtual) not Framebuffer (Physical).
 
|-
 
|-
 
|}
 
|}
 
</div></div>
 
</div></div>
 
<br />
 
<br />
 
'''RPi2 thread functions'''
 
 
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">procedure RPi2SchedulerInit;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2DMAGetChannels:LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the scheduler interrupt on the boot CPU</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the available DMA Channels from the Mailbox property tags channel</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 1,927: Line 1,957:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">procedure RPi2SchedulerStart(CPUID:LongWord);</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2VirtualGPIOAllocate:Boolean;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the scheduler interrupt on the specified secondary CPU</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Allocate the Virtual GPIO buffer either from memory or from the firmware</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 1,939: Line 1,969:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">procedure RPi2SecondaryBoot(CPUID:LongWord);</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2VirtualGPIOInputGet(Pin:LongWord):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
Line 1,950: Line 1,980:
 
</div></div>
 
</div></div>
 
<br />
 
<br />
 
'''RPi2 IRQ functions'''
 
 
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2DispatchIRQ(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2VirtualGPIOOutputSet(Pin,Level:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Process any pending IRQ requests</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
 
! Note
 
! Note
| Called by ARMv7IRQHandler in PlatformARMv7
+
| None documented
A DataMemoryBarrier is executed before and after calling this function
+
 
|-
 
|-
 
|}
 
|}
Line 1,967: Line 1,993:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2HandleIRQ(Number,CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2VirtualGPIOFunctionSelect(Pin,Mode:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Call the handler function for an IRQ that was received, or halt if it doesn't exist</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 1,979: Line 2,005:
 
<br />
 
<br />
  
'''RPi2 FIQ functions'''
+
'''RPi2 thread functions'''
  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2DispatchFIQ(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure RPi2SchedulerInit;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Process any pending FIQ requests</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the scheduler interrupt on the boot CPU</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
 
! Note
 
! Note
| Called by ARMv7FIQHandler in PlatformARMv7
+
| None documented
A DataMemoryBarrier is executed before and after calling this function
+
 
|-
 
|-
 
|}
 
|}
Line 1,995: Line 2,020:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2HandleFIQ(Number,CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure RPi2SchedulerStart(CPUID:LongWord);</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Call the handler function for an FIQ that was received, or halt if it doesn't exist</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the scheduler interrupt on the specified secondary CPU</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 2,006: Line 2,031:
 
</div></div>
 
</div></div>
 
<br />
 
<br />
 
'''RPi2 SWI functions'''
 
 
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2DispatchSWI(CPUID:LongWord; Thread:TThreadHandle; Request:PSystemCallRequest):TThreadHandle;</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure RPi2SecondaryBoot(CPUID:LongWord);</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Process an SWI request</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
 
! Note
 
! Note
| Called by ARMv7SoftwareInterruptHandler in PlatformARMv7
+
| None documented
A DataMemoryBarrier is executed before and after calling this function
+
 
|-
 
|-
 
|}
 
|}
Line 2,146: Line 2,167:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address,Size,Flags:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address:PtrUInt; Size,Flags:LongWord):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
Line 2,169: Line 2,190:
 
</div></div>
 
</div></div>
 
<br />
 
<br />
 +
 +
'''RPi2 helper functions'''
 +
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function RPi2FramebufferDeviceSetProperties(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure RPi2Wait; assembler; nostackframe;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
Line 2,181: Line 2,205:
 
</div></div>
 
</div></div>
 
<br />
 
<br />
 
'''RPi2 helper functions'''
 
 
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">procedure RPi2Wait; assembler; nostackframe;</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure RPi2LongWait; assembler; nostackframe;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
Line 2,197: Line 2,218:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">procedure RPi2LongWait; assembler; nostackframe;</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure RPi2ShortWait; assembler; nostackframe;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
Line 2,209: Line 2,230:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">procedure RPi2ShortWait; assembler; nostackframe;</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure RPi2SlowBlink; assembler; nostackframe;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
Line 2,221: Line 2,242:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">procedure RPi2SlowBlink; assembler; nostackframe;</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure RPi2FastBlink; assembler; nostackframe;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
Line 2,233: Line 2,254:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">procedure RPi2FastBlink; assembler; nostackframe;</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure RPi2BootBlink; assembler; nostackframe;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Blink the Activity LED without dependency on any other RTL setup</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure RPi2BootOutput(Value:LongWord);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Output characters to UART0 without dependency on any other RTL setup</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| This function is primarily intended for testing QEMU boot because it doesn't initialize the UART and won't work on real hardware.
 +
Based on hexstrings() function by dwelch67 (https://github.com/dwelch67)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure RPi2BootConsoleStart;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
Line 2,245: Line 2,291:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">procedure RPi2BootBlink; assembler; nostackframe;</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure RPi2BootConsoleWrite(const Value:String);</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Blink the Activity LED without dependency on any other RTL setup</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure RPi2BootConsoleWriteEx(const Value:String; X,Y:LongWord);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function RPi2BootConsoleGetX:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function RPi2BootConsoleGetY:LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"

Latest revision as of 05:09, 23 November 2022

Return to Unit Reference


Description


Ultibo Platform Interface unit for Raspberry Pi 2

The RPi2 B has the Power LED connected to GPIO Pin 35 (Activity LED is now on GPIO Pin 47).

The RPi3 B has the Activity LED connected to the GPU, access is via a Virtual GPIO (Power LED is only accessible via the GPIO expander driver).

The RPi3 B+ has the Activity LED connected to GPIO Pin 29 (Power LED is only accessible via the GPIO expander driver).

The RPi Zero2W has the Activity LED connected to GPIO Pin 29.

Constants



[Expand]
RPi2 ARM physical to VC IO mapping RPI2_VCIO_*


[Expand]
RPi2 ARM physical to VC bus mapping RPI2_VCBUS_*


[Expand]
RPi2 secure world boot RPI2_SECURE_*


[Expand]
RPi2 address of StartupHandler on reset RPI2_STARTUP_*


[Expand]
RPi2 page table address and size RPI2_PAGE_TABLE_*


[Expand]
RPi2 vector table address and size RPI2_VECTOR_TABLE_*


[Expand]
RPi2 CPU count RPI2_CPU_*


[Expand]
RPi2 IRQ/FIQ start/routing RPI2_IRQ_*, RPI2_FIQ_*


[Expand]
RPi2 SWI RPI2_SWI_*


[Expand]
RPi2 core timer prescaler RPI2_*_TIMER_*


[Expand]
RPi2 kernel image name RPI2_KERNEL_*


[Expand]
RPi2 GPIO power LED RPI2_GPIO_PWRLED_*


[Expand]
RPi2 GPIO activity LED RPI2_GPIO_ACTLED_*


[Expand]
RPi2 mailbox RPI2_MAILBOX_*


[Expand]
RPi2 local mailbox RPI2_LOCAL_MAILBOX_*


[Expand]
RPi2 framebuffer RPI2_FRAMEBUFFER_*


Type definitions


None defined

Public variables



RPi2 specific Ultibo variables

RPi2Initialized:Boolean;
RPi2CNTVOFFLow:LongWord = 0; The low 32 bits of the Virtual Counter Offset register at boot time (CPU0 only) (Set by Startup). Must be initialized to remain in .data or else rewritten to zero with .bss
RPi2CNTVOFFHigh:LongWord = 0; The high 32 bits of the Virtual Counter Offset register at boot time (CPU0 only) (Set by Startup). Must be initialized to remain in .data or else rewritten to zero with .bss

Timer variables

TimerRegisters:PBCM2836SystemTimerRegisters;

Mailbox variables

Mailbox0Registers:PBCM2836Mailbox0Registers;
Mailbox1Registers:PBCM2836Mailbox1Registers;

Interrupt variables

InterruptRegisters:PBCM2836InterruptRegisters;
InterruptEntries:array[0..(BCM2836_GPU_IRQ_COUNT + BCM2836_ARM_IRQ_COUNT - 1)] of PInterruptEntry;
LocalInterruptEntries:array[RPI2_IRQ_LOCAL_START..(BCM2836_IRQ_COUNT - 1),0..(RPI2_CPU_COUNT - 1)] of PInterruptEntry;

System call

SystemCallEntries:array[0..RPI2_SWI_COUNT - 1] of TSystemCallEntry;

IRQ/FIQ

IRQEnabled:array[0..2] of LongWord; 3 groups of IRQs to Enable/Disable (See: TBCM2836InterruptRegisters)
FIQEnabled:LongWord; The single IRQ number to Enable as FIQ instead (See: TBCM2836InterruptRegisters)
LocalIRQEnabled:array[0..(RPI2_CPU_COUNT - 1)] of LongWord; 1 group of local IRQs to Enable/Disable per CPU (See: TBCM2836ARMLocalRegisters)
LocalFIQEnabled:array[0..(RPI2_CPU_COUNT - 1)] of LongWord; 1 group of local FIQs to Enable/Disable per CPU (See: TBCM2836ARMLocalRegisters)

Watchdog variables

WatchdogRegisters:PBCM2836PMWatchdogRegisters;

ARM local

ARMLocalRegisters:PBCM2836ARMLocalRegisters;

Virtual GPIO

VirtualGPIOBuffer:TBCM2837VirtualGPIOBuffer;


Function declarations



Initialization functions

[Expand]
procedure RPi2Init;
Description: To be documented


[Expand]
procedure RPi2SecondarySwitch; assembler; nostackframe;
Description: Secondary CPU switch from HYP mode handler


[Expand]
procedure RPi2SecondarySecure; assembler; nostackframe;
Description: Secondary CPU switch to secure mode handler


[Expand]
procedure RPi2SecondaryHandler; assembler; nostackframe;
Description: Secondary CPU startup handler routine


RPi2 platform functions

[Expand]
procedure RPi2SMPInit;
Description: To be documented


[Expand]
procedure RPi2BoardInit;
Description: To be documented


[Expand]
procedure RPi2MemoryInit;
Description: To be documented


[Expand]
procedure RPi2ClockInit;
Description: To be documented


[Expand]
procedure RPi2PowerInit;
Description: To be documented


[Expand]
procedure RPi2MailboxInit;
Description: To be documented


[Expand]
procedure RPi2InterruptInit;
Description: To be documented


[Expand]
procedure RPi2PeripheralInit;
Description: To be documented


[Expand]
procedure RPi2FramebufferInit;
Description: To be documented


[Expand]
procedure RPi2PageTableInit;
Description: Initialize the Hardware Page Tables before enabling the MMU


[Expand]
procedure RPi2PowerLEDEnable;
Description: To be documented


[Expand]
procedure RPi2PowerLEDOn;
Description: To be documented


[Expand]
procedure RPi2PowerLEDOff;
Description: To be documented


[Expand]
procedure RPi2ActivityLEDEnable;
Description: To be documented


[Expand]
procedure RPi2ActivityLEDOn;
Description: To be documented


[Expand]
procedure RPi2ActivityLEDOff;
Description: To be documented


[Expand]
function RPi2MailboxReceive(Mailbox,Channel:LongWord):LongWord;
Description: Receive from specified mailbox on specified channel


[Expand]
procedure RPi2MailboxSend(Mailbox,Channel,Data:LongWord);
Description: Send to specified mailbox on specified channel


[Expand]
function RPi2MailboxCall(Mailbox,Channel,Data:LongWord; var Response:LongWord):LongWord;
Description: Perform a transaction (Send/Receive) to specified mailbox on specified channel


[Expand]
function RPi2MailboxCallEx(Mailbox,Channel,Data:LongWord; var Response:LongWord; Timeout:LongWord):LongWord;
Description: Perform a transaction (Send/Receive) to specified mailbox on specified channel


[Expand]
function RPi2MailboxPropertyCall(Mailbox,Channel:LongWord; Data:Pointer; var Response:LongWord):LongWord;
Description: Perform a property tag transaction (Send/Receive) to specified mailbox on specified channel


[Expand]
function RPi2MailboxPropertyCallEx(Mailbox,Channel:LongWord; Data:Pointer; var Response:LongWord; Timeout:LongWord):LongWord;
Description: Perform a property tag transaction (Send/Receive) to specified mailbox on specified channel


[Expand]
function RPi2MailboxPropertyTag(Tag:LongWord; Data:Pointer; Size:LongWord):LongWord;
Description: Request a property tag (Get/Set) from the mailbox property channel


[Expand]
function RPi2RequestExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
Description: Request registration of the supplied handler to the specified IRQ number


[Expand]
function RPi2ReleaseExIRQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
Description: Request deregistration of the supplied handler from the specified IRQ number


[Expand]
function RPi2RequestExFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
Description: Request registration of the supplied handler to the specified FIQ number


[Expand]
function RPi2ReleaseExFIQ(CPUID,Number:LongWord; Handler:TInterruptHandler; HandlerEx:TInterruptExHandler; Parameter:Pointer):LongWord;
Description: Request deregistration of the supplied handler from the specified FIQ number


[Expand]
function RPi2RegisterInterrupt(Number,Mask,Priority,Flags:LongWord; Handler:TSharedInterruptHandler; Parameter:Pointer):LongWord;
Description: To be documented


[Expand]
function RPi2DeregisterInterrupt(Number,Mask,Priority,Flags:LongWord; Handler:TSharedInterruptHandler; Parameter:Pointer):LongWord;
Description: To be documented


[Expand]
function RPi2RegisterSystemCallEx(CPUID,Number:LongWord; Handler:TSystemCallHandler; HandlerEx:TSystemCallExHandler):LongWord;
Description: Request registration of the supplied extended handler to the specified System Call number


[Expand]
function RPi2DeregisterSystemCallEx(CPUID,Number:LongWord; Handler:TSystemCallHandler; HandlerEx:TSystemCallExHandler):LongWord;
Description: Request deregistration of the supplied extended handler from the specified System Call number


[Expand]
function RPi2GetInterruptEntry(Number,Instance:LongWord; var Interrupt:TInterruptEntry):LongWord;
Description: Get the interrupt entry for the specified interrupt number and instance


[Expand]
function RPi2GetLocalInterruptEntry(CPUID,Number,Instance:LongWord; var Interrupt:TInterruptEntry):LongWord;
Description: Get the local interrupt entry for the specified interrupt number and instance


[Expand]
function RPi2GetSystemCallEntry(Number:LongWord):TSystemCallEntry;
Description: Get the system call entry for the specified system call number


[Expand]
function RPi2SystemRestart(Delay:LongWord):LongWord;
Description: To be documented


[Expand]
function RPi2SystemShutdown(Delay:LongWord):LongWord;
Description: To be documented


[Expand]
function RPi2SystemGetCommandLine:String;
Description: Get the Command Line from the Mailbox property tags channel


[Expand]
function RPi2CPUGetMemory(var Address:PtrUInt; var Length:UInt64):LongWord;
Description: Get the CPU Memory from the Mailbox property tags channel


[Expand]
function RPi2GPUGetState:LongWord;
Description: To be documented


[Expand]
function RPi2GPUGetMemory(var Address:PtrUInt; var Length:UInt64):LongWord;
Description: Get the GPU Memory from the Mailbox property tags channel


[Expand]
function RPi2BoardGetModel:LongWord;
Description: Get the Board Model from the Mailbox property tags channel


[Expand]
function RPi2BoardGetSerial:Int64;
Description: Get the Board Serial from the Mailbox property tags channel


[Expand]
function RPi2BoardGetRevision:LongWord;
Description: Get the Board Revision from the Mailbox property tags channel


[Expand]
function RPi2BoardGetMACAddress:String;
Description: Get the Board MAC Address from the Mailbox property tags channel


[Expand]
function RPi2FirmwareGetRevision:LongWord;
Description: Get the Firmware Revision from the Mailbox property tags channel


[Expand]
function RPi2FirmwareGetThrottled:LongWord;
Description: Get the Firmware Throttling state from the Mailbox property tags channel


[Expand]
function RPi2PowerGetWait(PowerId:LongWord):LongWord;
Description: Get the Power Wait from the Mailbox property tags channel


[Expand]
function RPi2PowerGetState(PowerId:LongWord):LongWord;
Description: Get the Power State from the Mailbox property tags channel


[Expand]
function RPi2PowerSetState(PowerId,State:LongWord; Wait:Boolean):LongWord;
Description: Set the Power State in the Mailbox property tags channel


[Expand]
function RPi2ClockGetCount:LongWord;
Description: Gets the current system clock count (32 least significant bits of total)


[Expand]
function RPi2ClockGetTotal:Int64;
Description: Gets the total system clock count


[Expand]
function RPi2ClockGetRate(ClockId:LongWord):LongWord;
Description: Get the Clock Rate from the Mailbox property tags channel


[Expand]
function RPi2ClockSetRate(ClockId,Rate:LongWord; Turbo:Boolean):LongWord;
Description: Set the Clock Rate in the Mailbox property tags channel


[Expand]
function RPi2ClockGetState(ClockId:LongWord):LongWord;
Description: Get the Clock State from the Mailbox property tags channel


[Expand]
function RPi2ClockSetState(ClockId,State:LongWord):LongWord;
Description: Set the Clock State in the Mailbox property tags channel


[Expand]
function RPi2ClockGetMinRate(ClockId:LongWord):LongWord;
Description: Get the Clock Min Rate from the Mailbox property tags channel


[Expand]
function RPi2ClockGetMaxRate(ClockId:LongWord):LongWord;
Description: Get the Clock Max Rate from the Mailbox property tags channel


[Expand]
function RPi2TurboGetState(TurboId:LongWord):LongWord;
Description: Get the Turbo State from the Mailbox property tags channel


[Expand]
function RPi2TurboSetState(TurboId,State:LongWord):LongWord;
Description: Set the Turbo State in the Mailbox property tags channel


[Expand]
function RPi2VoltageGetValue(VoltageId:LongWord):LongWord;
Description: Get the Voltage Value from the Mailbox property tags channel


[Expand]
function RPi2VoltageSetValue(VoltageId,Value:LongWord):LongWord;
Description: Set the Voltage Value in the Mailbox property tags channel


[Expand]
function RPi2VoltageGetMinValue(VoltageId:LongWord):LongWord;
Description: Get the Voltage Min Value from the Mailbox property tags channel


[Expand]
function RPi2VoltageGetMaxValue(VoltageId:LongWord):LongWord;
Description: Get the Voltage Max Value from the Mailbox property tags channel


[Expand]
function RPi2TemperatureGetCurrent(TemperatureId:LongWord):LongWord;
Description: Get the Temperature Current from the Mailbox property tags channel


[Expand]
function RPi2TemperatureGetMaximum(TemperatureId:LongWord):LongWord;
Description: Get the Temperature Maximum Model from the Mailbox property tags channel


[Expand]
function RPi2GPUMemoryAllocate(Length,Alignment,Flags:LongWord):THandle;
Description: Allocate GPU Memory from the Mailbox property tags channel


[Expand]
function RPi2GPUMemoryRelease(Handle:THandle):LongWord;
Description: Release GPU Memory from the Mailbox property tags channel


[Expand]
function RPi2GPUMemoryLock(Handle:THandle):LongWord;
Description: Lock GPU Memory from the Mailbox property tags channel


[Expand]
function RPi2GPUMemoryUnlock(Handle:THandle):LongWord;
Description: Unlock GPU Memory from the Mailbox property tags channel


[Expand]
function RPi2GPUExecuteCode(Address:Pointer; R0,R1,R2,R3,R4,R5:LongWord):LongWord;
Description: Execute GPU Code from the Mailbox property tags channel


[Expand]
function RPi2DispmanxHandleGet(Resource:THandle):THandle;
Description: Get Dispmanx Memory Handle from the Mailbox property tags channel


[Expand]
function RPi2EDIDBlockGet(Block:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Description: Get EDID Block from the Mailbox property tags channel


[Expand]
function RPi2FramebufferAllocate(Alignment:LongWord; var Address,Length:LongWord):LongWord;
Description: Allocate Framebuffer from the Mailbox property tags channel


[Expand]
function RPi2FramebufferRelease:LongWord;
Description: Release Framebuffer from the Mailbox property tags channel


[Expand]
function RPi2FramebufferSetState(State:LongWord):LongWord;
Description: Set Framebuffer State (Blank Screen) from the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetDimensions(var Width,Height,Top,Bottom,Left,Right:LongWord):LongWord;
Description: Get Framebuffer Dimensions from the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetPhysical(var Width,Height:LongWord):LongWord;
Description: Get Framebuffer Physical size from the Mailbox property tags channel


[Expand]
function RPi2FramebufferSetPhysical(var Width,Height:LongWord):LongWord;
Description: Set Framebuffer Physical size from the Mailbox property tags channel


[Expand]
function RPi2FramebufferTestPhysical(var Width,Height:LongWord):LongWord;
Description: Test Framebuffer Physical size from the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetVirtual(var Width,Height:LongWord):LongWord;
Description: Get Framebuffer Virtual size from the Mailbox property tags channel


[Expand]
function RPi2FramebufferSetVirtual(var Width,Height:LongWord):LongWord;
Description: Set Framebuffer Virtual size from the Mailbox property tags channel


[Expand]
function RPi2FramebufferTestVirtual(var Width,Height:LongWord):LongWord;
Description: Test Framebuffer Virtual size from the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetDepth(var Depth:LongWord):LongWord;
Description: Get Framebuffer Depth (Bits per pixel) from the Mailbox property tags channel


[Expand]
function RPi2FramebufferSetDepth(var Depth:LongWord):LongWord;
Description: Set Framebuffer Depth (Bits per pixel) from the Mailbox property tags channel


[Expand]
function RPi2FramebufferTestDepth(var Depth:LongWord):LongWord;
Description: Test Framebuffer Depth (Bits per pixel) from the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetPixelOrder(var Order:LongWord):LongWord;
Description: Get Framebuffer Pixel Order (RGB) from the Mailbox property tags channel


[Expand]
function RPi2FramebufferSetPixelOrder(var Order:LongWord):LongWord;
Description: Set Framebuffer Pixel Order (RGB) from the Mailbox property tags channel


[Expand]
function RPi2FramebufferTestPixelOrder(var Order:LongWord):LongWord;
Description: Test Framebuffer Pixel Order (RGB) from the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetAlphaMode(var Mode:LongWord):LongWord;
Description: Get Framebuffer Alpha Mode from the Mailbox property tags channel


[Expand]
function RPi2FramebufferSetAlphaMode(var Mode:LongWord):LongWord;
Description: Set Framebuffer Alpha Mode from the Mailbox property tags channel


[Expand]
function RPi2FramebufferTestAlphaMode(var Mode:LongWord):LongWord;
Description: Test Framebuffer Alpha Mode from the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetPitch:LongWord;
Description: Get Framebuffer Pitch (Bytes per line) from the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetOffset(var X,Y:LongWord):LongWord;
Description: Get Framebuffer Virtual Offset from the Mailbox property tags channel


[Expand]
function RPi2FramebufferSetOffset(var X,Y:LongWord):LongWord;
Description: Set Framebuffer Virtual Offset from the Mailbox property tags channel


[Expand]
function RPi2FramebufferTestOffset(var X,Y:LongWord):LongWord;
Description: Test Framebuffer Virtual Offset from the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Description: Get Framebuffer Overscan from the Mailbox property tags channel


[Expand]
function RPi2FramebufferSetOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Description: Set Framebuffer Overscan from the Mailbox property tags channel


[Expand]
function RPi2FramebufferTestOverscan(var Top,Bottom,Left,Right:LongWord):LongWord;
Description: Test Framebuffer Overscan from the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetPalette(Buffer:Pointer; Length:LongWord):LongWord;
Description: Get Framebuffer Palette from the Mailbox property tags channel


[Expand]
function RPi2FramebufferSetPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Description: Set Framebuffer Palette from the Mailbox property tags channel


[Expand]
function RPi2FramebufferTestPalette(Start,Count:LongWord; Buffer:Pointer; Length:LongWord):LongWord;
Description: Test Framebuffer Palette from the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetLayer(var Layer:LongInt):LongWord;
Description: Get Framebuffer Layer from the Mailbox property tags channel


[Expand]
function RPi2FramebufferSetLayer(var Layer:LongInt):LongWord;
Description: Set Framebuffer Layer from the Mailbox property tags channel


[Expand]
function RPi2FramebufferTestLayer(var Layer:LongInt):LongWord;
Description: Test Framebuffer Layer from the Mailbox property tags channel


[Expand]
function RPi2FramebufferTestVsync:LongWord;
Description: Test Framebuffer Vertical Sync from the Mailbox property tags channel


[Expand]
function RPi2FramebufferSetVsync:LongWord;
Description: Set Framebuffer Vertical Sync from the Mailbox property tags channel


[Expand]
function RPi2FramebufferSetBacklight(Brightness:LongWord):LongWord;
Description: Set Framebuffer Backlight Brightness from the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetNumDisplays(var NumDisplays:LongWord):LongWord;
Description: Get the number of displays from the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetDisplayId(DisplayNum:LongWord):LongWord;
Description: Get the display id for the specified display number from the Mailbox property tags channel


[Expand]
function RPi2FramebufferSetDisplayNum(DisplayNum:LongWord):LongWord;
Description: Get the display number that all framebuffer requests will refer to using the Mailbox property tags channel


[Expand]
function RPi2FramebufferGetDisplaySettings(DisplayNum:LongWord; var DisplaySettings:TDisplaySettings):LongWord;
Description: Get the display settings for the specified display number from the Mailbox property tags channel


[Expand]
function RPi2FramebufferDisplayIdToName(DisplayId:LongWord):String;
Description: Get the name for the specified display id


[Expand]
function RPi2TouchGetBuffer(var Address:PtrUInt):LongWord;
Description: Get the Touchscreen buffer from the Mailbox property tags channel


[Expand]
function RPi2TouchSetBuffer(Address:PtrUInt):LongWord;
Description: Set the Touchscreen buffer in the Mailbox property tags channel


[Expand]
function RPi2VirtualGPIOGetBuffer(var Address:PtrUInt):LongWord;
Description: Get the Virtual GPIO buffer from the Mailbox property tags channel


[Expand]
function RPi2VirtualGPIOSetBuffer(Address:PtrUInt):LongWord;
Description: Set the Virtual GPIO buffer in the Mailbox property tags channel


[Expand]
function RPi2CursorSetDefault:LongWord;
Description: Set Cursor Default (Pixels) from the Mailbox property tags channel


[Expand]
function RPi2CursorSetInfo(Width,Height,HotspotX,HotspotY:LongWord; Pixels:Pointer; Length:LongWord):LongWord;
Description: Set Cursor Info (Pixels) from the Mailbox property tags channel


[Expand]
function RPi2CursorSetState(Enabled:Boolean; X,Y:LongWord; Relative:Boolean):LongWord;
Description: Set Cursor State (Enable, X, Y) from the Mailbox property tags channel


[Expand]
function RPi2DMAGetChannels:LongWord;
Description: Get the available DMA Channels from the Mailbox property tags channel


[Expand]
function RPi2VirtualGPIOAllocate:Boolean;
Description: Allocate the Virtual GPIO buffer either from memory or from the firmware


[Expand]
function RPi2VirtualGPIOInputGet(Pin:LongWord):LongWord;
Description: To be documented


[Expand]
function RPi2VirtualGPIOOutputSet(Pin,Level:LongWord):LongWord;
Description: To be documented


[Expand]
function RPi2VirtualGPIOFunctionSelect(Pin,Mode:LongWord):LongWord;
Description: To be documented


RPi2 thread functions

[Expand]
procedure RPi2SchedulerInit;
Description: Initialize the scheduler interrupt on the boot CPU


[Expand]
procedure RPi2SchedulerStart(CPUID:LongWord);
Description: Initialize the scheduler interrupt on the specified secondary CPU


[Expand]
procedure RPi2SecondaryBoot(CPUID:LongWord);
Description: To be documented


RPi2 clock functions

[Expand]
procedure RPi2ClockInterrupt(Parameter:Pointer);
Description: Interrupt handler function for the clock interrupt


[Expand]
procedure RPi2ClockUpdate(Cycles:LongWord; var Last:LongWord);
Description: Setup a clock interrupt to trigger after the specified number of clock cycles


RPi2 scheduler functions

[Expand]
function RPi2SchedulerInterrupt(CPUID:LongWord; Thread:TThreadHandle; Parameter:Pointer):TThreadHandle;
Description: Interrupt handler function for the scheduler interrupt


[Expand]
procedure RPi2SchedulerUpdate(Cycles:LongWord; var Last:LongWord);
Description: Setup a scheduler interrupt to trigger after the specified number of clock cycles


[Expand]
procedure RPi2SchedulerSystemCall(Request:PSystemCallRequest);
Description: System Call handler for the scheduler


RPi2 framebuffer functions

[Expand]
function RPi2FramebufferDeviceAllocate(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Allocate a framebuffer using the Mailbox Property Tags


[Expand]
function RPi2FramebufferDeviceAllocateAlt(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Allocate a framebuffer using a simple Mailbox Call


[Expand]
function RPi2FramebufferDeviceRelease(Framebuffer:PFramebufferDevice):LongWord;
Description: To be documented


[Expand]
function RPi2FramebufferDeviceBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;
Description: To be documented


[Expand]
function RPi2FramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address:PtrUInt; Size,Flags:LongWord):LongWord;
Description: To be documented


[Expand]
function RPi2FramebufferDeviceSetBacklight(Framebuffer:PFramebufferDevice; Brightness:LongWord):LongWord;
Description: To be documented


RPi2 helper functions

[Expand]
procedure RPi2Wait; assembler; nostackframe;
Description: To be documented


[Expand]
procedure RPi2LongWait; assembler; nostackframe;
Description: To be documented


[Expand]
procedure RPi2ShortWait; assembler; nostackframe;
Description: To be documented


[Expand]
procedure RPi2SlowBlink; assembler; nostackframe;
Description: To be documented


[Expand]
procedure RPi2FastBlink; assembler; nostackframe;
Description: To be documented


[Expand]
procedure RPi2BootBlink; assembler; nostackframe;
Description: Blink the Activity LED without dependency on any other RTL setup


[Expand]
procedure RPi2BootOutput(Value:LongWord);
Description: Output characters to UART0 without dependency on any other RTL setup


[Expand]
procedure RPi2BootConsoleStart;
Description: To be documented


[Expand]
procedure RPi2BootConsoleWrite(const Value:String);
Description: To be documented


[Expand]
procedure RPi2BootConsoleWriteEx(const Value:String; X,Y:LongWord);
Description: To be documented


[Expand]
function RPi2BootConsoleGetX:LongWord;
Description: To be documented


[Expand]
function RPi2BootConsoleGetY:LongWord;
Description: To be documented


[Expand]
function RPi2ConvertPowerIdRequest(PowerId:LongWord):LongWord;
Description: Convert Ultibo Power Id to BCM2836 Power Id


[Expand]
function RPi2ConvertPowerStateRequest(PowerState:LongWord):LongWord;
Description: Convert Ultibo Power State to BCM2836 Power State


[Expand]
function RPi2ConvertPowerStateResponse(PowerState:LongWord):LongWord;
Description: Convert BCM2836 Power State to Ultibo Power State


[Expand]
function RPi2ConvertClockIdRequest(ClockId:LongWord):LongWord;
Description: Convert Ultibo Clock Id to BCM2836 Clock Id


[Expand]
function RPi2ConvertClockStateRequest(ClockState:LongWord):LongWord;
Description: Convert Ultibo Clock State to BCM2836 Clock State


[Expand]
function RPi2ConvertClockStateResponse(ClockState:LongWord):LongWord;
Description: Convert BCM2836 Clock State to Ultibo Clock State


[Expand]
function RPi2ConvertVoltageIdRequest(VoltageId:LongWord):LongWord;
Description: Convert Ultibo Voltage Id to BCM2836 Voltage Id


[Expand]
function RPi2ConvertTemperatureIdRequest(TemperatureId:LongWord):LongWord;
Description: Convert Ultibo Temperature Id to BCM2836 Temperature Id


Return to Unit Reference