Module Name:    src
Committed By:   rin
Date:           Fri Mar  5 06:26:57 UTC 2021

Modified Files:
        src/sys/arch/evbppc/conf: files.explora
        src/sys/arch/evbppc/explora: autoconf.c machdep.c

Log Message:
For very MD codes for Explora, reorder things, and use more common codes for
ibm4xx and ibm40x for clarity as well as better comparison with other boards.

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbppc/conf/files.explora
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbppc/explora/autoconf.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/evbppc/explora/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbppc/conf/files.explora
diff -u src/sys/arch/evbppc/conf/files.explora:1.10 src/sys/arch/evbppc/conf/files.explora:1.11
--- src/sys/arch/evbppc/conf/files.explora:1.10	Mon Jul  6 10:38:46 2020
+++ src/sys/arch/evbppc/conf/files.explora	Fri Mar  5 06:26:56 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: files.explora,v 1.10 2020/07/06 10:38:46 rin Exp $
+#	$NetBSD: files.explora,v 1.11 2021/03/05 06:26:56 rin Exp $
 
 # maxpartitions must be first item in files.${ARCH}
 
@@ -15,7 +15,13 @@ include		"arch/powerpc/pic/files.pic"
 file	arch/evbppc/explora/autoconf.c
 file	arch/evbppc/explora/consinit.c
 file	arch/evbppc/explora/machdep.c
+
 file	arch/powerpc/ibm4xx/ibm4xx_machdep.c
+file	arch/powerpc/ibm4xx/ibm40x_machdep.c
+
+# Board Properties
+file	arch/powerpc/ibm4xx/board_prop.c
+
 defflag	opt_uic.h	MULTIUIC
 file	arch/powerpc/ibm4xx/pic_uic.c
 file	dev/md_root.c				memory_disk_hooks

Index: src/sys/arch/evbppc/explora/autoconf.c
diff -u src/sys/arch/evbppc/explora/autoconf.c:1.14 src/sys/arch/evbppc/explora/autoconf.c:1.15
--- src/sys/arch/evbppc/explora/autoconf.c:1.14	Tue Mar  2 07:38:48 2021
+++ src/sys/arch/evbppc/explora/autoconf.c	Fri Mar  5 06:26:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.14 2021/03/02 07:38:48 rin Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.15 2021/03/05 06:26:56 rin Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.14 2021/03/02 07:38:48 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.15 2021/03/05 06:26:56 rin Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -43,6 +43,8 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
 void
 cpu_configure(void)
 {
+
+	intr_init();
 	calc_delayconst();
 
 	if (config_rootfound("elb", NULL) == NULL)

Index: src/sys/arch/evbppc/explora/machdep.c
diff -u src/sys/arch/evbppc/explora/machdep.c:1.41 src/sys/arch/evbppc/explora/machdep.c:1.42
--- src/sys/arch/evbppc/explora/machdep.c:1.41	Tue Mar  2 07:44:08 2021
+++ src/sys/arch/evbppc/explora/machdep.c	Fri Mar  5 06:26:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.41 2021/03/02 07:44:08 rin Exp $	*/
+/*	$NetBSD: machdep.c,v 1.42 2021/03/05 06:26:56 rin Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.41 2021/03/02 07:44:08 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.42 2021/03/05 06:26:56 rin Exp $");
 
 #include "opt_explora.h"
 #include "opt_modular.h"
@@ -71,7 +71,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #include <ddb/db_extern.h>
 #endif
 
-#define MEMREGIONS	2
 #define TLB_PG_SIZE	(16*1024*1024)
 
 char machine[] = MACHINE;		/* from <machine/param.h> */
@@ -79,12 +78,8 @@ char machine_arch[] = MACHINE_ARCH;	/* f
 
 static const unsigned int cpuspeed = 66000000;
 
-prop_dictionary_t board_properties;
 struct vm_map *phys_map = NULL;
 
-static struct mem_region phys_mem[MEMREGIONS];
-static struct mem_region avail_mem[MEMREGIONS];
-
 void		initppc(vaddr_t, vaddr_t);
 
 void
@@ -112,11 +107,6 @@ initppc(vaddr_t startkernel, vaddr_t end
 			size = maddr+msize;
 	}
 
-	phys_mem[0].start = 0;
-	phys_mem[0].size = size & ~PGOFSET;
-	avail_mem[0].start = startkernel;
-	avail_mem[0].size = size-startkernel;
-
 	/*
 	 * Setup initial tlbs.
 	 * Kernel memory and console device are
@@ -140,48 +130,29 @@ initppc(vaddr_t startkernel, vaddr_t end
 	/* Disable all timer interrupts */
 	mtspr(SPR_TCR, 0);
 
+	ibm40x_memsize_init(size, startkernel);
 	ibm4xx_init(startkernel, endkernel, pic_ext_intr);
+
+	/*
+	 * Look for the ibm4xx modules in the right place.
+	 */
+	module_machine = module_machine_ibm4xx;
 }
 
 void
 cpu_startup(void)
 {
-	vaddr_t minaddr, maxaddr;
 	prop_number_t pn;
-	char pbuf[9];
-
-	/*
-	 * Initialize error message buffer (before start of kernel)
-	 */
-	initmsgbuf((void *)msgbuf, round_page(MSGBUFSIZE));
-
-	printf("%s%s", copyright, version);
-	printf("NCD Explora451\n");
-
-	format_bytes(pbuf, sizeof(pbuf), ctob(physmem));
-	printf("total memory = %s\n", pbuf);
-
-	minaddr = 0;
-	/*
-	 * Allocate a submap for physio
-	 */
-	phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
-				 VM_PHYS_SIZE, 0, false, NULL);
 
 	/*
-	 * No need to allocate an mbuf cluster submap.  Mbuf clusters
-	 * are allocated via the pool allocator, and we use direct-mapped
-	 * pool pages.
+	 * cpu common startup
 	 */
-
-	format_bytes(pbuf, sizeof(pbuf), ptoa(uvm_availmem(false)));
-	printf("avail memory = %s\n", pbuf);
+	ibm4xx_cpu_startup("NCD Explora 451");
 
 	/*
 	 * Set up the board properties database.
 	 */
-	board_properties = prop_dictionary_create();
-	KASSERT(board_properties != NULL);
+	board_info_init();
 
 	pn = prop_number_create_integer(ctob(physmem));
 	KASSERT(pn != NULL);
@@ -196,12 +167,9 @@ cpu_startup(void)
 		panic("setting processor-frequency");
 	prop_object_release(pn);
 
-	intr_init();
-	
 	/*
-	 * Look for the ibm4xx modules in the right place.
+	 * no fake mapiodev
 	 */
-	module_machine = module_machine_ibm4xx;
 	fake_mapiodev = 0;
 }
 
@@ -248,10 +216,3 @@ cpu_reboot(int howto, char *what)
 		;
 #endif
 }
-
-void
-mem_regions(struct mem_region **mem, struct mem_region **avail)
-{
-	*mem = phys_mem;
-	*avail = avail_mem;
-}

Reply via email to