.\" Copyright (C) 1998 David A. Hinds -- dhinds@pcmcia.sourceforge.org .\" memory_cs.4 1.10 1999/10/25 19:50:46 .\" .\"O .TH MEMORY_CS 4 "1999/10/25 19:50:46" "pcmcia-cs" .\"O .SH NAME .\"O memory_cs \- MTD-aware PCMCIA memory card driver .\"O .SH SYNOPSIS .\"O .B insmod memory_cs.o .\"O .RB [ pc_debug=\c .\"O .IR n ] .\"O .RB [ mem_speed=\c .\"O .IR n ] .\"O .RB [ word_width=\c .\"O .IR n ] .\"O .SH DESCRIPTION .\"O .B Memory_cs .\"O is the Card Services driver for PCMCIA memory cards, and also provides .\"O direct memory access for other types of cards. .\"O It provides character-mode and block-mode for accessing any card's .\"O attribute and common memory address spaces, analogous to .\"O .IR /dev/mem . .\"O .B Memory_cs .\"O will allocate a free major device number when it is loaded. It .\"O provides two types of minor devices: "direct" character-mode devices .\"O for raw access a card's entire PCMCIA common and attribute memory .\"O spaces, and "indirect" devices for accessing specific memory .\"O partitions via an appropriate Memory Technology Driver. The .\"O bitwise layout of minor device numbers is 'ddddxarr'. 'dddd' .\"O is the device number, with one card counting as one memory device. .\"O 'x' is set if this is a direct-access device, 'a' is set for attribute .\"O memory, and 'rr' is the region number (for indirect devices). When .\"O .B memory_cs .\"O is bound to a card, it will report its major and minor device numbers .\"O to .\"O .BR cardmgr (8). .\"O .PP .\"O The default memory card initialization script creates character .\"O special device files for the direct common memory and attribute memory .\"O devices. It also creates character special devices for accessing the .\"O first attribute and common memory partitions, and a block device for .\"O accessing the first common memory partition. These devices have the .\"O following names: .\"O .TP .\"O .I /dev/mem#c .\"O Common memory direct access, character special device. .\"O .TP .\"O .I /dev/mem#a .\"O Attribute memory direct access, character special device. .\"O .TP .\"O .I /dev/mem#c0c .\"O Common memory region 0, character special device. .\"O .TP .\"O .I /dev/mem#c0b .\"O Common memory region 0, block special device. .\"O .TP .\"O .I /dev/mem#a0c .\"O Attribute memory region 0, character special device. .\"O .PP .\"O The block special device for a card's common memory can be used to .\"O create a filesystem on a card, and the device can be mounted in much .\"O the same way as a floppy disk. In some cases, you may need to .\"O explicitly specify the card's capacity when creating a filesystem. .\"O .PP .\"O The character special devices can be used to read and write arbitrary .\"O numbers of bytes to arbitrary locations. For devices that need to be .\"O explicitly erased before writing, if a write request is aligned and .\"O sized on erase block boundaries for the target memory card, the driver .\"O will erase the target region before writing to the card. .\"O .PP .\"O Since any PCMCIA card can be accessed as a memory card, .\"O .B memory_cs .\"O can be bound to any card regardless of function, and regardless of .\"O what other drivers might also be bound to that card. For example, .\"O this driver can be bound to a card and then used to read out the .\"O contents of the card's attribute memory. .\"O .SH PARAMETERS .\"O .TP .\"O .BI pc_debug= n .\"O Selects the PCMCIA debugging level. This parameter is only available .\"O if the module is compiled with debugging enabled. A non-zero value .\"O enables debugging. .\"O .TP .\"O .BI mem_speed= n .\"O Sets the access speed of the shared memory window for direct access .\"O devices, in nanoseconds. The default is 0 (i.e., no extra wait .\"O states). Values of up to 1000 are legal. .\"O .TP .\"O .BI word_width= n .\"O A flag indicating if direct access devices should be configured for .\"O 8-bit (if 0) or 16-bit (if 1) transfers. The default is 1 (16-bit). .\"O .SH IOCTLS .\"O These are defined in .\"O .BR . .\"O .TP .\"O .B MEMGETINFO .\"O This takes an argument of type .\"O .BR (region_info_t\ *) , .\"O defined in .\"O .BR . .\"O The structure will be filled in with memory region information for .\"O this device, such as access speed, erase block size, and JEDEC .\"O identifiers. .\"O .TP .\"O .B MEMERASE .\"O This takes an argument of type .\"O .BR (erase_info_t\ *) , .\"O specifying the offset and length of a memory region to be erased. .\"O .SH AUTHOR .\"O David Hinds \- dhinds@pcmcia.sourceforge.org .\"O .SH "SEE ALSO" .\"O cardmgr(8), pcmcia(5), memory_cb(4).