This commit is contained in:
pvvx 2017-06-28 07:09:45 +03:00
parent b8c699eb1c
commit 3a865fb51d
40 changed files with 293 additions and 463 deletions

View file

@ -4,6 +4,6 @@ r1
trst1
h
r
w4 0x40000210,0x111157
w4 0x40000210,0x0211157
g
q

View file

@ -7,6 +7,6 @@ r
loadbin build/bin/ram_1.r.bin 0x10000bc8
loadbin build/bin/ram_2.bin 0x10006000
r
w4 0x40000210,0x20111157
w4 0x40000210,0x20111113
g
q

View file

@ -48,27 +48,27 @@ end
# Boot RAM start_addr0() Run if ( v400001F4 & 0x8000000 ) && ( v40000210 & 0x80000000 )
define SetBootCall0
printf "SetBoot = Call0:\n"
monitor long 0x40000210 = 0x80111157
monitor long 0x40000210 = 0x80011117
end
# Boot RAM start_addr1() Run if ( v40000210 & 0x20000000 )
define SetBootCall1
printf "SetBoot = Call1:\n"
monitor long 0x40000210 = 0x20111157
monitor long 0x40000210 = 0x20011117
end
# Boot RAM start_addr2() Run if ( v40000210 & 0x10000000 )
define SetBootCall2
printf "SetBoot = Call2:\n"
monitor long 0x40000210 = 0x10111157
monitor long 0x40000210 = 0x10011117
end
# Boot RAM start_addr3() Run if ( v400001F4 & 0x8000000 ) && ( v40000210 & 0x8000000 )
define SetBootCall3
printf "SetBoot = Call3:\n"
monitor long 0x40000210 = 0x8111157
monitor long 0x40000210 = 0x8011117
end
# Boot RAM start_addr4() Init console, Run if ( v40000210 & 0x4000000 )
define SetBootCall4
printf "SetBoot = Call4:\n"
monitor long 0x40000210 = 0x4111157
monitor long 0x40000210 = 0x4011117
end
# CPU CLK 166 MHz?
define SetClk166MHz

View file

@ -4,7 +4,6 @@ source -v flasher/gdb_flasher.jlink
InitJlink
SystemInit
SPI_Init
monitor speed 12000
#FlashInfo
# Read FullFlash
printf "Read FullFlash:\n"
@ -12,6 +11,6 @@ set $dumpstartaddr = $SPI_FLASH_BASE
set $dumpendaddr = $SPI_FLASH_BASE + 0x100000
printf "Start addr of dumping = 0x%08x\n", $dumpstartaddr
printf "End addr of dumping = 0x%08x\n", $dumpendaddr
dump binary memory ../fullflash.bin $dumpstartaddr $dumpendaddr
dump binary memory ./build/bin/fullflash.bin $dumpstartaddr $dumpendaddr
printf "FullFlash saved in ./build/bin/fullflash.bin - OK.\n"
quit

View file

@ -134,12 +134,10 @@ end
end
#########################################
source -v flasher/gdb_flasher.jlink
source -v flasher/file_info.jlink
InitJlink
SystemInit
SetClk166MHz
SetClk83MHz
SPI_Init
FlasherInit
FlasherLoad flasher/rtl8710_flasher.bin
@ -155,8 +153,4 @@ end
else
printf "Error: Image size is zero!\n"
end
FlashImagesInfo
monitor reset
SetBootFlash
monitor go
quit

View file

@ -7,7 +7,6 @@ set $rtl8710_flasher_auto_erase = 1
set $rtl8710_flasher_auto_verify = 1
set $rtl8710_flasher_firmware_ptr = 0x10001000
set $rtl8710_flasher_buffer = 0x10008000
#262144
set $rtl8710_flasher_buffer_size = 421888
set $rtl8710_flasher_sector_size = 4096
set $rtl8710_flasher_auto_erase_sector = 0xFFFFFFFF
@ -37,12 +36,11 @@ if $rtl8710_flasher_capacity == 0
monitor go
FlasherWait
set $id = {int}($rtl8710_flasher_buffer + 0x0C)
set $rtl8710_flasher_capacity = 1 << (($id >> 16) & 0x0ff)
if ($id == 0x1420c2)
set $rtl8710_flasher_capacity = 1 << (($id >> 16) & 0x0ff)
printf "Flash ID = 0x%08x : MX25L8006E (%d kbytes)\n", $id, $rtl8710_flasher_capacity>>10
else
set $rtl8710_flasher_capacity = 1024*1024)
error "Flash ID = 0x%08x : ?\n", $id
printf "Flash ID = 0x%08x : (%d kbytes)\n", $id, $rtl8710_flasher_capacity>>10
end
printf "RTL8710 flasher initialized\n"
else
@ -108,9 +106,9 @@ while $offset < $size
end
set $flash_offset = $arg1 + $offset
printf "write offset 0x%08x\n", $flash_offset
set $parms1 = $rtl8710_flasher_buffer + 0x20 - $offset - $arg1
set $parms2 = $offset + $arg1
set $parms3 = $offset + $len + $arg1
set $parms1 = $rtl8710_flasher_buffer + 0x20 - $flash_offset
set $parms2 = $flash_offset
set $parms3 = $flash_offset + $len
restore $arg0 binary $parms1 $parms2 $parms3
if $rtl8710_flasher_auto_erase != 0
set $count_i = $flash_offset