Quentin Forcioli has submitted this change. ( 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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49570
Reviewed-by: Bobby R. Bruce <[email protected]>
Reviewed-by: Giacomo Travaglini <[email protected]>
Maintainer: Bobby R. Bruce <[email protected]>
Maintainer: Giacomo Travaglini <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/mem/cfi_mem.cc
M src/mem/cfi_mem.hh
2 files changed, 10 insertions(+), 2 deletions(-)

Approvals:
  Giacomo Travaglini: Looks good to me, approved; Looks good to me, approved
  Bobby R. Bruce: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




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..5a7a1c5 100644
--- a/src/mem/cfi_mem.hh
+++ b/src/mem/cfi_mem.hh
@@ -86,8 +86,8 @@
         BUFFERED_PROGRAM_CONFIRM = 0xD0,
         BLOCK_ERASE_CONFIRM = 0xD0,
         UNLOCK_BLOCK = 0xD0,
+        AMD_RESET=0xF0,
         READ_ARRAY = 0xFF,
-
         /** 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: 4
Gerrit-Owner: Quentin Forcioli <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: Quentin Forcioli <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to