From: Stefan E. <se...@us...> - 2002-04-21 10:31:19
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv27881 Added Files: ide.h pcmcia.h Log Message: - added missing header files --- NEW FILE: ide.h --- #ifndef BLOB_IDE_H #define BLOB_IDE_H 1 /* HDC Status Register Bit Masks (1F7h) */ #define BUSY 0x80 /* busy.. can't talk now! */ #define READY 0x40 /* Drive Ready */ #define WRITE_FAULT 0x20 /* Bad news */ #define SEEKOK 0x10 /* Seek Complete */ #define DATA_REQ 0x08 /* Sector buffer needs servicing */ #define CORRECTED 0x04 /* ECC corrected data was read */ #define REV_INDEX 0x02 /* Set once each disk revolution */ #define ERROR 0x01 /* data address mark not found */ /* HDC Error Register Bit Masks (1F1h) */ #define BAD_SECTOR 0x80 /* bad block */ #define BAD_ECC 0x40 /* bad data ecc */ #define BAD_IDMARK 0x10 /* id not found */ #define BAD_CMD 0x04 /* aborted command */ #define BAD_SEEK 0x02 /* trk 0 not found on recalibrate, or bad seek */ #define BAD_ADDRESS 0x01 /* data address mark not found */ /* HDC internal command bytes (HDC_Cmd[7]) */ #define HDC_RECAL 0x10 /* 0001 0000 */ #define HDC_READ 0x20 /* 0010 0000 */ #define HDC_READ_LONG 0x22 /* 0010 0010 */ #define HDC_WRITE 0x30 /* 0011 0000 */ #define HDC_WRITE_LONG 0x32 /* 0011 0010 */ #define HDC_VERIFY 0x40 /* 0100 0000 */ #define HDC_FORMAT 0x50 /* 0101 0000 */ #define HDC_SEEK 0x70 /* 0111 0000 */ #define HDC_DIAG 0x90 /* 1001 0000 */ #define HDC_SET_PARAMS 0x91 /* 1001 0001 */ #define HDC_IDENTIFY 0xEC /* ask drive to identify itself */ #define HD_PORT 0x1f0 #define HD_REG_PORT 0x3f6 /* structure returned by HDIO_GET_IDENTITY, as per ANSI ATA2 rev.2f spec */ typedef struct hd_driveid { unsigned short config; /* lots of obsolete bit flags */ unsigned short cyls; /* "physical" cyls */ unsigned short reserved2; /* reserved (word 2) */ unsigned short heads; /* "physical" heads */ unsigned short track_bytes; /* unformatted bytes per track */ unsigned short sector_bytes; /* unformatted bytes per sector */ unsigned short sectors; /* "physical" sectors per track */ unsigned short vendor0; /* vendor unique */ unsigned short vendor1; /* vendor unique */ unsigned short vendor2; /* vendor unique */ unsigned char serial_no[20]; /* 0 = not_specified */ unsigned short buf_type; unsigned short buf_size; /* 512 byte increments; 0 = not_specified */ unsigned short ecc_bytes; /* for r/w long cmds; 0 = not_specified */ unsigned char fw_rev[8]; /* 0 = not_specified */ unsigned char model[40]; /* 0 = not_specified */ unsigned char max_multsect; /* 0=not_implemented */ unsigned char vendor3; /* vendor unique */ unsigned short dword_io; /* 0=not_implemented; 1=implemented */ unsigned char vendor4; /* vendor unique */ unsigned char capability; /* bits 0:DMA 1:LBA 2:IORDYsw 3:IORDYsup*/ unsigned short reserved50; /* reserved (word 50) */ unsigned char vendor5; /* vendor unique */ unsigned char tPIO; /* 0=slow, 1=medium, 2=fast */ unsigned char vendor6; /* vendor unique */ unsigned char tDMA; /* 0=slow, 1=medium, 2=fast */ unsigned short field_valid; /* bits 0:cur_ok 1:eide_ok */ unsigned short cur_cyls; /* logical cylinders */ unsigned short cur_heads; /* logical heads */ unsigned short cur_sectors; /* logical sectors per track */ unsigned short cur_capacity0; /* logical total sectors on drive */ unsigned short cur_capacity1; /* (2 words, misaligned int) */ unsigned char multsect; /* current multiple sector count */ unsigned char multsect_valid; /* when (bit0==1) multsect is ok */ unsigned int lba_capacity; /* total number of sectors */ unsigned short dma_1word; /* single-word dma info */ unsigned short dma_mword; /* multiple-word dma info */ unsigned short eide_pio_modes; /* bits 0:mode3 1:mode4 */ unsigned short eide_dma_min; /* min mword dma cycle time (ns) */ unsigned short eide_dma_time; /* recommended mword dma cycle time (ns) */ unsigned short eide_pio; /* min cycle time (ns), no IORDY */ unsigned short eide_pio_iordy; /* min cycle time (ns), with IORDY */ unsigned short words69_70[2]; /* reserved words 69-70 */ /* HDIO_GET_IDENTITY currently returns only words 0 through 70 */ unsigned short words71_74[4]; /* reserved words 71-74 */ unsigned short queue_depth; /* */ unsigned short words76_79[4]; /* reserved words 76-79 */ unsigned short major_rev_num; /* */ unsigned short minor_rev_num; /* */ unsigned short command_set_1; /* bits 0:Smart 1:Security 2:Removable 3:PM */ unsigned short command_set_2; /* bits 14:Smart Enabled 13:0 zero */ unsigned short cfsse; /* command set-feature supported extensions */ unsigned short cfs_enable_1; /* command set-feature enabled */ unsigned short cfs_enable_2; /* command set-feature enabled */ unsigned short csf_default; /* command set-feature default */ unsigned short dma_ultra; /* */ unsigned short word89; /* reserved (word 89) */ unsigned short word90; /* reserved (word 90) */ unsigned short CurAPMvalues; /* current APM values */ unsigned short word92; /* reserved (word 92) */ unsigned short hw_config; /* hardware config */ unsigned short words94_125[32];/* reserved words 94-125 */ unsigned short last_lun; /* reserved (word 126) */ unsigned short word127; /* reserved (word 127) */ unsigned short dlf; /* device lock function * 15:9 reserved * 8 security level 1:max 0:high * 7:6 reserved * 5 enhanced erase * 4 expire * 3 frozen * 2 locked * 1 en/disabled * 0 capability */ unsigned short csfo; /* current set features options * 15:4 reserved * 3 auto reassign * 2 reverting * 1 read-look-ahead * 0 write cache */ unsigned short words130_155[26];/* reserved vendor words 130-155 */ unsigned short word156; unsigned short words157_159[3];/* reserved vendor words 157-159 */ unsigned short words160_255[95];/* reserved words 160-255 */ } hd_driveid_t; typedef struct { volatile u8 *ide_port; volatile u8 *ide_reg; unsigned int disk_sectors_per_track; unsigned int disk_heads; hd_driveid_t driveid; u8 last_status; } ide_drive_t; int ide_init( ide_drive_t *drive, u32 *base_addr ); int ide_status_dump( ide_drive_t *drive ); int ide_reset( ide_drive_t *drive ); int ide_identify_drive( ide_drive_t *drive ); int hd_read( ide_drive_t *drive, int head, int sector, int cyl, char *buffer); /* read, mapping abs [0..max] sector # into head, sector, cylinder */ int hd_read_mapped( ide_drive_t *drive, int sector_num, char *buffer); int hd_map_sector( ide_drive_t *drive, int sector, int *head, int *sec, int *cyl ); #endif --- NEW FILE: pcmcia.h --- #ifndef BLOB_PCMCIA_H #define BLOB_PCMCIA_H 1 /* defines for PCMCIA configuration information */ #define PCMCIA_MAX_TUPEL_SZ 512 #define PCMCIA_MAX_FEATURES 4 #define PCMCIA_MAX_IDENT_CHARS 64 #define PCMCIA_MAX_IDENT_FIELDS 4 #define PCMCIA_MAX_FEATURES 4 #define CISTPL_VERS_1 0x15 #define CISTPL_FUNCID 0x21 #define CISTPL_FUNCE 0x22 #define CISTPL_CONFIG 0x1a /* * CIS Function ID codes */ #define CISTPL_FUNCID_MULTI 0x00 #define CISTPL_FUNCID_MEMORY 0x01 #define CISTPL_FUNCID_SERIAL 0x02 #define CISTPL_FUNCID_PARALLEL 0x03 #define CISTPL_FUNCID_FIXED 0x04 #define CISTPL_FUNCID_VIDEO 0x05 #define CISTPL_FUNCID_NETWORK 0x06 #define CISTPL_FUNCID_AIMS 0x07 #define CISTPL_FUNCID_SCSI 0x08 /* * Fixed Disk FUNCE codes */ #define CISTPL_IDE_INTERFACE 0x01 #define CISTPL_FUNCE_IDE_IFACE 0x01 #define CISTPL_FUNCE_IDE_MASTER 0x02 #define CISTPL_FUNCE_IDE_SLAVE 0x03 /* First feature byte */ #define CISTPL_IDE_SILICON 0x04 #define CISTPL_IDE_UNIQUE 0x08 #define CISTPL_IDE_DUAL 0x10 /* Second feature byte */ #define CISTPL_IDE_HAS_SLEEP 0x01 #define CISTPL_IDE_HAS_STANDBY 0x02 #define CISTPL_IDE_HAS_IDLE 0x04 #define CISTPL_IDE_LOW_POWER 0x08 #define CISTPL_IDE_REG_INHIBIT 0x10 #define CISTPL_IDE_HAS_INDEX 0x20 #define CISTPL_IDE_IOIS16 0x40 /********************************************************************** * Arch dependent defines (should be pretty much the same everywhere, * tough) */ #define PCMCIA_MAX_SLOTS 2 #if defined(PT_SYSTEM3) # define PCMCIA_S0_BASE 0x20000000 # define PCMCIA_S0_ATTR_BASE 0x28000000 # define PCMCIA_S1_BASE 0x3c000000 # define PCMCIA_S1_ATTR_BASE 0x38000000 #else # error "Please add PCMCIA HW defines for your board here" #endif /* some slot stati */ #define PCMCIA_SS_DETECT (1<<0) #define PCMCIA_SS_ENABLED (1<<1) #define PCMCIA_SS_POWER (1<<2) #define PCMCIA_SS_IDENT (1<<3) /********************************************************************** * the following symbols can be overwritten by arch dependent code * (weak symbols) */ /* do whatever is needed to get pcmcia initialized */ int pcmcia_init(); /* set pcmcia slot voltage levels */ int pcmcia_voltage_set( int slot, int vcc, int vpp ); /* detect slot */ int pcmcia_slot_detect( int slot ); /* enable slot */ int pcmcia_slot_enable( int slot ); /* disable slot */ int pcmcia_slot_disable( int slot ); /* reset pcmcia slot */ int pcmcia_slot_reset(int slot); /********************************************************************** * following symbols cannot be overwritten */ /* set debug verbosity */ void pcmcia_dbg_set( int level ); /* dump slot stati */ int pcmcia_dump_stati( void ); /* identify pcmcia card */ int pcmcia_identify( volatile unsigned char *p ); /* parse cis tuples of card in slot <slot> */ int pcmcia_cis_parse( int slot ); /* get base adress and attribute space address of slot <slot> */ int pcmcia_slot_address_get( int slot, u32 **base, u32 **attr ); #endif |