StaticWS 7.22 KB
Newer Older
1
;
2
; Copyright (c) 2012, RISC OS Open Ltd
3
; Copyright (c) 2012, Adrian Lees
4
; All rights reserved.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;     * Redistributions of source code must retain the above copyright
;       notice, this list of conditions and the following disclaimer.
;     * Redistributions in binary form must reproduce the above copyright
;       notice, this list of conditions and the following disclaimer in the
;       documentation and/or other materials provided with the distribution.
;     * Neither the name of RISC OS Open Ltd nor the names of its contributors
;       may be used to endorse or promote products derived from this software
;       without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE.
;
; With many thanks to Broadcom Europe Ltd for releasing the source code to
; its Linux drivers, thus making this port possible.
;

Ben Avison's avatar
Ben Avison committed
33
                GET     Hdr:OSEntries
34 35
                GET     Hdr:HALDevice
                GET     Hdr:SDHCIDevice
Jeffrey Lee's avatar
Jeffrey Lee committed
36
                GET     Hdr:DMADevice
37
                GET     Hdr:GPIODevice
38
                GET     Hdr:VideoDevice
Ben Avison's avatar
Ben Avison committed
39
                GET     hdr.BCM2835
40

41 42 43 44 45 46 47 48
; Per-timer workspace layout
                            ^             0
Timer_Reload                #             4       ; interval between interrupts
Timer_Compare               #             4       ; soft copy of most recently programmed compare value
Timer_Register              #             4       ; address of compare register
Timer_Device                #             4       ; device number
TimerWsSize                 *             :INDEX: @

Jeffrey Lee's avatar
Jeffrey Lee committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
; Per-DMA channel workspace
                       ^ 0, a1
DMACDevice             # HALDevice_DMAL_Size
DMACWorkspace          # 4 ; HAL workspace ptr
DMACChanMask           # 4 ; DMA_ENABLE bit for this channel
DMACDREQ               # 4 ; Peripheral/DREQ this channel is servicing
DMACOptions            # 4 ; Options set by SetOptions
DMACPeriAddress        # 4 ; VC phys addr of peripheral - i.e. at &7e......
DMACLastProgress       # 4 ; Last progress value
DMACLastCONBLK_AD      # 4 ; Last control block seen executing
DMACLastTXFR_LEN       # 4 ; Last transfer length remaining seen
DMACCBOffset           # 4 ; Address offset to convert DMA CB addr to ARM CB addr
DMACDesc               # 32 ; Buffer for description string
DMAC_DeviceSize        * :INDEX: @

64 65 66 67 68 69 70 71 72
; VCHIQ HAL device layout

                                 ^ 0
                                 # HALDeviceSize
HALDevice_VCHIQARMToVCOffset     # 4
HALDevice_VCHIQVCDoorbell        # 4 ; Doorbell to interrupt VC
HALDevice_VCHIQARMDoorbell       # 4 ; Doorbell to interrupt us
HALDevice_VCHIQInitVC            # 4
HALDevice_VCHIQ_Size             * :INDEX: @
73

74 75 76 77 78 79 80 81
; Device-specific struct for the VDU device

                        ^ 0
VDUDevSpec_SizeField    # 4 ; Size field
VDUDevSpec_DMAChan      # 4 ; Pointer to DMA channel
VDUDevSpec_BurstLen     # 4 ; Burst length for use with DMA channel
VDUDevSpec_Size         # 0 ; Size value to write to size field

82
; Main workspace layout
83

Ben Avison's avatar
Ben Avison committed
84
sb              RN      9
85

Ben Avison's avatar
Ben Avison committed
86
                ^       0,sb
87

Ben Avison's avatar
Ben Avison committed
88
PeriBase        #       4
89 90 91
IRQ_Base_Address #      4
ARM_Counter_IO_Address # 4
ARM_Timer_IO_Address #  4
92
UARTOldModemStatus #    4
93
MMUOffBaseAddr  #       4                    ; original address kernel was loaded from
94
MachineID       #       8                    ; derived from MAC address if there
95

