#------------------------------------------------------------------------------ # Gigabeat F - Samsung s3c2440A Processor with 32MB DRAM, 1 MB N0R #------------------------------------------------------------------------------ # By Karl Kurbjun 5/2010 based off Mini2440 board setup by B Findlay # # Your openocd.cfg file should contain: # source [find interface/.cfg] # source [find board/mini2440.cfg] # #------------------------------------------------------------------------------ # CPU Configuration #------------------------------------------------------------------------------ # # The standard 2440 configuration will not work for the working space # source [find target/samsung_s3c2440.cfg] # The text below is the same as the 2440 configuration with the working space # changed. if { [info exists CHIPNAME] } { set _CHIPNAME $CHIPNAME } else { set _CHIPNAME s3c2440 } if { [info exists ENDIAN] } { set _ENDIAN $ENDIAN } else { # this defaults to a bigendian set _ENDIAN little } if { [info exists CPUTAPID ] } { set _CPUTAPID $CPUTAPID } else { # force an error till we get a good number set _CPUTAPID 0x0032409d } #jtag scan chain jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0x0f -expected-id $_CPUTAPID set _TARGETNAME $_CHIPNAME.cpu target create $_TARGETNAME arm920t -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm920t $_TARGETNAME configure -work-area-phys 0x30000000 -work-area-size 0x4000 -work-area-backup 1 #reset configuration reset_config trst_and_srst #------------------------------------------------------------------------------ # 1 MB Spansion/Fujitsu flash at address 0x04000000 with a 16-bit interface set _FLASHNAME $_CHIPNAME.flash flash bank $_FLASHNAME cfi 0x04000000 0x100000 2 2 $_TARGETNAME #reset configuration jtag_nsrst_delay 100 jtag_ntrst_delay 100 #------------------------------------------------------------------------------ # Setup JTAG adapter #------------------------------------------------------------------------------ jtag_khz 12000 #------------------------------------------------------------------------------ # Setup GDB #------------------------------------------------------------------------------ gdb_breakpoint_override hard #------------------------------------------------------------------------------ # Setup jtag chain resets and initialize processor #------------------------------------------------------------------------------ targets # arm7_9 dcc_downloads enable # arm7_9 fast_memory_access enable jtag_nsrst_delay 100 jtag_ntrst_delay 100 reset_config trst_and_srst init echo " " echo "-------------------------------------------" echo "--- login with - telnet localhost 4444 ---" echo "--- then type gigf_help ---" echo "-------------------------------------------" echo " " #------------------------------------------------------------------------------ # Processor Initialialization #------------------------------------------------------------------------------ proc gigf_init { } { halt # Disable watchdog mww 0x53000000 0x00000000 # Setup Memory mww 0x48000000 0x01055102 mww 0x48000004 0x00000D60 mww 0x48000008 0x00000000 mww 0x4800000C 0x00001FA0 mww 0x48000010 0x00001D80 mww 0x48000014 0x00001D80 mww 0x48000018 0x00000000 mww 0x4800001C 0x00018005 mww 0x48000020 0x00018005 mww 0x48000024 0x00980501 mww 0x48000028 0x00000090 mww 0x4800002C 0x00000030 mww 0x48000030 0x00000030 s3c2440.cpu curstate } #------------------------------------------------------------------------------ # Spansion/Fujitsu NOR Flash Routines #------------------------------------------------------------------------------ proc gigf_fconfig { } { halt flash probe 0 flash protect_check 0 flash info 0 } proc gigf_fwrite { image_location } { flash write_image erase $image_location 0x04000000 } #------------------------------------------------------------------------------ # Help information #------------------------------------------------------------------------------ proc gigf_help {} { echo " " echo " " echo "-------------------------------------------------------------" echo "---- The following gigabeatf funcs are supported ----" echo "---- gigf_init - Initialize SOC ----" echo "---- gigf_fconfig - Fills in NOR flash information ----" echo "---- gigf_fwrite - Writes the specified image to flash----" echo "---- gigf_help - Displays this help message ----" echo "-------------------------------------------------------------" echo " " echo " " }