Commit 5c01f74d authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Add GPIO table entries for OMAP4/Pi Compute/Pandora

Submission from TankStage.

Version 0.53. Tagged as 'GPIO-0_53'
parent cb927b17
No preview for this file type
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.52"
Module_Version SETA 52
Module_MajorVersion SETS "0.53"
Module_Version SETA 53
Module_MinorVersion SETS ""
Module_Date SETS "09 Oct 2014"
Module_ApplicationDate SETS "09-Oct-14"
Module_ComponentName SETS "GPIO"
Module_ComponentPath SETS "bsd/RiscOS/Sources/ThirdParty/TankStage/HWSupport/GPIO"
Module_FullVersion SETS "0.52"
Module_HelpVersion SETS "0.52 (09 Oct 2014)"
Module_FullVersion SETS "0.53"
Module_HelpVersion SETS "0.53 (09 Oct 2014)"
END
/* (0.52)
/* (0.53)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.52
#define Module_MajorVersion_CMHG 0.53
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Oct 2014
#define Module_MajorVersion "0.52"
#define Module_Version 52
#define Module_MajorVersion "0.53"
#define Module_Version 53
#define Module_MinorVersion ""
#define Module_Date "09 Oct 2014"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "GPIO"
#define Module_ComponentPath "bsd/RiscOS/Sources/ThirdParty/TankStage/HWSupport/GPIO"
#define Module_FullVersion "0.52"
#define Module_HelpVersion "0.52 (09 Oct 2014)"
#define Module_LibraryVersionInfo "0:52"
#define Module_FullVersion "0.53"
#define Module_HelpVersion "0.53 (09 Oct 2014)"
#define Module_LibraryVersionInfo "0:53"
......@@ -31,9 +31,9 @@
^ 0 ; beginaddress
;which machine are we running on
machine # 4 ;gpio machine number
halproc # 4
halboard # 4
halrevision # 4
halproc # 4 ;processor type
halboard # 4 ;board Type
halrevision # 4 ;board revision
machinename # 32
;store for logical addresses
logicalstore # 4*8 ;only 6 used atm
......@@ -200,23 +200,23 @@ C_gpio_95 * &10E
C_gpio_96 * &110
C_gpio_97 * &112
C_gpio_98 * &114
C_gpio_99 * &116 ;INPUT ONLY
C_gpio_100 * &118 ;INPUT ONLY
C_gpio_99 * &116+input_only ;INPUT ONLY
C_gpio_100 * &118+input_only ;INPUT ONLY
C_gpio_101 * &11A
C_gpio_102 * &11C
C_gpio_103 * &11E
C_gpio_104 * &120
C_gpio_105 * &122 ;INPUT ONLY
C_gpio_106 * &124 ;INPUT ONLY
C_gpio_107 * &126 ;INPUT ONLY
C_gpio_108 * &128 ;INPUT ONLY
C_gpio_105 * &122+input_only ;INPUT ONLY
C_gpio_106 * &124+input_only ;INPUT ONLY
C_gpio_107 * &126+input_only ;INPUT ONLY
C_gpio_108 * &128+input_only ;INPUT ONLY
C_gpio_109 * &12A
C_gpio_110 * &12C
C_gpio_111 * &12E
C_gpio_112 * &134 ;INPUT ONLY
C_gpio_113 * &136 ;INPUT ONLY
C_gpio_114 * &138 ;INPUT ONLY
C_gpio_115 * &13A ;INPUT ONLY
C_gpio_112 * &134+input_only ;INPUT ONLY
C_gpio_113 * &136+input_only ;INPUT ONLY
C_gpio_114 * &138+input_only ;INPUT ONLY
C_gpio_115 * &13A+input_only ;INPUT ONLY
C_gpio_116 * &13C
C_gpio_117 * &13E
C_gpio_118 * &140
......@@ -330,7 +330,37 @@ gpio_28 * 28
gpio_29 * 29
gpio_30 * 30
gpio_31 * 31
gpio_32 * 32
gpio_33 * 33
gpio_34 * 34
gpio_35 * 35
gpio_36 * 36
gpio_37 * 37
gpio_38 * 38
gpio_39 * 39
gpio_40 * 40
gpio_41 * 41
gpio_42 * 42
gpio_43 * 43
gpio_44 * 44
gpio_45 * 45
gpio_46 * 46
gpio_47 * 47
gpio_48 * 48
gpio_49 * 49
gpio_50 * 50
gpio_51 * 51
gpio_52 * 52
gpio_53 * 53
gpio_54 * 54
gpio_55 * 55
gpio_56 * 56
gpio_57 * 57
gpio_58 * 58
gpio_59 * 59
gpio_61 * 61
gpio_64 * 64
gpio_65 * 65
gpio_66 * 66
gpio_67 * 67
gpio_68 * 68
......@@ -375,6 +405,8 @@ gpio_107 * 107 ;INPUT ONLY
gpio_108 * 108 ;INPUT ONLY
gpio_109 * 109
gpio_110 * 110
gpio_113 * 113
gpio_121 * 121
gpio_130 * 130
gpio_131 * 131
gpio_132 * 132
......@@ -392,11 +424,13 @@ gpio_143 * 143
gpio_144 * 144
gpio_145 * 145
gpio_146 * 146
gpio_147 * 147
gpio_148 * 148
gpio_149 * 149
gpio_150 * 150
gpio_151 * 151
gpio_153 * 153
gpio_155 * 155
gpio_156 * 156
gpio_157 * 157
gpio_158 * 158
......@@ -406,6 +440,8 @@ gpio_161 * 161
gpio_162 * 162
gpio_163 * 163
gpio_164 * 164
gpio_165 * 165
gpio_166 * 166
gpio_167 * 167
gpio_168 * 168
gpio_170 * 170
......@@ -414,6 +450,7 @@ gpio_172 * 172
gpio_173 * 173
gpio_174 * 174
gpio_177 * 177
gpio_181 * 181
gpio_183 * 183
gpio_184 * 184
gpio_185 * 185
......@@ -552,7 +589,6 @@ dev_button * gpio_26
dev_led1 * gpio_186
dev_led2 * gpio_163
dev_led3 * gpio_164
dev_ledb * gpio_153
;i2c on exp
dev_i2c_1 * gpio_184
dev_i2c_2 * gpio_185
......@@ -576,6 +612,274 @@ dev_mmc2_clk * gpio_130
;i2c bus for i2c on exp
dev_i2cbus * 1
;**************************** Devkit end *************************************
;**************************** Panda ******************************************
;physical map locations
PDGPIO_1 * &4A310000
PDGPIO_2 * &48055000
PDGPIO_3 * &48057000
PDGPIO_4 * &48059000
PDGPIO_5 * &4805B000
PDGPIO_6 * &4805D000
PDPADCONF_1 * &4A100000
C_PDgpio_0 * &184
C_PDgpio_1 * &186
C_PDgpio_2 * &190
C_PDgpio_3 * &192
C_PDgpio_4 * &048
C_PDgpio_5 * &050+input_only
C_PDgpio_6 * &054
C_PDgpio_7 * &05A
C_PDgpio_8 * &05C
C_PDgpio_9 * &068
C_PDgpio_10 * &06A
C_PDgpio_11 * &1AE
C_PDgpio_12 * &1B0
C_PDgpio_13 * &1B2
C_PDgpio_14 * &1B4
C_PDgpio_15 * &1B6
C_PDgpio_16 * &1B8
C_PDgpio_17 * &1BA
C_PDgpio_18 * &1BC
C_PDgpio_19 * &1BE
C_PDgpio_20 * &1C0
C_PDgpio_21 * &1C2
C_PDgpio_22 * &1C4
C_PDgpio_23 * &1C6
C_PDgpio_24 * &1C8
C_PDgpio_25 * &1CA
C_PDgpio_26 * &1CC
C_PDgpio_27 * &1CE
C_PDgpio_28 * &1D0
C_PDgpio_29 * &066
C_PDgpio_30 * &056
C_PDgpio_31 * &058
C_PDgpio_32 * &050
C_PDgpio_33 * &052
C_PDgpio_34 * &054
C_PDgpio_35 * &056
C_PDgpio_36 * &058
C_PDgpio_37 * &05A
C_PDgpio_38 * &05C
C_PDgpio_39 * &05E
C_PDgpio_40 * &060
C_PDgpio_41 * &062
C_PDgpio_42 * &064
C_PDgpio_43 * &066
C_PDgpio_44 * &068
C_PDgpio_45 * &06A
C_PDgpio_46 * &06C
C_PDgpio_47 * &06E
C_PDgpio_48 * &070
C_PDgpio_49 * &072
C_PDgpio_50 * &074
C_PDgpio_51 * &076
C_PDgpio_52 * &078
C_PDgpio_53 * &07A
C_PDgpio_54 * &07C
C_PDgpio_55 * &07E
C_PDgpio_56 * &080
C_PDgpio_57 * &082
C_PDgpio_58 * &084
C_PDgpio_59 * &086
C_PDgpio_60 * &088
C_PDgpio_61 * &08A
C_PDgpio_62 * &08C
C_PDgpio_63 * &098
C_PDgpio_64 * &09A
C_PDgpio_65 * &09C
C_PDgpio_66 * &09E
C_PDgpio_67 * &0A0+input_only
C_PDgpio_68 * &0A2+input_only
C_PDgpio_69 * &0A4+input_only
C_PDgpio_70 * &0A6+input_only
C_PDgpio_71 * &0A8+input_only
C_PDgpio_72 * &0AA+input_only
C_PDgpio_73 * &0AC+input_only
C_PDgpio_74 * &0AE+input_only
C_PDgpio_75 * &0B0+input_only
C_PDgpio_76 * &0B2+input_only
C_PDgpio_77 * &0B4+input_only
C_PDgpio_78 * &0B6+input_only
C_PDgpio_79 * &0B8+input_only
C_PDgpio_80 * &0BA+input_only
C_PDgpio_81 * &0BC
C_PDgpio_82 * &0BE
C_PDgpio_83 * &0C0
C_PDgpio_84 * &0C2
C_PDgpio_85 * &0C4
C_PDgpio_86 * &0C6
C_PDgpio_87 * &0C8
C_PDgpio_88 * &0CA
C_PDgpio_89 * &0CC
C_PDgpio_90 * &0CE
C_PDgpio_91 * &0D0
C_PDgpio_92 * &0D2
C_PDgpio_93 * &0D4
C_PDgpio_94 * &0D6
C_PDgpio_95 * &0D8
C_PDgpio_96 * &0DA
C_PDgpio_97 * &0DC
C_PDgpio_98 * &0DE
C_PDgpio_99 * &0E0
C_PDgpio_100 * &0E2
C_PDgpio_101 * &0E4
C_PDgpio_102 * &0E6
C_PDgpio_103 * &0E8
C_PDgpio_104 * &0EA
C_PDgpio_105 * &0EC
C_PDgpio_106 * &0EE
C_PDgpio_107 * &0F0
C_PDgpio_108 * &0F2
C_PDgpio_109 * &0F4
C_PDgpio_110 * &0F6
C_PDgpio_111 * &0F8
C_PDgpio_112 * &0FA
C_PDgpio_113 * &0FC
C_PDgpio_114 * &0FE
C_PDgpio_115 * &100
C_PDgpio_116 * &102
C_PDgpio_117 * &104
C_PDgpio_118 * &10E
C_PDgpio_119 * &110
C_PDgpio_120 * &112
C_PDgpio_121 * &114
C_PDgpio_122 * &116
C_PDgpio_123 * &118
C_PDgpio_124 * &11A
C_PDgpio_125 * &11C
C_PDgpio_126 * &11E
C_PDgpio_127 * &120
C_PDgpio_128 * &126
C_PDgpio_129 * &128
C_PDgpio_130 * &12A
C_PDgpio_131 * &12C
C_PDgpio_132 * &12E
C_PDgpio_133 * &130
C_PDgpio_134 * &132
C_PDgpio_135 * &134
C_PDgpio_136 * &136
C_PDgpio_137 * &138
C_PDgpio_138 * &13A
C_PDgpio_139 * &13C
C_PDgpio_140 * &13E
C_PDgpio_141 * &140
C_PDgpio_142 * &142
C_PDgpio_143 * &144
C_PDgpio_144 * &146
C_PDgpio_145 * &148
C_PDgpio_146 * &14A
C_PDgpio_147 * &14C
C_PDgpio_148 * &14E
C_PDgpio_149 * &150
C_PDgpio_150 * &152
C_PDgpio_151 * &154
C_PDgpio_152 * &156
C_PDgpio_153 * &158
C_PDgpio_154 * &15A
C_PDgpio_155 * &15C
C_PDgpio_156 * &15E
C_PDgpio_157 * &160
C_PDgpio_158 * &162
C_PDgpio_159 * &164
C_PDgpio_160 * &166
C_PDgpio_161 * &168
C_PDgpio_162 * &16A
C_PDgpio_163 * &16C
C_PDgpio_164 * &16E
C_PDgpio_165 * &170
C_PDgpio_166 * &172
C_PDgpio_167 * &174
C_PDgpio_168 * &176
C_PDgpio_169 * &178
C_PDgpio_170 * &17A
C_PDgpio_171 * &17C
C_PDgpio_172 * &17E
C_PDgpio_173 * &180
C_PDgpio_174 * &182
C_PDgpio_175 * &184
C_PDgpio_176 * &186
C_PDgpio_177 * &188
C_PDgpio_178 * &18A
C_PDgpio_179 * &0
C_PDgpio_180 * &0
C_PDgpio_181 * &19A
C_PDgpio_182 * &19C
C_PDgpio_183 * &1A0
C_PDgpio_184 * &1A2
C_PDgpio_185 * &1A4
C_PDgpio_186 * &1A6
C_PDgpio_187 * &1A8
C_PDgpio_188 * &1AA
C_PDgpio_189 * &1AC
C_PDgpio_190 * &1D2
C_PDgpio_191 * &1D4
;i2c
PD_i2c_1 * gpio_130
PD_i2c_2 * gpio_131
PD_i2c_3 * gpio_132
PD_i2c_4 * gpio_133
;user
PDES_button * gpio_113
PDES_ledD1 * gpio_110
PDES_ledD2 * gpio_8
PD_button * gpio_121
PD_ledD1 * gpio_7
PD_ledD2 * gpio_8
;mmc
PD_mmc1_0 * gpio_32
PD_mmc1_1 * gpio_33
PD_mmc1_2 * gpio_34
PD_mmc1_3 * gpio_35
PD_mmc1_4 * gpio_36
PD_mmc1_5 * gpio_37
PD_mmc1_6 * gpio_38
PD_mmc1_7 * gpio_39
PD_mmc1_cmd * gpio_55
PD_mmc1_clk * gpio_56
PD_mmc1_mode * 5<<8
;uart
PD_uart4_rx * gpio_155
PD_uart4_tx * gpio_156
PD_uart4_mode * 0
omap4_GPIO_SYSCONFIG * &010
omap4_GPIO_SYSSTATUS * &114
omap4_GPIO_IRQSTATUS1 * &118
omap4_GPIO_IRQENABLE1 * &11c
omap4_GPIO_WAKE_EN * &120
omap4_GPIO_IRQSTATUS2 * &128
omap4_GPIO_IRQENABLE2 * &12c
omap4_GPIO_CTRL * &130
omap4_GPIO_OE * &134
omap4_GPIO_DATAIN * &138
omap4_GPIO_DATAOUT * &13c
omap4_GPIO_LEVELDETECT0 * &140
omap4_GPIO_LEVELDETECT1 * &144
omap4_GPIO_RISINGDETECT * &148
omap4_GPIO_FALLINGDETECT * &14c
omap4_GPIO_DEBOUNCE_EN * &150
omap4_GPIO_DEBOUNCE_VAL * &154
omap4_GPIO_CLEARIRQENABLE1 * &160
omap4_GPIO_SETIRQENABLE1 * &164
omap4_GPIO_CLEARIRQENABLE2 * &170
omap4_GPIO_SETIRQENABLE2 * &174
omap4_GPIO_CLEARWKUENA * &180
omap4_GPIO_SETWKUENA * &184
omap4_GPIO_CLEARDATAOUT * &190
omap4_GPIO_SETDATAOUT * &194
PDexpbitmap * 2_00000000000000000000000000000000
PDauxbitmap * 2_00000000000000000000000000000000
PDcambitmap * 2_00000000000000000000000000000000
;***************************** Panda end ****************************************
;***************************** Raspberry ****************************************
;pi_GPIO_Base * &7E200000
pi_GPIO_Base * &20200000
......@@ -679,8 +983,11 @@ pi_FSEL51 * &500+3
pi_FSEL52 * &500+6
pi_FSEL53 * &500+9
pi_top_gpio * 53
pi_top_gpio * 45
;user
Pi_LED * gpio_16
Com_LED * gpio_47
;i2c on exp
rpi_i2c0_1 * gpio_1
rpi_i2c0_2 * gpio_0
......@@ -712,72 +1019,32 @@ Pi_PUDEnDown * 1
Pi_PUDEnUp * 2
pi_exp_bitmask * 2_00000011111001101100111110010011
;pi_exp_bitmask * 2_00000011111001101100111110010011
;pi_com_bitmask1 * 2_11111111111111111111111111111111
;pi_com_bitmask2 * 2_00000000001111111111111111111111
;i2c bus for i2c on exp
pi_i2cbusr1 * 0
pi_i2cbusr2 * 0
;**************************** Raspberry end *************************************
;hal processor types
^ 0
hal_omap3 # 1
hal_omap4 # 1
hal_bcm2835 # 1
;dummy hal
^ 0
hal_dummy # 1
;hal board types omap3
^ 0
hal_beagle # 1
hal_devkit8000 # 1
hal_igep # 1
hal_pandora # 1
;hal board types bcm2835
^ 0
hal_raspi # 1
;hal revisions
^ 0
BeagleBoard_AB # 1 ; Rev A or B
BeagleBoard_C123 # 1 ; Rev C1, C2 or C3
BeagleBoard_C4 # 1 ; Rev C4
BeagleBoard_xMA # 1 ; Rev A
BeagleBoard_xMB # 1 ; Rev B
BeagleBoard_xMC # 1 ; Rev c
BeagleBoardNext # 1
^ 0
DevKit8000_Unknown # 1
DevKit8000Next # 1
^ 0
IGEPv2_BC # 1 ; Rev B or C (B-compatible)
IGEPv2_C # 1 ; Rev C (not a B-compatible one)
IGEPNext # 1
^ 0
Panda_Unknown # 1
PandaNext # 1
^ 0
RPi_BR1 # 1
RPi_BR2 # 1
RPiNext # 1
^ 0
dummy # 1
dummynext # 1
dummy # 1
dummynext # 1
;If new boards are added, change revision (from Hdr.GPIODevice) to the new last one and add a table!!!
;this gives internal machine type....
^ 0
hal_rev_dummy # dummynext
hal_rev_beagle # BeagleBoardNext
hal_rev_dev # DevKit8000Next
hal_rev_igep # IGEPNext
hal_rev_panda # PandaNext
hal_rev_pi # RPiNext
hal_rev_beagle # GPIORevision_BeagleBoard_xMC+1
hal_rev_dev # GPIORevision_DevKit8000_Unknown+1
hal_rev_igep # GPIORevision_IGEPv2_C+1
hal_rev_pandora # GPIORevision_Pandora_Unknown+1
hal_rev_panda # GPIORevision_PandaES+1
hal_rev_pi # GPIORevision_RaspberryPi_C_1+1
;offsets into table
^ 0
......@@ -814,6 +1081,8 @@ conf_falling * 1<<19
conf_debounce * 1<<20
conf_irq1 * 1<<21
conf_irq2 * 1<<22
input_only * 1<<15
;wide offsets
^ 0
wide_exp # 4
......@@ -846,4 +1115,34 @@ mcpgpioa * &12
mcpolata * &14
mcpbase * &40
;proc reg table offsets
^ 0
proc_sysconfig # 2
proc_sysstatus # 2
proc_irqstatus1 # 2
proc_irqenable1 # 2
proc_wakeupenable # 2
proc_irqstatus2 # 2
proc_irqenable2 # 2
proc_ctrl # 2
proc_oe # 2
proc_datain # 2
proc_dataout # 2
proc_leveldetect0 # 2
proc_leveldetect1 # 2
proc_risingdetect # 2
proc_fallingdetect # 2
proc_debounceenable # 2
proc_debouncetime # 2
proc_clearirqenable1 # 2
proc_setirqenable1 # 2
proc_clearirqenable2 # 2
proc_setirqenable2 # 2
proc_clearwkuena # 2
proc_setwkuena # 2
proc_cleardataout # 2
proc_setdataout # 2
proc_tableshift * 6
END
......@@ -34,19 +34,24 @@
Read_Data
CMP r0,#i2c_flag-1 ;check if i2c gpio
BCS i2c_Read_Data ;
PUSH {r1-r3,lr} ;
PUSH {r1-r10,lr} ;
BL get_logical_and_pin ;
CMP r0,#-1 ;
BEQ %FT10 ;
LDR r2,[r0,#GPIO_OE] ;get oe register value
ADRL r4,proc_reg_list ;
ADD r2,r2,r4 ;
LDRH r6,[r2,#proc_oe] ;
LDRH r5,[r2,#proc_datain] ;
LDRH r4,[r2,#proc_dataout] ;
LDR r2,[r0,r6] ;get oe register value
AND r2,r2,r1 ;
CMP r2,#0 ;is it output ?
LDREQ r0,[r0,#GPIO_DATAOUT] ;read data copy
LDRNE r0,[r0,#GPIO_DATAIN] ;read data input
LDREQ r0,[r0,r4] ;read data copy
LDRNE r0,[r0,r5] ;read data input
AND r0,r0,r1 ;mask just ours
CMP r0,#0 ;
MOVNE r0,#1 ;
10 POP {r1-r3,pc} ; restore registers and exit
10 POP {r1-r10,pc} ; restore registers and exit
;r0=value (0 or 1) -1 if not GPIO
;---------------------------------------------
......@@ -57,22 +62,27 @@ Read_Data
Write_Data
CMP r0,#i2c_flag-1 ;check if i2c gpio
BCS i2c_Write_Data ;
PUSH {r2-r6,lr} ;
MOV r6,r1 ;save value
PUSH {r2-r10,lr} ;
MOV r7,r1 ;save value
BL check_protect_i2c ;
CMP r0,#-1 ;
BEQ %FT10 ;
BL get_logical_and_pin ;
CMP r0,#-1 ;
BEQ %FT10 ;
LDR r2,[r0,#GPIO_OE] ;get oe register value
ADRL r4,proc_reg_list ;
ADD r2,r2,r4 ;
LDRH r6,[r2,#proc_oe] ;
LDRH r5,[r2,#proc_cleardataout] ;