Need to find out how kernel can direct read write user space memory.
sg_io()
blk_rq_map_user_iov() in block/blk-map.c worth a check.
bio_map_user_iov()
2015/11/13
2015/10/18
MLC Page Written Randomly?
Can UBI logical eraseblocks be written randomly?
No, the flash chip restrictions have to be taken into account. This is because UBI logical eraseblocks (LEB) are mapped to physical eraseblocks (PEB), and an LEB write operation is essentially a write to the corresponding PEB plus a small offset. The important flash restrictions are:
all writes have to be aligned to the min. I/O unit size and be multiple of min. I/O unit size;
sometimes it is prohibited to write more then once to the same PEB offset (e.g., in case of NAND flash);
many NAND flashes (specifically, MLC NAND flashes) require NAND pages to be written sequentially from the beginning of the physical eraseblock, to the end of the physical eraseblock; for example, it is prohibited to first write to offset 2048, then to offset 0; once offset 2048 has been written to, it is possible to write only to further offsets.
Even if the flash chip is devoid of the last restriction, UBI anyway requires logical eraseblocks to be written sequentially from the beginning to the end. This is because UBI calculates data CRC when moving logical eraseblocks to other physical eraseblocks (see here for more information), so a write an offset which is less than the furthest written data offset causes CRC errors;
Reference
http://www.linux-mtd.infradead.org/faq/ubi.html
No, the flash chip restrictions have to be taken into account. This is because UBI logical eraseblocks (LEB) are mapped to physical eraseblocks (PEB), and an LEB write operation is essentially a write to the corresponding PEB plus a small offset. The important flash restrictions are:
all writes have to be aligned to the min. I/O unit size and be multiple of min. I/O unit size;
sometimes it is prohibited to write more then once to the same PEB offset (e.g., in case of NAND flash);
many NAND flashes (specifically, MLC NAND flashes) require NAND pages to be written sequentially from the beginning of the physical eraseblock, to the end of the physical eraseblock; for example, it is prohibited to first write to offset 2048, then to offset 0; once offset 2048 has been written to, it is possible to write only to further offsets.
Even if the flash chip is devoid of the last restriction, UBI anyway requires logical eraseblocks to be written sequentially from the beginning to the end. This is because UBI calculates data CRC when moving logical eraseblocks to other physical eraseblocks (see here for more information), so a write an offset which is less than the furthest written data offset causes CRC errors;
Reference
http://www.linux-mtd.infradead.org/faq/ubi.html
2015/10/12
Linux Support for eMMC
Software Layer
File System (Sector Based)
Card (Block Device Driver)
Core (eMMC Driver )
Host (Host Driver, Platform Dependent)
eMMC Card (Card)
The eMMC subsystem (./drivers/mmc) is organized into three layers:
• The card layer is the external interface. It is seen as a block device driver, depending
on the enablement of block layer support for the kernel and interfaces within the file
system.
• The core layer implements all eMMC-dependent functionality, such as main operations,
command management, host setting, management functions, and high-level
functions.
• The host layer implements the driver for most known platform controllers and is platform
dependent.
SDHCI Specification
https://www.sdcard.org/downloads/pls/partA2_300.pdf
Reference
https://www.sdcard.org/downloads/pls/partA2_300.pdf
http://www.ebv.com/fileadmin/design_solutions/php/download.php?path=fileadmin%2Fproducts%2FEBVuniversity%2F120912_Micron_e.MMC%2F120912_mic_emmc_Linux.pdf
File System (Sector Based)
Card (Block Device Driver)
Core (eMMC Driver )
Host (Host Driver, Platform Dependent)
eMMC Card (Card)
The eMMC subsystem (./drivers/mmc) is organized into three layers:
• The card layer is the external interface. It is seen as a block device driver, depending
on the enablement of block layer support for the kernel and interfaces within the file
system.
• The core layer implements all eMMC-dependent functionality, such as main operations,
command management, host setting, management functions, and high-level
functions.
• The host layer implements the driver for most known platform controllers and is platform
dependent.
SDHCI Specification
https://www.sdcard.org/downloads/pls/partA2_300.pdf
Reference
https://www.sdcard.org/downloads/pls/partA2_300.pdf
http://www.ebv.com/fileadmin/design_solutions/php/download.php?path=fileadmin%2Fproducts%2FEBVuniversity%2F120912_Micron_e.MMC%2F120912_mic_emmc_Linux.pdf
2015/09/02
ARM Compiler 5.06 Cannot Handle __irq
Below code for Cortex-R5 CPU,
With ARM 5.05, it compiles OK as
With ARM 5.06, it compiles NOT OK as
Hey!! When IRQ handler ends, the PC return address should be "lr -4 not the "lr"!
ARM, please fix this problem!
__irq void Foo( void )
With ARM 5.05, it compiles OK as
PUSH {r0-r12,lr}
...
POP {r0-r12,lr}
SUBS pc,lr,#4
With ARM 5.06, it compiles NOT OK as
PUSH {r4-r12,lr}
...
POP {r4-r12,pc}
Hey!! When IRQ handler ends, the PC return address should be "lr -4 not the "lr"!
ARM, please fix this problem!
2015/08/19
Difference of DMA and First Party DMA in SATA
DMA
The data is blindly transferred between the pre-programmed memory region, as described by the scatter/gather list.
First Party DMA
The mechanism is intended to allow the device to select the host memory buffer that is transfers data to or from.
The memory buffer selection mechanism is through the DMA Setup FIS.
IN the DMA Setup FIS, the Buffer ID field identifies the memory buffer.
The data is blindly transferred between the pre-programmed memory region, as described by the scatter/gather list.
First Party DMA
The mechanism is intended to allow the device to select the host memory buffer that is transfers data to or from.
The memory buffer selection mechanism is through the DMA Setup FIS.
IN the DMA Setup FIS, the Buffer ID field identifies the memory buffer.
2015/07/24
ARM Memory Types
Even ARM itself thinks Device type and Strongly Ordered are confusing.
In Programmer's Guide for ARMv8-A, it says:
In Programmer's Guide for ARMv8-A, it says:
13.1 Memory types
The ARMv8 architecture defines two mutually-exclusive
memory types. All regions of memory are configured as one or the other of these two types,
which are Normal and Device. A third memory type, Strongly Ordered, is part of the ARMv7
architecture. The differences between this type and Device memory are few and it is therefore
now omitted in ARMv8.
ARM Linker Veneer
3.3.7. Veneer generation
Veneers are small sections of code generated by the linker and inserted into your program. armlink must generate veneers when a branch involves a destination beyond the branching range of the current state.
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0285b/Cchhgfaj.html
Subscribe to:
Posts (Atom)
Post Code on Blogger
Simplest way to post code to blogger for me: <pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black;overflow-x:...
-
Priority Inversion http://en.wikipedia.org/wiki/Priority_inversion Consider there is a task L, with low priority. This task requires res...
-
Explain There is not interrupt PIN for PCIe interrupt. When device wants to raise an interrupt, an interrupt message is sent to host via ...
-
Configure Space Addressing One of the major improvements the PCI Local Bus had over other I/O architectures was its configuration mechanism...