initial push

This commit is contained in:
Bernd Mueller
2026-06-17 13:44:30 +02:00
commit adfd70813f
372 changed files with 146450 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,55 @@
diff -urN insight-5.0.orig/gdb/gdbtk/library/targetselection.itb insight-5.0/gdb/gdbtk/library/targetselection.itb
--- insight-5.0.orig/gdb/gdbtk/library/targetselection.itb Fri Feb 2 17:34:20 2001
+++ insight-5.0/gdb/gdbtk/library/targetselection.itb Fri Feb 2 23:07:22 2001
@@ -104,6 +104,20 @@
set gdb_target(remotetcp,runlist) {1 1 0 1}
set gdb_target(remotetcp,after_attaching) {}
+ # BDM
+ set gdb_target(bdm,pretty-name) "BDM/Direct"
+ set gdb_target(bdm,defbaud) "DIRECT"
+ set gdb_target(bdm,baud-rates) {}
+ set gdb_target(bdm,cmd) "bdm /dev/bdmcf0"
+ set gdb_target(bdm,runlist) {1 1 0 1}
+ set gdb_target(bdm,after_attaching) { setup-and-load }
+ set gdb_target(bdmtcp,pretty-name) "BDM/TCP"
+ set gdb_target(bdmtcp,defbaud) "TCP"
+ set gdb_target(bdmtcp,baud-rates) {}
+ set gdb_target(bdmtcp,cmd) "BDM tcpX"
+ set gdb_target(bdmtcp,runlist) {1 1 0 1}
+ set gdb_target(bdmtcp,after_attaching) { setup-and-load }
+
# ARM Angel
set gdb_target(rdi,pretty-name) "ARM Angel/Serial"
set gdb_target(rdi,defbaud) "9600"
@@ -627,7 +641,20 @@
pref define gdb/load/$t-verbose [pref get gdb/load/verbose]
$f.fr.verb config -variable [pref varname gdb/load/$t-verbose]
# Map the correct entries and comboboxes onto the screen
- if {$gdb_target($t,defbaud) == "TCP"} {
+ if {$gdb_target($t,defbaud) == "DIRECT"} {
+ # we have a direct device target
+ # map device
+ if {$mapped1 != "$fr.host"} {
+ grid forget $mapped1
+ set mapped1 $fr.host
+ grid $mapped1 -row 1 -column 1 -sticky w -padx 5 -pady 5
+ }
+ $fr.cbl configure -text "Device:"
+ $fr.host config -textvariable [pref varname gdb/load/$t-device]
+
+ $mapped1 configure -state normal
+# $mapped2 configure -state normal
+ } elseif {$gdb_target($t,defbaud) == "TCP"} {
# we have a tcp target
# map host and porte
if {$mapped1 != "$fr.host"} {
@@ -769,7 +796,7 @@
# ------------------------------------------------------------------
body TargetSelection::change_baud {w {baud ""}} {
if {$baud != ""} {
- if {[string compare $baud "TCP"] != 0} {
+ if {[string compare $baud "TCP"] != 0 && [string compare $baud "DIRECT"] != 0} {
gdb_cmd "set remotebaud $baud"
if {[catch {gdb_cmd "show remotebaud"} res]} {
set newbaud 0

View File

@@ -0,0 +1,56 @@
diff -urN insight-5.2.1.orig/gdb/gdbtk/library/targetselection.itb insight-5.2.1/gdb/gdbtk/library/targetselection.itb
--- insight-5.2.1.orig/gdb/gdbtk/library/targetselection.itb 2002-02-12 21:05:14.000000000 +0100
+++ insight-5.2.1/gdb/gdbtk/library/targetselection.itb 2003-06-14 00:48:01.000000000 +0200
@@ -104,6 +104,20 @@
set gdb_target(remotetcp,runlist) {1 1 0 1}
set gdb_target(remotetcp,after_attaching) {}
+ # BDM
+ set gdb_target(bdm,pretty-name) "BDM/Direct"
+ set gdb_target(bdm,defbaud) "DIRECT"
+ set gdb_target(bdm,baud-rates) {}
+ set gdb_target(bdm,cmd) "bdm /dev/bdmcf0"
+ set gdb_target(bdm,runlist) {1 1 0 1}
+ set gdb_target(bdm,after_attaching) { setup-and-load }
+ set gdb_target(bdmtcp,pretty-name) "BDM/TCP"
+ set gdb_target(bdmtcp,defbaud) "TCP"
+ set gdb_target(bdmtcp,baud-rates) {}
+ set gdb_target(bdmtcp,cmd) "BDM tcpX"
+ set gdb_target(bdmtcp,runlist) {1 1 0 1}
+ set gdb_target(bdmtcp,after_attaching) { setup-and-load }
+
# ARM Angel
set gdb_target(rdi,pretty-name) "ARM Angel/Serial"
set gdb_target(rdi,defbaud) "9600"
@@ -681,7 +695,20 @@
pref define gdb/load/$t-verbose [pref get gdb/load/verbose]
$f.fr.verb config -variable [pref varname gdb/load/$t-verbose]
# Map the correct entries and comboboxes onto the screen
- if {$gdb_target($t,defbaud) == "TCP"} {
+ if {$gdb_target($t,defbaud) == "DIRECT"} {
+ # we have a direct device target
+ # map device
+ if {$mapped1 != "$fr.host"} {
+ grid forget $mapped1
+ set mapped1 $fr.host
+ grid $mapped1 -row 1 -column 1 -sticky w -padx 5 -pady 5
+ }
+ $fr.cbl configure -text "Device:"
+ $fr.host config -textvariable [pref varname gdb/load/$t-device]
+
+ $mapped1 configure -state normal
+# $mapped2 configure -state normal
+ } elseif {$gdb_target($t,defbaud) == "TCP"} {
# we have a tcp target
# map host and porte
if {$mapped1 != "$fr.host"} {
@@ -833,7 +860,8 @@
body TargetSelection::change_baud {w {baud ""}} {
if {$baud != ""} {
if {([string compare $baud "TCP"] != 0)
- && ([string compare $baud "ETH"] != 0)} {
+ && ([string compare $baud "ETH"] != 0)
+ && ([string compare $baud "DIRECT"] != 0)} {
gdb_cmd "set remotebaud $baud"
if {[catch {gdb_cmd "show remotebaud"} res]} {
set newbaud 0

View File

@@ -0,0 +1,79 @@
diff -urN insight-5.3.orig/gdb/gdbtk/library/targetselection.itb insight-5.3/gdb/gdbtk/library/targetselection.itb
--- insight-5.3.orig/gdb/gdbtk/library/targetselection.itb 2002-02-12 21:05:14.000000000 +0100
+++ insight-5.3/gdb/gdbtk/library/targetselection.itb 2003-06-14 00:48:01.000000000 +0200
@@ -104,6 +104,20 @@
set gdb_target(remotetcp,runlist) {1 1 0 1}
set gdb_target(remotetcp,after_attaching) {}
+ # BDM
+ set gdb_target(bdm,pretty-name) "BDM/Direct"
+ set gdb_target(bdm,defbaud) "DIRECT"
+ set gdb_target(bdm,baud-rates) {}
+ set gdb_target(bdm,cmd) "bdm /dev/bdmcf0"
+ set gdb_target(bdm,runlist) {1 1 0 1}
+ set gdb_target(bdm,after_attaching) { setup-and-load }
+ set gdb_target(bdmtcp,pretty-name) "BDM/TCP"
+ set gdb_target(bdmtcp,defbaud) "TCP"
+ set gdb_target(bdmtcp,baud-rates) {}
+ set gdb_target(bdmtcp,cmd) "BDM tcpX"
+ set gdb_target(bdmtcp,runlist) {1 1 0 1}
+ set gdb_target(bdmtcp,after_attaching) { setup-and-load }
+
# ARM Angel
set gdb_target(rdi,pretty-name) "ARM Angel/Serial"
set gdb_target(rdi,defbaud) "9600"
@@ -681,7 +695,20 @@
pref define gdb/load/$t-verbose [pref get gdb/load/verbose]
$f.fr.verb config -variable [pref varname gdb/load/$t-verbose]
# Map the correct entries and comboboxes onto the screen
- if {$gdb_target($t,defbaud) == "TCP"} {
+ if {$gdb_target($t,defbaud) == "DIRECT"} {
+ # we have a direct device target
+ # map device
+ if {$mapped1 != "$fr.host"} {
+ grid forget $mapped1
+ set mapped1 $fr.host
+ grid $mapped1 -row 1 -column 1 -sticky w -padx 5 -pady 5
+ }
+ $fr.cbl configure -text "Device:"
+ $fr.host config -textvariable [pref varname gdb/load/$t-device]
+
+ $mapped1 configure -state normal
+# $mapped2 configure -state normal
+ } elseif {$gdb_target($t,defbaud) == "TCP"} {
# we have a tcp target
# map host and porte
if {$mapped1 != "$fr.host"} {
@@ -833,7 +860,8 @@
body TargetSelection::change_baud {w {baud ""}} {
if {$baud != ""} {
if {([string compare $baud "TCP"] != 0)
- && ([string compare $baud "ETH"] != 0)} {
+ && ([string compare $baud "ETH"] != 0)
+ && ([string compare $baud "DIRECT"] != 0)} {
gdb_cmd "set remotebaud $baud"
if {[catch {gdb_cmd "show remotebaud"} res]} {
set newbaud 0
diff -Nur insight-5.3.orig/gdb/gdbtk/generic/gdbtk-hooks.c insight-5.3/gdb/gdbtk/generic/gdbtk-hooks.c
--- insight-5.3.orig/gdb/gdbtk/generic/gdbtk-hooks.c 2002-07-03 19:38:22.000000000 +0200
+++ insight-5.3/gdb/gdbtk/generic/gdbtk-hooks.c 2003-09-05 14:02:42.000000000 +0200
@@ -518,6 +518,10 @@
gdbtk_call_command (struct cmd_list_element *cmdblk,
char *arg, int from_tty)
{
+ struct cleanup *old_chain;
+
+ old_chain = make_cleanup (null_cleanup, 0);
+
running_now = 0;
if (cmdblk->class == class_run || cmdblk->class == class_trace)
{
@@ -532,6 +536,8 @@
}
else
cmd_func (cmdblk, arg, from_tty);
+
+ do_cleanups (old_chain);
}
/* Called after a `set' command succeeds. Runs the Tcl hook

View File

@@ -0,0 +1,56 @@
diff -Nru insight-5.3.92.orig/gdb/gdbtk/library/targetselection.itb insight-5.3.92/gdb/gdbtk/library/targetselection.itb
--- insight-5.3.92.orig/gdb/gdbtk/library/targetselection.itb 2003-02-04 09:03:09.000000000 +0100
+++ insight-5.3.92/gdb/gdbtk/library/targetselection.itb 2003-09-21 13:12:41.000000000 +0200
@@ -104,6 +104,20 @@
set gdb_target(remotetcp,runlist) {1 1 0 1}
set gdb_target(remotetcp,after_attaching) {}
+ # BDM
+ set gdb_target(bdm,pretty-name) "BDM/Direct"
+ set gdb_target(bdm,defbaud) "DIRECT"
+ set gdb_target(bdm,baud-rates) {}
+ set gdb_target(bdm,cmd) "bdm /dev/bdmcf0"
+ set gdb_target(bdm,runlist) {1 1 0 1}
+ set gdb_target(bdm,after_attaching) { setup-and-load }
+ set gdb_target(bdmtcp,pretty-name) "BDM/TCP"
+ set gdb_target(bdmtcp,defbaud) "TCP"
+ set gdb_target(bdmtcp,baud-rates) {}
+ set gdb_target(bdmtcp,cmd) "BDM tcpX"
+ set gdb_target(bdmtcp,runlist) {1 1 0 1}
+ set gdb_target(bdmtcp,after_attaching) { setup-and-load }
+
# ARM Angel
set gdb_target(rdi,pretty-name) "ARM Angel/Serial"
set gdb_target(rdi,defbaud) "9600"
@@ -694,7 +708,20 @@
pref define gdb/load/$t-verbose [pref get gdb/load/verbose]
$f.fr.verb config -variable [pref varname gdb/load/$t-verbose]
# Map the correct entries and comboboxes onto the screen
- if {$gdb_target($t,defbaud) == "TCP"} {
+ if {$gdb_target($t,defbaud) == "DIRECT"} {
+ # we have a direct device target
+ # map device
+ if {$mapped1 != "$fr.host"} {
+ grid forget $mapped1
+ set mapped1 $fr.host
+ grid $mapped1 -row 1 -column 1 -sticky w -padx 5 -pady 5
+ }
+ $fr.cbl configure -text "Device:"
+ $fr.host config -textvariable [pref varname gdb/load/$t-device]
+
+ $mapped1 configure -state normal
+# $mapped2 configure -state normal
+ } elseif {$gdb_target($t,defbaud) == "TCP"} {
# we have a tcp target
# map host and porte
if {$mapped1 != "$fr.host"} {
@@ -846,7 +873,8 @@
itcl::body TargetSelection::change_baud {w {baud ""}} {
if {$baud != ""} {
if {([string compare $baud "TCP"] != 0)
- && ([string compare $baud "ETH"] != 0)} {
+ && ([string compare $baud "ETH"] != 0)
+ && ([string compare $baud "DIRECT"] != 0)} {
gdb_cmd "set remotebaud $baud"
if {[catch {gdb_cmd "show remotebaud"} res]} {
set newbaud 0

127
gdb/scripts/5206.gdb Normal file
View File

@@ -0,0 +1,127 @@
#
# GDB Init script for the Coldfire 5206 processor.
#
# The main purpose of this script is to configure the
# DRAM controller so code can be loaded.
#
#
define addresses
set $mbar = 0x10000001
set $simr = $mbar - 1 + 0x003
set $icr1 = $mbar - 1 + 0x014
set $icr2 = $mbar - 1 + 0x015
set $icr3 = $mbar - 1 + 0x016
set $icr4 = $mbar - 1 + 0x017
set $icr5 = $mbar - 1 + 0x018
set $icr6 = $mbar - 1 + 0x019
set $icr7 = $mbar - 1 + 0x01A
set $icr8 = $mbar - 1 + 0x01B
set $icr9 = $mbar - 1 + 0x01C
set $icr10 = $mbar - 1 + 0x01D
set $icr11 = $mbar - 1 + 0x01E
set $icr12 = $mbar - 1 + 0x01F
set $icr13 = $mbar - 1 + 0x020
set $imr = $mbar - 1 + 0x036
set $ipr = $mbar - 1 + 0x03A
set $rsr = $mbar - 1 + 0x040
set $sypcr = $mbar - 1 + 0x041
set $swivr = $mbar - 1 + 0x042
set $swsr = $mbar - 1 + 0x043
set $dcrr = $mbar - 1 + 0x046
set $dctr = $mbar - 1 + 0x04A
set $dcar0 = $mbar - 1 + 0x04C
set $dcmr0 = $mbar - 1 + 0x050
set $dccr0 = $mbar - 1 + 0x057
set $dcar1 = $mbar - 1 + 0x058
set $dcmr1 = $mbar - 1 + 0x05C
set $dccr1 = $mbar - 1 + 0x063
set $csar0 = $mbar - 1 + 0x064
set $csmr0 = $mbar - 1 + 0x068
set $cscr0 = $mbar - 1 + 0x06E
set $csar1 = $mbar - 1 + 0x070
set $csmr1 = $mbar - 1 + 0x074
set $cscr1 = $mbar - 1 + 0x07A
set $csar2 = $mbar - 1 + 0x07C
set $csmr2 = $mbar - 1 + 0x080
set $cscr2 = $mbar - 1 + 0x086
set $csar3 = $mbar - 1 + 0x088
set $csmr3 = $mbar - 1 + 0x08C
set $cscr3 = $mbar - 1 + 0x092
set $csar4 = $mbar - 1 + 0x094
set $csmr4 = $mbar - 1 + 0x098
set $cscr4 = $mbar - 1 + 0x09E
set $csar5 = $mbar - 1 + 0x0A0
set $csmr5 = $mbar - 1 + 0x0A4
set $cscr5 = $mbar - 1 + 0x0AA
set $csar6 = $mbar - 1 + 0x0AC
set $csmr6 = $mbar - 1 + 0x0B0
set $cscr6 = $mbar - 1 + 0x0B6
set $csar7 = $mbar - 1 + 0x0B8
set $csmr7 = $mbar - 1 + 0x0BC
set $cscr7 = $mbar - 1 + 0x0C2
set $dmcr = $mbar - 1 + 0x0C6
set $par = $mbar - 1 + 0x0CA
set $tmr1 = $mbar - 1 + 0x100
set $trr1 = $mbar - 1 + 0x104
set $tcr1 = $mbar - 1 + 0x108
set $tcn1 = $mbar - 1 + 0x10C
set $ter1 = $mbar - 1 + 0x111
set $tmr2 = $mbar - 1 + 0x120
set $trr2 = $mbar - 1 + 0x124
set $tcr2 = $mbar - 1 + 0x128
set $tcn2 = $mbar - 1 + 0x12C
set $ter2 = $mbar - 1 + 0x131
end
#
# Setup CSAR0 for the FLASH ROM.
#
define setup-cs
set *((short*) $csar0) = 0xffe0
set *((short*) $csmr0) = 0x00030000
set *((short*) $cscr0) = 0x0d83
set *((short*) $csar1) = 0xffff
set *((short*) $csmr1) = 0x0000001e
set *((short*) $cscr1) = 0x0043
set *((short*) $csar2) = 0x3000
set *((short*) $csmr2) = 0x00000014
set *((short*) $cscr2) = 0x0043
set *((short*) $csar3) = 0x4000
set *((short*) $csmr3) = 0x000f0000
set *((short*) $cscr3) = 0x0083
end
#
# Setup the DRAM controller.
#
define setup-dram
set *((short*) $dcrr) = 24
set *((short*) $dctr) = 0x0000
set *((short*) $dcar0) = 0x0000
set *((long*) $dcmr0) = 0x000e0000
set *((char*) $dccr0) = 0x07
set *((short*) $dcar1) = 0x0000
set *((long*) $dcmr1) = 0x00000000
set *((char*) $dccr1) = 0x00
end
#
# Wake up the board
#
defined initBoard
addresses
setup-cs
setup-dram
end

15
gdb/scripts/Makefile Normal file
View File

@@ -0,0 +1,15 @@
prefix = /usr/local/RTEMS
SCRIPTDIR = $(prefix)/lib/gdbScripts
BINDIR = $(prefix)/bin
all:
install:
-mkdir -p $(SCRIPTDIR)
for i in *.gdb ; do sed -e "/===PREFIX===/s@@$(prefix)"@ $$i >$(SCRIPTDIR)/$$i ; done
-mkdir -p $(BINDIR)
sed -e "/===PREFIX===/s@@$(prefix)"@ m68k-rtems-gdb >$(BINDIR)/m68k-rtems-gdb
chmod 755 $(BINDIR)/m68k-rtems-gdb
clean:

43
gdb/scripts/RTEMS360.gdb Normal file
View File

@@ -0,0 +1,43 @@
#
# Prepare to download and run an RTEMS executable image
#
#
# Load BDM/CPU32 support
#
source ===PREFIX===/lib/gdbScripts/SAL68360.gdb
source ===PREFIX===/lib/gdbScripts/showCPU32Exception.gdb
#
# Connect to the BDM interface
#
target bdm /dev/bdmcpu320
bdm_setdelay 0
#
# Catch exceptions and display the exception stack
#
break _uhoh
commands
displayExceptionStack
end
#
# Regain control on fatal errors
#
break rtems_panic
break _Internal_error_Occurred
break rtems_fatal_error_occurred
#
# Quit when the RTEMS executable finishes
#
break _mainDone
commands
quit
end
#
# Get the hardware to a known state
#
initBoard

43
gdb/scripts/RTEMS5206.gdb Normal file
View File

@@ -0,0 +1,43 @@
#
# Prepare to download and run an RTEMS executable image
#
#
# Load BDM/CF support
#
source ===PREFIX===/lib/gdbScripts/5206.gdb
source ===PREFIX===/lib/gdbScripts/showCPU32Exception.gdb
#
# Connect to the BDM interface
#
target bdm /dev/bdmcf0
bdm_setdelay 0
#
# Catch exceptions and display the exception stack
#
break _uhoh
commands
displayExceptionStack
end
#
# Regain control on fatal errors
#
break rtems_panic
break _Internal_error_Occurred
break rtems_fatal_error_occurred
#
# Quit when the RTEMS executable finishes
#
break _mainDone
commands
quit
end
#
# Get the hardware to a known state
#
initBoard

78
gdb/scripts/SAL68360.gdb Normal file
View File

@@ -0,0 +1,78 @@
#####################################################################
# Board setup for SAL Communications Controller card #
#####################################################################
define initBoard
bdm_reset
#
# Step 4: Set up module base address register
#
set $dpram = 0x0e000000
set $mbar = $dpram|0x101
set $regb = $dpram+0x1000
#
# I/O is to supervisor program space
#
set $dfc=5
set $sfc=5
#
# Step 7: Deal with clock synthesizer
#
set {unsigned char}($regb+0x000c) = 0x8f
set {unsigned char}($regb+0x0010) = 0xd000
set {unsigned short}($regb+0x0014) = 0x8000
#
# Step 8: Initialize system protection
#
set {unsigned char}($regb+0x0022) = 0x7f
#
# Step 9: Clear parameter RAM and reset communication processor module
# Ignore this for now, since all we want to use is the memory controller
#
#
# Step 10: Write PEPAR
#
set {unsigned short}($regb+0x0016) = 0x0180
#
# Step 11: Remap Chip Select 0 (CS0}
#
set {unsigned long}($regb+0x0040) = 0x17940120
set {unsigned long}($regb+0x0054) = 0x4ff80004
set {unsigned long}($regb+0x0050) = 0x0f000003
#
# Step 12: Initialize the system RAM
#
set {unsigned long}($regb+0x0064) = 0x0f000001
set {unsigned long}($regb+0x0060) = 0x00000001
set $ramjnk={unsigned long}0@8
#
# Determine RAM size
#
set {char}0 = 0
if ({char}0x00801000 == 0)
set {char}0 = 1
if ({char}0x000801000 == 1)
set {unsigned long}($regb+0x0040) = 0x178C0120
end
end
#
# Step 15: Set module configuration register
#
set {unsigned long}($regb+0x0000) = 0x00004c7f
end
define hook-run
initBoard
end

View File

@@ -0,0 +1,3 @@
#!/bin/sh
exec m68k-bdm-elf-gdb -x "===PREFIX===/lib/gdbScripts/RTEMS360.gdb" "$@"

View File

@@ -0,0 +1,22 @@
#
# Display an exception stack
#
define displayExceptionStack
set $frsr = *(unsigned short *)$sp
set $frpc = *(unsigned long *)((unsigned long)$sp + 2)
set $frfvo = *(unsigned short *)((unsigned long)$sp + 6)
set $frcode = $frfvo >> 12
set $frvect = ($frfvo & 0xFFF) >> 2
printf "EXCEPTION -- SR:0x%X PC:0x%X FRAME:0x%x VECTOR:%d\n", $frsr, $frpc, $frcode, $frvect
if $frcode==0x2
set $fripc = *(unsigned long *)((unsigned long)$sp + 0x8)
set $frssw = *(unsigned short *)((unsigned long)$sp + 0x16)
printf " INSTRUCTION PC:0x%X\n", $fripc,
end
if $frcode==0xC
set $frfault = *(unsigned long *)((unsigned long)$sp + 0x8)
set $fripc = *(unsigned long *)((unsigned long)$sp + 0x10)
set $frssw = *(unsigned short *)((unsigned long)$sp + 0x16)
printf " ADDRESS:0x%X INSTRUCTION PC:0x%X SSW:0x%X\n", $frfault, $fripc, $frssw
end
end