mtd: Replace MTDIOC_XIPBASE with BIOC_XIPBASE
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
177e1ced3f
commit
6b6c11f0ad
@ -28,8 +28,6 @@ Memory Technology Device Drivers
|
|||||||
Support other, less frequently used commands:
|
Support other, less frequently used commands:
|
||||||
|
|
||||||
- ``MTDIOC_GEOMETRY``: Get MTD geometry
|
- ``MTDIOC_GEOMETRY``: Get MTD geometry
|
||||||
- ``MTDIOC_XIPBASE:``: Convert block to physical address for
|
|
||||||
eXecute-In-Place
|
|
||||||
- ``MTDIOC_BULKERASE``: Erase the entire device
|
- ``MTDIOC_BULKERASE``: Erase the entire device
|
||||||
|
|
||||||
is provided via a single ``ioctl`` method (see
|
is provided via a single ``ioctl`` method (see
|
||||||
|
@ -349,8 +349,8 @@ static int lc823450_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
|||||||
geo->erasesize, geo->neraseblocks);
|
geo->erasesize, geo->neraseblocks);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTDIOC_XIPBASE:
|
case BIOC_XIPBASE:
|
||||||
finfo("MTDIOC_XIPBASE\n");
|
finfo("BIOC_XIPBASE\n");
|
||||||
ppv = (FAR void**)arg;
|
ppv = (FAR void**)arg;
|
||||||
if (ppv)
|
if (ppv)
|
||||||
{
|
{
|
||||||
|
@ -394,7 +394,7 @@ static int tiva_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTDIOC_XIPBASE:
|
case BIOC_XIPBASE:
|
||||||
{
|
{
|
||||||
FAR void **ppv = (FAR void**)arg;
|
FAR void **ppv = (FAR void**)arg;
|
||||||
|
|
||||||
|
@ -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;
|
dev = (struct ftl_struct_s *)inode->i_private;
|
||||||
|
|
||||||
/* Only one block driver ioctl command is supported by this driver (and
|
if (cmd == BIOC_FLUSH)
|
||||||
* 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)
|
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_FTL_WRITEBUFFER
|
#ifdef CONFIG_FTL_WRITEBUFFER
|
||||||
rwb_flush(&dev->rwb);
|
rwb_flush(&dev->rwb);
|
||||||
|
@ -432,7 +432,7 @@ static int part_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTDIOC_XIPBASE:
|
case BIOC_XIPBASE:
|
||||||
{
|
{
|
||||||
FAR void **ppv = (FAR void**)arg;
|
FAR void **ppv = (FAR void**)arg;
|
||||||
unsigned long base;
|
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 */
|
/* 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));
|
(unsigned long)((uintptr_t)&base));
|
||||||
if (ret == OK)
|
if (ret == OK)
|
||||||
{
|
{
|
||||||
|
@ -326,7 +326,7 @@ static int progmem_ioctl(FAR struct mtd_dev_s *dev, int cmd,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTDIOC_XIPBASE:
|
case BIOC_XIPBASE:
|
||||||
{
|
{
|
||||||
FAR void **ppv = (FAR void**)arg;
|
FAR void **ppv = (FAR void**)arg;
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ static int ram_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTDIOC_XIPBASE:
|
case BIOC_XIPBASE:
|
||||||
{
|
{
|
||||||
FAR void **ppv = (FAR void**)((uintptr_t)arg);
|
FAR void **ppv = (FAR void**)((uintptr_t)arg);
|
||||||
if (ppv)
|
if (ppv)
|
||||||
|
@ -259,7 +259,7 @@ static int skel_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTDIOC_XIPBASE:
|
case BIOC_XIPBASE:
|
||||||
{
|
{
|
||||||
FAR void **ppv = (FAR void**)arg;
|
FAR void **ppv = (FAR void**)arg;
|
||||||
|
|
||||||
|
@ -5467,27 +5467,6 @@ static int smart_ioctl(FAR struct inode *inode, int cmd, unsigned long arg)
|
|||||||
|
|
||||||
switch (cmd)
|
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:
|
case BIOC_GETFORMAT:
|
||||||
|
|
||||||
/* Return the format information for the device */
|
/* Return the format information for the device */
|
||||||
|
@ -723,7 +723,7 @@ static int sst39vf_ioctl(FAR struct mtd_dev_s *dev,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MTDIOC_XIPBASE:
|
case BIOC_XIPBASE:
|
||||||
{
|
{
|
||||||
FAR void **ppv = (FAR void **)arg;
|
FAR void **ppv = (FAR void **)arg;
|
||||||
if (ppv)
|
if (ppv)
|
||||||
|
@ -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);
|
ret = parent->u.i_bops->ioctl(parent, cmd, arg);
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
{
|
{
|
||||||
if (cmd == BIOC_XIPBASE || cmd == MTDIOC_XIPBASE)
|
if (cmd == BIOC_XIPBASE)
|
||||||
{
|
{
|
||||||
FAR void **base = (FAR void **)ptr_arg;
|
FAR void **base = (FAR void **)ptr_arg;
|
||||||
struct geometry geo;
|
struct geometry geo;
|
||||||
|
@ -530,7 +530,7 @@ int romfs_hwconfigure(struct romfs_mountpt_s *rm)
|
|||||||
|
|
||||||
if (INODE_IS_MTD(inode))
|
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);
|
(unsigned long)&rm->rm_xipbase);
|
||||||
}
|
}
|
||||||
else if (inode->u.i_bops->ioctl != NULL)
|
else if (inode->u.i_bops->ioctl != NULL)
|
||||||
|
@ -41,10 +41,11 @@
|
|||||||
/* Ioctl commands */
|
/* Ioctl commands */
|
||||||
|
|
||||||
/* Note, the following ioctl existed in the past and was removed:
|
/* Note, the following ioctl existed in the past and was removed:
|
||||||
|
* #define MTDIOC_XIPBASE _MTDIOC(0x0002)
|
||||||
* #define MTDIOC_FLUSH _MTDIOC(0x0009)
|
* #define MTDIOC_FLUSH _MTDIOC(0x0009)
|
||||||
* #define MTDIOC_PARTINFO _MTDIOC(0x000b)
|
* #define MTDIOC_PARTINFO _MTDIOC(0x000b)
|
||||||
* try to avoid adding a new ioctl with the same ioctl number and
|
* 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
|
#define MTDIOC_GEOMETRY _MTDIOC(0x0001) /* IN: Pointer to write-able struct
|
||||||
@ -52,11 +53,6 @@
|
|||||||
* receive geometry data (see mtd.h)
|
* receive geometry data (see mtd.h)
|
||||||
* OUT: Geometry structure is populated
|
* OUT: Geometry structure is populated
|
||||||
* with data for the MTD */
|
* 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
|
#define MTDIOC_BULKERASE _MTDIOC(0x0003) /* IN: None
|
||||||
* OUT: None */
|
* OUT: None */
|
||||||
#define MTDIOC_PROTECT _MTDIOC(0x0004) /* IN: Pointer to read-able struct
|
#define MTDIOC_PROTECT _MTDIOC(0x0004) /* IN: Pointer to read-able struct
|
||||||
|
Loading…
Reference in New Issue
Block a user