From 52ff2e4c8d7e7e10088461980d6b381647874d4d Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Thu, 28 May 2015 13:12:43 -0700 Subject: flash_ec: remove redundant code from lm4x_cmds.tcl All boards in ToT have the same RO configuration. Boards which define CONFIG_FLASH_PSTATE_BANK have pstate following RO. BRANCH=none BUG=chrome-os-partner:22990 TEST="git grep" to see that none of the affected functions are called. Change-Id: Ie1eb9a726e1fa157852b0c55d474c9b4587c41f0 Signed-off-by: Myles Watson Reviewed-on: https://chromium-review.googlesource.com/273908 Reviewed-by: Randall Spangler --- util/openocd/lm4x_cmds.tcl | 48 ++++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 32 deletions(-) (limited to 'util/openocd') diff --git a/util/openocd/lm4x_cmds.tcl b/util/openocd/lm4x_cmds.tcl index 601d03e445..ffcda0464a 100644 --- a/util/openocd/lm4x_cmds.tcl +++ b/util/openocd/lm4x_cmds.tcl @@ -7,47 +7,25 @@ # Program internal flash proc flash_lm4 {path offset} { - #set firstsect [expr {$offset / 1024}]; - #set lastsect [expr {($offset + $size) / 1024 - 1}]; reset halt; flash write_image erase $path $offset; reset } -proc flash_auron { } { - flash_lm4 ../../../build/auron/ec.bin 0 +proc flash_lm4_board {board} { + flash_lm4 ../../../build/$board/ec.bin 0 } -proc flash_bds { } { - flash_lm4 ../../../build/bds/ec.bin 0 +proc flash_lm4_ro {board} { + flash_lm4 ../../../build/$board/ec.RO.flat 0 } -proc flash_rambi { } { - flash_lm4 ../../../build/rambi/ec.bin 0 +proc flash_lm4_rw {board} { + flash_lm4 ../../../build/$board/ec.RW.bin 131072 } -proc flash_samus { } { - flash_lm4 ../../../build/samus/ec.bin 0 -} - -proc flash_samus_ro { } { - flash_lm4 ../../../build/samus/ec.RO.flat 0 -} - -proc flash_samus_rw { } { - flash_lm4 ../../../build/samus/ec.RW.bin 131072 -} - -proc flash_rambi_ro { } { - flash_lm4 ../../../build/rambi/ec.RO.flat 0 -} - -proc flash_rambi_rw { } { - flash_lm4 ../../../build/rambi/ec.RW.bin 131072 -} - -# Auron have pstate following RO -proc unprotect_auron { } { +# Boards with CONFIG_FLASH_PSTATE_BANK have pstate following RO +proc unprotect_pstate { } { reset halt flash erase_sector 0 126 127 reset @@ -62,6 +40,12 @@ proc ramboot_lm4 {path} { resume } -proc ramboot_bds { } { - ramboot_lm4 ../../../build/bds/ec.RO.flat +proc ramboot_lm4_board {board} { + ramboot_lm4 ../../../build/$board/ec.RO.flat +} + +proc flash_emerged_board {board} { + set firmware_image ../../../../../../chroot/build/$board/firmware/ec.bin + + flash_lm4 $firmware_image 0 } -- cgit v1.2.1