/*-----------------------------------------------------------------------------------
!
!                              COPYRIGHT 2015 BY
!                            MegaChips Corporation
!
!------------------------------------------------------------------------------------
! These coded instructions, statements, and computer programs include
! intellectual property and know-how belonging to MegaChips
! Corporaiton ("MCC") and its partner companies.
! Therefore, do not use these specifications for any purpose other than
! the purpose
! expressly agreed to by MCCs customer and MCC.  Also, do not duplicate,
! copy,
! or reproduce these specifications, nor reveal these specifications to
! any third party
! without MCCs prior written consent.
!
*/

/*-----------------------------------------------------------------------------------
  FILE        : fifo_reg.h
  DESCRIPTION : fifo Register
  Revision    : $Rev: 4 $
  Author      : $Author: shirait $
  Date        : $Date: 2015-09-09 15:19:58 +0900 (水, 09 9 2015) $
-----------------------------------------------------------------------------------*/
#ifndef ___FIFO_REG_H_INCLUDED___
#define ___FIFO_REG_H_INCLUDED___

#include <stdint.h>

typedef struct _TagFifoReg {
	uint32_t sel;
	uint32_t amf_lvl;
	uint32_t status;
	uint32_t wdin;
	uint32_t rdout;
}FifoReg;

#define FIFO_REG_BASE (0x40008000u)
#define FIFOR (*(volatile FifoReg*)(FIFO_REG_BASE))


#define FIFO_SEL_EMMC2UP    (0x00000000u)
#define FIFO_SEL_EMMC2WGN   (0x00000001u)
#define FIFO_SEL_UP2EMMC    (0x00000002u)
#define FIFO_SEL_UP2WGN    	(0x00000003u)
#define FIFO_SEL_WGN2UP     (0x00000004u)
#define FIFO_SEL_WGN2EMMC   (0x00000005u)

#define FIFO_AMF_4Byte      (0x00000001u)
#define FIFO_AMF_64Byte     (0x00000002u)
#define FIFO_AMF_512Byte    (0x00000004u)

#define FIFO_EMPTY_MASK     (0x00000001u)
#define FIFO_ALE_MASK       (0x00000002u)
#define FIFO_FULL_MASK      (0x00000004u)
#define FIFO_ALF_MASK       (0x00000008u)



#endif // ___CTL_REG_H_INCLUDED___
