/******************************************************************************* * * copy_code - copy u-boot image from flash to RAM * * This routine is needed to solve flash problems on this board * */ void copy_code (ulong dest_addr) { extern long uboot_end_data; unsigned long start; unsigned long end; /* load copydwords into ram */ programLoad(); /* copy u-boot code */ copyLongs((ulong *)CFG_MONITOR_BASE, (ulong *)dest_addr, ((ulong)&uboot_end_data - CFG_MONITOR_BASE + 3) / 4); /* flush caches */ start = CKSEG0; end = start + CFG_DCACHE_SIZE; while(start < end) { cache_unroll(start,Index_Writeback_Inv_D); start += CFG_CACHELINE_SIZE; } start = CKSEG0; end = start + CFG_ICACHE_SIZE; while(start < end) { cache_unroll(start,Index_Invalidate_I); start += CFG_CACHELINE_SIZE; } }
static __inline__ void blast_dcache(unsigned long size, unsigned long lsize) { unsigned long start = KSEG0; unsigned long end = (start + size); while(start < end) { cache_unroll(start,Index_Writeback_Inv_D); start += lsize; } }
static __inline__ void blast_icache(unsigned long size, unsigned long lsize) { unsigned long start = KSEG0; unsigned long end = (start + size); while(start < end) { cache_unroll(start,Index_Invalidate_I); start += lsize; } }