Source-Changes-HG archive

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

[src/trunk]: src/sys/arch correct physical/virtual address handling



details:   https://anonhg.NetBSD.org/src/rev/6fb00a153545
branches:  trunk
changeset: 543303:6fb00a153545
user:      igy <igy%NetBSD.org@localhost>
date:      Sat Feb 22 05:32:00 2003 +0000

description:
correct physical/virtual address handling

        - to identify device instance, using hardware address.
        - when console accesses device, using statically mapped address.
        - when tty accesses device, using handler given by bus_space_map().

diffstat:

 sys/arch/arm/ixp12x0/ixp12x0_com.c        |  12 ++++++------
 sys/arch/arm/ixp12x0/ixp12x0_comreg.h     |  11 ++++++-----
 sys/arch/arm/ixp12x0/ixp12x0_comvar.h     |   5 +++--
 sys/arch/evbarm/conf/NAPPI                |   4 ++--
 sys/arch/evbarm/ixm1200/ixm1200_machdep.c |   9 +++++----
 5 files changed, 22 insertions(+), 19 deletions(-)

diffs (130 lines):

diff -r 8e3232132f99 -r 6fb00a153545 sys/arch/arm/ixp12x0/ixp12x0_com.c
--- a/sys/arch/arm/ixp12x0/ixp12x0_com.c        Sat Feb 22 05:24:16 2003 +0000
+++ b/sys/arch/arm/ixp12x0/ixp12x0_com.c        Sat Feb 22 05:32:00 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ixp12x0_com.c,v 1.12 2003/02/21 01:53:35 igy Exp $ */
+/*     $NetBSD: ixp12x0_com.c,v 1.13 2003/02/22 05:32:00 igy Exp $ */
 /*
  * Copyright (c) 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -244,9 +244,7 @@
 
                cn_tab->cn_dev = makedev(maj, sc->sc_dev.dv_unit);
 
-               delay(10000); /* XXX */
-               printf("%s: console\n", sc->sc_dev.dv_xname);
-               delay(10000); /* XXX */
+               aprint_normal("%s: console\n", sc->sc_dev.dv_xname);
        }
 
        sc->sc_si = softintr_establish(IPL_SOFTSERIAL, ixpcomsoft, sc);
@@ -855,9 +853,10 @@
 }
 
 int
-ixpcomcnattach(iot, iobase, ospeed, cflag)
+ixpcomcnattach(iot, iobase, ioh, ospeed, cflag)
        bus_space_tag_t iot;
        bus_addr_t iobase;
