www.pudn.com > MT7681_IoT_Package_v0.02.rar > flash_map.h, change:2014-01-28,size:7144b


#ifndef _FLASH_MAP_H_
#define _FLASH_MAP_H_

#include "types.h"

/***************************************************************************
  *	Flash Mapping
  **************************************************************************/
#define FLASH_OFFSET_BASE				(0x00000)

#define FLASH_OFFSET_LOADER_START		(FLASH_OFFSET_BASE)
#define FLASH_OFFSET_LOADER_END			(FLASH_OFFSET_LOADER_START + (0x1000))    //4KB

#define FLASH_OFFSET_RESERVE_1_START	(FLASH_OFFSET_LOADER_END)
#define FLASH_OFFSET_RESERVE_1_END		(FLASH_OFFSET_RESERVE_1_START + (0x1000)) //4KB

#define FLASH_OFFSET_STA_FW_START		(FLASH_OFFSET_RESERVE_1_END)
#define FLASH_OFFSET_STA_FW_END			(FLASH_OFFSET_STA_FW_START + (0x10000))   //64KB

#define FLASH_OFFSET_RESERVE_2_START	(FLASH_OFFSET_STA_FW_END)
#define FLASH_OFFSET_RESERVE_2_END		(FLASH_OFFSET_RESERVE_2_START + (0x1000)) //4KB

#define FLASH_OFFSET_AP_FW_START		(FLASH_OFFSET_RESERVE_2_END)
#define FLASH_OFFSET_AP_FW_END			(FLASH_OFFSET_AP_FW_START + (0x10000))    //64KB

#define FLASH_OFFSET_RESERVE_3_START	(FLASH_OFFSET_AP_FW_END)
#define FLASH_OFFSET_RESERVE_3_END		(FLASH_OFFSET_RESERVE_3_START + (0x1000)) //4KB

#define FLASH_OFFSET_CAL_FW_START		(FLASH_OFFSET_RESERVE_3_END)
#define FLASH_OFFSET_CAL_FW_END			(FLASH_OFFSET_CAL_FW_START + (0x10000))   //64KB

#define FLASH_OFFSET_RESERVE_4_START	(FLASH_OFFSET_CAL_FW_END)
#define FLASH_OFFSET_RESERVE_4_END		(FLASH_OFFSET_RESERVE_4_START + (0x1000)) //4KB

#define FLASH_OFFSET_UPG_FW_START		(FLASH_OFFSET_RESERVE_4_END)              //4KB
#define FLASH_OFFSET_UPG_FW_END			(FLASH_OFFSET_UPG_FW_START + (0x10000))   //64KB

#define FLASH_OFFSET_RESERVE_5_START	(FLASH_OFFSET_UPG_FW_END)
#define FLASH_OFFSET_RESERVE_5_END		(FLASH_OFFSET_RESERVE_5_START + (0x1000)) //4KB

#define FLASH_OFFSET_COM_CFG_START		(FLASH_OFFSET_RESERVE_5_END)              //4KB
#define FLASH_OFFSET_COM_CFG_END		(FLASH_OFFSET_COM_CFG_START + (0x01000))  //4KB

#define FLASH_OFFSET_STA_CFG_START		(FLASH_OFFSET_COM_CFG_END)                //4KB
#define FLASH_OFFSET_STA_CFG_END		(FLASH_OFFSET_STA_CFG_START + (0x1000))   //4KB

#define FLASH_OFFSET_AP_CFG_START		(FLASH_OFFSET_STA_CFG_END)                //4KB
#define FLASH_OFFSET_AP_CFG_END			(FLASH_OFFSET_AP_CFG_START + (0x1000))    //4KB

#define FLASH_OFFSET_RESERVE_6_START	(FLASH_OFFSET_AP_CFG_END)                 //4KB
#define FLASH_OFFSET_RESERVE_6_END		(FLASH_OFFSET_RESERVE_6_START + (0x1000)) //4KB

#define FLASH_OFFSET_EEP_CFG_START		(FLASH_OFFSET_RESERVE_6_END)              //4KB
#define FLASH_OFFSET_EEP_CFG_END		(FLASH_OFFSET_EEP_CFG_START + (0x1000))   //4KB

#define FLASH_OFFSET_RESERVE_7_START	(FLASH_OFFSET_EEP_CFG_END)                //4KB
#define FLASH_OFFSET_RESERVE_7_END		(FLASH_OFFSET_RESERVE_7_START + (0x1000)) //4KB

#define FLASH_OFFSET_WRITE_BUF_START	(FLASH_OFFSET_RESERVE_7_END)              //4KB
#define FLASH_OFFSET_WRITE_BUF_END		(FLASH_OFFSET_WRITE_BUF_START + (0x1000)) //4KB

#define FLASH_OFFSET_RESERVE_8_START	(FLASH_OFFSET_WRITE_BUF_END)              //4KB
#define FLASH_OFFSET_RESERVE_8_END		(FLASH_OFFSET_RESERVE_8_START + (0x3000)) //12KB

#define FLASH_OFFSET_USR_CFG_START		(FLASH_OFFSET_RESERVE_8_END)              //4KB
#define FLASH_OFFSET_USR_CFG_END		(FLASH_OFFSET_USR_CFG_START + (0x1000))   //4KB



