devf-j7-ospi
Driver for the OSPI Flash memory
Syntax:
devf-j7-ospi [-aAcDElORrVv] [-b priority] [-d log_method] [-e arg]
[-f verifylevel] [-i arrayindex[,partindex]]
[-L limit] [-k blksize]
[-m mountover] [-o file_max]
[-P lock_mode] [-p backgroundpercent[,superlimit]]
[-S sector_erase_latency]
[-s [options]]
[-T max_erase_diff]
[-t hi_water[,lo_water[,max]]]
[-u update] [-w buffersize] [-W num] [-w buffersize] [-x type]
[-I]
[[board-specific_option][,board-specific_option]...]
Runs on:
QNX OS
Options:
- -A
- When registering the path names for the partitions with resmgr_attach(), use the _RESMGR_FLAG_AFTER flag to force the path to be resolved after others with the same pathname at the same mountpoint.
- -a
- Don't automount or enumerate filesystem partitions present on the media. If you specify both the -a and -R options, the driver ignores the -R option.
- -b priority
- Enable background reclaim at the specified priority. By default, background reclamation is disabled.
- -D
- Enable automatic detection of error-correcting code (ECC) mode. If you
specify this option, you don't need to specify -x. Note:Don't mix ECC-enabled partitions and ECC-disabled partitions; the driver doesn't support this.
- -d log_method
- Control the logging from the flash driver. The possible values for
log_method are:
- 0 — log to stdout (the default)
- 1 — log to slogger2
- 2 — log to both stdout and slogger2
- -E
- Don't daemonize. If the driver detects a corrupt filesystem, the exit status is that filesystem's partition number plus 1.
- -e arg
- Only enumerate the flash partitions, instead of doing a full scan and
mount:
- If arg is an integer, the flash driver automounts
all partitions with a partition number less than or equal to
arg.
For example, assume we have a flash layout as follows:
- /dev/fs0p0 — raw
- /dev/fs0p1 — formatted
- /dev/fs0p2 — formatted
- /dev/fs0p3 — formatted
If you start the driver with -e 1, the driver creates all the raw entries in /dev, but mounts only /dev/fs0p1 (/dev/fs0p0 is raw, so it's never mounted, regardless of the -e option).
- If arg is a string, the driver interprets it as a colon-separated list of exact paths to mount, if found.
- If arg is an integer, the flash driver automounts
all partitions with a partition number less than or equal to
arg.
- -f verifylevel
- Enable flash verification (default=0, 0=none, write=1, erase=2, all=3).
- -I
- Gain System (privileged) execution mode.
- -i arrayindex[,partindex]
- Starting socket index and first partition index; 0≥ index ≥ 15. The default is 0,0. Use this to give multiple drivers unique IDs. The -i option is just a suggestion for the resource database manager; the selected indexes can be larger.
- -k blksz
- Set the extent cache block size. The default is 128 KB.
- -L limit
- The number of retries to make if the physical flash erase function for a unit fails. The default is 0.
- -l
- List the available flash databases and then exit. ???
- -m mountover
- Override the mountpoints assigned to the file system that are formatted with
an empty (i.e.,
flashctl -p/dev/fs0p0 -f -n ""
) mountpoint. The mountover argument can include two%X
format specifiers (like those for printf()) that are replaced by the socket index and the partition index.Note:The -m option doesn't override a mountpoint specified with mkefs. - -O
- Use a directory lock for I/O operations.
- -o file_max
- Set the maximum number of files to cache. The default is 64.
- -P lockmode
- Set the protection mode for Spansion-compatible devices:
- 0 — no lock (the default)
- 1 — persistent lock mode
- 2 — dynamic lock mode
- -p backgroundpercent[,superlimit]
- Set the background-reclaim percentage trigger (stale space over free space) and, optionally, the superseded extent limit before reclaim. The default is 100,16.
- -R
- Mount any automount filesystems as read-only. This option doesn't affect raw partition mounts, and it has an effect only at startup and initialization. Any subsequent mounting (with either flashctl or mount) ignores the -R option. If you also specify the -a option, the driver ignores the -R option.
- -r
- Enable fault recovery for dirty extents, dangling extents (dirty headers or
damaged pointers), and partial reclaims. Note:You should always specify the -r option unless you're trying to debug an issue concerning flash corruption.
If you don't specify -r, and a power failure occurs, the following can happen:
- You can waste space. If an erasure was happening when the power was
cut off, there will be some
dangling
extents (i.e., marked for deletion, but not actually deleted). If you specify the -vv option, the driver printsdangle
for every dangling extent found. These extents will continue to occupy space forever, until they're deleted. Using the -r option will cause them to be reclaimed. - The system may be marked as read-only. If the driver detects an error in the structure of the filesystem, and you haven't specified the -r option, the driver marks the partition as read-only, so that it can't be further damaged.
- If a reclaim operation is interrupted by a power loss, the
spare block may be unusable. In this case, if you specify the
-vv option, the driver prints
partial
to the console. The partition is still read-write, but reclaims are turned off; if you continue to overwrite files, you'll eventually fill the filesystem with stale data.
- You can waste space. If an erasure was happening when the power was
cut off, there will be some
- -S sector_erase_latency
- Set the simulated sector erase latency in milliseconds (max = 10000).
- -s args
- Set socket options.
- -T max_erase_diff
- Set the threshold value (maximum erase count − minimum erase count in a partition) to trigger wear-leveling. The default value is two times the sector number in the partition. Typically, for very large partitions containing more than 1000 sectors, you should use this option to specify a threshold (for example, 1000) to make the sector erasure counts more evenly distributed across the entire partition.
- -t hi_water[,lo_water[,max]]
- Set the high water, low water, and maximum attributes of the thread pool;
the increment (i.e., the number of threads created at one time) is 1. The
default is 4,2,100. The values must be related as follows:
- 0 < hi_water < max
- 0 <= lo_water <= hi_water
- hi_water < max <= 100
- -u updatelevel
- Specify the update level for timestamps. POSIX specifies that timestamps be
kept when you access, create, or modify a file. FFSv3 is documented as not
supporting the access timestamp, in order to reduce wear on the hardware.
The values for update are:
- 0 — don't update the modification time for files (the default).
- 1 — update the modification time for files according to the POSIX rules.
- 2 — update the modification time for files, as well as for the parent directory.
Note:The -u2 option is very, very expensive and will cause many reclaims because the time updates have to flow right up to the root directory, so one file update may cause many directory updates. - -V
- Display filesystem and MTD version information, and then exit.
- -v
- Be verbose; specify additional v characters for more verbosity.
- -W num
- Use the workaround identified by num. The workarounds available (if any) depend on the board.
- -w buffersize
- Write (append) buffer size in bytes. The default buffersize is 512. Using a larger write buffer prevents the creation of very small extents, reducing overhead. If buffersize is 0, appending is disabled.
- -x mode
- Enable software ECC mode. Specify type as 1 for 64-byte
alignment ECC, or 2 for 32-byte. Note:Don't mix ECC-enabled partitions and ECC-disabled partitions; the driver doesn't support this.
- socket options
- All options are separated by commas. This driver has the following socket
options, which are specified using these parameters:
- verbose=level
- Reference clock
- unit_size=size
- This option specifies the size of erase sector to use. sector size must be supported by flash device.
- soc=[options]
- Set SoC specific options, options are separated by colons.
- vid=vid
- did=did
- Use [vid]/[did] instead of IDs from the flash device. Both vid/did need to be specified.
- drate=rate
- Set data rate(SPI bus clock)
- protocol=[~]protocol
- Set/clear SPI bus protocol Supported bus protocols are: 111, 111FAST, 111DTR, 112, 122, 222, 122DTR 114, 144, 444, 144DTR, 118, 188, 888, 188DTR, 888DTR
- drv_strength=strength
- Set flash device driver strength if applicable.
- numcs=options
- Set number of chip select
- stripe
- Flash chips are connected in stripe mode.
- soc_specific_option
- Board Specific options are separated by colons. This driver has the
following soc-specific options (soc_specific_option),
which are specified using these parameters:
- rclk=rclk
- Reference clock
- clk=clk
- SPI bus clock
- base=base
- OSPI controller base address
- data=data
- OSPI data port address
- phy=[off|ddr|otp1]
- Enable PHY mode and select tuning algorithm (default: off)
- pdelay=num
- PHY phase delay (default: 3)
- phy_mode=[bypass|master]
- Control bypass mode (default: master)
- poffset=poffset
- The offset of the OSPI tuning pattern from the beginning of flash
- rdelay=cycles
- Read Delay Cycles
- dma=[0|1]
- DMA mode enable
- ch=ch
- Channel number
- mem=name
- Set typed memory path
Description:
This driver provides Flash filesystem support for the Texas Instruments Jacinto 7 EVM boards.
PHY Calibration:
PHY Calibration optimizes read performance. When using UDMA the PHY must be enabled and the PHY calibration pattern must be flashed to OSPI. For information on flashing the pattern file, see the PHY Calibration section from section 3.1.1.7.1. AM654/J721S2 Support of the Processor SDK Linux Software Developer’s Guide that's available on the Texas Instruments website at https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j721s2/09_02_00_05/exports/docs/linux/Foundational_Components/U-Boot/UG-QSPI.html