#ifndef __QUAD_FLASH_H_
#define __QUAD_FLASH_H_

#include "brom_func.h"

#define __XT25F32F_ID   (0x0B4016UL)
#define P25Q32_ID 		(0x856016UL)
#define P25Q32_ID_1     (0x856015UL)
#define P25Q16_ID 		(0x854215UL)
#define EN25Q16_ID 		(0x1c7015UL)
#define BY25Q16_ID 		(0x684015UL)
#define BY25Q8_ID		(0x681014UL)

#define __P25XX_WriteEnable             0x06UL
#define __P25XX_ReadStatusReg1          0x05UL
#define __P25XX_ReadStatusReg2          0x35UL
#define __P25XX_WriteStatusReg1         0x01UL
#define __P25XX_WriteStatusReg2         0x31UL

#define __BY25XX_WriteEnable            0x06UL
#define __BY25XX_ReadStatusReg1         0x05UL
#define __BY25XX_ReadStatusReg2         0x35UL
#define __BY25XX_WriteStatusReg2        0x31UL

#define __EN25XX_WriteEnable            0x06UL
#define __EN25XX_WriteStatusReg         0x01UL
#define __EN25XX_ReadStatusReg          0x05UL
#define __EN25X_EnteOTP                 0x3AUL
#define __EN25X_ExitOTP                 0x04UL

#define SF_STATUS_REGISTER_TIME 		60UL


typedef struct
{
	uint32_t sck;
	uint32_t nss;
	uint32_t dat0;
	uint32_t dat1;
	uint32_t dat2;
	uint32_t dat3;
	uint32_t spi_mfp;
	uint32_t nor_mfp;
}qflash_pin_info_t;

void NORCTRL_QuadSPIinit(uint32_t flash_type,qflash_pin_info_t* pin_info);


#endif /* SRC_COMMON_NOR_CTRL_H_ */
