Quentin Forcioli has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/49570 )
Change subject: mem: Fix for CFI memory
......................................................................
mem: Fix for CFI memory
Subtile modification of the CFI memory to bring back u-boot compatibility :
- Ignoring AMD_RESET_CMD (0xf0)
- Increasing CFIQueryTable size to have 4 Erase Block Region Information (3
are
just empty)
Change-Id: I49e7a78a89a46b1298f04132559debafdeddb8ef
---
M src/mem/cfi_mem.cc
M src/mem/cfi_mem.hh
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/mem/cfi_mem.cc b/src/mem/cfi_mem.cc
index 9075d14..70dc43f 100644
--- a/src/mem/cfi_mem.cc
+++ b/src/mem/cfi_mem.cc
@@ -219,6 +219,9 @@
static_cast<uint8_t>(bits(blocks.number(), 15, 8)),
static_cast<uint8_t>(bits(blocks.size(), 7, 0)),
static_cast<uint8_t>(bits(blocks.size(), 15, 8)),
+ 0x00,0x00,0x00,0x00,//empty Block region 2 info
+ 0x00,0x00,0x00,0x00,//empty Block region 3 info
+ 0x00,0x00,0x00,0x00//empty Block region 4 info
}
{}
@@ -709,6 +712,11 @@
writeState = CfiCommand::BUFFERED_PROGRAM_SETUP;
readState = CfiCommand::READ_STATUS_REG;
break;
+ case CfiCommand::AMD_RESET:
+ //because of how u-boot works and reset the flash
+ //we have to ignore the AMD RESET explicitly
+ // (see the function __flash_cmd_reset in drivers/mtd/cfi_flash.c)
+ break;
default:
panic("Don't know what to do with %#x\n",
static_cast<uint16_t>(new_cmd));
diff --git a/src/mem/cfi_mem.hh b/src/mem/cfi_mem.hh
index 76278f6..565395a 100644
--- a/src/mem/cfi_mem.hh
+++ b/src/mem/cfi_mem.hh
@@ -87,7 +87,7 @@
BLOCK_ERASE_CONFIRM = 0xD0,
UNLOCK_BLOCK = 0xD0,
READ_ARRAY = 0xFF,
-
+ AMD_RESET=0xF0,
/** This is not a real command, but it is used by the internal
* model only to represent the 2nd write cycle state for a buffered
* program (when the buffer size is supplied) */
@@ -343,7 +343,7 @@
ProgramBuffer programBuffer;
- uint8_t cfiQueryTable[49];
+ uint8_t cfiQueryTable[61];
public:
CfiMemory(const CfiMemoryParams &p);
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/49570
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I49e7a78a89a46b1298f04132559debafdeddb8ef
Gerrit-Change-Number: 49570
Gerrit-PatchSet: 1
Gerrit-Owner: Quentin Forcioli <quentin.forci...@telecom-paris.fr>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s