Difference between revisions of "Unit PlatformQEMUVPB"

From Ultibo.org
Jump to: navigation, search
Line 107: Line 107:
 
----
 
----
  
''To be documented''
+
 
 +
'''PL110 CLCD registers'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PPL110CLCDRegisters = ^TPL110CLCDRegisters;</code>
 +
 
 +
<code>TPL110CLCDRegisters = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Layout of the PL110 registers (See: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0161e/I913915.html)
 +
|-
 +
| <code>TIMING0:LongWord;</code>
 +
| Horizontal Axis Panel Control Register
 +
|-
 +
| <code>TIMING1:LongWord;</code>
 +
| Vertical Axis Panel Control Register
 +
|-
 +
| <code>TIMING2:LongWord;</code>
 +
| Clock and Signal Polarity Control Register
 +
|-
 +
| <code>TIMING3:LongWord;</code>
 +
| Line End Control Register
 +
|-
 +
| <code>UPBASE:LongWord;</code>
 +
| Upper Panel Frame Base Address Registers
 +
|-
 +
| <code>LPBASE:LongWord;</code>
 +
| Lower Panel Frame Base Address Registers
 +
|-
 +
| <code>CONTROL:LongWord;</code>
 +
| Control Register Note: Reversed in VersatilePB implementation, 0x0000001c in PL110 TRM
 +
|-
 +
| <code>IMSC:LongWord;</code>
 +
| Interrupt Mask Set/Clear Register Note: Reversed in VersatilePB implementation, 0x00000018 in PL110 TRM
 +
|-
 +
| <code>RIS:LongWord;</code>
 +
| Raw Interrupt Status Register
 +
|-
 +
| <code>MIS:LongWord;</code>
 +
| Masked Interrupt Status Register
 +
|-
 +
| <code>ICR:LongWord;</code>
 +
| Interrupt Clear Register
 +
|-
 +
| <code>UPCURR:LongWord;</code>
 +
| Upper Panel Current Address Value Registers
 +
|-
 +
| <code>LPCURR:LongWord;</code>
 +
| Lower Panel Current Address Value Registers
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''PL110 framebuffer''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PPL110Framebuffer = ^TPL110Framebuffer;</code>
 +
 
 +
<code>TPL110Framebuffer = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''Framebuffer Properties''
 +
|-
 +
| <code>Framebuffer:TFramebufferDevice;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''PL110 Properties''
 +
|-
 +
| <code>Mode:LongWord;</code>
 +
| PL110 framebuffer mode (eg PL110_MODE_TFT)
 +
|-
 +
| <code>Depth:LongWord;</code>
 +
| Framebuffer color depth (eg FRAMEBUFFER_DEPTH_16)
 +
|-
 +
| <code>Width:LongWord;</code>
 +
| Framebuffer width in pixels
 +
|-
 +
| <code>Height:LongWord;</code>
 +
| Framebuffer height in pixels
 +
|-
 +
| <code>Rotation:LongWord;</code>
 +
| Framebuffer rotation (eg FRAMEBUFFER_ROTATION_180)
 +
|-
 +
|colspan="2"|''Driver Properties''
 +
|-
 +
| <code>Control:LongWord;</code>
 +
| Preset Control register value
 +
|-
 +
| <code>Timing0:LongWord;</code>
 +
| Preset Timing0 register value
 +
|-
 +
| <code>Timing1:LongWord;</code>
 +
| Preset Timing1 register value
 +
|-
 +
| <code>Timing2:LongWord;</code>
 +
| Preset Timing2 register value
 +
|-
 +
| <code>Timing3:LongWord;</code>
 +
| Preset Timing2 register value
 +
|-
 +
| <code>Registers:PPL110CLCDRegisters;</code>
 +
| PL110 registers
 +
|-
 +
|}
 +
</div></div> 
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===

Revision as of 02:14, 24 January 2017

Return to Unit Reference


Description


Ultibo Platform interface unit for QEMU VersatilePB

To be documented

Constants



[Expand]
QEMUVPB specific constants QEMUVPB_*


[Expand]
QEMUVPB page table constants QEMUVPB_PAGE_TABLE_*


[Expand]
QEMUVPB vector table constants QEMUVPB_VECTOR_TABLE_*


[Expand]
QEMUVPB CPU count constants QEMUVPB_CPU_*


[Expand]
QEMUVPB SWI constants QEMUVPB_SWI_*


[Expand]
QEMUVPB kernel name constants QEMUVPB_KERNEL_*


Type definitions



PL110 CLCD registers

[Expand]

PPL110CLCDRegisters = ^TPL110CLCDRegisters;

TPL110CLCDRegisters = record

PL110 framebuffer

[Expand]

PPL110Framebuffer = ^TPL110Framebuffer;

TPL110Framebuffer = record


Public variables



QEMUVPB specific Ultibo variables

QEMUVPBInitialized:Boolean;

Clock variables

ClockGetLock:LongWord; Atomic lock variable for updating the clock rollover
ClockGetLast:LongWord; Value of 24MHz Counter on last ClockGetCount or ClockGetTotal call
ClockGetRollover:LongWord; Number of times the 24MHz counter has rolled over (Only accurate if ClockGetCount/ClockGetTotal is called at least once per 178 seconds)

Timer variables

Timer0Registers:PSP804TimerRegisters; Use Timer0 for Clock
Timer2Registers:PSP804TimerRegisters; Use Timer2 for Scheduler

Interrupt variables

PrimaryInterruptRegisters:PPL190InterruptRegisters;
SecondaryInterruptRegisters:PVersatilePBInterruptRegisters;
InterruptEntries:array[0..(VERSATILEPB_IRQ_COUNT - 1)] of TInterruptEntry;

System call variables

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

IRQ/FIQ variables

IRQEnabled:array[0..1] of LongWord; 2 groups of IRQs to Enable/Disable (See: TPL190InterruptRegisters)
FIQEnabled:LongWord; The single IRQ number to Enable as FIQ instead (See: TPL190InterruptRegisters)


Function declarations



Initialization functions

[Expand]
procedure QEMUVPBInit;
Description: To be documented


QEMUVPB platform functions

[Expand]
procedure QEMUVPBBoardInit;
Description: To be documented


[Expand]
procedure QEMUVPBMemoryInit;
Description: To be documented


[Expand]
procedure QEMUVPBClockInit;
Description: To be documented


[Expand]
procedure QEMUVPBPowerInit;
Description: To be documented


[Expand]
procedure QEMUVPBInterruptInit;
Description: To be documented


[Expand]
procedure QEMUVPBPeripheralInit;
Description: To be documented


[Expand]
procedure QEMUVPBFramebufferInit;
Description: To be documented


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


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


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


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


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


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


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


[Expand]
function QEMUVPBGetInterruptEntry(Number:LongWord):TInterruptEntry;
Description: To be documented


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


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


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


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


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


QEMUVPB thread functions

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


QEMUVPB IRQ functions

[Expand]
function QEMUVPBDispatchIRQ(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
Description: Process any pending IRQ requests


[Expand]
function QEMUVPBHandleIRQ(Number,CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
Description: Call the handler function for an IRQ that was received, or halt if it doesn't exist


QEMUVPB FIQ functions

[Expand]
function QEMUVPBDispatchFIQ(CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
Description: Process any pending FIQ requests


[Expand]
function QEMUVPBHandleFIQ(Number,CPUID:LongWord; Thread:TThreadHandle):TThreadHandle;
Description: Call the handler function for an FIQ that was received, or halt if it doesn't exist


QEMUVPB SWI functions

[Expand]
function QEMUVPBDispatchSWI(CPUID:LongWord; Thread:TThreadHandle; Request:PSystemCallRequest):TThreadHandle;
Description: Process an SWI request


QEMUVPB clock functions

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


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


QEMUVPB scheduler functions

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


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


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


QEMUVPB framebuffer functions

[Expand]
function QEMUVPBFramebufferDeviceAllocate(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Implementation of FramebufferDeviceAllocate API for PL110 Framebuffer


[Expand]
function QEMUVPBFramebufferDeviceRelease(Framebuffer:PFramebufferDevice):LongWord;
Description: Implementation of FramebufferDeviceRelease API for PL110 Framebuffer


[Expand]
function QEMUVPBFramebufferDeviceBlank(Framebuffer:PFramebufferDevice; Blank:Boolean):LongWord;
Description: Implementation of FramebufferDevicBlank API for PL110 Framebuffer


[Expand]
function QEMUVPBFramebufferDeviceCommit(Framebuffer:PFramebufferDevice; Address,Size,Flags:LongWord):LongWord;
Description: Implementation of FramebufferDeviceCommit API for PL110 Framebuffer


[Expand]
function QEMUVPBFramebufferDeviceSetProperties(Framebuffer:PFramebufferDevice; Properties:PFramebufferProperties):LongWord;
Description: Implementation of FramebufferDeviceSetProperties API for PL110 Framebuffer


QEMUVPB helper functions

[Expand]
procedure QEMUVPBBootBlink; assembler; nostackframe;
Description: Output characters to UART0 without dependency on any other RTL setup


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


Return to Unit Reference