2007-06-06 14:52:38 +08:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*/
|
|
|
|
#include <linux/fs.h>
|
|
|
|
#include <linux/fcntl.h>
|
|
|
|
#include <linux/mm.h>
|
|
|
|
|
2009-07-02 23:22:36 +08:00
|
|
|
#include <asm/bootinfo.h>
|
|
|
|
|
2009-07-02 23:23:03 +08:00
|
|
|
#include <loongson.h>
|
2009-07-02 23:26:45 +08:00
|
|
|
#include <mem.h>
|
2009-07-02 23:22:36 +08:00
|
|
|
|
|
|
|
void __init prom_init_memory(void)
|
|
|
|
{
|
|
|
|
add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM);
|
|
|
|
#ifdef CONFIG_64BIT
|
|
|
|
if (highmemsize > 0)
|
2009-07-02 23:26:45 +08:00
|
|
|
add_memory_region(LOONGSON_HIGHMEM_START,
|
|
|
|
highmemsize << 20, BOOT_MEM_RAM);
|
2009-07-02 23:22:36 +08:00
|
|
|
#endif /* CONFIG_64BIT */
|
|
|
|
}
|
|
|
|
|
2007-06-06 14:52:38 +08:00
|
|
|
/* override of arch/mips/mm/cache.c: __uncached_access */
|
|
|
|
int __uncached_access(struct file *file, unsigned long addr)
|
|
|
|
{
|
|
|
|
if (file->f_flags & O_SYNC)
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
return addr >= __pa(high_memory) ||
|
2009-07-02 23:26:45 +08:00
|
|
|
((addr >= LOONGSON_MMIO_MEM_START) &&
|
|
|
|
(addr < LOONGSON_MMIO_MEM_END));
|
2007-06-06 14:52:38 +08:00
|
|
|
}
|