#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/arch/svinto.h>
#include <asm/arch/io_interface_mux.h>
Include dependency graph for ide-cris.c:
Go to the source code of this file.
Defines | |
#define | MAX_DMA_DESCRS 64 |
#define | IDE_REGISTER_TIMEOUT 300 |
#define | LOWDB(x) |
here is a place to enable hardware debugging | |
#define | D(x) |
#define | ATA_UDMA2_CYC 0 |
#define | ATA_UDMA2_DVS 0 |
#define | ATA_UDMA1_CYC 0 |
#define | ATA_UDMA1_DVS 0 |
#define | ATA_UDMA0_CYC 0 |
#define | ATA_UDMA0_DVS 0 |
#define | ATA_DMA2_STROBE 4 |
#define | ATA_DMA2_HOLD 0 |
#define | ATA_DMA1_STROBE 4 |
#define | ATA_DMA1_HOLD 1 |
#define | ATA_DMA0_STROBE 12 |
#define | ATA_DMA0_HOLD 9 |
#define | ATA_PIO4_SETUP 1 |
#define | ATA_PIO4_STROBE 5 |
#define | ATA_PIO4_HOLD 0 |
#define | ATA_PIO3_SETUP 1 |
#define | ATA_PIO3_STROBE 5 |
#define | ATA_PIO3_HOLD 1 |
#define | ATA_PIO2_SETUP 1 |
#define | ATA_PIO2_STROBE 6 |
#define | ATA_PIO2_HOLD 2 |
#define | ATA_PIO1_SETUP 2 |
#define | ATA_PIO1_STROBE 11 |
#define | ATA_PIO1_HOLD 4 |
#define | ATA_PIO0_SETUP 4 |
#define | ATA_PIO0_STROBE 19 |
#define | ATA_PIO0_HOLD 4 |
#define | cris_dma_descr_type etrax_dma_descr |
#define | cris_pio_read IO_STATE(R_ATA_CTRL_DATA, rw, read) |
#define | cris_ultra_mask 0x0 |
#define | IRQ 4 |
#define | MAX_DESCR_SIZE 0x10000UL |
Enumerations | |
enum | { TYPE_PIO, TYPE_DMA, TYPE_UDMA } |
Functions | |
int | cris_ide_ack_intr (ide_hwif_t *hwif) |
static int | cris_ide_busy (void) |
static int | cris_ide_ready (void) |
static int | cris_ide_data_available (unsigned short *data) |
static void | cris_ide_write_command (unsigned long command) |
static void | cris_ide_set_speed (int type, int setup, int strobe, int hold) |
static unsigned long | cris_ide_base_address (int bus) |
static unsigned long | cris_ide_reg_addr (unsigned long addr, int cs0, int cs1) |
static __init void | cris_ide_reset (unsigned val) |
static __init void | cris_ide_init (void) |
static unsigned long | cris_ide_get_reg (unsigned long reg) |
static void | cris_ide_fill_descriptor (cris_dma_descr_type *d, void *buf, unsigned int len, int last) |
static void | cris_ide_start_dma (ide_drive_t *drive, cris_dma_descr_type *d, int dir, int type, int len) |
static void | cris_ide_wait_dma (int dir) |
static int | cris_dma_test_irq (ide_drive_t *drive) |
static void | cris_ide_initialize_dma (int dir) |
void | cris_ide_outw (unsigned short data, unsigned long reg) |
void | cris_ide_outb (unsigned char data, unsigned long reg) |
void | cris_ide_outbsync (ide_drive_t *drive, u8 addr, unsigned long port) |
unsigned short | cris_ide_inw (unsigned long reg) |
unsigned char | cris_ide_inb (unsigned long reg) |
static int | cris_dma_check (ide_drive_t *drive) |
static int | cris_dma_end (ide_drive_t *drive) |
static int | cris_dma_setup (ide_drive_t *drive) |
static void | cris_dma_exec_cmd (ide_drive_t *drive, u8 command) |
static void | cris_dma_start (ide_drive_t *drive) |
static void | cris_ide_input_data (ide_drive_t *drive, void *, unsigned int) |
static void | cris_ide_output_data (ide_drive_t *drive, void *, unsigned int) |
static void | cris_atapi_input_bytes (ide_drive_t *drive, void *, unsigned int) |
static void | cris_atapi_output_bytes (ide_drive_t *drive, void *, unsigned int) |
static int | cris_dma_off (ide_drive_t *drive) |
static int | cris_dma_on (ide_drive_t *drive) |
static int | cris_dma_host_off (ide_drive_t *drive) |
static int | cris_dma_host_on (ide_drive_t *drive) |
static void | tune_cris_ide (ide_drive_t *drive, u8 pio) |
static int | speed_cris_ide (ide_drive_t *drive, u8 speed) |
void __init | init_e100_ide (void) |
static cris_dma_descr_type mydescr | __attribute__ ((__aligned__(16))) |
static int | cris_ide_build_dmatable (ide_drive_t *drive) |
static int | cris_config_drive_for_dma (ide_drive_t *drive) |
static ide_startstop_t | cris_dma_intr (ide_drive_t *drive) |
Variables | |
int | _353_io_board_present |
static unsigned int | ata_tot_size |
#define ATA_DMA0_HOLD 9 |
#define ATA_DMA0_STROBE 12 |
#define ATA_DMA1_HOLD 1 |
#define ATA_DMA1_STROBE 4 |
#define ATA_DMA2_HOLD 0 |
Definition at line 399 of file ide-cris.c.
Referenced by cris_ide_set_speed(), init_e100_ide(), and speed_cris_ide().
#define ATA_DMA2_STROBE 4 |
Definition at line 398 of file ide-cris.c.
Referenced by cris_ide_set_speed(), init_e100_ide(), and speed_cris_ide().
#define ATA_PIO0_HOLD 4 |
#define ATA_PIO0_SETUP 4 |
#define ATA_PIO0_STROBE 19 |
#define ATA_PIO1_HOLD 4 |
#define ATA_PIO1_SETUP 2 |
#define ATA_PIO1_STROBE 11 |
#define ATA_PIO2_HOLD 2 |
#define ATA_PIO2_SETUP 1 |
#define ATA_PIO2_STROBE 6 |
#define ATA_PIO3_HOLD 1 |
#define ATA_PIO3_SETUP 1 |
#define ATA_PIO3_STROBE 5 |
#define ATA_PIO4_HOLD 0 |
Definition at line 406 of file ide-cris.c.
Referenced by cris_ide_set_speed(), init_e100_ide(), and tune_cris_ide().
#define ATA_PIO4_SETUP 1 |
Definition at line 404 of file ide-cris.c.
Referenced by cris_ide_set_speed(), init_e100_ide(), and tune_cris_ide().
#define ATA_PIO4_STROBE 5 |
Definition at line 405 of file ide-cris.c.
Referenced by cris_ide_set_speed(), init_e100_ide(), and tune_cris_ide().
#define ATA_UDMA0_CYC 0 |
#define ATA_UDMA0_DVS 0 |
#define ATA_UDMA1_CYC 0 |
#define ATA_UDMA1_DVS 0 |
#define ATA_UDMA2_CYC 0 |
#define ATA_UDMA2_DVS 0 |
#define cris_dma_descr_type etrax_dma_descr |
Definition at line 562 of file ide-cris.c.
#define cris_pio_read IO_STATE(R_ATA_CTRL_DATA, rw, read) |
#define cris_ultra_mask 0x0 |
#define D | ( | x | ) |
Definition at line 49 of file ide-cris.c.
#define IDE_REGISTER_TIMEOUT 300 |
#define IRQ 4 |
Definition at line 565 of file ide-cris.c.
Referenced by createDefaultConfig(), init_e100_ide(), and profileShow().
#define LOWDB | ( | x | ) |
here is a place to enable hardware debugging
Definition at line 48 of file ide-cris.c.
Referenced by cris_ide_inw(), and cris_ide_outw().
#define MAX_DESCR_SIZE 0x10000UL |
Definition at line 566 of file ide-cris.c.
Referenced by cris_ide_build_dmatable(), and cris_ide_fill_descriptor().
#define MAX_DMA_DESCRS 64 |
anonymous enum |
static cris_dma_descr_type mydescr __attribute__ | ( | (__aligned__(16)) | ) | [static] |
static void cris_atapi_input_bytes | ( | ide_drive_t * | drive, | |
void * | , | |||
unsigned | int | |||
) | [static] |
Definition at line 964 of file ide-cris.c.
References cris_ide_fill_descriptor(), cris_ide_start_dma(), cris_ide_wait_dma(), D, LED_DISK_READ, printk, and TYPE_PIO.
Referenced by cris_ide_input_data(), and init_e100_ide().
static void cris_atapi_output_bytes | ( | ide_drive_t * | drive, | |
void * | , | |||
unsigned | int | |||
) | [static] |
Definition at line 986 of file ide-cris.c.
References cris_ide_fill_descriptor(), cris_ide_start_dma(), cris_ide_wait_dma(), D, LED_DISK_READ, LED_DISK_WRITE, printk, and TYPE_PIO.
Referenced by cris_ide_output_data(), and init_e100_ide().
static int cris_config_drive_for_dma | ( | ide_drive_t * | drive | ) | [static] |
Definition at line 1114 of file ide-cris.c.
References speed_cris_ide().
Referenced by cris_dma_check().
static int cris_dma_check | ( | ide_drive_t * | drive | ) | [static] |
Definition at line 1154 of file ide-cris.c.
References cris_config_drive_for_dma(), and ide_use_dma().
Referenced by init_e100_ide().
static int cris_dma_end | ( | ide_drive_t * | drive | ) | [static] |
static void cris_dma_exec_cmd | ( | ide_drive_t * | drive, | |
u8 | command | |||
) | [static] |
Definition at line 1193 of file ide-cris.c.
References cris_dma_intr(), and cris_ide_outb().
Referenced by init_e100_ide().
static int cris_dma_host_off | ( | ide_drive_t * | drive | ) | [static] |
static int cris_dma_host_on | ( | ide_drive_t * | drive | ) | [static] |
static ide_startstop_t cris_dma_intr | ( | ide_drive_t * | drive | ) | [static] |
Definition at line 1130 of file ide-cris.c.
References ide_dma_intr(), LED_DISK_READ, and LED_DISK_WRITE.
Referenced by cris_dma_exec_cmd().
static int cris_dma_off | ( | ide_drive_t * | drive | ) | [static] |
static int cris_dma_on | ( | ide_drive_t * | drive | ) | [static] |
static int cris_dma_setup | ( | ide_drive_t * | drive | ) | [static] |
Definition at line 1179 of file ide-cris.c.
References cris_ide_build_dmatable(), and cris_ide_initialize_dma().
Referenced by init_e100_ide().
static void cris_dma_start | ( | ide_drive_t * | drive | ) | [static] |
Definition at line 1202 of file ide-cris.c.
References cris_ide_start_dma(), LED_DISK_READ, LED_DISK_WRITE, TYPE_DMA, and TYPE_UDMA.
Referenced by init_e100_ide().
static int cris_dma_test_irq | ( | ide_drive_t * | drive | ) | [static] |
int cris_ide_ack_intr | ( | ide_hwif_t * | hwif | ) |
static unsigned long cris_ide_base_address | ( | int | bus | ) | [static] |
static int cris_ide_build_dmatable | ( | ide_drive_t * | drive | ) | [static] |
Definition at line 1033 of file ide-cris.c.
References cris_ide_fill_descriptor(), MAX_DESCR_SIZE, MAX_DMA_DESCRS, printk, and size.
Referenced by cris_dma_setup().
static int cris_ide_busy | ( | void | ) | [inline, static] |
static int cris_ide_data_available | ( | unsigned short * | data | ) | [inline, static] |
static void cris_ide_fill_descriptor | ( | cris_dma_descr_type * | d, | |
void * | buf, | |||
unsigned int | len, | |||
int | last | |||
) | [static] |
Definition at line 575 of file ide-cris.c.
References MAX_DESCR_SIZE.
Referenced by cris_atapi_input_bytes(), cris_atapi_output_bytes(), and cris_ide_build_dmatable().
static unsigned long cris_ide_get_reg | ( | unsigned long | reg | ) | [static] |
unsigned char cris_ide_inb | ( | unsigned long | reg | ) |
Definition at line 749 of file ide-cris.c.
References cris_ide_inw().
Referenced by init_e100_ide().
static __init void cris_ide_init | ( | void | ) | [static] |
Definition at line 512 of file ide-cris.c.
References printk, read, and set.
Referenced by init_e100_ide().
static void cris_ide_initialize_dma | ( | int | dir | ) | [static] |
static void cris_ide_input_data | ( | ide_drive_t * | drive, | |
void * | , | |||
unsigned | int | |||
) | [static] |
Definition at line 1011 of file ide-cris.c.
References cris_atapi_input_bytes().
Referenced by init_e100_ide().
unsigned short cris_ide_inw | ( | unsigned long | reg | ) |
Definition at line 701 of file ide-cris.c.
References cris_ide_busy(), cris_ide_data_available(), cris_ide_get_reg(), cris_ide_write_command(), cris_pio_read, IDE_REGISTER_TIMEOUT, LOWDB, and printk.
Referenced by cris_ide_inb(), and init_e100_ide().
void cris_ide_outb | ( | unsigned char | data, | |
unsigned long | reg | |||
) |
Definition at line 689 of file ide-cris.c.
References cris_ide_outw().
Referenced by cris_dma_exec_cmd(), and init_e100_ide().
void cris_ide_outbsync | ( | ide_drive_t * | drive, | |
u8 | addr, | |||
unsigned long | port | |||
) |
Definition at line 695 of file ide-cris.c.
References cris_ide_outw().
Referenced by init_e100_ide().
static void cris_ide_output_data | ( | ide_drive_t * | drive, | |
void * | , | |||
unsigned | int | |||
) | [static] |
Definition at line 1020 of file ide-cris.c.
References cris_atapi_output_bytes().
Referenced by init_e100_ide().
void cris_ide_outw | ( | unsigned short | data, | |
unsigned long | reg | |||
) |
Definition at line 654 of file ide-cris.c.
References cris_ide_busy(), cris_ide_ready(), cris_ide_write_command(), IDE_REGISTER_TIMEOUT, LOWDB, and printk.
Referenced by cris_ide_outb(), cris_ide_outbsync(), and init_e100_ide().
static int cris_ide_ready | ( | void | ) | [inline, static] |
static unsigned long cris_ide_reg_addr | ( | unsigned long | addr, | |
int | cs0, | |||
int | cs1 | |||
) | [static] |
static __init void cris_ide_reset | ( | unsigned | val | ) | [static] |
Definition at line 492 of file ide-cris.c.
References port_csp0_addr.
Referenced by init_e100_ide().
static void cris_ide_set_speed | ( | int | type, | |
int | setup, | |||
int | strobe, | |||
int | hold | |||
) | [static] |
Definition at line 453 of file ide-cris.c.
References ATA_DMA2_HOLD, ATA_DMA2_STROBE, ATA_PIO4_HOLD, ATA_PIO4_SETUP, ATA_PIO4_STROBE, TYPE_DMA, and TYPE_PIO.
Referenced by init_e100_ide(), speed_cris_ide(), and tune_cris_ide().
static void cris_ide_start_dma | ( | ide_drive_t * | drive, | |
cris_dma_descr_type * | d, | |||
int | dir, | |||
int | type, | |||
int | len | |||
) | [static] |
Definition at line 583 of file ide-cris.c.
References cmd, data, read, start, TYPE_PIO, and write.
Referenced by cris_atapi_input_bytes(), cris_atapi_output_bytes(), and cris_dma_start().
static void cris_ide_wait_dma | ( | int | dir | ) | [static] |
Definition at line 621 of file ide-cris.c.
Referenced by cris_atapi_input_bytes(), and cris_atapi_output_bytes().
static void cris_ide_write_command | ( | unsigned long | command | ) | [static] |
void __init init_e100_ide | ( | void | ) |
Definition at line 857 of file ide-cris.c.
References ATA_DMA2_HOLD, ATA_DMA2_STROBE, ATA_PIO4_HOLD, ATA_PIO4_SETUP, ATA_PIO4_STROBE, ATA_UDMA2_CYC, ATA_UDMA2_DVS, cris_atapi_input_bytes(), cris_atapi_output_bytes(), cris_dma_check(), cris_dma_end(), cris_dma_exec_cmd(), cris_dma_host_off(), cris_dma_host_on(), cris_dma_off(), cris_dma_on(), cris_dma_setup(), cris_dma_start(), cris_dma_test_irq(), cris_ide_ack_intr(), cris_ide_base_address(), cris_ide_inb(), cris_ide_init(), cris_ide_input_data(), cris_ide_inw(), cris_ide_outb(), cris_ide_outbsync(), cris_ide_output_data(), cris_ide_outw(), cris_ide_reg_addr(), cris_ide_reset(), cris_ide_set_speed(), cris_ultra_mask, IRQ, memset(), printk, speed_cris_ide(), tune_cris_ide(), TYPE_DMA, TYPE_PIO, TYPE_UDMA, and udelay.
static int speed_cris_ide | ( | ide_drive_t * | drive, | |
u8 | speed | |||
) | [static] |
Definition at line 807 of file ide-cris.c.
References ATA_DMA0_HOLD, ATA_DMA0_STROBE, ATA_DMA1_HOLD, ATA_DMA1_STROBE, ATA_DMA2_HOLD, ATA_DMA2_STROBE, ATA_UDMA0_CYC, ATA_UDMA0_DVS, ATA_UDMA1_CYC, ATA_UDMA1_DVS, ATA_UDMA2_CYC, ATA_UDMA2_DVS, cris_ide_set_speed(), tune_cris_ide(), TYPE_DMA, and TYPE_UDMA.
Referenced by cris_config_drive_for_dma(), and init_e100_ide().
static void tune_cris_ide | ( | ide_drive_t * | drive, | |
u8 | pio | |||
) | [static] |
Definition at line 769 of file ide-cris.c.
References ATA_PIO0_HOLD, ATA_PIO0_SETUP, ATA_PIO0_STROBE, ATA_PIO1_HOLD, ATA_PIO1_SETUP, ATA_PIO1_STROBE, ATA_PIO2_HOLD, ATA_PIO2_SETUP, ATA_PIO2_STROBE, ATA_PIO3_HOLD, ATA_PIO3_SETUP, ATA_PIO3_STROBE, ATA_PIO4_HOLD, ATA_PIO4_SETUP, ATA_PIO4_STROBE, cris_ide_set_speed(), and TYPE_PIO.
Referenced by init_e100_ide(), and speed_cris_ide().
unsigned int ata_tot_size [static] |
Definition at line 1027 of file ide-cris.c.