Commit e626e215 authored by Jeffrey Lee's avatar Jeffrey Lee

Add JTAG debugging support

Detail:
  hdr/BCM2835 - Add switch to allow GPIOs 22-27 to be reconfigured for ARM JTAG access
  s/Top - Configure GPIOs for JTAG if switch enabled
  s/GPIO - Disable GPIO HAL device if JTAG enabled (try and avoid any software messing with the pins)
Admin:
  Tested on Raspberry Pi 1 B, B+


Version 0.66. Tagged as 'BCM2835-0_66'
parent e277e70f
/* (0.65)
/* (0.66)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.65
#define Module_MajorVersion_CMHG 0.66
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 12 Dec 2016
#define Module_Date_CMHG 20 Jan 2017
#define Module_MajorVersion "0.65"
#define Module_Version 65
#define Module_MajorVersion "0.66"
#define Module_Version 66
#define Module_MinorVersion ""
#define Module_Date "12 Dec 2016"
#define Module_Date "20 Jan 2017"
#define Module_ApplicationDate "12-Dec-16"
#define Module_ApplicationDate "20-Jan-17"
#define Module_ComponentName "BCM2835"
#define Module_ComponentPath "mixed/RiscOS/Sources/HAL/BCM2835"
#define Module_FullVersion "0.65"
#define Module_HelpVersion "0.65 (12 Dec 2016)"
#define Module_LibraryVersionInfo "0:65"
#define Module_FullVersion "0.66"
#define Module_HelpVersion "0.66 (20 Jan 2017)"
#define Module_LibraryVersionInfo "0:66"
......@@ -42,6 +42,28 @@ Debug SETL {FALSE}
GBLL HALDebug
HALDebug SETL {FALSE} :LAND: Debug
; Enable JTAG support
;
; This reconfigures GPIO22-27 into alt4 mode, which maps the ARM JTAG
; signals to the following pins on the 40-pin GPIO header that's
; found on the B+ and later models:
;
; GPIO22 ARM_TRST pin 15
; GPIO23 ARM_RTCK pin 16
; GPIO24 ARM_TDO pin 18
; GPIO25 ARM_TCK pin 22
; GPIO26 ARM_TDI pin 37
; GPIO27 ARM_TMS pin 13
;
; If you want to debug an older board then you'll have to adjust the
; code accordingly (n.b. revision 1 boards for Pi 1B only have ARM_TDI
; available via the camera header, which will be awkward to get
; access to)
;
; As a precaution, this setting will also disable registration of the
; GPIO HAL device
GBLL JTAG
JTAG SETL {FALSE}
; RPi ARM11 registers
......
......@@ -147,9 +147,11 @@ GPIO_InitDevices ROUT
; Found a match
ADRL a2, GPIODevice
STR a4, [a2, #HALDevice_GPIORevision]
[ :LNOT: JTAG ; Play it safe, we don't want software messing with the JTAG GPIOs
MOV a1, #0
MOV lr, pc
LDR pc, OSentries+4*OS_AddDevice
]
EXIT
GPIO_Activate
......
......@@ -257,6 +257,19 @@ start
DCB "HalStartup",10,0
ALIGN
]
[ JTAG
; Configure the GPIO pins used for JTAG
LDR a1, PeriBase
ADD a1, a1, #GPIO_Base
LDR a2, [a1, #GPFSel2]
LDR a3, =&3f00003f
AND a2, a2, a3 ; Keep settings for 20, 21, 28, 29
LDR a3, =(3<<6)+(3<<9)+(3<<12)+(3<<15)+(3<<18)+(3<<21) ; Set 22-27 to alt4
ORR a2, a2, a3
STR a2, [a1, #GPFSel2]
]
; Enable USB power
; Note - may need changing to enable other devices in future
; Looks like we need to write the logical OR of all the devices we want enabled
......
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