Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm/integrator Changes to allow for the fact tha...



details:   https://anonhg.NetBSD.org/src/rev/907c5cced6f7
branches:  trunk
changeset: 533733:907c5cced6f7
user:      rearnsha <rearnsha%NetBSD.org@localhost>
date:      Mon Jul 08 16:20:07 2002 +0000

description:
Changes to allow for the fact that the kernel is now mapped at
0xc0200000.  Tidy up to remove dead comments and code.
Allow more than one L1 entry for the kernel space and use the 'spare'
memory below the kernel code for the initial page tables in the same
way that the iq80310 does.

diffstat:

 sys/arch/evbarm/integrator/integrator_machdep.c |  464 +++++++++++------------
 1 files changed, 218 insertions(+), 246 deletions(-)

diffs (truncated from 757 to 300 lines):

diff -r ce20f6db703a -r 907c5cced6f7 sys/arch/evbarm/integrator/integrator_machdep.c
--- a/sys/arch/evbarm/integrator/integrator_machdep.c   Mon Jul 08 16:17:42 2002 +0000
+++ b/sys/arch/evbarm/integrator/integrator_machdep.c   Mon Jul 08 16:20:07 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: integrator_machdep.c,v 1.22 2002/04/12 06:13:42 thorpej Exp $  */
+/*     $NetBSD: integrator_machdep.c,v 1.23 2002/07/08 16:20:07 rearnsha Exp $ */
 
 /*
- * Copyright (c) 2001 ARM Ltd
+ * Copyright (c) 2001,2002 ARM Ltd
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -16,18 +16,20 @@
  *    products derived from this software without specific prior written
  *    permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
+ * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL ARM LTD
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
  * Copyright (c) 1997,1998 Mark Brinicombe.
  * Copyright (c) 1997,1998 Causality Limited.
  * All rights reserved.
@@ -92,6 +94,8 @@
 #include <evbarm/ifpga/irqhandler.h>   /* XXX XXX XXX */
 #include <arm/undefined.h>
 
+#include <arm/arm32/machdep.h>
+
 #include <evbarm/integrator/integrator_boot.h>
 
 #include "opt_ipkdb.h"
@@ -115,9 +119,7 @@
 #define UND_STACK_SIZE 1
 #endif
 
-struct intbootinfo intbootinfo;
 BootConfig bootconfig;         /* Boot config storage */
-static char bootargs[MAX_BOOT_STRING + 1];
 char *boot_args = NULL;
 char *boot_file = NULL;
 
@@ -151,9 +153,12 @@
 extern int pmap_debug_level;
 #endif
 
-#define KERNEL_PT_SYS          0       /* Page table for mapping proc0 zero page */
-#define KERNEL_PT_KERNEL       1       /* Page table for mapping kernel */
-#define KERNEL_PT_VMDATA       2       /* Page tables for mapping kernel VM */
+#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 tables for mapping kernel VM */
+#define KERNEL_PT_VMDATA       (KERNEL_PT_KERNEL + KERNEL_PT_KERNEL_NUM)
 #define        KERNEL_PT_VMDATA_NUM    4       /* start with 16MB of KVM */
 #define NUM_KERNEL_PTS         (KERNEL_PT_VMDATA + KERNEL_PT_VMDATA_NUM)
 
@@ -163,19 +168,13 @@
 
 /* Prototypes */
 
-void consinit          __P((void));
+static void    integrator_sdram_bounds (paddr_t *, psize_t *);
 
-void process_kernel_args       __P((char *));
-void data_abort_handler                __P((trapframe_t *frame));
-void prefetch_abort_handler    __P((trapframe_t *frame));
-void undefinedinstruction_bounce       __P((trapframe_t *frame));
-extern void configure          __P((void));
-extern void parse_mi_bootargs  __P((char *args));
-extern void dumpsys            __P((void));
+void   consinit(void);
 
 /* A load of console goo. */
 #include "vga.h"
-#if (NVGA > 0)
+#if NVGA > 0
 #include <dev/ic/mc6845reg.h>
 #include <dev/ic/pcdisplayvar.h>
 #include <dev/ic/vgareg.h>
@@ -183,13 +182,13 @@
 #endif
 
 #include "pckbc.h"
-#if (NPCKBC > 0)
+#if NPCKBC > 0
 #include <dev/ic/i8042reg.h>
 #include <dev/ic/pckbcvar.h>
 #endif
 
 #include "com.h"
-#if (NCOM > 0)
+#if NCOM > 0
 #include <dev/ic/comreg.h>
 #include <dev/ic/comvar.h>
 #ifndef CONCOMADDR
@@ -197,6 +196,10 @@
 #endif
 #endif
 
+/*
+ * Define the default console speed for the board.  This is generally
+ * what the firmware provided with the board defaults to.
+ */
 #define CONSPEED B115200
 #ifndef CONSPEED
 #define CONSPEED B9600 /* TTYDEF_SPEED */
@@ -248,11 +251,8 @@
  * Deal with any syncing, unmounting, dumping and shutdown hooks,
  * then reset the CPU.
  */
-
 void
-cpu_reboot(howto, bootstr)
-       int howto;
-       char *bootstr;
+cpu_reboot(int howto, char *bootstr)
 {
 #ifdef DIAGNOSTIC
        /* info */
@@ -274,13 +274,13 @@
        }
 
        /* Disable console buffering */
