Skip to content

Commit fd7bdb9

Browse files
[manuf,ast] do not copy all AST values to CSRs during SRAM load
All value will be copied to OTP and subsequently loaded into the CSRs by the ROM. Signed-off-by: Tim Trippel <[email protected]>
1 parent 1396795 commit fd7bdb9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

sw/device/silicon_creator/manuf/lib/ast_program.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ status_t ast_program_config(bool verbose) {
101101
// Program AST CSRs.
102102
LOG_INFO("Programming %u AST words",
103103
kFlashInfoAstCalibrationDataSizeIn32BitWords);
104-
for (size_t i = 0; i < kFlashInfoAstCalibrationDataSizeIn32BitWords; ++i) {
104+
// Don't write the last 3 words of AST config to CSRs on SRAM program boot;
105+
// they will get copied to OTP later and written by the ROM on boot.
106+
for (size_t i = 0; i < kFlashInfoAstCalibrationDataSizeIn32BitWords - 3;
107+
++i) {
105108
uint32_t addr = TOP_EARLGREY_AST_BASE_ADDR + i * sizeof(uint32_t);
106109
uint32_t data = ast_data[i];
107110
LOG_INFO("\tAddress = 0x%08x, Data = 0x%08x", addr, data);

sw/device/silicon_creator/manuf/lib/ast_program_functest.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ static status_t execute_test(void) {
8282
TRY(program_page());
8383
TRY(ast_program_config(true));
8484
uint32_t crc =
85-
crc32(ast_cfg_data,
86-
kFlashInfoAstCalibrationDataSizeIn32BitWords * sizeof(uint32_t));
87-
TRY_CHECK(ast_nr_writes == 39);
85+
crc32(ast_cfg_data, (kFlashInfoAstCalibrationDataSizeIn32BitWords - 3) *
86+
sizeof(uint32_t));
87+
TRY_CHECK(ast_nr_writes == 36);
8888
TRY_CHECK(crc32_finish(&ast_crc) == crc);
8989
return OK_STATUS();
9090
}

0 commit comments

Comments
 (0)