Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbppc For very MD codes for Explora, reorder thing...



details:   https://anonhg.NetBSD.org/src/rev/04c06e5d5098
branches:  trunk
changeset: 960007:04c06e5d5098
user:      rin <rin%NetBSD.org@localhost>
date:      Fri Mar 05 06:26:56 2021 +0000

description:
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.

diffstat:

 sys/arch/evbppc/conf/files.explora |   8 ++++-
 sys/arch/evbppc/explora/autoconf.c |   6 ++-
 sys/arch/evbppc/explora/machdep.c  |  63 +++++++------------------------------
 3 files changed, 23 insertions(+), 54 deletions(-)

diffs (184 lines):

diff -r dec4a88d0b02 -r 04c06e5d5098 sys/arch/evbppc/conf/files.explora
--- a/sys/arch/evbppc/conf/files.explora        Fri Mar 05 06:17:02 2021 +0000
+++ b/sys/arch/evbppc/conf/files.explora        Fri Mar 05 06:26:56 2021 +0000
@@ -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 @@
 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
diff -r dec4a88d0b02 -r 04c06e5d5098 sys/arch/evbppc/explora/autoconf.c
--- a/sys/arch/evbppc/explora/autoconf.c        Fri Mar 05 06:17:02 2021 +0000
+++ b/sys/arch/evbppc/explora/autoconf.c        Fri Mar 05 06:26:56 2021 +0000
@@ -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 @@
 void
 cpu_configure(void)
 {
+
+       intr_init();
        calc_delayconst();
 
        if (config_rootfound("elb", NULL) == NULL)
diff -r dec4a88d0b02 -r 04c06e5d5098 sys/arch/evbppc/explora/machdep.c
--- a/sys/arch/evbppc/explora/machdep.c Fri Mar 05 06:17:02 2021 +0000
+++ b/sys/arch/evbppc/explora/machdep.c Fri Mar 05 06:26:56 2021 +0000
@@ -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 @@
 #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 @@
 
 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 @@
                        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 @@
        /* 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)
+        * cpu common startup
         */
-       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.
-        */
-
-       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 @@
                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 @@
                ;
 #endif
 }
-
-void
-mem_regions(struct mem_region **mem, struct mem_region **avail)
-{
-       *mem = phys_mem;
-       *avail = avail_mem;
-}



Home | Main Index | Thread Index | Old Index