aboutsummaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-07-24 22:56:36 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-07-24 22:56:36 +0000
commitd7280d43821c750e6d8aa35ac6f26f811cc6890b (patch)
treef9293a2385b426204e0e8b9125660c6b22885755 /nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c
parentac6f7a722bd9bdb35e738b7fbbd1cd32d68b2373 (diff)
downloadpx4-firmware-d7280d43821c750e6d8aa35ac6f26f811cc6890b.tar.gz
px4-firmware-d7280d43821c750e6d8aa35ac6f26f811cc6890b.tar.bz2
px4-firmware-d7280d43821c750e6d8aa35ac6f26f811cc6890b.zip
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
Diffstat (limited to 'nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c')
-rw-r--r--nuttx/arch/arm/src/lpc43xx/lpc43_spifi.c8
1 files changed, 6 insertions, 2 deletions
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);