patch-2.3.99-pre7 linux/arch/ppc/mm/init.c

Next file: linux/arch/ppc/xmon/Makefile
Previous file: linux/arch/ppc/mm/fault.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre6/linux/arch/ppc/mm/init.c linux/arch/ppc/mm/init.c
@@ -48,8 +48,14 @@
 #include <asm/mmu.h>
 #include <asm/residual.h>
 #include <asm/uaccess.h>
+#ifdef CONFIG_8xx
 #include <asm/8xx_immap.h>
 #include <asm/mpc8xx.h>
+#endif
+#ifdef CONFIG_8260
+#include <asm/immap_8260.h>
+#include <asm/mpc8260.h>
+#endif
 #include <asm/smp.h>
 #include <asm/bootx.h>
 #include <asm/machdep.h>
@@ -104,6 +110,9 @@
 #ifdef CONFIG_4xx
 unsigned long *oak_find_end_of_memory(void);
 #endif
+#ifdef CONFIG_8260
+unsigned long *m8260_find_end_of_memory(void);
+#endif /* CONFIG_8260 */
 static void mapin_ram(void);
 void map_page(unsigned long va, unsigned long pa, int flags);
 extern void die_if_kernel(char *,struct pt_regs *,long);
@@ -725,7 +734,7 @@
                          * don't get ASID compares on kernel space.
                          */
 			f = _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_SHARED;
-#ifdef CONFIG_KGDB
+#if defined(CONFIG_KGDB) || defined(CONFIG_XMON)
  			/* Allows stub to set breakpoints everywhere */
  			f |= _PAGE_RW | _PAGE_DIRTY | _PAGE_HWWRITE;
 #else
@@ -896,6 +905,9 @@
         mtspr(SPRN_ICCR, 0x80000000);	/* 128 MB of instr. space at 0x0. */
 }
 #else
+	/* How about ppc_md.md_find_end_of_memory instead of these
+	 * ifdefs?  -- Dan.
+	 */
 void __init MMU_init(void)
 {
 	if ( ppc_md.progress ) ppc_md.progress("MMU:enter", 0x111);
@@ -910,8 +922,13 @@
 	else if ( _machine == _MACH_gemini )
 		end_of_DRAM = gemini_find_end_of_memory();
 #endif /* CONFIG_GEMINI	*/
+#if defined(CONFIG_8260)
+	else
+		end_of_DRAM = m8260_find_end_of_memory();
+#else
 	else /* prep */
 		end_of_DRAM = prep_find_end_of_memory();
+#endif
 
 	if ( ppc_md.progress ) ppc_md.progress("MMU:hash init", 0x300);
         hash_init();
@@ -960,11 +977,6 @@
 			setbat(0, base, base, 0x100000, IO_PAGE);
 		}
 #endif
-#if 0
-// This is bogus, BAT must be aligned.
-//		setbat(0, disp_bi->dispDeviceBase, disp_bi->dispDeviceBase, 0x100000, IO_PAGE);
-//		disp_bi->logicalDisplayBase = disp_bi->dispDeviceBase;
-#endif		
 		ioremap_base = 0xf0000000;
 		break;
 	case _MACH_apus:
@@ -977,6 +989,16 @@
 		setbat(0, 0xf0000000, 0xf0000000, 0x10000000, IO_PAGE);
 		setbat(1, 0x80000000, 0x80000000, 0x10000000, IO_PAGE);
 		break;
+	case _MACH_8260:
+		/* Map the IMMR, plus anything else we can cover
+		 * in that upper space according to the memory controller
+		 * chip select mapping.  Grab another bunch of space
+		 * below that for stuff we can't cover in the upper.
+		 */
+		setbat(0, 0xf0000000, 0xf0000000, 0x10000000, IO_PAGE);
+		setbat(1, 0xe0000000, 0xe0000000, 0x10000000, IO_PAGE);
+		ioremap_base = 0xe0000000;
+		break;
 	}
 	ioremap_bot = ioremap_base;
 #else /* CONFIG_8xx */
@@ -1295,6 +1317,28 @@
 }
 #endif /* defined(CONFIG_GEMINI) */
 
+#ifdef CONFIG_8260
+/*
+ * Same hack as 8xx.
+ */
+unsigned long __init *m8260_find_end_of_memory(void)
+{
+	bd_t	*binfo;
+	unsigned long *ret;
+	extern unsigned char __res[];
+	
+	binfo = (bd_t *)__res;
+
+	phys_mem.regions[0].address = 0;
+	phys_mem.regions[0].size = binfo->bi_memsize;	
+	phys_mem.n_regions = 1;
+	
+	ret = __va(phys_mem.regions[0].size);
+	set_phys_avail(&phys_mem);
+	return ret;
+}
+#endif /* CONFIG_8260 */
+
 #ifdef CONFIG_APUS
 #define HARDWARE_MAPPED_SIZE (512*1024)
 unsigned long __init *apus_find_end_of_memory(void)
@@ -1396,6 +1440,7 @@
 	case 3: /* 603 */
 	case 6: /* 603e */
 	case 7: /* 603ev */
+	case 0x0081: /* 82xx */
 		Hash_size = 0;
 		Hash_mask = 0;
 		break;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)