iplleomacro.h 3.93 KB
/*
 *  F i l e N a m e  :  i p l l e o m a c r o . h
 *
 ****************************************************************************
 *                   (C) Copyright ALPS Electric Co., Ltd. 1996
 ****************************************************************************
 *  ver     Date
 *  ----  --------
 *  1.01  '96-10-30 Change iplleomecha.c function external definition .
 *  1.00  '96-08-02 Initial revision .
 ****************************************************************************
*/
/************************************************************/
/*   FUNCTIONALLY MACRO FOR IPL READ                        */
/************************************************************/
/*--------------------------------------*/
/* Macros to Access Drive Registers     */
/*--------------------------------------*/
#define   leoiplAd16ReadIo(adr,data)    osEPiReadIo(LeoIPLPiInfo,adr,data)
#define   leoiplAd16WriteIo(adr,data)   osEPiWriteIo(LeoIPLPiInfo,adr,data)
#define   leoiplAd16StartDma(flag)      osEPiStartDma(LeoIPLPiInfo,&LeoIPLPiDmaParam,flag)
/*-----------------------------------*/
#define leoiplGet_leo_status(x)       osEPiReadIo(LeoIPLPiInfo,ASIC_STATUS, x)
#define leoiplGet_leo_bm_status(x)    osEPiReadIo(LeoIPLPiInfo,ASIC_BM_STATUS, x)
#define leoiplGet_leo_err_sec(x)      osEPiReadIo(LeoIPLPiInfo,ASIC_ERR_SECTOR, x)
#define leoiplGet_leo_asic_id(x)      osEPiReadIo(LeoIPLPiInfo,ASIC_ID_REG, x)
#define leoiplGet_leo_asic_data(x)    osEPiReadIo(LeoIPLPiInfo,ASIC_DATA, x)
#define leoiplGet_leo_cur_tk(x)       osEPiReadIo(LeoIPLPiInfo,ASIC_CUR_TK, x)

/*------------------------------------*/
/* Macros for setup BM                */
/*------------------------------------*/
#define leoiplMicro_pc_disable()   LeoIPLasic_seq_ctl_shadow &= (~MICRO_PC_ENABLE),\
                                   osEPiWriteIo(LeoIPLPiInfo,ASIC_SEQ_CTL,LeoIPLasic_seq_ctl_shadow)

#define leoiplMicro_pc_enable()    LeoIPLasic_seq_ctl_shadow |= MICRO_PC_ENABLE,\
                                   osEPiWriteIo(LeoIPLPiInfo,ASIC_SEQ_CTL,LeoIPLasic_seq_ctl_shadow)

#define leoiplClear_bm_error()     osEPiWriteIo(LeoIPLPiInfo,ASIC_BM_CTL,(LeoIPLasic_bm_ctl_shadow | BM_RESET) ),\
                                   osEPiWriteIo(LeoIPLPiInfo,ASIC_BM_CTL, LeoIPLasic_bm_ctl_shadow)

#define leoiplStart_sequencer()    osEPiWriteIo(LeoIPLPiInfo,ASIC_BM_CTL,(LeoIPLasic_bm_ctl_shadow | START_BM))

#define leoiplStop_sequencer()     osEPiWriteIo(LeoIPLPiInfo,ASIC_BM_CTL,(LeoIPLasic_bm_ctl_shadow | BM_RESET) ),\
                                   osEPiWriteIo(LeoIPLPiInfo,ASIC_BM_CTL, LeoIPLasic_bm_ctl_shadow)

#define leoiplClear_mecha_int()  /*  osEPiWriteIo(LeoIPLPiInfo,ASIC_BM_CTL,(LeoIPLasic_bm_ctl_shadow | (BM_MECHA_INT_RESET+BM_INT_MASK))),\  */
                                 /*  osEPiWriteIo(LeoIPLPiInfo,ASIC_BM_CTL,(LeoIPLasic_bm_ctl_shadow &= (~BM_INT_MASK)));                    */

/*------------------------------------*/
/* Macros for system information      */
/*------------------------------------*/
#define leoiplChk_sys_read()          (LeoIPLdrive_flag)

#define leoiplSet_sys_read()          (LeoIPLdrive_flag = (u8)0xff)

#define leoiplClr_sys_read()          (LeoIPLdrive_flag = (u8)0x00)

/*------------------------------------*/
/* Macros for CLEAR_QUEUE command     */
/*------------------------------------*/
#define leoiplChk_clr_que_flag()      (LeoIPLclr_que_flag)

#define leoiplSet_clr_que_flag()      (LeoIPLclr_que_flag = (u8)0xff)

#define leoiplClr_clr_que_flag()      (LeoIPLclr_que_flag = (u8)0x00)

/*-----------------------------------*/
/* External Functions Definitions    */
/*-----------------------------------*/
#ifndef _ASIC_IF
extern u8   leoiplChk_asic_ready(u32 asic_cmd);
extern u8   leoiplWait_mecha_cmd_done(u32 asic_cmd );
extern u8   leoiplSend_asic_cmd_w(u32 asic_cmd, u32 asic_data);
extern u8   leoiplSeek_read_i(void);
extern u8   leoiplDetect_index_w(void);
extern u32  leoiplChk_err_retry(u32 sense);
extern void leoiplDrive_reset(void);
#endif