Ben Avison's avatar
Ben Avison committed
96
IIC_Status      #       4 ; Non-zero if an IIC transfer is going on
97 98 99 100 101 102 103 104 105 106 107
; NOTE - The following locations are for the base addresses of the
; controllers that RISC OS uses for bus 0 and bus 1.  The use is
; dependent on board revision.  Revision 1 boards (Board_Revision
; values 0..3) use Broadcom controller 0 for RISC OS bus 0 and
; Broadcom 1 for RISC OS 1.  Revision 2 boards (Board_Revision
; values 4 upwards) use Broadcom controller 1 for RISC OS bus 0
; and Broadcom controller 0 for RISC OS bus 1, because the PCB
; layout exchanged the busses.
IIC_Base        #       4 ; Base address of IIC controller for RO bus 0
;               #       4 ; Base address of IIC controller for RO bus 1
; NOTE - Bus 1 isn't yet implemented!
Ben Avison's avatar
Ben Avison committed
108

109 110 111 112 113 114
Timer   SETA    0
        WHILE   Timer < NumTimers
Timer$Timer.Ws  #       TimerWsSize
Timer   SETA    Timer + 1
        WEND

John Ballance's avatar
John Ballance committed
115
FB_CacheMode    #       4
116 117

; info interrogated from the VC side
118 119 120 121
ARM_Base        #       4
ARM_Size        #       4
VC_Base         #       4
VC_Size         #       4
122 123 124
Board_Model     #       4
Board_Revision  #       4
ARM_DMAChannels #       4
125
VirtGPIOBuf     #       4
126
SafetyCatch     #       4 ; Only valid on Compute Module 3
127

128
; align to 16 byte boundary NB this isnt aligned once hal initialised
129
                #       (((:INDEX:@)+15):AND::NOT:15)-(:INDEX:@)
130
tagbuffer       #       300 ; platform query buffer
131

Jeffrey Lee's avatar
Jeffrey Lee committed
132 133
NCNBAddr        #       4       ;NCNB workspace
NCNBPhysAddr    #       4       ;VC physical address of NCNB workspace
Ben Avison's avatar
Ben Avison committed
134 135

OSheader        #       4
136 137
OSentries       #       4*(HighestOSEntry+1)

138 139
SimulatedCMOS   #       2048+4  ;Usual 2k plus version word (as appended by *SaveCMOS)

140 141
SDHCIWriteInterval #    4 ; minimum counter ticks between writes
SDHCILastWriteCount #   4 ; counter value at last write
Ben Avison's avatar
Ben Avison committed
142
SDHCIInputClock #       4 ; estimated speed of input clock to SDHCI block
143 144 145 146
                #       (16-:INDEX:@):AND:15         ; align nicely
SDHCIDevice     #       HALDevice_SDHCISize          ; see Hdr:SDHCIDevice
SDHCISlotInfo   #       HALDeviceSDHCI_SlotInfo_Size ; the controller has just the 1 slot

Jeffrey Lee's avatar
Jeffrey Lee committed
147 148 149 150 151 152 153
DMAFreeChannels #       4 ; Mask of which physical DMA channels are free
DMANumChannels  #       4 ; Count of how many channel devices exist
DMAChannelList  #       DMA_CH_Count*4 ; List of channel devices for Enumerate
                #       (16-:INDEX:@):AND:15         ; align nicely
DMAController   #       HALDevice_DMAC_Size_0_1      ; see Hdr:HALDevice
DMAChannels     #       DMAC_DeviceSize*DMA_CH_Count ; List of channel devices (indexed by physical channel #)

154
VCHIQDevice     #       HALDevice_VCHIQ_Size
ROOL's avatar
ROOL committed
155 156
GPIO0Device     #       HALDevice_GPIO_Size_1_0 + 16
GPIO1Device     #       HALDevice_GPIO_Size_1_0 + 16
157 158
VDUDevice       #       HALDevice_VDU_Size
VDUDevSpec      #       VDUDevSpec_Size
Jeffrey Lee's avatar
Jeffrey Lee committed
159
RTCDeviceStruct #       80
160 161 162
SPI0Device      #       HALDeviceSize
SPI1Device      #       HALDeviceSize
SPI2Device      #       HALDeviceSize
163
TouchDevice     #       HALDeviceSize
164
MBoxDevice      #       HALDeviceSize
165

Ben Avison's avatar
Ben Avison committed
166 167
HAL_WsSize              *       :INDEX:@
sizeof_workspace        *       :INDEX:@
168

Ben Avison's avatar
Ben Avison committed
169
                END