From 1fed0407b3b2285e151ce16354a9f8f8ad9262ac Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 27 Nov 2013 11:04:11 -0600 Subject: [PATCH] MTD: Pack the geometry structure so that is can handle larger erase blocks --- ChangeLog | 4 ++++ include/nuttx/mtd/mtd.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef7b7326e1..b8e438ecff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6106,3 +6106,7 @@ (2013-11-23) * configs/sama5d3x-ek/src/sam_nand.c: Add support for auto-mounting NAND MTD block or NXFFS devices (2013-11-25). + * include/mtd/mtd.h: Packed the geometry structure so that it can + support larger erase block sizes without increasing the size of + the geometry structure (2013-11-27). + diff --git a/include/nuttx/mtd/mtd.h b/include/nuttx/mtd/mtd.h index ab3f4608ba..dfd40edf7c 100644 --- a/include/nuttx/mtd/mtd.h +++ b/include/nuttx/mtd/mtd.h @@ -79,9 +79,9 @@ struct mtd_geometry_s { - uint16_t blocksize; /* Size of one read/write block */ - uint16_t erasesize; /* Size of one erase blocks -- must be a multiple - * of blocksize. */ + uint32_t blocksize :14; /* Size of one read/write block. Largest: 16KB-1 */ + uint32_t erasesize :18; /* Size of one erase blocks -- must be a multiple + * of blocksize. Largest: 512KB-1 */ size_t neraseblocks; /* Number of erase blocks */ };