};
extern char gKernelEnd[];
+
#include <tpl_mm_phys_bitmap.h>
+//#define REALVIEW_LOWRAM_SIZE 0x10000000
+#define REALVIEW_LOWRAM_SIZE (32*1024*1024)
+
void MM_SetupPhys(void)
{
- MM_Tpl_InitPhys( 16*1024*1024/0x1000, NULL );
+ MM_Tpl_InitPhys( REALVIEW_LOWRAM_SIZE/0x1000, NULL );
}
int MM_int_GetMapEntry( void *Data, int Index, tPAddr *Start, tPAddr *Length )
{
case 0:
*Start = ((tVAddr)&gKernelEnd - KERNEL_BASE + 0xFFF) & ~0xFFF;
- *Length = 16*1024*1024 - *Start;
+ *Length = REALVIEW_LOWRAM_SIZE - *Start;
return 1;
default:
return 0;
#include <mm_virt.h>
#include <hal_proc.h>
+#define TRACE_MAPS 0
+
#define AP_KRW_ONLY 1 // Kernel page
#define AP_KRO_ONLY 5 // Kernel RO page
#define AP_RW_BOTH 3 // Standard RW
int MM_Map(tVAddr VAddr, tPAddr PAddr)
{
tMM_PageInfo pi = {0};
-// Log("MM_Map %P=>%p", PAddr, VAddr);
+ #if TRACE_MAPS
+ Log("MM_Map %P=>%p", PAddr, VAddr);
+ #endif
pi.PhysAddr = PAddr;
pi.Size = 12;
// Map the pages
for( i = 0; i < NPages; i ++ )
- MM_Map(ret+i*PAGE_SIZE, PAddr+i*PAddr);
+ MM_Map(ret+i*PAGE_SIZE, PAddr+i*PAGE_SIZE);
// and return
LEAVE('p', ret);
return ret;
tVAddr ret;
phys = MM_AllocPhysRange(Pages, MaxBits);
- if(!phys) return 0;
+ if(!phys) {
+ Log_Warning("MMVirt", "No space left for a %i page block (MM_AllocDMA)", Pages);
+ return 0;
+ }
ret = MM_MapHWPages(phys, Pages);
*PAddr = phys;