Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpcsh adapt to new pmap code.



details:   https://anonhg.NetBSD.org/src/rev/55d5ed585e12
branches:  trunk
changeset: 526743:55d5ed585e12
user:      uch <uch%NetBSD.org@localhost>
date:      Thu May 09 12:37:58 2002 +0000

description:
adapt to new pmap code.

diffstat:

 sys/arch/hpcsh/conf/std.hpcsh              |    4 +-
 sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c |   50 +++----
 sys/arch/hpcsh/hpcsh/kloader_machdep.c     |    4 +-
 sys/arch/hpcsh/hpcsh/machdep.c             |  178 +++++++++++++---------------
 4 files changed, 106 insertions(+), 130 deletions(-)

diffs (truncated from 546 to 300 lines):

diff -r 1f8bc57fa25e -r 55d5ed585e12 sys/arch/hpcsh/conf/std.hpcsh
--- a/sys/arch/hpcsh/conf/std.hpcsh     Thu May 09 12:36:17 2002 +0000
+++ b/sys/arch/hpcsh/conf/std.hpcsh     Thu May 09 12:37:58 2002 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: std.hpcsh,v 1.3 2002/02/24 18:19:44 uch Exp $
+# $NetBSD: std.hpcsh,v 1.4 2002/05/09 12:37:58 uch Exp $
 #
 # standard, required NetBSD/hpcsh 'options'
 
 machine hpcsh sh3
 
 options        EXEC_SCRIPT     # exec #! scripts
-options                IOM_RAM_BEGIN=0x8c000000
+options                IOM_RAM_BEGIN=0x0c000000
 
 makeoptions    ENDIAN="-EL"
 #makeoptions   LDSCRIPTBASE="shl-coff.x"       # for COFF kernel
diff -r 1f8bc57fa25e -r 55d5ed585e12 sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c
--- a/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c        Thu May 09 12:36:17 2002 +0000
+++ b/sys/arch/hpcsh/dev/hd64465/hd64465pcmcia.c        Thu May 09 12:37:58 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hd64465pcmcia.c,v 1.4 2002/03/28 15:27:02 uch Exp $    */
+/*     $NetBSD: hd64465pcmcia.c,v 1.5 2002/05/09 12:37:59 uch Exp $    */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -53,6 +53,7 @@
 #include <dev/pcmcia/pcmciachip.h>
 
 #include <sh3/bscreg.h>
+#include <sh3/mmu.h>
 
 #include <hpcsh/dev/hd64465/hd64465reg.h>
 #include <hpcsh/dev/hd64465/hd64465var.h>
@@ -62,8 +63,8 @@
 #include "locators.h"
 
 #ifdef HD64465PCMCIA_DEBUG
-#define DPRINTF_ENABLE
-#define DPRINTF_DEBUG  hd64465pcmcia_debug
+#define        DPRINTF_ENABLE
+#define        DPRINTF_DEBUG   hd64465pcmcia_debug
 #endif
 #include <machine/debug.h>
 
@@ -73,14 +74,14 @@
        MEMWIN_16M_COMMON_2,
        MEMWIN_16M_COMMON_3,
 };
-#define MEMWIN_16M_MAX 4
+#define        MEMWIN_16M_MAX  4
 
 enum hd64465pcmcia_event_type {
        EVENT_NONE,
        EVENT_INSERT,
        EVENT_REMOVE,
 };
-#define EVENT_QUEUE_MAX                5
+#define        EVENT_QUEUE_MAX         5
 
 struct hd64465pcmcia_softc; /* forward declaration */
 
@@ -201,7 +202,7 @@
 STATIC int __sh_hd64465_map(vaddr_t, paddr_t, size_t, u_int32_t);
 STATIC vaddr_t __sh_hd64465_map_2page(paddr_t);
 
-#define DELAY_MS(x)    delay((x) * 1000)
+#define        DELAY_MS(x)     delay((x) * 1000)
 
 int
 hd64465pcmcia_match(struct device *parent, struct cfdata *cf, void *aux)
@@ -218,7 +219,7 @@
        struct hd64465pcmcia_softc *sc = (struct hd64465pcmcia_softc *)self;
 
        sc->sc_module_id = ha->ha_module_id;
-       
+
        printf("\n");
 
        sc->sc_area5 = __sh_hd64465_map_2page(0x14000000); /* area 5 */
