Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm Don't use ARM32_NEW_VM_LAYOUT or initarm_com...



details:   https://anonhg.NetBSD.org/src/rev/10a5917eba85
branches:  trunk
changeset: 546011:10a5917eba85
user:      scw <scw%NetBSD.org@localhost>
date:      Sat Apr 19 08:18:12 2003 +0000

description:
Don't use ARM32_NEW_VM_LAYOUT or initarm_common() for now. It's not
quite ready for prime-time on evbarm.

diffstat:

 sys/arch/evbarm/conf/files.iq80321        |    7 +-
 sys/arch/evbarm/conf/mk.iq80321           |    6 +-
 sys/arch/evbarm/conf/std.iq80321          |    4 +-
 sys/arch/evbarm/iq80321/iq80321_machdep.c |  556 +++++++++++++++++++++++++++--
 sys/arch/evbarm/iq80321/iq80321reg.h      |    3 +-
 5 files changed, 522 insertions(+), 54 deletions(-)

diffs (truncated from 722 to 300 lines):

diff -r 88e8d8da46c4 -r 10a5917eba85 sys/arch/evbarm/conf/files.iq80321
--- a/sys/arch/evbarm/conf/files.iq80321        Sat Apr 19 07:34:15 2003 +0000
+++ b/sys/arch/evbarm/conf/files.iq80321        Sat Apr 19 08:18:12 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.iq80321,v 1.4 2003/04/18 12:01:32 scw Exp $
+#      $NetBSD: files.iq80321,v 1.5 2003/04/19 08:18:12 scw Exp $
 #
 # Intel IQ80321 evaluation board configuration info
 #
@@ -6,8 +6,9 @@
 # Use the generic ARM soft interrupt code.
 file   arch/arm/arm/softintr.c
 
-# Use the shared initarm_common() code
-file   arch/evbarm/evbarm/initarm_common.c
+# Use the shared initarm_common() code.
+# XXX: Not yet ready for prime-time
+#file  arch/evbarm/evbarm/initarm_common.c
 
 file   arch/evbarm/iq80321/iq80321_7seg.c
 file   arch/evbarm/iq80321/iq80321_machdep.c
diff -r 88e8d8da46c4 -r 10a5917eba85 sys/arch/evbarm/conf/mk.iq80321
--- a/sys/arch/evbarm/conf/mk.iq80321   Sat Apr 19 07:34:15 2003 +0000
+++ b/sys/arch/evbarm/conf/mk.iq80321   Sat Apr 19 08:18:12 2003 +0000
@@ -1,10 +1,10 @@
-#      $NetBSD: mk.iq80321,v 1.2 2003/04/18 12:01:32 scw Exp $
+#      $NetBSD: mk.iq80321,v 1.3 2003/04/19 08:18:12 scw Exp $
 
 SYSTEM_FIRST_OBJ=      iq80321_start.o
 SYSTEM_FIRST_SFILE=    ${THISARM}/iq80321/iq80321_start.S
 
-KERNEL_BASE_PHYS=0x00020000
-KERNEL_BASE_VIRT=0xc0020000
+KERNEL_BASE_PHYS=0x00200000
+KERNEL_BASE_VIRT=0xc0200000
 
 SYSTEM_LD_TAIL_EXTRA+=; \
        echo ${OBJCOPY} -S -O srec $@ $@.srec; \
diff -r 88e8d8da46c4 -r 10a5917eba85 sys/arch/evbarm/conf/std.iq80321
--- a/sys/arch/evbarm/conf/std.iq80321  Sat Apr 19 07:34:15 2003 +0000
+++ b/sys/arch/evbarm/conf/std.iq80321  Sat Apr 19 08:18:12 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: std.iq80321,v 1.7 2003/04/18 12:01:32 scw Exp $
+#      $NetBSD: std.iq80321,v 1.8 2003/04/19 08:18:12 scw Exp $
 #
 # standard NetBSD/evbarm for IQ80321 options
 
@@ -16,7 +16,7 @@
 
 # New pmap options are standard on this board
 options        ARM32_PMAP_NEW
-options        ARM32_NEW_VM_LAYOUT
+#options       ARM32_NEW_VM_LAYOUT     # Not yet ready for prime-time
 
 makeoptions    BOARDTYPE="iq80321"
 makeoptions    BOARDMKFRAG="${THISARM}/conf/mk.iq80321"
