<commit_before># Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Command automation for Blizzard LM4F chip

# Program internal flash

proc flash_lm4 {path size} {
	set lastsect [expr {$size / 1024 - 1}];
	reset halt;
	flash erase_sector 0 0 $lastsect;
	flash write_image $path 0;
	reset
}

# Link proto0 has 128KB flash; proto1+ will likely have 256KB, in which
# case this'll need changing.
proc flash_link { } {
	flash_lm4 ../../../build/link/ec.bin 131072
}

proc flash_bds { } {
	flash_lm4 ../../../build/bds/ec.bin 262144
}

# Boot a software using internal RAM only

proc ramboot_lm4 {path} {
	reset halt<commit_msg>Dump a few words at the start of flash as a diagnostic for full-chip erase failure<commit_after># Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Command automation for Blizzard LM4F chip

# Program internal flash

proc flash_lm4 {path size} {
	set lastsect [expr {$size / 1024 - 1}];
	reset halt;
	flash erase_sector 0 0 $lastsect;
	# Note erase_sector silently fails sometimes; see crosbug.com/p/8632
	# Dump a few words as a diagnostic for whether erase succeeded
	mdw 0 16
	flash write_image $path 0;
	reset
}

# Link proto0 has 128KB flash; proto1+ will likely have 256KB, in which
# case this'll need changing.
proc flash_link { } {
	flash_lm4 ../../../build/link/ec.bin 131072
}

proc flash_bds { } {
	flash_lm4 ../../../build/bds/ec.bin 262144
}

# Boot a software using internal RAM only

proc ramboot_lm4 {path} {
	reset halt
{'fraction_non_alphanumeric': 0.09219025249559601, 'fraction_numerical': 0.04756312389900176, 'mean_word_length': 3.556149732620321, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '792539', 'n_tokens_mistral': 633, 'n_tokens_neox': 546, 'n_words': 233}