diff --git a/Documentation/components/drivers/special/mtd.rst b/Documentation/components/drivers/special/mtd.rst index 5e6e556a8c..646b39ff87 100644 --- a/Documentation/components/drivers/special/mtd.rst +++ b/Documentation/components/drivers/special/mtd.rst @@ -28,8 +28,6 @@ Memory Technology Device Drivers Support other, less frequently used commands: - ``MTDIOC_GEOMETRY``: Get MTD geometry - - ``MTDIOC_XIPBASE:``: Convert block to physical address for - eXecute-In-Place - ``MTDIOC_BULKERASE``: Erase the entire device is provided via a single ``ioctl`` method (see diff --git a/arch/arm/src/lc823450/lc823450_mtd.c b/arch/arm/src/lc823450/lc823450_mtd.c index 30289c7a23..f5a92fc8d5 100644 --- a/arch/arm/src/lc823450/lc823450_mtd.c +++ b/arch/arm/src/lc823450/lc823450_mtd.c @@ -349,8 +349,8 @@ static int lc823450_ioctl(FAR struct mtd_dev_s *dev, int cmd, geo->erasesize, geo->neraseblocks); break; - case MTDIOC_XIPBASE: - finfo("MTDIOC_XIPBASE\n"); + case BIOC_XIPBASE: + finfo("BIOC_XIPBASE\n"); ppv = (FAR void**)arg; if (ppv) { diff --git a/arch/arm/src/tiva/common/tiva_flash.c b/arch/arm/src/tiva/common/tiva_flash.c index 75956be5cc..5b4e2e9a09 100644 --- a/arch/arm/src/tiva/common/tiva_flash.c +++ b/arch/arm/src/tiva/common/tiva_flash.c @@ -394,7 +394,7 @@ static int tiva_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) } break; - case MTDIOC_XIPBASE: + case BIOC_XIPBASE: { FAR void **ppv = (FAR void**)arg; diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c index 664b9df45f..0b02393697 100644 --- a/drivers/mtd/ftl.c +++ b/drivers/mtd/ftl.c @@ -506,31 +506,7 @@ static int ftl_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) dev = (struct ftl_struct_s *)inode->i_private; - /* Only one block driver ioctl command is supported by this driver (and - * that command is just passed on to the MTD driver in a slightly - * different form). - */ - - if (cmd == BIOC_XIPBASE) - { - /* The argument accompanying the BIOC_XIPBASE should be non-NULL. If - * DEBUG is enabled, we will catch it here instead of in the MTD - * driver. - */ - -#ifdef CONFIG_DEBUG_FEATURES - if (arg == 0) - { - ferr("ERROR: BIOC_XIPBASE argument is NULL\n"); - return -EINVAL; - } -#endif - - /* Change the BIOC_XIPBASE command to the MTDIOC_XIPBASE command. */ - - cmd = MTDIOC_XIPBASE; - } - else if (cmd == BIOC_FLUSH) + if (cmd == BIOC_FLUSH) { #ifdef CONFIG_FTL_WRITEBUFFER rwb_flush(&dev->rwb); diff --git a/drivers/mtd/mtd_partition.c b/drivers/mtd/mtd_partition.c index b71722d985..bc5588af19 100644 --- a/drivers/mtd/mtd_partition.c +++ b/drivers/mtd/mtd_partition.c @@ -432,7 +432,7 @@ static int part_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) } break; - case MTDIOC_XIPBASE: + case BIOC_XIPBASE: { FAR void **ppv = (FAR void**)arg; unsigned long base; @@ -441,7 +441,7 @@ static int part_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) { /* Get the XIP base of the entire FLASH */ - ret = priv->parent->ioctl(priv->parent, MTDIOC_XIPBASE, + ret = priv->parent->ioctl(priv->parent, BIOC_XIPBASE, (unsigned long)((uintptr_t)&base)); if (ret == OK) { diff --git a/drivers/mtd/mtd_progmem.c b/drivers/mtd/mtd_progmem.c index 9ce8c3aa39..4c9ed0d644 100644 --- a/drivers/mtd/mtd_progmem.c +++ b/drivers/mtd/mtd_progmem.c @@ -326,7 +326,7 @@ static int progmem_ioctl(FAR struct mtd_dev_s *dev, int cmd, } break; - case MTDIOC_XIPBASE: + case BIOC_XIPBASE: { FAR void **ppv = (FAR void**)arg; diff --git a/drivers/mtd/rammtd.c b/drivers/mtd/rammtd.c index 47c80ab8a9..a123d2d770 100644 --- a/drivers/mtd/rammtd.c +++ b/drivers/mtd/rammtd.c @@ -386,7 +386,7 @@ static int ram_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) } break; - case MTDIOC_XIPBASE: + case BIOC_XIPBASE: { FAR void **ppv = (FAR void**)((uintptr_t)arg); if (ppv) diff --git a/drivers/mtd/skeleton.c b/drivers/mtd/skeleton.c index 60adf05be9..ad8d211892 100644 --- a/drivers/mtd/skeleton.c +++ b/drivers/mtd/skeleton.c @@ -259,7 +259,7 @@ static int skel_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg) } break; - case MTDIOC_XIPBASE: + case BIOC_XIPBASE: { FAR void **ppv = (FAR void**)arg; diff --git a/drivers/mtd/smart.c b/drivers/mtd/smart.c index 5b02586753..5a414232b3 100644 --- a/drivers/mtd/smart.c +++ b/drivers/mtd/smart.c @@ -5467,27 +5467,6 @@ static int smart_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) switch (cmd) { - case BIOC_XIPBASE: - /* The argument accompanying the BIOC_XIPBASE should be non-NULL. If - * DEBUG is enabled, we will catch it here instead of in the MTD - * driver. - */ - -#ifdef CONFIG_DEBUG_FEATURES - if (arg == 0) - { - ferr("ERROR: BIOC_XIPBASE argument is NULL\n"); - return -EINVAL; - } -#endif - - /* Just change the BIOC_XIPBASE command to the MTDIOC_XIPBASE - * command. - */ - - cmd = MTDIOC_XIPBASE; - break; - case BIOC_GETFORMAT: /* Return the format information for the device */ diff --git a/drivers/mtd/sst39vf.c b/drivers/mtd/sst39vf.c index 3028918564..a1114a86dd 100644 --- a/drivers/mtd/sst39vf.c +++ b/drivers/mtd/sst39vf.c @@ -723,7 +723,7 @@ static int sst39vf_ioctl(FAR struct mtd_dev_s *dev, } break; - case MTDIOC_XIPBASE: + case BIOC_XIPBASE: { FAR void **ppv = (FAR void **)arg; if (ppv) diff --git a/fs/driver/fs_blockpartition.c b/fs/driver/fs_blockpartition.c index b277c6fec9..dd34f89ede 100644 --- a/fs/driver/fs_blockpartition.c +++ b/fs/driver/fs_blockpartition.c @@ -227,7 +227,7 @@ static int part_ioctl(FAR struct inode *inode, int cmd, unsigned long arg) ret = parent->u.i_bops->ioctl(parent, cmd, arg); if (ret >= 0) { - if (cmd == BIOC_XIPBASE || cmd == MTDIOC_XIPBASE) + if (cmd == BIOC_XIPBASE) { FAR void **base = (FAR void **)ptr_arg; struct geometry geo; diff --git a/fs/romfs/fs_romfsutil.c b/fs/romfs/fs_romfsutil.c index a606bbc5bb..a82b97672e 100644 --- a/fs/romfs/fs_romfsutil.c +++ b/fs/romfs/fs_romfsutil.c @@ -530,7 +530,7 @@ int romfs_hwconfigure(struct romfs_mountpt_s *rm) if (INODE_IS_MTD(inode)) { - ret = MTD_IOCTL(inode->u.i_mtd, MTDIOC_XIPBASE, + ret = MTD_IOCTL(inode->u.i_mtd, BIOC_XIPBASE, (unsigned long)&rm->rm_xipbase); } else if (inode->u.i_bops->ioctl != NULL) diff --git a/include/nuttx/mtd/mtd.h b/include/nuttx/mtd/mtd.h index fe4bf05bb2..1a54a54a3e 100644 --- a/include/nuttx/mtd/mtd.h +++ b/include/nuttx/mtd/mtd.h @@ -41,10 +41,11 @@ /* Ioctl commands */ /* Note, the following ioctl existed in the past and was removed: + * #define MTDIOC_XIPBASE _MTDIOC(0x0002) * #define MTDIOC_FLUSH _MTDIOC(0x0009) * #define MTDIOC_PARTINFO _MTDIOC(0x000b) * try to avoid adding a new ioctl with the same ioctl number and - * replace with BIOC_FLUSH and BIOC_PARTINFO instead. + * replace with BIOC_XIPBASE, BIOC_FLUSH and BIOC_PARTINFO instead. */ #define MTDIOC_GEOMETRY _MTDIOC(0x0001) /* IN: Pointer to write-able struct @@ -52,11 +53,6 @@ * receive geometry data (see mtd.h) * OUT: Geometry structure is populated * with data for the MTD */ -#define MTDIOC_XIPBASE _MTDIOC(0x0002) /* IN: Pointer to pointer to void in - * which to received the XIP base. - * OUT: If media is directly accessible, - * return (void *) base address - * of device memory */ #define MTDIOC_BULKERASE _MTDIOC(0x0003) /* IN: None * OUT: None */ #define MTDIOC_PROTECT _MTDIOC(0x0004) /* IN: Pointer to read-able struct