bbe3ee8dc5
This patch replaces the formerly fixed 2 KiB data alignment within the packet-stream buffer by a server-defined alignment. This has two benefits. First, when using block servers that provide small block sizes like 512 bytes, we avoid fragmenting the packet-stream buffer, which occurs when aligning 512-byte requests at 2 KiB boundaries. This reduces meta data costs for the packet-stream allocator and also allows fitting more requests into the buffer. Second, block drivers with alignment constraints dictated by the hardware can now pass those constraints to the client, thereby easing the use of zero-copy DMA directly into the packet stream. The alignment is determined by the Block::Session_client at construction time and applied by the Block::Session_client::alloc_packet method. Block-session clients should always use this method, not the 'alloc_packet' method of the packet stream (tx source) directly. The latter merely applies a default alignment of 2 KiB. At the server side, the alignment is automatically checked by block/component.h (old API) and block/request_stream.h (new API). Issue #3274 |
||
---|---|---|
.. | ||
spec | ||
ahci.cc | ||
ahci.h | ||
ata_driver.h | ||
atapi_driver.h | ||
main.cc | ||
README | ||
target.mk |
This directory contains the implementation of Genode's AHCI driver Behavior -------- The driver supports x86 32/64 bit platforms and the Exynos5 SOC. If more than one AHCI controller is present, the first one will be used. Each active device on each AHCI port will be represented by a Genode block session. The server must be configured via a policy, that states which client can access a certain device: !<start name="ahci"> ! <binary name="ahci_drv" /> ! <resource name="RAM" quantum="10M" /> ! <provides><service name="Block" /></provides> } ! <route> ! <any-service> <parent /> <any-child /> </any-service> ! </route> ! <config atapi="no"> ! <!-- use model and serial number --> ! <policy label_prefix="test-ahci" model="QEMU HARDDISK" serial="QM00005" writeable="yes" /> ! <!-- use controller port number --> ! <policy label_prefix="bench" device="1" writeable="yes" /> ! <!-- read-only access --> ! <policy label_prefix="boot_fs" device="2"/> ! </config> !</start> In the example above, a session request labeled with "test-ahci" gains access to a device with certain model and serial numbers, "bench" gains access to device at port 1, and finally the session "boot_fs" gains read-only access to port 2. ATAPI support is by default disabled and can be enabled by setting the config attribute "atapi" to "yes". ahci_drv supports reporting of active ports, which can be enabled via configuration sub-node like follows. !<report ports="yes"/> The report structure is depicted by the following example. ! <ports> ! <port num="0" type="ATA" block_count="32768" block_size="512" ! model="QEMU HARDDISK" serial="QM00005"/> ! <port num="1" type="ATAPI"/> ! <port num="2" type="ATA" block_count="32768" block_size="512" ! model="QEMU HARDDISK" serial="QM00009"/> ! </ports>