diff --git a/arch b/arch index e6fdf9eb6a..a26ed33fa4 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit e6fdf9eb6a1e288e90a12eb3ee70a393ea30bec3 +Subproject commit a26ed33fa4c164564b45b4f0905887fcf553f425 diff --git a/include/nuttx/fs/ioctl.h b/include/nuttx/fs/ioctl.h index f047d38906..827f62e4c5 100644 --- a/include/nuttx/fs/ioctl.h +++ b/include/nuttx/fs/ioctl.h @@ -217,25 +217,6 @@ #define _MTDIOCVALID(c) (_IOC_TYPE(c)==_MTDIOCBASE) #define _MTDIOC(nr) _IOC(_MTDIOCBASE,nr) -#define MTDIOC_GEOMETRY _MTDIOC(0x0001) /* IN: Pointer to write-able struct - * mtd_geometry_s in which to receive - * 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_SETSPEED _MTDIOC(0x0004) /* IN: New bus speed in Hz - * OUT: None */ -#define MTDIOC_EXTENDED _MTDIOC(0x0005) /* IN: unsigned long - * 0=Use normal memory region - * 1=Use alternate/extended memory - * OUT: None */ - /* NuttX ARP driver ioctl definitions (see netinet/arp.h) *******************/ #define _ARPIOCVALID(c) (_IOC_TYPE(c)==_ARPIOCBASE) diff --git a/include/nuttx/mtd/mtd.h b/include/nuttx/mtd/mtd.h index 4162cde6f9..e9e4060ae6 100644 --- a/include/nuttx/mtd/mtd.h +++ b/include/nuttx/mtd/mtd.h @@ -49,6 +49,34 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* Ioctl commands */ + +#define MTDIOC_GEOMETRY _MTDIOC(0x0001) /* IN: Pointer to write-able struct + * mtd_geometry_s in which to receive + * 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 + * mtd_protects_s that provides + * the region to protect. + * OUT: None */ +#define MTDIOC_UNPROTECT _MTDIOC(0x0005) /* IN: Pointer to read-able struct + * mtd_protects_s that provides + * the region to un-protect. + * OUT: None */ +#define MTDIOC_SETSPEED _MTDIOC(0x0006) /* IN: New bus speed in Hz + * OUT: None */ +#define MTDIOC_EXTENDED _MTDIOC(0x0007) /* IN: unsigned long + * 0=Use normal memory region + * 1=Use alternate/extended memory + * OUT: None */ /* Macros to hide implementation */ @@ -90,6 +118,16 @@ struct mtd_geometry_s uint32_t neraseblocks; /* Number of erase blocks */ }; +/* This structure describes a range of sectors to be protected or + * unprotected. + */ + +struct mtd_protect_s +{ + off_t startblock; /* First block to be [un-]protected */ + size_t nblocks; /* Number of blocks to [un-]protect */ +}; + /* The following defines the information for writing bytes to a sector * that are not a full page write (bytewrite). */