mirror of
https://github.com/sandeepmistry/rtl8710-openocd.git
synced 2024-12-04 20:20:29 +00:00
MAC address reading support
This commit is contained in:
parent
e0e2b289d1
commit
0baf213844
3 changed files with 41 additions and 0 deletions
3
Makefile
3
Makefile
|
@ -31,6 +31,9 @@ clean:
|
||||||
test:
|
test:
|
||||||
openocd -f interface/stlink-v2-1.cfg -f script/rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_flash_read_id" -c "shutdown"
|
openocd -f interface/stlink-v2-1.cfg -f script/rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_flash_read_id" -c "shutdown"
|
||||||
|
|
||||||
|
mac:
|
||||||
|
openocd -f interface/stlink-v2-1.cfg -f script/rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_flash_read_mac" -c "shutdown"
|
||||||
|
|
||||||
dump:
|
dump:
|
||||||
openocd -f interface/stlink-v2-1.cfg -f script/rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_flash_read_id" -c "rtl8710_flash_read dump.bin 0 1048576" -c "shutdown"
|
openocd -f interface/stlink-v2-1.cfg -f script/rtl8710.ocd -c "init" -c "reset halt" -c "rtl8710_flash_read_id" -c "rtl8710_flash_read dump.bin 0 1048576" -c "shutdown"
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,8 @@ set rtl8710_flasher_command_read 3
|
||||||
set rtl8710_flasher_command_write 4
|
set rtl8710_flasher_command_write 4
|
||||||
set rtl8710_flasher_command_verify 5
|
set rtl8710_flasher_command_verify 5
|
||||||
|
|
||||||
|
set rtl8710_flasher_mac_address_offset 0xA088
|
||||||
|
|
||||||
set rtl8710_flasher_ready 0
|
set rtl8710_flasher_ready 0
|
||||||
set rtl8710_flasher_capacity 0
|
set rtl8710_flasher_capacity 0
|
||||||
set rtl8710_flasher_auto_erase 0
|
set rtl8710_flasher_auto_erase 0
|
||||||
|
@ -208,6 +210,23 @@ proc rtl8710_flash_verify {local_filename loc} {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc rtl8710_flash_read_mac {} {
|
||||||
|
global rtl8710_flasher_mac_address_offset
|
||||||
|
global rtl8710_flasher_buffer
|
||||||
|
rtl8710_flasher_init
|
||||||
|
rtl8710_flasher_read_block $rtl8710_flasher_mac_address_offset 6
|
||||||
|
set mac ""
|
||||||
|
mem2array mac 8 [expr {$rtl8710_flasher_buffer + 0x20}] 6
|
||||||
|
set res "MAC address: "
|
||||||
|
append res [format %02X $mac(0)]
|
||||||
|
append res ":" [format %02X $mac(1)]
|
||||||
|
append res ":" [format %02X $mac(2)]
|
||||||
|
append res ":" [format %02X $mac(3)]
|
||||||
|
append res ":" [format %02X $mac(4)]
|
||||||
|
append res ":" [format %02X $mac(5)]
|
||||||
|
echo $res
|
||||||
|
}
|
||||||
|
|
||||||
proc rtl8710_flash_auto_erase {on} {
|
proc rtl8710_flash_auto_erase {on} {
|
||||||
global rtl8710_flasher_auto_erase
|
global rtl8710_flasher_auto_erase
|
||||||
if {[expr {$on != 0}]} {
|
if {[expr {$on != 0}]} {
|
||||||
|
|
|
@ -101,6 +101,8 @@ set rtl8710_flasher_command_read 3
|
||||||
set rtl8710_flasher_command_write 4
|
set rtl8710_flasher_command_write 4
|
||||||
set rtl8710_flasher_command_verify 5
|
set rtl8710_flasher_command_verify 5
|
||||||
|
|
||||||
|
set rtl8710_flasher_mac_address_offset 0xA088
|
||||||
|
|
||||||
set rtl8710_flasher_ready 0
|
set rtl8710_flasher_ready 0
|
||||||
set rtl8710_flasher_capacity 0
|
set rtl8710_flasher_capacity 0
|
||||||
set rtl8710_flasher_auto_erase 0
|
set rtl8710_flasher_auto_erase 0
|
||||||
|
@ -304,6 +306,23 @@ proc rtl8710_flash_verify {local_filename loc} {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc rtl8710_flash_read_mac {} {
|
||||||
|
global rtl8710_flasher_mac_address_offset
|
||||||
|
global rtl8710_flasher_buffer
|
||||||
|
rtl8710_flasher_init
|
||||||
|
rtl8710_flasher_read_block $rtl8710_flasher_mac_address_offset 6
|
||||||
|
set mac ""
|
||||||
|
mem2array mac 8 [expr {$rtl8710_flasher_buffer + 0x20}] 6
|
||||||
|
set res "MAC address: "
|
||||||
|
append res [format %02X $mac(0)]
|
||||||
|
append res ":" [format %02X $mac(1)]
|
||||||
|
append res ":" [format %02X $mac(2)]
|
||||||
|
append res ":" [format %02X $mac(3)]
|
||||||
|
append res ":" [format %02X $mac(4)]
|
||||||
|
append res ":" [format %02X $mac(5)]
|
||||||
|
echo $res
|
||||||
|
}
|
||||||
|
|
||||||
proc rtl8710_flash_auto_erase {on} {
|
proc rtl8710_flash_auto_erase {on} {
|
||||||
global rtl8710_flasher_auto_erase
|
global rtl8710_flasher_auto_erase
|
||||||
if {[expr {$on != 0}]} {
|
if {[expr {$on != 0}]} {
|
||||||
|
|
Loading…
Reference in a new issue