Commit 227406f6 authored by Robert Sprowson's avatar Robert Sprowson Committed by ROOL

Don't return Pi 4-only GPIO in all enumerations

The pin list table had the Pi 4-only alternates mixed in, the result of which is that enumerating the pins on something other than Pi 4 would return ghost alternates for peripherals that don't exist.
Split the pin lists and pick the appropriate one.

Also, add 2 missing board revisions that have sneaked out for 2B/3B.
parent 740691e6
......@@ -295,6 +295,8 @@ GPIO_Board_Conversion_Table
DCD GPIORevision_RaspberryPi_APlus
DCD BoardRevision_Mem_512M+BoardRevision_Model_BPlus+(2:SHL:BoardRevision_Rev_Shift)
DCD GPIORevision_RaspberryPi_BPlus
DCD BoardRevision_Mem_1G+BoardRevision_Model_B2+(0:SHL:BoardRevision_Rev_Shift)
DCD GPIORevision_RaspberryPi_Mk2_B
DCD BoardRevision_Mem_1G+BoardRevision_Model_B2+(1:SHL:BoardRevision_Rev_Shift)
DCD GPIORevision_RaspberryPi_Mk2_B
DCD BoardRevision_Mem_1G+BoardRevision_Model_B2+(2:SHL:BoardRevision_Rev_Shift)
......@@ -305,6 +307,8 @@ GPIO_Board_Conversion_Table
DCD GPIORevision_RaspberryPi_Zero
DCD BoardRevision_Mem_1G+BoardRevision_Model_B3+(2:SHL:BoardRevision_Rev_Shift)
DCD GPIORevision_RaspberryPi_Mk3_B
DCD BoardRevision_Mem_1G+BoardRevision_Model_B3+(3:SHL:BoardRevision_Rev_Shift)
DCD GPIORevision_RaspberryPi_Mk3_B
DCD BoardRevision_Mem_1G+BoardRevision_Model_Compute3+(0:SHL:BoardRevision_Rev_Shift)
DCD GPIORevision_RaspberryPi_C_3
DCD BoardRevision_Mem_512M+BoardRevision_Model_ZeroW+(1:SHL:BoardRevision_Rev_Shift)
......@@ -572,7 +576,9 @@ GPIOEnumerate
TST v1, ip, LSL a3
BEQ %FT60 ; invalid on this target
ADRL v2, GPIOPortTables
CPUDetect v2
ADRLSL v2, GPIOPortTables
ADRHIL v2, GPIOPortTables_BCM2838
LDR v2, [v2, a1, LSL #2] ; start of pin data
MOV v3, #0
30
......@@ -919,6 +925,153 @@ GPIOFreeToUse
; Pin enumerations
GPIO_Port0_Table
PinStart 0, IO
PinBelongsTo GPIOType_GPIO, 0, AltGPI ; GPIO
PinBelongsTo GPIOType_I2C, 0, Alt0 ; I2C0 SDA
PinEnd
PinStart 1, IO
PinBelongsTo GPIOType_GPIO, 1, AltGPI ; GPIO
PinBelongsTo GPIOType_I2C, 0, Alt0 ; I2C0 SCL
PinEnd
PinStart 2, IO
PinBelongsTo GPIOType_GPIO, 2, AltGPI ; GPIO
PinBelongsTo GPIOType_I2C, 1, Alt0 ; I2C1 SDA
PinEnd
PinStart 3, IO
PinBelongsTo GPIOType_GPIO, 3, AltGPI ; GPIO
PinBelongsTo GPIOType_I2C, 1, Alt0 ; I2C1 SCL
PinEnd
PinStart 4, IO
PinBelongsTo GPIOType_GPIO, 4, AltGPI ; GPIO
PinBelongsTo GPIOType_GPCLK, 0, Alt0 ; GPCLK0
PinEnd
PinStart 5, IO
PinBelongsTo GPIOType_GPIO, 5, AltGPI ; GPIO
PinBelongsTo GPIOType_GPCLK, 1, Alt0 ; GPCLK1
PinEnd
PinStart 6, IO
PinBelongsTo GPIOType_GPIO, 6, AltGPI ; GPIO
PinBelongsTo GPIOType_GPCLK, 2, Alt0 ; GPCLK2
PinEnd
PinStart 7, IO
PinBelongsTo GPIOType_GPIO, 7, AltGPI ; GPIO
PinBelongsTo GPIOType_SPI, 0, Alt0 ; SPI0 CE1
PinEnd
PinStart 8, IO
PinBelongsTo GPIOType_GPIO, 8, AltGPI ; GPIO
PinBelongsTo GPIOType_SPI, 0, Alt0 ; SPI0 CE0
PinEnd
PinStart 9, IO
PinBelongsTo GPIOType_GPIO, 9, AltGPI ; GPIO
PinBelongsTo GPIOType_SPI, 0, Alt0 ; SPI0 MISO
PinEnd
PinStart 10, IO
PinBelongsTo GPIOType_GPIO, 10, AltGPI ; GPIO
PinBelongsTo GPIOType_SPI, 0, Alt0 ; SPI0 MOSI
PinEnd
PinStart 11, IO
PinBelongsTo GPIOType_GPIO, 11, AltGPI ; GPIO
PinBelongsTo GPIOType_SPI, 0, Alt0 ; SPI0 SCLK
PinEnd
PinStart 12, IO
PinBelongsTo GPIOType_GPIO, 12, AltGPI ; GPIO
PinBelongsTo GPIOType_PWM, 0, Alt0 ; PWM0
PinEnd
PinStart 13, IO
PinBelongsTo GPIOType_GPIO, 13, AltGPI ; GPIO
PinBelongsTo GPIOType_PWM, 1, Alt0 ; PWM1
PinEnd
PinStart 14, IO
PinBelongsTo GPIOType_GPIO, 14, AltGPI ; GPIO
PinBelongsTo GPIOType_UART, 0, Alt0 ; UART0 TXD
PinBelongsTo GPIOType_UART, 1, Alt5 ; UART1 TXD
PinEnd
PinStart 15, IO
PinBelongsTo GPIOType_GPIO, 15, AltGPI ; GPIO
PinBelongsTo GPIOType_UART, 0, Alt0 ; UART0 RXD
PinBelongsTo GPIOType_UART, 1, Alt5 ; UART1 RXD
PinEnd
PinStart 16, IO
PinBelongsTo GPIOType_GPIO, 16, AltGPI ; GPIO
PinBelongsTo GPIOType_UART, 0, Alt0 ; UART0 CTS
PinBelongsTo GPIOType_SPI, 1, Alt4 ; SPI1 CE2
PinBelongsTo GPIOType_UART, 1, Alt5 ; UART1 CTS
PinEnd
PinStart 17, IO
PinBelongsTo GPIOType_GPIO, 17, AltGPI ; GPIO
PinBelongsTo GPIOType_UART, 0, Alt0 ; UART0 RTS
PinBelongsTo GPIOType_SPI, 1, Alt4 ; SPI1 CE1
PinBelongsTo GPIOType_UART, 1, Alt5 ; UART1 RTS
PinEnd
PinStart 18, IO
PinBelongsTo GPIOType_GPIO, 18, AltGPI ; GPIO
PinBelongsTo GPIOType_PCM, 0, Alt0 ; PCM0 CLK
PinBelongsTo GPIOType_BSC, 0, Alt3 ; BSC0 SDA/MOSI
PinBelongsTo GPIOType_SPI, 1, Alt4 ; SPI1 CE0
PinBelongsTo GPIOType_PWM, 0, Alt5 ; PWM0
PinEnd
PinStart 19, IO
PinBelongsTo GPIOType_GPIO, 19, AltGPI ; GPIO
PinBelongsTo GPIOType_PCM, 0, Alt0 ; PCM0 FS
PinBelongsTo GPIOType_BSC, 0, Alt3 ; BSC0 SCL/SCLK
PinBelongsTo GPIOType_SPI, 1, Alt4 ; SPI1 MISO
PinBelongsTo GPIOType_PWM, 1, Alt5 ; PWM1
PinEnd
PinStart 20, IO
PinBelongsTo GPIOType_GPIO, 20, AltGPI ; GPIO
PinBelongsTo GPIOType_PCM, 0, Alt0 ; PCM0 DIN
PinBelongsTo GPIOType_BSC, 0, Alt3 ; BSC0 MISO
PinBelongsTo GPIOType_SPI, 1, Alt4 ; SPI1 MOSI
PinBelongsTo GPIOType_GPCLK, 0, Alt5 ; GPCLK0
PinEnd
PinStart 21, IO
PinBelongsTo GPIOType_GPIO, 21, AltGPI ; GPIO
PinBelongsTo GPIOType_PCM, 0, Alt0 ; PCM0 DOUT
PinBelongsTo GPIOType_BSC, 0, Alt3 ; BSC0 CE
PinBelongsTo GPIOType_SPI, 1, Alt4 ; SPI1 SCLK
PinBelongsTo GPIOType_GPCLK, 0, Alt5 ; GPCLK1
PinEnd
PinStart 22, IO
PinBelongsTo GPIOType_GPIO, 22, AltGPI ; GPIO
PinEnd
PinStart 23, IO
PinBelongsTo GPIOType_GPIO, 23, AltGPI ; GPIO
PinEnd
PinStart 24, IO
PinBelongsTo GPIOType_GPIO, 24, AltGPI ; GPIO
PinEnd
PinStart 25, IO
PinBelongsTo GPIOType_GPIO, 25, AltGPI ; GPIO
PinEnd
PinStart 26, IO
PinBelongsTo GPIOType_GPIO, 26, AltGPI ; GPIO
PinEnd
PinStart 27, IO
PinBelongsTo GPIOType_GPIO, 27, AltGPI ; GPIO
PinEnd
PinStart 28, IO
PinBelongsTo GPIOType_GPIO, 28, AltGPI ; GPIO
PinBelongsTo GPIOType_I2C, 0, Alt0 ; I2C0 SDA
PinBelongsTo GPIOType_PCM, 0, Alt2 ; PCM0 CLK
PinEnd
PinStart 29, IO
PinBelongsTo GPIOType_GPIO, 29, AltGPI ; GPIO
PinBelongsTo GPIOType_I2C, 0, Alt0 ; I2C0 SCL
PinBelongsTo GPIOType_PCM, 0, Alt2 ; PCM0 FS
PinEnd
PinStart 30, IO
PinBelongsTo GPIOType_GPIO, 30, AltGPI ; GPIO
PinBelongsTo GPIOType_PCM, 0, Alt2 ; PCM0 DIN
PinEnd
PinStart 31, IO
PinBelongsTo GPIOType_GPIO, 31, AltGPI ; GPIO
PinBelongsTo GPIOType_PCM, 0, Alt2 ; PCM0 DOUT
PinEnd
; Table ends
DCD -1
GPIO_Port0_Table_BCM2838
PinStart 0, IO
PinBelongsTo GPIOType_GPIO, 0, AltGPI ; GPIO
PinBelongsTo GPIOType_I2C, 0, Alt0 ; I2C0 SDA
......@@ -1042,32 +1195,28 @@ GPIO_Port0_Table
PinStart 18, IO
PinBelongsTo GPIOType_GPIO, 18, AltGPI ; GPIO
PinBelongsTo GPIOType_PCM, 0, Alt0 ; PCM0 CLK
PinBelongsTo GPIOType_BSC, 0, Alt3 ; BSC0 SDA/MOSI BCM2835-7
PinBelongsTo GPIOType_SPI, 6, Alt3 ; SPI6 CE0 BCM2838
PinBelongsTo GPIOType_SPI, 6, Alt3 ; SPI6 CE0
PinBelongsTo GPIOType_SPI, 1, Alt4 ; SPI1 CE0
PinBelongsTo GPIOType_PWM, 0, Alt5 ; PWM0
PinEnd
PinStart 19, IO
PinBelongsTo GPIOType_GPIO, 19, AltGPI ; GPIO
PinBelongsTo GPIOType_PCM, 0, Alt0 ; PCM0 FS
PinBelongsTo GPIOType_BSC, 0, Alt3 ; BSC0 SCL/SCLK BM2835-7
PinBelongsTo GPIOType_SPI, 5, Alt3 ; SPI5 MISO BCM2838
PinBelongsTo GPIOType_SPI, 5, Alt3 ; SPI5 MISO
PinBelongsTo GPIOType_SPI, 1, Alt4 ; SPI1 MISO
PinBelongsTo GPIOType_PWM, 1, Alt5 ; PWM1
PinEnd
PinStart 20, IO
PinBelongsTo GPIOType_GPIO, 20, AltGPI ; GPIO
PinBelongsTo GPIOType_PCM, 0, Alt0 ; PCM0 DIN
PinBelongsTo GPIOType_BSC, 0, Alt3 ; BSC0 MISO BCM2835-7
PinBelongsTo GPIOType_SPI, 5, Alt3 ; SPI5 MOSI BCM2838
PinBelongsTo GPIOType_SPI, 5, Alt3 ; SPI5 MOSI
PinBelongsTo GPIOType_SPI, 1, Alt4 ; SPI1 MOSI
PinBelongsTo GPIOType_GPCLK, 0, Alt5 ; GPCLK0
PinEnd
PinStart 21, IO
PinBelongsTo GPIOType_GPIO, 21, AltGPI ; GPIO
PinBelongsTo GPIOType_PCM, 0, Alt0 ; PCM0 DOUT
PinBelongsTo GPIOType_BSC, 0, Alt3 ; BSC0 CE BCM2835-7
PinBelongsTo GPIOType_SPI, 5, Alt3 ; SPI5 SCLK BCM2838
PinBelongsTo GPIOType_SPI, 5, Alt3 ; SPI5 SCLK
PinBelongsTo GPIOType_SPI, 1, Alt4 ; SPI1 SCLK
PinBelongsTo GPIOType_GPCLK, 0, Alt5 ; GPCLK1
PinEnd
......@@ -1227,4 +1376,8 @@ GPIOPortTables
DCD GPIO_Port0_Table
DCD GPIO_Port1_Table
GPIOPortTables_BCM2838
DCD GPIO_Port0_Table_BCM2838
DCD GPIO_Port1_Table
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