#ifndef _MYX_BOOT_STATE_H_
#define _MYX_BOOT_STATE_H_

typedef unsigned short			myxbs_t;

#ifdef MYX_SIM
# define MYX_BS_DEV			"mtd2"
#else /* not MYX_SIM */
# define MYX_BS_DEV			"/dev/mtd/bootstate"
#endif /* not MYX_SIM */

#define MYX_BS_SIZE			MYX_FLASH_SECTOR_SIZE
#define MYX_BS_HI_WATER			(MYX_FLASH_SECTOR_SIZE - 100)
#define MYX_BS_N			(MYX_BS_SIZE / sizeof(myxbs_t))
#define MYX_BS_SD			0x0100

#define MYX_BS_BIT_LOADER_ALIVE		(1 << 0)
#ifdef CONFIG_OOMA_MYX_SYMMETRICAL_IMAGES
# define MYX_BS_BIT_LOADER_IMAGE_B	(1 << 1)
# define MYX_BS_BIT_LOADER_IMAGE_A	(1 << 2)
#else /* not CONFIG_OOMA_MYX_SYMMETRICAL_IMAGES */
# define MYX_BS_BIT_LOADER_OPS		(1 << 1)
# define MYX_BS_BIT_LOADER_RECOVERY	(1 << 2)
#endif /* not CONFIG_OOMA_MYX_SYMMETRICAL_IMAGES */
#define MYX_BS_BIT_LOADER_WATCHDOG	(1 << 3)
#define MYX_BS_BIT_LOADER_SWR		(1 << 4)
#define MYX_BS_BIT_LOADER_POR		(1 << 5)
#define MYX_BS_BIT_LOADER_RTT		(1 << 6)

#define MYX_BS_BIT_USER_INIT		(1 << 8)
#define MYX_BS_BIT_USER_OPM		(1 << 9)
#define MYX_BS_BIT_PROV_START		(1 << 10)
#define MYX_BS_BIT_PROV_DONE		(1 << 11)
#define MYX_BS_BIT_USER_REBOOT		(1 << 12)

#ifdef CONFIG_OOMA_MYX_SYMMETRICAL_IMAGES
# define MYX_BS_BIT_USER_SWITCH		(1 << 15)
#else /* not CONFIG_OOMA_MYX_SYMMETRICAL_IMAGES */
# define MYX_BS_BIT_USER_RECOVERY	(1 << 15)
#endif /* not CONFIG_OOMA_MYX_SYMMETRICAL_IMAGES */

#endif /* _MYX_BOOT_STATE_H_ */
