Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
30c34c07
Commit
30c34c07
authored
11 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
Add an MTD driver to wrap another MTD driver and makes is sector size look like 512 bytes
parent
bd52d9af
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
drivers/mtd/Kconfig
+21
-0
21 additions, 0 deletions
drivers/mtd/Kconfig
drivers/mtd/Make.defs
+4
-0
4 additions, 0 deletions
drivers/mtd/Make.defs
drivers/mtd/sector512.c
+648
-0
648 additions, 0 deletions
drivers/mtd/sector512.c
include/nuttx/mtd/mtd.h
+18
-0
18 additions, 0 deletions
include/nuttx/mtd/mtd.h
with
691 additions
and
0 deletions
drivers/mtd/Kconfig
+
21
−
0
View file @
30c34c07
...
...
@@ -26,6 +26,27 @@ config MTD_PARTITION
managing the sub-region of flash beginning at 'offset' (in blocks)
and of size 'nblocks' on the device specified by 'mtd'.
config MTD_SECT512
bool "512B sector conversion"
default n
---help---
If enabled, a MTD driver will be created that will convert the
sector size of any other MTD driver to a 512 byte "apparent" sector
size. The managed MTD driver in this case must have an erase block
size that is greater than 512B and an event multiple of 512B.
if MTD_SECT512
config MTD_SECT512_ERASED_STATE
hex "Erased state of the FLASH"
default 0xff
config MTD_SECT512_READONLY
bool "512B read-only"
default n
endif # MTD_SECT512
config MTD_PARTITION_NAMES
bool "Support MTD partition naming"
depends on FS_PROCFS
...
...
This diff is collapsed.
Click to expand it.
drivers/mtd/Make.defs
+
4
−
0
View file @
30c34c07
...
...
@@ -45,6 +45,10 @@ ifeq ($(CONFIG_MTD_PARTITION),y)
CSRCS += mtd_partition.c
endif
ifeq ($(CONFIG_MTD_SECT512),y)
CSRCS += sector512.c
endif
ifeq ($(CONFIG_MTD_NAND),y)
CSRCS += mtd_nand.c mtd_onfi.c mtd_nandscheme.c mtd_nandmodel.c mtd_modeltab.c
ifeq ($(CONFIG_MTD_NAND_SWECC),y)
...
...
This diff is collapsed.
Click to expand it.
drivers/mtd/sector512.c
0 → 100644
+
648
−
0
View file @
30c34c07
This diff is collapsed.
Click to expand it.
include/nuttx/mtd/mtd.h
+
18
−
0
View file @
30c34c07
...
...
@@ -266,6 +266,24 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd,
* functions (such as a block or character driver front end).
*/
/************************************************************************************
* Name: s512_initialize
*
* Description:
* Create an initialized MTD device instance. This MTD driver contains another
* MTD driver and converts a larger sector size to a standard 512 byte sector
* size.
*
* MTD devices are not registered in the file system, but are created as instances
* that can be bound to other functions (such as a block or character driver front
* end).
*
************************************************************************************/
#ifdef CONFIG_MTD_SECT512
FAR
struct
mtd_dev_s
*
s512_initialize
(
FAR
struct
mtd_dev_s
*
mtd
);
#endif
/****************************************************************************
* Name: at45db_initialize
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment