Linux Kernel
3.7.1
|
#include <linux/ata.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/libata.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pata_arasan_cf_data.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/workqueue.h>
Go to the source code of this file.
Data Structures | |
struct | arasan_cf_dev |
Macros | |
#define | DRIVER_NAME "arasan_cf" |
#define | TIMEOUT msecs_to_jiffies(3000) |
#define | CFI_STS 0x000 |
#define | STS_CHG (1) |
#define | BIN_AUDIO_OUT (1 << 1) |
#define | CARD_DETECT1 (1 << 2) |
#define | CARD_DETECT2 (1 << 3) |
#define | INP_ACK (1 << 4) |
#define | CARD_READY (1 << 5) |
#define | IO_READY (1 << 6) |
#define | B16_IO_PORT_SEL (1 << 7) |
#define | IRQ_STS 0x004 |
#define | IRQ_EN 0x008 |
#define | CARD_DETECT_IRQ (1) |
#define | STATUS_CHNG_IRQ (1 << 1) |
#define | MEM_MODE_IRQ (1 << 2) |
#define | IO_MODE_IRQ (1 << 3) |
#define | TRUE_IDE_MODE_IRQ (1 << 8) |
#define | PIO_XFER_ERR_IRQ (1 << 9) |
#define | BUF_AVAIL_IRQ (1 << 10) |
#define | XFER_DONE_IRQ (1 << 11) |
#define | IGNORED_IRQS |
#define | TRUE_IDE_IRQS |
#define | OP_MODE 0x00C |
#define | CARD_MODE_MASK (0x3) |
#define | MEM_MODE (0x0) |
#define | IO_MODE (0x1) |
#define | TRUE_IDE_MODE (0x2) |
#define | CARD_TYPE_MASK (1 << 2) |
#define | CF_CARD (0) |
#define | CF_PLUS_CARD (1 << 2) |
#define | CARD_RESET (1 << 3) |
#define | CFHOST_ENB (1 << 4) |
#define | OUTPUTS_TRISTATE (1 << 5) |
#define | ULTRA_DMA_ENB (1 << 8) |
#define | MULTI_WORD_DMA_ENB (1 << 9) |
#define | DRQ_BLOCK_SIZE_MASK (0x3 << 11) |
#define | DRQ_BLOCK_SIZE_512 (0) |
#define | DRQ_BLOCK_SIZE_1024 (1 << 11) |
#define | DRQ_BLOCK_SIZE_2048 (2 << 11) |
#define | DRQ_BLOCK_SIZE_4096 (3 << 11) |
#define | CLK_CFG 0x010 |
#define | CF_IF_CLK_MASK (0XF) |
#define | TM_CFG 0x014 |
#define | MEM_MODE_TIMING_MASK (0x3) |
#define | MEM_MODE_TIMING_250NS (0x0) |
#define | MEM_MODE_TIMING_120NS (0x1) |
#define | MEM_MODE_TIMING_100NS (0x2) |
#define | MEM_MODE_TIMING_80NS (0x3) |
#define | IO_MODE_TIMING_MASK (0x3 << 2) |
#define | IO_MODE_TIMING_250NS (0x0 << 2) |
#define | IO_MODE_TIMING_120NS (0x1 << 2) |
#define | IO_MODE_TIMING_100NS (0x2 << 2) |
#define | IO_MODE_TIMING_80NS (0x3 << 2) |
#define | TRUEIDE_PIO_TIMING_MASK (0x7 << 4) |
#define | TRUEIDE_PIO_TIMING_SHIFT 4 |
#define | TRUEIDE_MWORD_DMA_TIMING_MASK (0x7 << 7) |
#define | TRUEIDE_MWORD_DMA_TIMING_SHIFT 7 |
#define | ULTRA_DMA_TIMING_MASK (0x7 << 10) |
#define | ULTRA_DMA_TIMING_SHIFT 10 |
#define | XFER_ADDR 0x014 |
#define | XFER_ADDR_MASK (0x7FF) |
#define | MAX_XFER_COUNT 0x20000u |
#define | XFER_CTR 0x01C |
#define | XFER_COUNT_MASK (0x3FFFF) |
#define | ADDR_INC_DISABLE (1 << 24) |
#define | XFER_WIDTH_MASK (1 << 25) |
#define | XFER_WIDTH_8B (0) |
#define | XFER_WIDTH_16B (1 << 25) |
#define | MEM_TYPE_MASK (1 << 26) |
#define | MEM_TYPE_COMMON (0) |
#define | MEM_TYPE_ATTRIBUTE (1 << 26) |
#define | MEM_IO_XFER_MASK (1 << 27) |
#define | MEM_XFER (0) |
#define | IO_XFER (1 << 27) |
#define | DMA_XFER_MODE (1 << 28) |
#define | AHB_BUS_NORMAL_PIO_OPRTN (~(1 << 29)) |
#define | XFER_DIR_MASK (1 << 30) |
#define | XFER_READ (0) |
#define | XFER_WRITE (1 << 30) |
#define | XFER_START (1 << 31) |
#define | WRITE_PORT 0x024 |
#define | READ_PORT 0x028 |
#define | ATA_DATA_PORT 0x030 |
#define | ATA_DATA_PORT_MASK (0xFFFF) |
#define | ATA_ERR_FTR 0x034 |
#define | ATA_SC 0x038 |
#define | ATA_SN 0x03C |
#define | ATA_CL 0x040 |
#define | ATA_CH 0x044 |
#define | ATA_SH 0x048 |
#define | ATA_STS_CMD 0x04C |
#define | ATA_ASTS_DCTR 0x050 |
#define | EXT_WRITE_PORT 0x200 |
#define | EXT_READ_PORT 0x400 |
#define | FIFO_SIZE 0x200u |
#define | GIRQ_STS 0x800 |
#define | GIRQ_STS_EN 0x804 |
#define | GIRQ_SGN_EN 0x808 |
#define | GIRQ_CF (1) |
#define | GIRQ_XD (1 << 1) |
Functions | |
void | arasan_cf_error_handler (struct ata_port *ap) |
unsigned int | arasan_cf_qc_issue (struct ata_queued_cmd *qc) |
module_platform_driver (arasan_cf_driver) | |
MODULE_AUTHOR ("Viresh Kumar <[email protected]>") | |
MODULE_DESCRIPTION ("Arasan ATA Compact Flash driver") | |
MODULE_LICENSE ("GPL") | |
MODULE_ALIAS ("platform:"DRIVER_NAME) | |
#define ADDR_INC_DISABLE (1 << 24) |
Definition at line 126 of file pata_arasan_cf.c.
#define AHB_BUS_NORMAL_PIO_OPRTN (~(1 << 29)) |
Definition at line 141 of file pata_arasan_cf.c.
#define ATA_ASTS_DCTR 0x050 |
Definition at line 169 of file pata_arasan_cf.c.
#define ATA_CH 0x044 |
Definition at line 163 of file pata_arasan_cf.c.
#define ATA_CL 0x040 |
Definition at line 161 of file pata_arasan_cf.c.
#define ATA_DATA_PORT 0x030 |
Definition at line 152 of file pata_arasan_cf.c.
#define ATA_DATA_PORT_MASK (0xFFFF) |
Definition at line 153 of file pata_arasan_cf.c.
#define ATA_ERR_FTR 0x034 |
Definition at line 155 of file pata_arasan_cf.c.
#define ATA_SC 0x038 |
Definition at line 157 of file pata_arasan_cf.c.
#define ATA_SH 0x048 |
Definition at line 165 of file pata_arasan_cf.c.
#define ATA_SN 0x03C |
Definition at line 159 of file pata_arasan_cf.c.
#define ATA_STS_CMD 0x04C |
Definition at line 167 of file pata_arasan_cf.c.
#define B16_IO_PORT_SEL (1 << 7) |
Definition at line 56 of file pata_arasan_cf.c.
#define BIN_AUDIO_OUT (1 << 1) |
Definition at line 50 of file pata_arasan_cf.c.
#define BUF_AVAIL_IRQ (1 << 10) |
Definition at line 67 of file pata_arasan_cf.c.
#define CARD_DETECT1 (1 << 2) |
Definition at line 51 of file pata_arasan_cf.c.
#define CARD_DETECT2 (1 << 3) |
Definition at line 52 of file pata_arasan_cf.c.
#define CARD_DETECT_IRQ (1) |
Definition at line 61 of file pata_arasan_cf.c.
#define CARD_MODE_MASK (0x3) |
Definition at line 75 of file pata_arasan_cf.c.
#define CARD_READY (1 << 5) |
Definition at line 54 of file pata_arasan_cf.c.
#define CARD_RESET (1 << 3) |
Definition at line 84 of file pata_arasan_cf.c.
#define CARD_TYPE_MASK (1 << 2) |
Definition at line 80 of file pata_arasan_cf.c.
#define CF_CARD (0) |
Definition at line 81 of file pata_arasan_cf.c.
#define CF_IF_CLK_MASK (0XF) |
Definition at line 96 of file pata_arasan_cf.c.
#define CF_PLUS_CARD (1 << 2) |
Definition at line 82 of file pata_arasan_cf.c.
#define CFHOST_ENB (1 << 4) |
Definition at line 85 of file pata_arasan_cf.c.
#define CFI_STS 0x000 |
Definition at line 48 of file pata_arasan_cf.c.
#define CLK_CFG 0x010 |
Definition at line 95 of file pata_arasan_cf.c.
#define DMA_XFER_MODE (1 << 28) |
Definition at line 139 of file pata_arasan_cf.c.
#define DRIVER_NAME "arasan_cf" |
Definition at line 43 of file pata_arasan_cf.c.
#define DRQ_BLOCK_SIZE_1024 (1 << 11) |
Definition at line 91 of file pata_arasan_cf.c.
#define DRQ_BLOCK_SIZE_2048 (2 << 11) |
Definition at line 92 of file pata_arasan_cf.c.
#define DRQ_BLOCK_SIZE_4096 (3 << 11) |
Definition at line 93 of file pata_arasan_cf.c.
#define DRQ_BLOCK_SIZE_512 (0) |
Definition at line 90 of file pata_arasan_cf.c.
#define DRQ_BLOCK_SIZE_MASK (0x3 << 11) |
Definition at line 89 of file pata_arasan_cf.c.
#define EXT_READ_PORT 0x400 |
Definition at line 173 of file pata_arasan_cf.c.
#define EXT_WRITE_PORT 0x200 |
Definition at line 171 of file pata_arasan_cf.c.
#define FIFO_SIZE 0x200u |
Definition at line 174 of file pata_arasan_cf.c.
#define GIRQ_CF (1) |
Definition at line 181 of file pata_arasan_cf.c.
#define GIRQ_SGN_EN 0x808 |
Definition at line 180 of file pata_arasan_cf.c.
#define GIRQ_STS 0x800 |
Definition at line 176 of file pata_arasan_cf.c.
#define GIRQ_STS_EN 0x804 |
Definition at line 178 of file pata_arasan_cf.c.
#define GIRQ_XD (1 << 1) |
Definition at line 182 of file pata_arasan_cf.c.
#define IGNORED_IRQS |
Definition at line 69 of file pata_arasan_cf.c.
#define INP_ACK (1 << 4) |
Definition at line 53 of file pata_arasan_cf.c.
#define IO_MODE (0x1) |
Definition at line 77 of file pata_arasan_cf.c.
#define IO_MODE_IRQ (1 << 3) |
Definition at line 64 of file pata_arasan_cf.c.
#define IO_MODE_TIMING_100NS (0x2 << 2) |
Definition at line 108 of file pata_arasan_cf.c.
#define IO_MODE_TIMING_120NS (0x1 << 2) |
Definition at line 107 of file pata_arasan_cf.c.
#define IO_MODE_TIMING_250NS (0x0 << 2) |
Definition at line 106 of file pata_arasan_cf.c.
#define IO_MODE_TIMING_80NS (0x3 << 2) |
Definition at line 109 of file pata_arasan_cf.c.
#define IO_MODE_TIMING_MASK (0x3 << 2) |
Definition at line 105 of file pata_arasan_cf.c.
#define IO_READY (1 << 6) |
Definition at line 55 of file pata_arasan_cf.c.
#define IO_XFER (1 << 27) |
Definition at line 137 of file pata_arasan_cf.c.
#define IRQ_EN 0x008 |
Definition at line 60 of file pata_arasan_cf.c.
#define IRQ_STS 0x004 |
Definition at line 58 of file pata_arasan_cf.c.
#define MAX_XFER_COUNT 0x20000u |
Definition at line 122 of file pata_arasan_cf.c.
#define MEM_IO_XFER_MASK (1 << 27) |
Definition at line 135 of file pata_arasan_cf.c.
#define MEM_MODE (0x0) |
Definition at line 76 of file pata_arasan_cf.c.
#define MEM_MODE_IRQ (1 << 2) |
Definition at line 63 of file pata_arasan_cf.c.
#define MEM_MODE_TIMING_100NS (0x2) |
Definition at line 102 of file pata_arasan_cf.c.
#define MEM_MODE_TIMING_120NS (0x1) |
Definition at line 101 of file pata_arasan_cf.c.
#define MEM_MODE_TIMING_250NS (0x0) |
Definition at line 100 of file pata_arasan_cf.c.
#define MEM_MODE_TIMING_80NS (0x3) |
Definition at line 103 of file pata_arasan_cf.c.
#define MEM_MODE_TIMING_MASK (0x3) |
Definition at line 99 of file pata_arasan_cf.c.
#define MEM_TYPE_ATTRIBUTE (1 << 26) |
Definition at line 133 of file pata_arasan_cf.c.
#define MEM_TYPE_COMMON (0) |
Definition at line 132 of file pata_arasan_cf.c.
#define MEM_TYPE_MASK (1 << 26) |
Definition at line 131 of file pata_arasan_cf.c.
#define MEM_XFER (0) |
Definition at line 136 of file pata_arasan_cf.c.
#define MULTI_WORD_DMA_ENB (1 << 9) |
Definition at line 88 of file pata_arasan_cf.c.
#define OP_MODE 0x00C |
Definition at line 74 of file pata_arasan_cf.c.
#define OUTPUTS_TRISTATE (1 << 5) |
Definition at line 86 of file pata_arasan_cf.c.
#define PIO_XFER_ERR_IRQ (1 << 9) |
Definition at line 66 of file pata_arasan_cf.c.
#define READ_PORT 0x028 |
Definition at line 150 of file pata_arasan_cf.c.
#define STATUS_CHNG_IRQ (1 << 1) |
Definition at line 62 of file pata_arasan_cf.c.
#define STS_CHG (1) |
Definition at line 49 of file pata_arasan_cf.c.
#define TIMEOUT msecs_to_jiffies(3000) |
Definition at line 44 of file pata_arasan_cf.c.
#define TM_CFG 0x014 |
Definition at line 98 of file pata_arasan_cf.c.
#define TRUE_IDE_IRQS |
Definition at line 71 of file pata_arasan_cf.c.
#define TRUE_IDE_MODE (0x2) |
Definition at line 78 of file pata_arasan_cf.c.
#define TRUE_IDE_MODE_IRQ (1 << 8) |
Definition at line 65 of file pata_arasan_cf.c.
#define TRUEIDE_MWORD_DMA_TIMING_MASK (0x7 << 7) |
Definition at line 114 of file pata_arasan_cf.c.
#define TRUEIDE_MWORD_DMA_TIMING_SHIFT 7 |
Definition at line 115 of file pata_arasan_cf.c.
#define TRUEIDE_PIO_TIMING_MASK (0x7 << 4) |
Definition at line 111 of file pata_arasan_cf.c.
#define TRUEIDE_PIO_TIMING_SHIFT 4 |
Definition at line 112 of file pata_arasan_cf.c.
#define ULTRA_DMA_ENB (1 << 8) |
Definition at line 87 of file pata_arasan_cf.c.
#define ULTRA_DMA_TIMING_MASK (0x7 << 10) |
Definition at line 117 of file pata_arasan_cf.c.
#define ULTRA_DMA_TIMING_SHIFT 10 |
Definition at line 118 of file pata_arasan_cf.c.
#define WRITE_PORT 0x024 |
Definition at line 148 of file pata_arasan_cf.c.
#define XFER_ADDR 0x014 |
Definition at line 120 of file pata_arasan_cf.c.
#define XFER_ADDR_MASK (0x7FF) |
Definition at line 121 of file pata_arasan_cf.c.
#define XFER_COUNT_MASK (0x3FFFF) |
Definition at line 125 of file pata_arasan_cf.c.
#define XFER_CTR 0x01C |
Definition at line 124 of file pata_arasan_cf.c.
#define XFER_DIR_MASK (1 << 30) |
Definition at line 142 of file pata_arasan_cf.c.
#define XFER_DONE_IRQ (1 << 11) |
Definition at line 68 of file pata_arasan_cf.c.
#define XFER_READ (0) |
Definition at line 143 of file pata_arasan_cf.c.
#define XFER_START (1 << 31) |
Definition at line 146 of file pata_arasan_cf.c.
#define XFER_WIDTH_16B (1 << 25) |
Definition at line 129 of file pata_arasan_cf.c.
#define XFER_WIDTH_8B (0) |
Definition at line 128 of file pata_arasan_cf.c.
#define XFER_WIDTH_MASK (1 << 25) |
Definition at line 127 of file pata_arasan_cf.c.
#define XFER_WRITE (1 << 30) |
Definition at line 144 of file pata_arasan_cf.c.
Definition at line 661 of file pata_arasan_cf.c.
unsigned int arasan_cf_qc_issue | ( | struct ata_queued_cmd * | qc | ) |
Definition at line 687 of file pata_arasan_cf.c.
MODULE_ALIAS | ( | "platform:" | DRIVER_NAME | ) |
MODULE_AUTHOR | ( | "Viresh Kumar <[email protected]>" | ) |
MODULE_LICENSE | ( | "GPL" | ) |
module_platform_driver | ( | arasan_cf_driver | ) |