@@ -260,7 +261,7 @@
        struct hd64465pcmcia_softc *sc = arg;
        struct hd64465pcmcia_event *pe;
        int s;
-       
+
        while (!sc->sc_shutdown) {
                tsleep(sc, PWAIT, "CSC wait", 0);
                s = splhigh();
@@ -327,7 +328,7 @@
 {
        struct device *parent = (struct device *)sc;
        struct hd64465pcmcia_channel *ch = &sc->sc_ch[channel];
-       struct pcmciabus_attach_args paa;       
+       struct pcmciabus_attach_args paa;
        bus_addr_t baseaddr;
        u_int8_t r;
        int i;
@@ -335,8 +336,8 @@
        ch->ch_parent = sc;
        ch->ch_channel = channel;
 
-       /* 
-        * Continuous 16-MB Area Mode 
+       /*
+        * Continuous 16-MB Area Mode
         */
        /* set Continuous 16-MB Area Mode */
        r = hd64465_reg_read_1(HD64461_PCCGCR(channel));
@@ -362,7 +363,7 @@
        /* I/O port extent */
        ch->ch_iobase = 0;
        ch->ch_iosize = 0x01000000;
-       ch->ch_iot = bus_space_create(0, "PCMCIA I/O port", 
+       ch->ch_iot = bus_space_create(0, "PCMCIA I/O port",
            baseaddr + 0x01000000 * 2, ch->ch_iosize);
 
        /* Interrupt */
@@ -558,7 +559,7 @@
                if (bus_space_subregion(ch->ch_memt, ch->ch_memh, card_addr,
                    size, &cookie->wc_handle) != 0)
                        goto bad;
-               
+
                *offsetp = card_addr;
                cookie->wc_window = -1;
        } else {
@@ -570,7 +571,7 @@
                if (bus_space_map(cookie->wc_tag, ofs, size, 0,
                    &cookie->wc_handle) != 0)
                        goto bad;
-               
+
                /* XXX bogus. check window per common memory access. */
                hd64465pcmcia_memory_window16_switch(ch->ch_channel, window);
                *offsetp = ofs + 0x01000000; /* skip attribute area */
@@ -728,7 +729,7 @@
                return EVENT_REMOVE;
        }
        if (r == 0) {
-               DPRINTF("insert\n");            
+               DPRINTF("insert\n");
                return EVENT_INSERT;
        }
        DPRINTF("transition\n");
@@ -774,7 +775,7 @@
        u_int16_t r16;
 
        r16 = _reg_read_2(SH4_BCR2);
-#ifdef HD64465PCMCIA_DEBUG     
+#ifdef HD64465PCMCIA_DEBUG
        dbg_bit_print_msg(r16, "BCR2");
 #endif
        if (channel == 0) {
@@ -826,23 +827,14 @@
 
        epa = pa + sz;
        while (pa < epa) {
-               if (pmap_enter(pmap_kernel(), va, pa,
-                   VM_PROT_READ | VM_PROT_WRITE, PMAP_WIRED) != 0) {
-                       PRINTF("can't map va 0x%08x -> pa 0x%08x\n",
-                           (unsigned)va, (unsigned)pa);
-                       return (1);
-               }
-
-               pte = kvtopte(va);
-               *pte &= ~PG_N; /* uncacheable */
+               pmap_kenter_pa(va, pa, VM_PROT_READ | VM_PROT_WRITE);
+               pte = __pmap_kpte_lookup(va);
+               KDASSERT(pte);
                *pte |= flags;  /* PTEA PCMCIA assistant bit */
-               pmap_update_pg(va);
-
+               sh_tlb_update(0, va, *pte);
                pa += NBPG;
                va += NBPG;
        }
 
-       pmap_update(pmap_kernel());
-
        return (0);
 }
diff -r 1f8bc57fa25e -r 55d5ed585e12 sys/arch/hpcsh/hpcsh/kloader_machdep.c
--- a/sys/arch/hpcsh/hpcsh/kloader_machdep.c    Thu May 09 12:36:17 2002 +0000
+++ b/sys/arch/hpcsh/hpcsh/kloader_machdep.c    Thu May 09 12:37:58 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kloader_machdep.c,v 1.5 2002/02/28 01:57:00 uch Exp $  */
+/*     $NetBSD: kloader_machdep.c,v 1.6 2002/05/09 12:37:59 uch Exp $  */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -37,6 +37,8 @@
 #include <sys/systm.h>
 
 #include <sh3/mmu.h>
+#include <sh3/mmu_sh3.h>
+#include <sh3/mmu_sh4.h>
 #include <sh3/cache.h>
 #include <sh3/cache_sh3.h>
 #include <sh3/cache_sh4.h>
diff -r 1f8bc57fa25e -r 55d5ed585e12 sys/arch/hpcsh/hpcsh/machdep.c
--- a/sys/arch/hpcsh/hpcsh/machdep.c    Thu May 09 12:36:17 2002 +0000
+++ b/sys/arch/hpcsh/hpcsh/machdep.c    Thu May 09 12:37:58 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.37 2002/03/28 15:27:05 uch Exp $ */
+/*     $NetBSD: machdep.c,v 1.38 2002/05/09 12:37:59 uch Exp $ */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -32,7 +32,6 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
-#undef LOAD_ALL_MEMORY
 
 #include "opt_md.h"
 #include "opt_ddb.h"
@@ -53,13 +52,13 @@
 #include <sys/mount.h>
 #include <sys/sysctl.h>
 #include <sys/kcore.h>
-#include <sys/msgbuf.h>
 #include <sys/boot_flag.h>
 
 #include <ufs/mfs/mfs_extern.h>                /* mfs_initminiroot() */
 
 #include <sh3/cpu.h>
 #include <sh3/exception.h>
+#include <sh3/cache.h>
 #include <sh3/clock.h>
 #include <sh3/intcreg.h>
 
@@ -73,7 +72,7 @@
 #ifndef DB_ELFSIZE
 #error Must define DB_ELFSIZE!
 #endif
-#define ELFSIZE                DB_ELFSIZE
+#define        ELFSIZE         DB_ELFSIZE
 #include <sys/exec_elf.h>
 #endif /* DDB || KGDB */
 
@@ -87,37 +86,6 @@
 #include <machine/kloader.h>
 #include <machine/intr.h>
 
-#include <hpcsh/dev/hd6446x/hd6446xintcvar.h>
-#include <hpcsh/dev/hd6446x/hd6446xintcreg.h>
-#include <hpcsh/dev/hd64465/hd64465var.h>
-
-#ifdef DEBUG
-#define DPRINTF_ENABLE
-#define DPRINTF_DEBUG  machdep_debug
-#endif /* DEBUG */
-#include <machine/debug.h>
-
-/* 
- * D-RAM location (Windows CE machine specific)
- *
- * sample) jornada 690 (32MByte) SH7709A
- * SH7709A has 2 banks in CS3
- *
- * CS3 (0x0c000000-0x0fffffff
- * 0x0c000000 --- main      16MByte
- * 0x0d000000 --- main      16MByte (shadow)
- * 0x0e000000 --- extension 16MByte
- * 0x10000000 --- extension 16MByte (shadow)
- */
-
-#define DRAM_BANK_NUM          2
-#define DRAM_BANK_SIZE         0x02000000      /* 32MByte */
-
-#define DRAM_BANK0_START       0x0c000000
-#define DRAM_BANK0_END         (DRAM_BANK0_START + DRAM_BANK_SIZE)
-#define DRAM_BANK1_START       0x0e000000
-#define DRAM_BANK1_END         (DRAM_BANK1_START + DRAM_BANK_SIZE)
-
 #ifdef NFS
 #include <nfs/rpcv2.h>
 #include <nfs/nfsproto.h>
@@ -125,6 +93,46 @@
 #include <nfs/nfsmount.h>
 #endif
 
+#include <hpcsh/dev/hd6446x/hd6446xintcvar.h>
+#include <hpcsh/dev/hd6446x/hd6446xintcreg.h>
+#include <hpcsh/dev/hd64465/hd64465var.h>
+
+#ifdef DEBUG
+#define        DPRINTF_ENABLE
+#define        DPRINTF_DEBUG   machdep_debug
+#endif /* DEBUG */
+#include <machine/debug.h>
+
+/*
+ * D-RAM location (Windows CE machine specific)
+ *
+ * Jornada 690 (32MB model) SH7709A
+ *  + SH7709A split CS3 to 2 banks.
+ *
+ * CS3 (0x0c000000-0x0fffffff



Home | Main Index | Thread Index | Old Index