diff -r 88e8d8da46c4 -r 10a5917eba85 sys/arch/evbarm/iq80321/iq80321_machdep.c
--- a/sys/arch/evbarm/iq80321/iq80321_machdep.c Sat Apr 19 07:34:15 2003 +0000
+++ b/sys/arch/evbarm/iq80321/iq80321_machdep.c Sat Apr 19 08:18:12 2003 +0000
@@ -1,10 +1,10 @@
-/*     $NetBSD: iq80321_machdep.c,v 1.14 2003/04/18 12:01:32 scw Exp $ */
+/*     $NetBSD: iq80321_machdep.c,v 1.15 2003/04/19 08:18:13 scw Exp $ */
 
 /*
  * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc.
  * All rights reserved.
  *
- * Written by Jason R. Thorpe and Steve C. Woodford for Wasabi Systems, Inc.
+ * Written by Jason R. Thorpe for Wasabi Systems, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -81,9 +81,12 @@
 #include <sys/kernel.h>
 #include <sys/exec.h>
 #include <sys/proc.h>
+#include <sys/msgbuf.h>
 #include <sys/reboot.h>
 #include <sys/termios.h>
 
+#include <uvm/uvm_extern.h>
+
 #include <dev/cons.h>
 
 #include <machine/db_machdep.h>
@@ -94,18 +97,19 @@
 #include <machine/bus.h>
 #include <machine/cpu.h>
 #include <machine/frame.h>
+#include <arm/undefined.h>
 
 #include <arm/arm32/machdep.h>
 
 #include <arm/xscale/i80321reg.h>
 #include <arm/xscale/i80321var.h>
 
+#include <dev/pci/ppbreg.h>
+
 #include <evbarm/iq80321/iq80321reg.h>
 #include <evbarm/iq80321/iq80321var.h>
 #include <evbarm/iq80321/obiovar.h>
 
-#include <evbarm/evbarm/initarmvar.h>
-
 #include "opt_ipkdb.h"
 
 /*
@@ -119,10 +123,67 @@
 
 u_int cpu_reset_address = 0x00000000;
 
+/* Define various stack sizes in pages */
+#define IRQ_STACK_SIZE 1
+#define ABT_STACK_SIZE 1
+#ifdef IPKDB
+#define UND_STACK_SIZE 2
+#else
+#define UND_STACK_SIZE 1
+#endif
+
 BootConfig bootconfig;         /* Boot config storage */
 char *boot_args = NULL;
 char *boot_file = NULL;
 
+vm_offset_t physical_start;
+vm_offset_t physical_freestart;
+vm_offset_t physical_freeend;
+vm_offset_t physical_end;
+u_int free_pages;
+vm_offset_t pagetables_start;
+int physmem = 0;
+
+/*int debug_flags;*/
+#ifndef PMAP_STATIC_L1S
+int max_processes = 64;                        /* Default number */
+#endif /* !PMAP_STATIC_L1S */
+
+/* Physical and virtual addresses for some global pages */
+pv_addr_t systempage;
+pv_addr_t irqstack;
+pv_addr_t undstack;
+pv_addr_t abtstack;
+pv_addr_t kernelstack;
+pv_addr_t minidataclean;
+
+vm_offset_t msgbufphys;
+
+extern u_int data_abort_handler_address;
+extern u_int prefetch_abort_handler_address;
+extern u_int undefined_handler_address;
+
+#ifdef PMAP_DEBUG
+extern int pmap_debug_level;
+#endif
+
+#define KERNEL_PT_SYS          0       /* L2 table for mapping zero page */
+
+#define KERNEL_PT_KERNEL       1       /* L2 table for mapping kernel */
+#define        KERNEL_PT_KERNEL_NUM    2
+
+                                       /* L2 table for mapping i80321 */
+#define        KERNEL_PT_IOPXS         (KERNEL_PT_KERNEL + KERNEL_PT_KERNEL_NUM)
+
+                                       /* L2 tables for mapping kernel VM */ 
+#define KERNEL_PT_VMDATA       (KERNEL_PT_IOPXS + 1)
+#define        KERNEL_PT_VMDATA_NUM    4       /* start with 16MB of KVM */
+#define NUM_KERNEL_PTS         (KERNEL_PT_VMDATA + KERNEL_PT_VMDATA_NUM)
+
+pv_addr_t kernel_pt_table[NUM_KERNEL_PTS];
+
+struct user *proc0paddr;
+
 /* Prototypes */
 
 void   consinit(void);
@@ -230,43 +291,36 @@
 }
 
 /*
- * Mapping table for core on-board devices.
+ * Mapping table for core kernel memory. This memory is mapped at init
+ * time with section mappings.
  */
