You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/09/16 13:11:12 UTC

[incubator-nuttx] branch master updated: phy62xx:support MTDIOC_ERASESTATE

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 521f870965 phy62xx:support MTDIOC_ERASESTATE
521f870965 is described below

commit 521f87096560c3178aa092573faa78402c90a5f0
Author: 田昕 <ti...@xiaomi.com>
AuthorDate: Fri Sep 16 17:43:56 2022 +0800

    phy62xx:support MTDIOC_ERASESTATE
    
    Signed-off-by: 田昕 <ti...@xiaomi.com>
---
 arch/arm/src/phy62xx/pplus_mtd_flash.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/src/phy62xx/pplus_mtd_flash.c b/arch/arm/src/phy62xx/pplus_mtd_flash.c
index ec78a20a4f..adfb56f16e 100644
--- a/arch/arm/src/phy62xx/pplus_mtd_flash.c
+++ b/arch/arm/src/phy62xx/pplus_mtd_flash.c
@@ -43,6 +43,12 @@
 #include <nuttx/fs/ioctl.h>
 #include <nuttx/mtd/mtd.h>
 
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define MTD_ERASED_STATE            (0xff)
+
 /****************************************************************************
  * Private Types
  ****************************************************************************/
@@ -312,6 +318,14 @@ static int pplus_fls_ioctl(struct mtd_dev_s *dev,
           break;
         }
 
+      case MTDIOC_ERASESTATE:
+        {
+          uint8_t *result = (uint8_t *)arg;
+          *result = MTD_ERASED_STATE;
+          ret = OK;
+        }
+        break;
+
       default:
           ret = -ENOTTY; /* Bad/unsupported command */
           break;