-/*     cnpollc(1);*/
 
        /*
         * If RB_NOSYNC was not specified sync the discs.
-        * Note: Unless cold is set to 1 here, syslogd will die during the unmount.
-        * It looks like syslogd is getting woken up only to find that it cannot
-        * page part of the binary in as the filesystem has been unmounted.
+        * Note: Unless cold is set to 1 here, syslogd will die during the
+        * unmount.  It looks like syslogd is getting woken up only to find
+        * that it cannot page part of the binary in as the filesystem has
+        * been unmounted.
         */
        if (!(howto & RB_NOSYNC))
                bootsync();
@@ -314,30 +314,57 @@
  * time with section mappings.
  */
 struct l1_sec_map {
-       vm_offset_t     va;
-       vm_offset_t     pa;
-       vm_size_t       size;
-       vm_prot_t       prot;
-       int             cache;
+       vaddr_t va;
+       vaddr_t pa;
+       vsize_t size;
+       vm_prot_t prot;
+       int cache;
 } l1_sec_table[] = {
 #if NPLCOM > 0 && defined(PLCONSOLE)
-       { UART0_BOOT_BASE, IFPGA_IO_BASE + IFPGA_UART0, 1024 * 1024,
-         VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE },
-       { UART1_BOOT_BASE, IFPGA_IO_BASE + IFPGA_UART1, 1024 * 1024,
-         VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE },
+       {
+               UART0_BOOT_BASE,
+               IFPGA_IO_BASE + IFPGA_UART0,
+               1024 * 1024,
+               VM_PROT_READ|VM_PROT_WRITE,
+               PTE_NOCACHE
+       },
+
+       {
+               UART1_BOOT_BASE,
+               IFPGA_IO_BASE + IFPGA_UART1,
+               1024 * 1024,
+               VM_PROT_READ|VM_PROT_WRITE,
+               PTE_NOCACHE
+       },
 #endif
 #if NPCI > 0
-       { IFPGA_PCI_IO_VBASE, IFPGA_PCI_IO_BASE, IFPGA_PCI_IO_VSIZE,
-         VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE },
-       { IFPGA_PCI_CONF_VBASE, IFPGA_PCI_CONF_BASE, IFPGA_PCI_CONF_VSIZE,
-         VM_PROT_READ|VM_PROT_WRITE, PTE_NOCACHE },
+       {
+               IFPGA_PCI_IO_VBASE,
+               IFPGA_PCI_IO_BASE,
+               IFPGA_PCI_IO_VSIZE,
+               VM_PROT_READ|VM_PROT_WRITE,
+               PTE_NOCACHE
+       },
+
+       {
+               IFPGA_PCI_CONF_VBASE,
+               IFPGA_PCI_CONF_BASE,
+               IFPGA_PCI_CONF_VSIZE,
+               VM_PROT_READ|VM_PROT_WRITE,
+               PTE_NOCACHE },
 #endif
 
-       { 0, 0, 0, 0, 0 }
+       {
+               0,
+               0,
+               0,
+               0,
+               0
+       }
 };
 
 /*
- * u_int initarm(struct ebsaboot *bootinfo)
+ * u_int initarm(...)
  *
  * Initial entry point on startup. This gets called before main() is
  * entered.
@@ -351,8 +378,7 @@
  */
 
 u_int
-initarm(bootinfo)
-       struct intbootinfo *bootinfo;
+initarm(void *arg)
 {
        int loop;
        int loop1;
@@ -361,22 +387,18 @@
        extern int end asm ("_end");
        pv_addr_t kernel_l1pt;
        pv_addr_t kernel_ptpt;
+       paddr_t memstart;
+       psize_t memsize;
 #if NPLCOM > 0 && defined(PLCONSOLE)
        static struct bus_space plcom_bus_space;
 #endif
 
-
-#if 0
-       cn_tab = &kcomcons;
-#endif
        /*
         * Heads up ... Setup the CPU / MMU / TLB functions
         */
        if (set_cpufuncs())
                panic("cpu not recognized!");
 
-       /*    - intbootinfo.bt_memstart) / NBPG */;
-
 #if NPLCOM > 0 && defined(PLCONSOLE)
        /*
         * Initialise the diagnostic serial console
@@ -397,24 +419,13 @@
 #endif
 
        /* Talk to the user */
-       printf("\nNetBSD/integrator booting ...\n");
-
-#if 0
-       if (intbootinfo.bt_magic != BT_MAGIC_NUMBER_EBSA
-           && intbootinfo.bt_magic != BT_MAGIC_NUMBER_CATS)
-               panic("Incompatible magic number passed in boot args\n");
-#endif
-
-/*     {
-       int loop;
-       for (loop = 0; loop < 8; ++loop) {
-               printf("%08x\n", *(((int *)bootinfo)+loop));
-       }
-       }*/
+       printf("\nNetBSD/evbarm (Integrator) booting ...\n");
 
        /*
         * Ok we have the following memory map
         *
+        * XXX NO WE DON'T
+        *
         * virtual address == physical address apart from the areas:
         * 0x00000000 -> 0x000fffff which is mapped to
         * top 1MB of physical memory
@@ -438,62 +449,36 @@
         */



Home | Main Index | Thread Index | Old Index