Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jan 2008 03:09:35 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 133393 for review
Message-ID:  <200801160309.m0G39ZMb022640@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=133393

Change 133393 by imp@imp_lighthouse on 2008/01/16 03:08:29

	We can finally get rid of mips_init and getbootinfo().  We'll
	keep a commented out copy of getmemory() because we don't yet
	know about the mips tlb wiring stuff that was omitted yet.
	
	This gets us down to one undefined function, but it is a biggie:
	mips_cpu_init().  That's going to take some time to sort out.

Affected files ...

.. //depot/projects/mips2-jnpr/src/sys/mips/mips/machdep.c#14 edit

Differences ...

==== //depot/projects/mips2-jnpr/src/sys/mips/mips/machdep.c#14 (text+ko) ====

@@ -107,8 +107,9 @@
 void mips_init(int, int, u_int32_t, struct bootinfo *);
 void mips_vector_init(void);
 void hardware_basic_init(void);
+#if 0 /* see comment below */
 static void getmemsize(void);
-static void getbootinfo(int, int, u_int32_t, struct bootinfo *);
+#endif
 #ifdef	DEBUG_UART_POLLED
 void init_bootstrap_console(void);
 #endif
@@ -282,39 +283,6 @@
 	PCPU_SET(curpcb, thread0.td_pcb);
 }
 
-static void
-getbootinfo(int bootinfo_magic, int boothowto_arg, u_int32_t bootdev_arg,
-    struct bootinfo *bootinfop)
-{
-	if (bootinfo_magic == MIPS_BOOTINFO_MAGIC &&
-		bootinfop && bootinfop->bi_version == BOOTINFO_VERSION) {
-
-		bootinfo = *bootinfop;
-		boothowto = boothowto_arg;
-		bootdev = bootdev_arg;
-
-		if (bootinfo.bi_modulep)
-			preload_metadata = (caddr_t)bootinfo.bi_modulep;
-
-		/* set up kern_envp */
-		if (bootinfo.bi_envp)
-			kern_envp = (caddr_t)bootinfo.bi_envp;
-	}
-
-	/*
-	 * Look at arguments passed to us and compute boothowto.
-	 * Default to SINGLE and ASKNAME if no args or
-	 * SINGLE and DFLTROOT if this is a ramdisk kernel.
-	 */
-#ifdef MD_ROOT
-	boothowto |= RB_DFLTROOT;
-#else
-	boothowto |= RB_ASKNAME;
-#endif /* RAMDISK_HOOKS */
-
-}
-
-
 #ifdef	DEBUG_UART_POLLED
 void
 init_bootstrap_console()
@@ -329,6 +297,15 @@
 #endif
 
 struct msgbuf *msgbufp=0;
+
+#if 0
+/*
+ * This code has been moved to the platform_init code.  The only
+ * thing that's beign done here that hasn't been moved is the wired tlb
+ * pool stuff.  I'm still trying to understand that feature..., since
+ * it maps from the end the kernel to 0x08000000 somehow.  But the stuff
+ * was stripped out, so it is hard to say what's going on....
+ */
 u_int32_t	 freemem_start;
 
 static void
@@ -429,7 +406,7 @@
 	msgbufinit(msgbufp, sz);
 	printf("%s: msgbufp[size=%d] = 0x%p\n", __FUNCTION__, sz, msgbufp);
 }
-
+#endif
 
 /*
  * Initialize the hardware exception vectors, and the jump table used to
@@ -508,92 +485,6 @@
 	pcpu->pc_asid_generation = 1;
 }
 
-#include <machine/ns16550.h>
-/*
- * Do all the stuff that locore normally does before calling mi_start().
- *
- * We need to migrate to the mips2 way of doing things.  There's code in
- * locore.S which preserves environment parameters and passes them to
- * platform start...
- *
- * XXXimp
- */
-void
-mips_init(int bootinfo_magic, int boothowto_arg, u_int32_t bootdev_arg,
-	struct bootinfo *bootinfop)
-{
-	char systype[30];
-
-	/* clear the BSS segment */
-	bzero(edata, (vm_offset_t)mips_round_page(end) - (vm_offset_t)edata);
-
-	getbootinfo(bootinfo_magic, boothowto_arg, bootdev_arg, bootinfop);
-	boothowto = 0x00001820;
-
-	/*
-	 * Identify the processor type by reading the Processor Id register
-	 */
-	mfc0_macro(cpu_id, 15);
-
-	switch (mips_proc_type()) {
-	case MIPS_RM7000:
-		strcpy(systype, "rm7000"); 
-		need_wired_tlb_page_pool = 0;
-		break;
-
-	case MIPS_RM9000:
-		strcpy(systype, "rm9220"); 
-		need_wired_tlb_page_pool = 1;
-		break;
-
-	default:
-		break;
-	}
-#ifdef UNIMPLEMENTED
-	if (cputype >= ncpuinit) {
-		platform_not_supported(cputype);
-		/* NOTREACHED */
-	}
-	cpuinit[cputype].init(cputype);
-#endif
-	/* Do basic tuning, hz etc */
-	init_param1();
-
-	hardware_basic_init();
-
-#ifdef UNIMPLEMENTED
-	snprintf(cpu_model, sizeof(cpu_model), "%s", platform.model);
-#endif
-
-#if BOOTINFO_DEBUG
-	printf("boothowto = %x, bootdev = %x\n", boothowto, bootdev);
-	printf("bootinfo: version = %x, kernelname = %x, size = %x, memsize_valid = %x, basemem = %x, extmem = %x, symtab = %x, esymtab = %x, modulep = %x, kernend = %x, envp = %x\n",
-	    bootinfo.bi_version, bootinfo.bi_kernelname, bootinfo.bi_size,
-	    bootinfo.bi_memsizes_valid, bootinfo.bi_basemem, 
-	    bootinfo.bi_extmem, bootinfo.bi_symtab, bootinfo.bi_esymtab,
-	    bootinfo.bi_modulep, bootinfo.bi_kernend, bootinfo.bi_envp);
-#endif
-
-	getmemsize();
-
-#if 0
-	/* depend on phys_avail being initialized first */
-	mips_proc0_init();
-	mutex_init();
-
-#ifdef DDB
-	kdb_init();
-	if ((boothowto & RB_KDB) || (boothowto & RB_GDB))
-		kdb_enter(KDB_WHY_BOOTFLAGS, "Boot flags requested debugger");
-#endif
-	pmap_bootstrap();
-#else
-	/* XXXimp need to call platform start */
-#endif
-	init_param2(physmem);
-}
-
-
 int
 sysarch(struct thread *td, register struct sysarch_args *uap)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801160309.m0G39ZMb022640>