# # GDB Init script for the DISKtel ColdFire 5307 board. # # The main purpose of this script is to configure the # DRAM controller so code can be loaded. # define addresses set $mbar = 0x10000001 set $rsr = $mbar - 1 + 0x000 set $sypcr = $mbar - 1 + 0x001 set $swivr = $mbar - 1 + 0x002 set $swsr = $mbar - 1 + 0x003 set $simr = $mbar - 1 + 0x003 set $par = $mbar - 1 + 0x004 set $irqpar= $mbar - 1 + 0x006 set $pllcr = $mbar - 1 + 0x008 set $mpark = $mbar - 1 + 0x00c set $ipr = $mbar - 1 + 0x040 set $imr = $mbar - 1 + 0x044 set $icr0 = $mbar - 1 + 0x04c set $icr1 = $mbar - 1 + 0x04d set $icr2 = $mbar - 1 + 0x04e set $icr3 = $mbar - 1 + 0x04f set $icr4 = $mbar - 1 + 0x050 set $icr5 = $mbar - 1 + 0x051 set $icr6 = $mbar - 1 + 0x052 set $icr7 = $mbar - 1 + 0x053 set $icr8 = $mbar - 1 + 0x054 set $icr9 = $mbar - 1 + 0x055 set $icr10 = $mbar - 1 + 0x056 set $icr11 = $mbar - 1 + 0x057 set $csar0 = $mbar - 1 + 0x080 set $csmr0 = $mbar - 1 + 0x084 set $cscr0 = $mbar - 1 + 0x08a set $csar1 = $mbar - 1 + 0x08c set $csmr1 = $mbar - 1 + 0x090 set $cscr1 = $mbar - 1 + 0x096 set $csbar = $mbar - 1 + 0x098 set $csbamr= $mbar - 1 + 0x09c set $csmr2 = $mbar - 1 + 0x09e set $cscr2 = $mbar - 1 + 0x0a2 set $csmr3 = $mbar - 1 + 0x0aa set $cscr3 = $mbar - 1 + 0x0ae set $csmr4 = $mbar - 1 + 0x0b6 set $cscr4 = $mbar - 1 + 0x0ba set $csmr5 = $mbar - 1 + 0x0c2 set $cscr5 = $mbar - 1 + 0x0c6 set $csmr6 = $mbar - 1 + 0x0ce set $cscr6 = $mbar - 1 + 0x0d2 set $csmr7 = $mbar - 1 + 0x0da set $cscr7 = $mbar - 1 + 0x0de set $dcr = $mbar - 1 + 0x100 set $dacr0 = $mbar - 1 + 0x108 set $dmr0 = $mbar - 1 + 0x10c set $dacr1 = $mbar - 1 + 0x110 set $dmr1 = $mbar - 1 + 0x114 set $tmr1 = $mbar - 1 + 0x140 set $trr1 = $mbar - 1 + 0x144 set $tcr1 = $mbar - 1 + 0x148 set $tcn1 = $mbar - 1 + 0x14C set $ter1 = $mbar - 1 + 0x151 set $tmr2 = $mbar - 1 + 0x180 set $trr2 = $mbar - 1 + 0x184 set $tcr2 = $mbar - 1 + 0x188 set $tcn2 = $mbar - 1 + 0x18C set $ter2 = $mbar - 1 + 0x191 set $paddr = $mbar - 1 + 0x244 set $padat = $mbar - 1 + 0x248 end # # Setup RAMBAR for the internal SRAM. # define setup-sram set $rambar = 0x20000001 end # # Setup Parallel I/O ports... # define setup-pp set *((unsigned short *) $par) = 0xc000 set *((unsigned short *) $paddr) = 0x3000 set *((unsigned short *) $padat) = 0x0000 end # # Setup chip selects... # define setup-cs # CS0 -- FLASH ROM set *((unsigned short *) $csar0) = 0xf000 set *((unsigned long *) $csmr0) = 0x000f0001 set *((unsigned short *) $cscr0) = 0x3d80 # CS1 -- Nothing set *((unsigned short *) $csar1) = 0xf800 set *((unsigned long *) $csmr1) = 0x000f0001 set *((unsigned short *) $cscr1) = 0x3d80 # CS2-7 are at 0x30000000 set *((unsigned short *) $csbar) = 0x3000 set *((unsigned short *) $csbamr) = 0x0000 # CS2 -- Nothing, address=0x30400000 set *((unsigned short *) $csmr2) = 0x0001 set *((unsigned short *) $cscr2) = 0x3d40 # CS3 -- Ethernet, address=0x30600000 set *((unsigned short *) $csmr3) = 0x0001 set *((unsigned short *) $cscr3) = 0x3d80 # CS4 -- Nothing, address=0x30800000 set *((unsigned short *) $csmr4) = 0x0001 set *((unsigned short *) $cscr4) = 0x3d40 # CS5 -- Nothing, address=0x30a00000 set *((unsigned short *) $csmr5) = 0x0001 set *((unsigned short *) $cscr5) = 0x3d40 # CS6 -- IDE interface, address=0x30c00000 set *((unsigned short *) $csmr6) = 0x0001 set *((unsigned short *) $cscr6) = 0x0040 # CS7 -- Nothing, address=0x30e00000 set *((unsigned short *) $csmr7) = 0x0001 set *((unsigned short *) $cscr7) = 0x3d40 end # # GDB boot loader # define bootload cont load boot/etherboot/ethboot-bdm.elf load boot/boot-bdm.elf symbol-file boot/boot-bdm.elf set $pc=_start add-symbol-file boot/etherboot/ethboot-bdm.elf ðerboot_addr echo \nType 'cont' to start bootloader...\n end # # Init for DISKtel ColdFire target... # target bdm /dev/bdmcf0 addresses setup-sram setup-cs setup-pp load bin/eliamem.elf set $pc = 0x20000000 set $sp = 0x20000400 set $fp = 0x20000400 set $vbr = 0x20000000 set $ps = 0x2700 set print pretty set print asm-demangle display/i $pc select-frame 0