#ifndef _CCM_H
#define _CCM_H

#include "common.h"

/* Defines */

/*************************************************************/
/* CCM->CGPR index - CGx (x=0 to 191) - off platform modules */
/* Some modules listed here, feel free to add more....	 */
/*************************************************************/
#define DMAMUX0_CCGR_INDEX			4
#define DMAMUX1_CCGR_INDEX			5
#define PDB_CCGR_INDEX 				22
#define PIT_CCGR_INDEX  			23
#define FTM0_CCGR_INDEX 			24
#define FTM1_CCGR_INDEX 			25
#define ADC0_CCGR_INDEX 			27
#define UART0_CCGR_INDEX			39
#define UART1_CCGR_INDEX			40
#define UART2_CCGR_INDEX			41
#define UART3_CCGR_INDEX			42
#define PORT0_CCGR_INDEX			73
#define PORT1_CCGR_INDEX			74
#define PORT2_CCGR_INDEX			75
#define PORT3_CCGR_INDEX			76
#define PORT4_CCGR_INDEX			77
#define DMAMUX2_CCGR_INDEX			97
#define DMAMUX3_CCGR_INDEX			98
#define DDRMC_CCGR_INDEX			110
#define FTM2_CCGR_INDEX				120
#define FTM3_CCGR_INDEX				121
#define ADC1_CCGR_INDEX 			123
#define DAC0_CCGR_INDEX 			140
#define DAC1_CCGR_INDEX 			141
#define I2C0_CCGR_INDEX				166
#define I2C1_CCGR_INDEX				167

/* CCM CCPGR index - Platform modules */
#define DMA0_CCPGR_INDEX			24
#define DMA0_TCD_CCPGR_INDEX		25
#define DMA1_CCPGR_INDEX			56
#define DMA1_TCD_CCPGR_INDEX		57

/* Prototypes */
void set_ccgr_register(uint32_t clock_gate_index, uint32_t clk_gate_value);
void clear_ccgr_register(uint32_t clock_gate_index);
uint32_t read_ccgr_value(uint32_t clock_gate_index);

#endif