+       bus_space_handle_t ioh;
        int ospeed;
        tcflag_t cflag;
 {
@@ -882,7 +881,8 @@
        cn_set_magic("\047\001\047\001");
 
        ixpcomcn_sc.sc_iot = iot;
-       ixpcomcn_sc.sc_ioh = ixpcomcn_sc.sc_baseaddr = iobase;
+       ixpcomcn_sc.sc_ioh = ioh;
+       ixpcomcn_sc.sc_baseaddr = iobase;
        ixpcomcn_sc.sc_ospeed = ospeed;
        ixpcomcn_sc.sc_cflag = cflag;
 
diff -r 8e3232132f99 -r 6fb00a153545 sys/arch/arm/ixp12x0/ixp12x0_comreg.h
--- a/sys/arch/arm/ixp12x0/ixp12x0_comreg.h     Sat Feb 22 05:24:16 2003 +0000
+++ b/sys/arch/arm/ixp12x0/ixp12x0_comreg.h     Sat Feb 22 05:32:00 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ixp12x0_comreg.h,v 1.5 2003/02/17 20:51:52 ichiro Exp $ */
+/*     $NetBSD: ixp12x0_comreg.h,v 1.6 2003/02/22 05:32:00 igy Exp $ */
 
 /*
  * Copyright (c) 2002
@@ -43,11 +43,12 @@
 #define IXPCOMSPEED(b)         (IXPCOM_FREQ / (b) - 1)
 #define IXPCOMSPEED2BRD(b)     (IXPCOMSPEED(b) << 16)
 
-/* size of I/O space */
+/* I/O space */
 #define IXPCOM_UART_SIZE       0x00004000UL
-
-/* Register base virtual addresses mapped by initarm() */
-#define        IXPCOM_UART_BASE        0xf0000000UL
+#define IXPCOM_UART_OFFSET     0x00000000UL
+#define        IXPCOM_UART_HWBASE      (IXP12X0_SYS_HWBASE + IXPCOM_UART_OFFSET)
+/* IXPCOM_UART_VBASE should be used only for console's ioh. */
+#define        IXPCOM_UART_VBASE       (IXP12X0_SYS_VBASE + IXPCOM_UART_OFFSET)
 
 /* UART control register */
 #define IXPCOM_CR      0x00003800UL
diff -r 8e3232132f99 -r 6fb00a153545 sys/arch/arm/ixp12x0/ixp12x0_comvar.h
--- a/sys/arch/arm/ixp12x0/ixp12x0_comvar.h     Sat Feb 22 05:24:16 2003 +0000
+++ b/sys/arch/arm/ixp12x0/ixp12x0_comvar.h     Sat Feb 22 05:32:00 2003 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: ixp12x0_comvar.h,v 1.3 2002/12/02 14:10:13 ichiro Exp $        */
+/*      $NetBSD: ixp12x0_comvar.h,v 1.4 2003/02/22 05:32:01 igy Exp $        */
 /*-
  * Copyright (c) 2001, The NetBSD Foundation, Inc.  All rights reserved.
  *
@@ -103,6 +103,7 @@
 void   ixpcom_attach_subr(struct ixpcom_softc *);
 
 int    ixpcomintr(void* arg);
-int    ixpcomcnattach(bus_space_tag_t, bus_addr_t, int, tcflag_t);
+int    ixpcomcnattach(bus_space_tag_t, bus_addr_t, bus_space_handle_t,
+                      int, tcflag_t);
 
 #endif /* _IXP12X0_COMVAR_H_ */
diff -r 8e3232132f99 -r 6fb00a153545 sys/arch/evbarm/conf/NAPPI
--- a/sys/arch/evbarm/conf/NAPPI        Sat Feb 22 05:24:16 2003 +0000
+++ b/sys/arch/evbarm/conf/NAPPI        Sat Feb 22 05:32:00 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NAPPI,v 1.4 2002/12/08 13:22:31 ichiro Exp $
+#      $NetBSD: NAPPI,v 1.5 2003/02/22 05:32:01 igy Exp $
 #
 #      NAPPI -- Netwise APlication Platform Board Kernel
 #
@@ -140,7 +140,7 @@
 ixpclk*                at ixpsip? addr 0x42000300 size 0x10
 
 # Serial
-ixpcom*                at ixpsip? addr 0xf0000000 size 0x4000
+ixpcom*                at ixpsip? addr 0x90000000 size 0x4000
 
 # Status LEDs
 nappinr*       at ixpsip? addr 0x38508000 size 0x1000
diff -r 8e3232132f99 -r 6fb00a153545 sys/arch/evbarm/ixm1200/ixm1200_machdep.c
--- a/sys/arch/evbarm/ixm1200/ixm1200_machdep.c Sat Feb 22 05:24:16 2003 +0000
+++ b/sys/arch/evbarm/ixm1200/ixm1200_machdep.c Sat Feb 22 05:32:00 2003 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: ixm1200_machdep.c,v 1.11 2002/12/08 13:22:32 ichiro Exp $ */
+/*     $NetBSD: ixm1200_machdep.c,v 1.12 2003/02/22 05:32:02 igy Exp $ */
 #undef DEBUG_BEFOREMMU
 /*
- * Copyright (c) 2002
+ * Copyright (c) 2002, 2003
  *     Ichiro FUKUHARA <ichiro%ichiro.org@localhost>.
  * All rights reserved.
  *
@@ -738,9 +738,10 @@
 
        consinit_called = 1;
 
-       if (ixpcomcnattach(&ixpsip_bs_tag, IXPCOM_UART_BASE,
+       if (ixpcomcnattach(&ixpsip_bs_tag,
+                          IXPCOM_UART_HWBASE, IXPCOM_UART_VBASE,
                           CONSPEED, CONMODE))
-               panic("can't init serial console @%lx", IXPCOM_UART_BASE);
+               panic("can't init serial console @%lx", IXPCOM_UART_HWBASE);
 }
 
 #ifdef DEBUG_BEFOREMMU



Home | Main Index | Thread Index | Old Index