/**
 * @file hv_comm_FlashConfig.h
 * @brief Header file of Project.
 *
 * @verbatim
 * ==============================================================================
 *                        ##### How to use #####
 * ==============================================================================
 *
 *
 @ endverbatim
 *
 * @author HiView SoC Software Team
 * @version 1.0.0
 * @date 2023-04-25
 */
#ifndef __HV_COMM_FLASH_CONFIG_H__
#define __HV_COMM_FLASH_CONFIG_H__

#define CONFIG_DB_USERDATA                  1
#define HV_PROJECT_CONFIG_FLASH_PROTECT
#define CONFIG_CODE_COMPRESSED
#define CONFIG_PQ_COMPRESSED

/* need io2 for wp. */
//#define HV_FLASH_CONFIG_4LINE_DMA
/* depend flash type & board */
//#define HV_FLASH_CONFIG_BOOT_SPEED_100

#define HV_FLASH_CONFIG_START_XIP           0xbfc00000

#define HV_FLASH_CONFIG_PM_PART_SIZE        (28*1024)
#define HV_FLASH_CONFIG_PM_DATA_SIZE        (4*1024)
#define HV_FLASH_CONFIG_SUPERBLK_SIZE       (4*1024)
#define HV_FLASH_CONFIG_BOOT_SIZE           (60*1024*2)
#define HV_FLASH_CONFIG_CODE_PART_SIZE      (1300*1024)
#define HV_FLASH_CONFIG_HOTFIX_SIZE         (4*1024)
#define HV_FLASH_CONFIG_LOGO_PART_SIZE      (128*1024)
#define HV_FLASH_CONFIG_PQ_DATA_PART_SIZE   (396*1024)

#define HV_FLASH_CONFIG_START               0x0
#define HV_FLASH_CONFIG_PM_DATA_START       (HV_FLASH_CONFIG_START+HV_FLASH_CONFIG_PM_PART_SIZE)
#define HV_FLASH_CONFIG_SUPERBLOCK_START    (HV_FLASH_CONFIG_PM_DATA_START+HV_FLASH_CONFIG_PM_DATA_SIZE)
#define HV_FLASH_CONFIG_BOOT_START          (HV_FLASH_CONFIG_SUPERBLOCK_START+HV_FLASH_CONFIG_SUPERBLK_SIZE)
#define HV_FLASH_CONFIG_CODE_START          (HV_FLASH_CONFIG_BOOT_START+HV_FLASH_CONFIG_BOOT_SIZE)
#define HV_FLASH_CONFIG_HOTFIX_START        (HV_FLASH_CONFIG_CODE_START + HV_FLASH_CONFIG_CODE_PART_SIZE)
#define HV_FLASH_CONFIG_LOGO_PART_START     (HV_FLASH_CONFIG_HOTFIX_START + HV_FLASH_CONFIG_HOTFIX_SIZE)
#define HV_FLASH_CONFIG_PQ_DATA_PART_START  (HV_FLASH_CONFIG_LOGO_PART_START+ HV_FLASH_CONFIG_LOGO_PART_SIZE)
#ifdef CONFIG_USER_FLASH_DB_ON
#define HV_FLASH_CONFIG_SECOND_PART_SIZE   (2048*1024)
#define HV_FLASH_CONFIG_MONITOR_DATA_PART_START (0x3f0000)
#else
#define HV_FLASH_CONFIG_SECOND_PART_SIZE   (0*1024)
#define HV_FLASH_CONFIG_MONITOR_DATA_PART_START (0x1f0000)
#endif

#define HV_FLASH_CONFIG_TIMER_SIZE          (4*1024)
#define HV_FLASH_CONFIG_USERDATA_SIZE       (4*1024)
#define HV_FLASH_CONFIG_USERBACK_SIZE       (4*1024)
#define HV_FLASH_CONFIG_SYSTEMDATA_SIZE     (4*1024)
#define HV_FLASH_CONFIG_FACDATA_SIZE        (4*1024)
#define HV_FLASH_CONFIG_PANEL_SIZE          (4*1024)
#define HV_FLASH_CONFIG_GAMMA_SIZE          (16*1024)
#define HV_FLASH_CONFIG_DPEDID_SIZE         (8*1024)
#define HV_FLASH_CONFIG_HDMIEDID_SIZE       (8*1024)
#define HV_FLASH_CONFIG_HDCP_SIZE           (4*1024)
#define HV_FLASH_CONFIG_HDCP1X_SIZE         (4*1024)

#define HV_FLASH_CONFIG_TIMER_START         (0*1024)
#define HV_FLASH_CONFIG_USERDATA_START      (HV_FLASH_CONFIG_TIMER_START+HV_FLASH_CONFIG_TIMER_SIZE)
#define HV_FLASH_CONFIG_USERBACK_START      (HV_FLASH_CONFIG_USERDATA_START+HV_FLASH_CONFIG_USERDATA_SIZE)
#define HV_FLASH_CONFIG_SYSTEMDATA_START    (HV_FLASH_CONFIG_USERBACK_START+HV_FLASH_CONFIG_USERBACK_SIZE)
#define HV_FLASH_CONFIG_FACDATA_START       (HV_FLASH_CONFIG_SYSTEMDATA_START+HV_FLASH_CONFIG_SYSTEMDATA_SIZE)
#define HV_FLASH_CONFIG_PANEL_START         (HV_FLASH_CONFIG_FACDATA_START+HV_FLASH_CONFIG_FACDATA_SIZE)
#define HV_FLASH_CONFIG_GAMMA_START         (HV_FLASH_CONFIG_PANEL_START+HV_FLASH_CONFIG_PANEL_SIZE)
#define HV_FLASH_CONFIG_DPEDID_START        (HV_FLASH_CONFIG_GAMMA_START+HV_FLASH_CONFIG_GAMMA_SIZE)
#define HV_FLASH_CONFIG_HDMIEDID_START      (HV_FLASH_CONFIG_DPEDID_START+HV_FLASH_CONFIG_DPEDID_SIZE)
#define HV_FLASH_CONFIG_HDCP_START          (HV_FLASH_CONFIG_HDMIEDID_START+HV_FLASH_CONFIG_HDMIEDID_SIZE)
#define HV_FLASH_CONFIG_HDCP1X_START        (HV_FLASH_CONFIG_HDCP_START+HV_FLASH_CONFIG_HDCP_SIZE)
#endif
