Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(754)

Unified Diff: saft_flashrom_util.py

Issue 6594114: saft: update 'flashrom_util' to use new syntax (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/saft.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: saft_flashrom_util.py
diff --git a/saft_flashrom_util.py b/saft_flashrom_util.py
index 8c71409490d2779a07624cfdd80f37c727007d9b..d5520d0866f681606099d857a8f5e311a236bba9 100644
--- a/saft_flashrom_util.py
+++ b/saft_flashrom_util.py
@@ -217,16 +217,13 @@ class flashrom_util(object):
self.bios_layout = {}
self.os_if = chromeos_interface.ChromeOSInterface(True)
self.os_if.init(tempfile.gettempdir())
+ self._target_command = ''
self._enable_bios_access()
def _enable_bios_access(self):
if not self.os_if.target_hosted():
return
- value = int(self.os_if.run_shell_command_get_output(
- 'iotools mmio_read32 0xfed1f410')[0], 0)
- value = (value & 0xffff0000) + 0x460
- self.os_if.run_shell_command(
- 'iotools mmio_write32 0xfed1f410 0x%x' % value)
+ self._target_command = '-p internal:bus=spi'
vb 2011/03/02 17:50:08 why not to make it 'flashrom -p internal:bus=spi'
Hung-Te 2011/03/03 06:52:29 Because I'm not sure if SAFT will need to deal wit
def get_temp_filename(self, prefix):
''' (internal) Returns name of a temporary file in self.tmp_root '''
@@ -297,7 +294,7 @@ class flashrom_util(object):
Returns the data read from flash ROM, or empty string for other error.
'''
tmpfn = self.get_temp_filename('rd_')
- cmd = 'flashrom -r "%s"' % (tmpfn)
+ cmd = 'flashrom %s -r "%s"' % (self._target_command, tmpfn)
if self.verbose:
print 'flashrom_util.read_whole(): ', cmd
@@ -324,8 +321,8 @@ class flashrom_util(object):
open(tmpfn, 'wb').write(base_image)
layout_fn = self.create_layout_file(layout_map)
- cmd = 'flashrom -l "%s" -i %s -w "%s"' % (
- layout_fn, ' -i '.join(write_list), tmpfn)
+ cmd = 'flashrom %s -l "%s" -i %s -w "%s"' % (
+ self._target_command, layout_fn, ' -i '.join(write_list), tmpfn)
if self.verbose:
print 'flashrom.write_partial(): ', cmd
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698