-static const struct initarm_iospace iq80321_ioconf[] = {
-       {
-               IQ80321_OBIO_BASE,
-               IQ80321_OBIO_BASE,
-               IQ80321_OBIO_SIZE,
-               VM_PROT_READ|VM_PROT_WRITE,
-               PTE_NOCACHE
-       },
-       {
-               IQ80321_IOW_VBASE,
-               VERDE_OUT_XLATE_IO_WIN0_BASE,
-               VERDE_OUT_XLATE_IO_WIN_SIZE,
-               VM_PROT_READ|VM_PROT_WRITE,
-               PTE_NOCACHE
-       },
-       {
-               IQ80321_80321_VBASE,
-               VERDE_PMMR_BASE,
-               VERDE_PMMR_SIZE,
-               VM_PROT_READ|VM_PROT_WRITE,
-               PTE_NOCACHE
-       }
+struct l1_sec_map {
+       vaddr_t va;
+       vaddr_t pa;
+       vsize_t size;
+       vm_prot_t prot;
+       int cache;
+} l1_sec_table[] = {
+    /*
+     * Map the on-board devices VA == PA so that we can access them
+     * with the MMU on or off.
+     */
+    {
+       IQ80321_OBIO_BASE,
+       IQ80321_OBIO_BASE,
+       IQ80321_OBIO_SIZE,
+       VM_PROT_READ|VM_PROT_WRITE,
+       PTE_NOCACHE,
+    },
+
+    {
+       0,
+       0,
+       0,
+       0,
+       0,
+    }
 };
-#define        IQ80321_NIO (sizeof(iq80321_ioconf)/sizeof(struct initarm_iospace))
-
-static struct initarm_config iq80321_bootconf = {
-       &bootconfig,
-       0,                    /* PA which maps to KERNEL_BASE (see initarm()) */
-       ARM_VECTORS_HIGH,       /* Where we'd like the vector page */
-       IQ80321_IOPXS_VBASE,    /* KVA of fixed onboard devices */
-       IQ80321_IOPXS_VSIZE,    /* Size of the above mapping (5MB) */
-       IQ80321_NIO,            /* # of fixed I/O mappings */
-       iq80321_ioconf          /* List of fixed I/O mappings */
-};
-
 
 static void
 iq80321_hardclock_hook(void)
@@ -294,9 +348,16 @@
 initarm(void *arg)
 {
        extern vaddr_t xscale_cache_clean_addr;
+#ifdef DIAGNOSTIC
+       extern vsize_t xscale_minidata_clean_size;
+#endif
+       int loop;
+       int loop1;
+       u_int l1pagetable;
+       pv_addr_t kernel_l1pt;
+       pv_addr_t kernel_ptpt;
        paddr_t memstart;
        psize_t memsize;
-       vaddr_t kstack;
 
        /*
         * Clear out the 7-segment display.  Whee, the first visual
@@ -345,7 +406,314 @@
        bootconfig.dramblocks = 1;
        bootconfig.dram[0].address = memstart;
        bootconfig.dram[0].pages = memsize / PAGE_SIZE;
-       iq80321_bootconf.ic_kernel_base_pa = memstart;
+
+       /*
+        * Set up the variables that define the availablilty of
+        * physical memory.  For now, we're going to set
+        * physical_freestart to 0xa0200000 (where the kernel
+        * was loaded), and allocate the memory we need downwards.
+        * If we get too close to the L1 table that we set up, we
+        * will panic.  We will update physical_freestart and
+        * physical_freeend later to reflect what pmap_bootstrap()
+        * wants to see.
+        *
+        * XXX pmap_bootstrap() needs an enema.
+        */
+       physical_start = bootconfig.dram[0].address;
+       physical_end = physical_start + (bootconfig.dram[0].pages * PAGE_SIZE);
+
+       physical_freestart = 0xa0009000UL;
+       physical_freeend = 0xa0200000UL;
+
+       physmem = (physical_end - physical_start) / PAGE_SIZE;
+
+       /* Tell the user about the memory */
+       printf("physmemory: %d pages at 0x%08lx -> 0x%08lx\n", physmem,
+           physical_start, physical_end - 1);
+
+       /*
+        * Okay, the kernel starts 2MB in from the bottom of physical
+        * memory.  We are going to allocate our bootstrap pages downwards
+        * from there.
+        *



Home | Main Index | Thread Index | Old Index