From d7280d43821c750e6d8aa35ac6f26f811cc6890b Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 24 Jul 2012 22:56:36 +0000 Subject: Combine cfset[o|i]speed to cfsetspeed; combine cfget[o|i]speed for cfgetspeed git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4975 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c') diff --git a/nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c b/nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c index fe26fabc5..8e633e5d1 100644 --- a/nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c +++ b/nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c @@ -77,6 +77,10 @@ * CONFIG_SPIFI_OFFSET - Offset the beginning of the block driver this many * bytes into the device address space. This offset must be an exact * multiple of the erase block size. Default 0. + * CONFIG_SPIFI_BLKSIZE - The size of one device erase block. If not defined + * then the driver will try to determine the correct erase block size by + * examining that data returned from spifi_initialize (which sometimes + * seems bad). * CONFIG_SPIFI_SECTOR512 - If defined, then the driver will report a more * FAT friendly 512 byte sector size and will manage the read-modify-write * operations on the larger erase block. @@ -1082,7 +1086,7 @@ static inline int lpc43_rominit(FAR struct lpc43_dev_s *priv) priv->blkshift = log2; priv->blksize = (1 << log2); - priv->nblocks = priv->rom.memsize / priv->blksize; + priv->nblocks = (priv->rom.memsize - CONFIG_SPIFI_OFFSET) / priv->blksize; fvdbg("Driver FLASH Geometry:\n"); fvdbg(" blkshift: %d\n", priv->blkshift); @@ -1097,7 +1101,7 @@ static inline int lpc43_rominit(FAR struct lpc43_dev_s *priv) /* Save the digested FLASH geometry info */ - priv->nblocks = (priv->rom.memsize >> SPIFI_BLKSHIFT); + priv->nblocks = ((priv->rom.memsize - CONFIG_SPIFI_OFFSET) >> SPIFI_BLKSHIFT); fvdbg("Driver FLASH Geometry:\n"); fvdbg(" blkshift: %d\n", SPIFI_BLKSHIFT); -- cgit v1.2.3