/*
 *               Copyright (C) 2005, BroadOn Communications Corp.
 *
 *  These coded instructions, statements, and computer programs contain
 *  unpublished proprietary information of BroadOn Communications Corp.,
 *  and are protected by federal copyright law. They may not be disclosed
 *  to third parties or copied or duplicated in any form, in whole or in
 *  part, without the prior written consent of BroadOn Communications Corp.
 *
 */
#include <iostypes.h>
#include <ios.h>
#include <iop.h>
#include <ioslibc.h>

#include <ahb_fdl_defs.h>
#include <mem_reg.h>
#include <sys.h>

void
setupDDR_PPCCGBoundary(u32 start, u32 end)
{
    /* Disabling/enabling PI access to AHM regs done in setPPCACRPerms */
    
    /* Enable coarse grained PI protection */
    busWrt16(DDR_PROT_DDR_TRUSTED, 0x1);
    /* Setup start of coarse grained region */
    busWrt16(DDR_PROT_DDR_BASE_TRUSTED, ((start - DDR_BASE)>>12));
    /* Setup end of coarse grained region */
    busWrt16(DDR_PROT_DDR_END_TRUSTED, ((end - DDR_BASE)>>12));
    busDelay(1000);
    return;
}
