/*****************************************************************************
Copyright(c) 2005 Analog Devices, Inc.  All Rights Reserved. This software is 
proprietary and confidential to Analog Devices, Inc. and its licensors.
******************************************************************************

$RCSfile: jpeg_mjpeg_cache.c,v $
$Revision: 1.1 $
$Date: 2008/03/17 14:26:45 $

Project:	BlackfinSDK (JPEG-MJPEG)
Title:		cache services for JPEG-MJPEG
Author(s):	dwu
Revised by: bmk

Description:
			Functions for configuring cache.

References:
			None

******************************************************************************
Tab Setting:			4

Target Processor:		ADSP-BF5xx
Target Tools Revision:	ADSP VisualDSP++ v4.5
******************************************************************************

Modification History:
====================
$Log: jpeg_mjpeg_cache.c,v $
Revision 1.1  2008/03/17 14:26:45  gstephan
Updates for SDK 3.00

Revision 1.1  2007/05/22 18:20:11  gstephan
Creating VDSP 5.00 release folder.  Created from the head copy of
VDSP 4.50 release folder.

Revision 1.2  2006/07/25 08:07:22  bmk
no message

Revision 1.1  2006/07/21 08:02:35  bmk
JPEG common files


*****************************************************************************/

#include <jpeg_mjpeg_cache.h>
#include <cplb.h>
 
// configuration routines
void configure_data_cache_cplbs(int dcplb_table[16][2])
{
	short i;
	volatile void ** pADDR_ENTRIES = (volatile void**)pDCPLB_ADDR0;
	volatile unsigned long * pDATA_ENTRIES = pDCPLB_DATA0;
	// set up the table entries

	for (i=0; i<16; i++)
	{
		*(pADDR_ENTRIES++) = (void*)dcplb_table[i][0];
		*(pDATA_ENTRIES++) = (unsigned long)dcplb_table[i][1];
	}
	
	return;
}

void configure_instruction_cache_cplbs(int icplb_table[16][2])
{
	short i;
	volatile void ** pADDR_ENTRIES = (volatile void**)pICPLB_ADDR0;
	volatile unsigned long * pDATA_ENTRIES = pICPLB_DATA0;
	// set up the table entries

	for (i=0; i<16; i++)
	{
		*(pADDR_ENTRIES++) = (void*)icplb_table[i][0];
		*(pDATA_ENTRIES++) = (unsigned long)icplb_table[i][1];
	}
	
	return;
}


