@@ -709,4 +709,10 @@ extern void (*_dma_cache_inv)(unsigned long start, unsigned long size);
void __ioread64_copy(void *to, const void __iomem *from, size_t count);
+#ifdef CONFIG_SONY_PS2
+#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
+extern int valid_phys_addr_range(phys_addr_t addr, size_t size);
+extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
+#endif /* CONFIG_SONY_PS2 */
+
#endif /* _ASM_IO_H */
@@ -7,9 +7,25 @@
#include <linux/init.h>
#include <linux/ioport.h>
+#include <linux/mm.h>
#include <linux/types.h>
#include <asm/bootinfo.h>
+#include <asm/io.h>
+
+#include <asm/mach-ps2/rom.h>
+
+int valid_phys_addr_range(phys_addr_t addr, size_t size)
+{
+ return addr + size <= __pa(high_memory) ||
+ (ROM0_BASE <= addr && addr + size <= ROM0_BASE + ROM0_SIZE) ||
+ (ROM1_BASE <= addr && addr + size <= ROM1_BASE + ROM1_SIZE);
+}
+
+int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
+{
+ return 1;
+}
void __init plat_mem_setup(void)
{
Signed-off-by: Fredrik Noring <noring@nocrew.org> --- arch/mips/include/asm/io.h | 6 ++++++ arch/mips/ps2/memory.c | 16 ++++++++++++++++ 2 files changed, 22 insertions(+)