Commit 2a65474e authored by ROOL's avatar ROOL 🤖
Browse files

Transition Pi HAL to API 1.00

Detail:
  Add extra definitions and structure layouts to GPIODevice header. Remove local inclusion of Hdr:HALDevice, in line with the other HAL device headers (BMU, Mixer, RTC, et al).
  Remove GPIOType/Revision definitions for Pi.
  Switch out the Pi machine checks in the module so it still builds.
Admin:
  GPIO module built, but not tested.

Version 0.64. Tagged as 'GPIO-0_64'
parent e8147082
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.63"
Module_Version SETA 63
Module_MajorVersion SETS "0.64"
Module_Version SETA 64
Module_MinorVersion SETS ""
Module_Date SETS "16 Mar 2016"
Module_ApplicationDate SETS "16-Mar-16"
Module_Date SETS "11 Feb 2017"
Module_ApplicationDate SETS "11-Feb-17"
Module_ComponentName SETS "GPIO"
Module_ComponentPath SETS "bsd/RiscOS/Sources/ThirdParty/TankStage/HWSupport/GPIO"
Module_FullVersion SETS "0.63"
Module_HelpVersion SETS "0.63 (16 Mar 2016)"
Module_FullVersion SETS "0.64"
Module_HelpVersion SETS "0.64 (11 Feb 2017)"
END
/* (0.63)
/* (0.64)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.63
#define Module_MajorVersion_CMHG 0.64
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 16 Mar 2016
#define Module_Date_CMHG 11 Feb 2017
#define Module_MajorVersion "0.63"
#define Module_Version 63
#define Module_MajorVersion "0.64"
#define Module_Version 64
#define Module_MinorVersion ""
#define Module_Date "16 Mar 2016"
#define Module_Date "11 Feb 2017"
#define Module_ApplicationDate "16-Mar-16"
#define Module_ApplicationDate "11-Feb-17"
#define Module_ComponentName "GPIO"
#define Module_ComponentPath "bsd/RiscOS/Sources/ThirdParty/TankStage/HWSupport/GPIO"
#define Module_FullVersion "0.63"
#define Module_HelpVersion "0.63 (16 Mar 2016)"
#define Module_LibraryVersionInfo "0:63"
#define Module_FullVersion "0.64"
#define Module_HelpVersion "0.64 (11 Feb 2017)"
#define Module_LibraryVersionInfo "0:64"
......@@ -34,15 +34,8 @@ OldOpt SETA {OPT}
GBLL Included_Hdr_GPIODevice
Included_Hdr_GPIODevice SETL {TRUE}
[ :LNOT: :DEF: Included_Hdr_HALDevice
GET HALDevice
]
; Device for GPIO devices
; This device just reports the board type and revision, so that the GPIO manager
; knows how everything is set up and which bits should be off-limits.
;
; extra for basic GPIO device with register wide i/o control
; Extra entries for basic GPIO device with all driver code in the GPIO module
; HALDevice_Version = 0
^ HALDeviceSize
HALDevice_GPIOType # 4
......@@ -63,12 +56,12 @@ HALDevice_GPIODeviceNumber # 4
HALDevice_GPIOReservedAPI1 # 4
HALDevice_GPIO_Size_0_1 * :INDEX: @
;
; Extra entries for API 0.2 with register wide GPIO control in the HAL
; HALDevice_Version = 2
; Extra entries for API 1.0 with register wide GPIO control in the HAL
; HALDevice_Version = &10000
^ HALDeviceSize
HALDevice_GPIOPorts # 4
HALDevice_GPIONumber # 4
HALDevice_GPIOEnumerate # 4
HALDevice_GPIOEnumerateAltModes # 4
HALDevice_GPIOSetDataBits # 4
HALDevice_GPIOClearDataBits # 4
HALDevice_GPIOToggleDataBits # 4
......@@ -76,13 +69,47 @@ HALDevice_GPIOReadDataBits # 4
HALDevice_GPIODataDirection # 4
HALDevice_GPIOReadMode # 4
HALDevice_GPIOWriteMode # 4
HALDevice_GPIOEnablePullControl # 4
HALDevice_GPIOPullControl # 4
HALDevice_GPIOPullDirection # 4
HALDevice_GPIOEdgeControl # 4
HALDevice_GPIOEdgeDetect # 4
HALDevice_GPIOModeToBit # 4
HALDevice_GPIOBitToMode # 4
HALDevice_GPIOWorkspace # 4
HALDevice_GPIO_Size_0_2 * :INDEX: @
HALDevice_GPIOEdgePollStatus # 4
HALDevice_GPIO_Size_1_0 * :INDEX: @
; HALDevice_GPIOEnumerate structure
^ 0
GPIOEnumerate_Pin # 1 ; 5 bit value
GPIOEnumerate_PinFlags_Output * 1:SHL:5 ; Capabilities of the pin when used as GPIO
GPIOEnumerate_PinFlags_Input * 1:SHL:6
# 3 ; Spare flags
GPIOEnumerate_ModesAllowed # 4 ; Bit field
GPIOEnumerate_GroupList # 0 ; Repeats of...
GPIOEnumerate_GroupListEnd * -1
^ 0
GPIOGroupList_Number # 1
GPIOGroupList_Mode # 1 ; Opaque 5 bit value
GPIOGroupList_Type # 2
GPIOGroupList_Size * :INDEX: @
; Group list types
^ 0
GPIOType_GPIO # 1 ; GPIO
GPIOType_I2C # 1 ; I2C bus SDA,SCL
GPIOType_GPCLK # 1 ; General Purpose Clock
GPIOType_SPI # 1 ; SPI bus MISO,MOSI,SCLK,CE
GPIOType_PWM # 1 ; Pulse Width Modulator
GPIOType_UART # 1 ; Serial bus TX,RX,CTS,RTS,DCD,DTR,DSR,RI
GPIOType_PCM # 1 ; PCM Audio CLK,FS,DIN,DOUT
GPIOType_BSC # 1 ; BSC bus SDA,SCL,MISO,CE
GPIOType_JTAG # 1 ; JTAG bus TRST,RTCK,TDO,TCK,TDI,TMS
GPIOType_USB # 1 ; USB D+,D-
GPIOType_LED # 1 ; Onboard LED
GPIOType_SW # 1 ; Onboard switch
; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
; NOTE: The following GPIOType/GPIORevision pairs are due for
; retirement as they were only needed by the original 0.0 API
; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
;
; Type & revision values specific to HALDeviceID_GPIO_OMAP3:
......@@ -126,22 +153,6 @@ GPIORevision_Pandora_Unknown # 1
^ 0
GPIORevision_TouchBook_Unknown # 1
; Type & revision values specific to HALDeviceID_GPIO_BCM2835:
^ 0
GPIOType_BCM2835_RaspberryPi # 1 ; It's a Raspberry Pi
; Raspberry Pi revision values:
^ 0
GPIORevision_RaspberryPi_B_1 # 1 ; Model B Rev 1.0
GPIORevision_RaspberryPi_B_2 # 1 ; Model B Rev 2.0
GPIORevision_RaspberryPi_A_2 # 1 ; Model A Rev 2.0
GPIORevision_RaspberryPi_BPlus # 1 ; Model B+
GPIORevision_RaspberryPi_C_1 # 1 ; Model Compute Rev 1.0
GPIORevision_RaspberryPi_APlus # 1 ; Model A+
GPIORevision_RaspberryPi_Mk2_B_1 # 1 ; Model Pi 2
; Type & revision values specific to HALDeviceID_GPIO_OMAP4:
^ 0
......
......@@ -1045,7 +1045,9 @@ 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
[ {FALSE}
hal_rev_pi # GPIORevision_RaspberryPi_Mk2_B_1+1
]
;offsets into table
^ 0
......
......@@ -29,6 +29,7 @@
GET Hdr:Macros
GET Hdr:System
GET Hdr:ModHand
GET Hdr:HALDevice
GET Hdr:GPIODevice
GET hdr.reals
......
......@@ -111,7 +111,8 @@ RM_Init
MOV r0,#hal_rev_dummy ;board type default if it falls through
B %FT100 ;default if not any
;omap4 section
400 CMP r3,#HALDeviceID_GPIO_OMAP4
400
CMP r3,#HALDeviceID_GPIO_OMAP4
BNE %FT500 ;not omap4 try something else
ADR r2,omap4_gpio_tables ;pointer to board table
CMP r0,#GPIOType_OMAP4_Panda
......@@ -121,9 +122,10 @@ RM_Init
24 ADR r2,dummy_gpio_table ;pointer to board table
MOV r0,#hal_rev_dummy ;board type default if it falls through
B %FT100 ;default if not any
;bcm section
500 CMP r3,#HALDeviceID_GPIO_BCM2835
500
[ {FALSE}
CMP r3,#HALDeviceID_GPIO_BCM2835
BNE %FT600 ;not pi try something else
ADR r2,bcm2835_gpio_tables ;pointer to board table
CMP r0,#GPIOType_BCM2835_RaspberryPi
......@@ -133,8 +135,10 @@ RM_Init
28 ADR r2,dummy_gpio_table ;pointer to board table
MOV r0,#hal_rev_dummy ;board type default if it falls through
B %FT100 ;default if not any
]
;xxxx section
600 ADR r2,dummy_gpio_table ;pointer to board table
600
ADR r2,dummy_gpio_table ;pointer to board table
MOV r0,#hal_rev_dummy ;board type default if it falls through
B %FT100 ;default if not any
;add more if needed
......@@ -198,10 +202,12 @@ RM_Init
LDR r10,[r12,#machine] ;get board type
CMP r10,#hal_rev_dummy ;is it unkown
BEQ %FT60
[ {FALSE}
CMP r10,#hal_rev_pi ;is it a Pi
BLGE Pi_Enable_I2C ;
BLLT Enable_I2C ;
BL get_i2c_info ;get extender info
]
60
CLRV
Pull "r0-r11,pc" ;
......@@ -216,8 +222,10 @@ omap3_gpio_tables
DCD hal_rev_pandora
omap4_gpio_tables
DCD hal_rev_panda
[ {FALSE}
bcm2835_gpio_tables
DCD hal_rev_pi
]
;******************************************************************************
END
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment