/**
 * @file   rtic_secdrv.h
 * @brief  RTIC function definitions
 *
 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
 *
 * This software is proprietary of Samsung Electronics.
 * No part of this software, either material or conceptual may be copied
 * or distributed, transmitted, transcribed, stored in a retrieval system
 * or translated into any human or computer language in any form by any means,
 * electronic, mechanical, manual or otherwise, or disclosed to third parties
 * without the express written permission of Samsung Electronics.
 */

#ifndef _RTIC_HW_HAL_H_
#define _RTIC_HW_HAL_H_

#define SMC_SECDRV_PREFIX		0x81000000
#define SMC_CM_RTIC_CLK_SET		0x101E
#define RTIC_CLK_ENABLE			0
#define RTIC_CLK_DISABLE		1

/* Maxmum memory block count */
#define RTIC_SHA1_LENGTH	5

/* Memory block number definitions */
#define MEMA				0
#define MEMB				1
#define MEMC				2
#define	MEMD				3
#define MEME				4

/* RTIC run mode definitions */
#define SW_RESET_ON			1
#define HASHONCE			0
#define RUN					1

/* Time out for polling */
#define TIME_OUT			0xFFFFFF

#if defined(USE_INTERRUPT)
/* ISR thread and its handler functions */
_THREAD_ENTRY void rtic_isr_thread(void);
uint32_t start_rtic_isr_thread(void);
uint32_t stop_rtic_isr_thread(void);
#endif

/* RTIC driver functions */
uint32_t rtic_init(void);
uint32_t rtic_set_mem(uint32_t mem_no, uint32_t start_addr, uint32_t length );
uint32_t rtic_read_hash_val(uint32_t mem_no, uint32_t *hashval);
uint32_t rtic_hashonce(void);
uint32_t rtic_stop(void);
uint32_t rtic_get_hash(uint32_t start_addr, uint32_t length, uint8_t *hashval);
uint32_t rtic_wrapper_test(void);
uint32_t rtic_bus_clk_control(uint32_t command);

#endif /* _RTIC_SECDRV_H_ */