/***************************************************************************
  *	Flash SECTOR or BLOCK
  **************************************************************************/
/*For flash model: EN25T16*/
#define FLASH_TOTAL_SIZE        (FLASH_OFFSET_USR_CFG_END)
#define FLASH_SECTOR_SIZE		(0x1000)   //4KB
#define FLASH_BLOCK_SIZE		(0x10000)  //64KB
#define FLASH_RW_BUF_START		(FLASH_OFFSET_WRITE_BUF_START)  //(0x4C000)
#define FLASH_RW_BUF_SIZE		(FLASH_OFFSET_WRITE_BUF_END - FLASH_OFFSET_WRITE_BUF_START)

#define RAM_RW_BUF_SIZE			(256)


/***************************************************************************
  *	The Detail layout for Common Config
  **************************************************************************/
#define FLASH_COM_CFG_BASE					(FLASH_OFFSET_COM_CFG_START)

#define FLASH_COM_CFG_MODE_SETTING			(FLASH_COM_CFG_BASE + 0x0)
#define FLASH_COM_CFG_MODE_SETTING_LEN		(0x1)

#define FLASH_COM_CFG_UPG_FW_SETTING		(FLASH_COM_CFG_BASE + 0x1)
#define FLASH_COM_CFG_UPG_FW_SETTING_LEN	(0x1)








/***************************************************************************
  *	The Detail layout for AP Config
  **************************************************************************/
#define FLASH_AP_CFG_BASE				(FLASH_OFFSET_AP_CFG_START)

#define FLASH_AP_CFG_BSSID				(0x0)
#define FLASH_AP_CFG_BSSID_LEN 				(MAC_ADDR_LEN)     //6 Bytes

#define FLASH_AP_CFG_SSID				(0x6)
#define FLASH_AP_CFG_SSID_LEN  				(MAX_LEN_OF_SSID)  //32 Bytes

#define FLASH_AP_CFG_PASSPHASE			(0x26)
#define FLASH_AP_CFG_PASSPHASE_LEN			(0x40)

#define FLASH_AP_CFG_AUTH_MODE			(0x66)
#define FLASH_AP_CFG_AUTH_MODE_LEN			(0x1)

#define FLASH_AP_CFG_FGIS_HID_SSID		(0x67)
#define FLASH_AP_CFG_FGIS_HID_SSID_LEN		(0x1)






/***************************************************************************
  *	The Detail layout for Station Config
  **************************************************************************/
#define FLASH_STA_CFG_BASE				(FLASH_OFFSET_STA_CFG_START)

#define FLASH_STA_CFG_BSSID				(0x0)
#define FLASH_STA_CFG_BSSID_LEN 			(MAC_ADDR_LEN)      //6 Bytes

#define FLASH_STA_CFG_SSID				(0x6)
#define FLASH_STA_CFG_SSID_LEN  			(MAX_LEN_OF_SSID)   //32 Bytes

#define FLASH_STA_CFG_SSIDLEN			(0x26)
#define FLASH_STA_CFG_SSIDLEN_LEN			(0x1)

#define FLASH_STA_CFG_PASSPHASE			(0x27)
#define FLASH_STA_CFG_PASSPHASE_LEN 		(CIPHER_TEXT_LEN)	//64Bytes

#define FLASH_STA_CFG_PASSPHASELEN		(0x67)
#define FLASH_STA_CFG_PASSPHASELEN_LEN 		(0x1)

#define FLASH_STA_CFG_AUTH_MODE			(0x68)
#define FLASH_STA_CFG_AUTH_MODE_LEN			(0x1)






/***************************************************************************
  *	The Detail layout for User Config
  **************************************************************************/
#define FLASH_USR_CFG_BASE				(FLASH_OFFSET_USR_CFG_START)

#define FLASH_USR_CFG_VENDOR_NAME		(0x0)
#define FLASH_USR_CFG_VENDOR_NAME_LEN 		(0x20)  //32 Byte

#define FLASH_USR_CFG_PRODUCT_TYPE		(0x20)
#define FLASH_USR_CFG_PRODUCT_TYPE_LEN 		(0x20)  //32 Byte

#define FLASH_USR_CFG_PRODUCT_NAME		(0x40)
#define FLASH_USR_CFG_PRODUCT_NAME_LEN 		(0x20)  //32 Byte





/***************************************************************************
  *	The Detail layout for EEPROM Config
  **************************************************************************/
#define FLASH_EEP_CFG_BASE				(FLASH_OFFSET_EEP_CFG_START)

#define FLASH_EEP_CFG_CHIP_ID			(0x00)
#define FLASH_EEP_CFG_EEP_VER			(0x02)
#define FLASH_EEP_CFG_MAC_ADDR			(0x04)
#define FLASH_EEP_CFG_MAC_ADDR_LEN			(MAC_ADDR_LEN)     //6 Bytes

#define FLASH_EEP_CFG_NIC_0				(0x34)
#define FLASH_EEP_CFG_NIC_1				(0x36)
#define FLASH_EEP_CFG_COUNTRY_REGION_24	(0x39)
#define FLASH_EEP_CFG_FREQ_OFFSET		(0x3A)
#define FLASH_EEP_CFG_NIC_2				(0x42)
#define FLASH_EEP_CFG_TX0_POWER			(0x52)

#endif /* _FLASH_MAP_H_ */