/*-----------------------------------------------------------------------------------
!
!                              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        : rom_reg.h
  DESCRIPTION : rom Register
  Revision    : $Rev: 4 $
  Author      : $Author: shirait $
  Date        : $Date: 2015-09-09 15:19:58 +0900 (水, 09 9 2015) $
-----------------------------------------------------------------------------------*/
#ifndef __ROM_REG_INCLUDED__
#define __ROM_REG_INCLUDED__


#include <stdint.h>

#define ROM_REG_BASE (0x4000B000u)

#define PUBKEYE_SIZE           (4)
#define PUBKEYN_SIZE           (256)
#define SOC_CERTIFICATION_SIZE (1024)
#define CV_FIX_VALUE_SIZE      (16)
#define LABEL_SIZE             (32)
#define CA_OKEY_NUM            (5)


typedef struct _tagRomReg {
	// 0000h - 04FFh
	const uint32_t ca_pkeyn[CA_OKEY_NUM][PUBKEYN_SIZE / sizeof(uint32_t)]; 
	
	// 0500h - 05FFh
	const uint32_t fw_pkeyn[PUBKEYN_SIZE / sizeof(uint32_t)]; 

	// 0600h - 0613h
	const uint32_t ca_pkeye[CA_OKEY_NUM];

	// 0614h - 617h
	const uint32_t fw_pkeye;

	// 0618h - 61Fh
	uint32_t  reserve1[2];
	
	// 0620h - 071Fh
	const uint32_t t1_ca_pkeyn[PUBKEYN_SIZE / sizeof(uint32_t)];
	
	// 0720h - 723h
	const uint32_t t1_ca_pkeye;
	
} RomReg;

#define ROMR (*(volatile RomReg*)(ROM_REG_BASE))

#endif // __ROM_REG_INCLUDED__
