Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm/bcm53xx Include PCI outbound windows in the ...



details:   https://anonhg.NetBSD.org/src/rev/4135f3579d3f
branches:  trunk
changeset: 781464:4135f3579d3f
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Sep 07 11:53:49 2012 +0000

description:
Include PCI outbound windows in the kernel IO region.  Make sure these start
on a SuperSection boundary.

diffstat:

 sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c |  36 +++++++++++++++++++++++++-----
 sys/arch/evbarm/bcm53xx/bcm53xx_start.S   |   9 +++----
 sys/arch/evbarm/bcm53xx/genassym.cf       |   6 ++--
 sys/arch/evbarm/bcm53xx/platform.h        |  20 ++++++++++++----
 4 files changed, 52 insertions(+), 19 deletions(-)

diffs (176 lines):

diff -r 9728e5643cbb -r 4135f3579d3f sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c
--- a/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c Fri Sep 07 11:52:30 2012 +0000
+++ b/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c Fri Sep 07 11:53:49 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm53xx_machdep.c,v 1.1 2012/09/01 00:15:11 matt Exp $ */
+/*     $NetBSD: bcm53xx_machdep.c,v 1.2 2012/09/07 11:53:49 matt Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -33,12 +33,13 @@
 #define IDM_PRIVATE
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm53xx_machdep.c,v 1.1 2012/09/01 00:15:11 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm53xx_machdep.c,v 1.2 2012/09/07 11:53:49 matt Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_broadcom.h"
 #include "opt_kgdb.h"
 #include "com.h"
+#include "pci.h"
 #include "bcmrng_ccb.h"
 
 #include <sys/param.h>
@@ -130,19 +131,42 @@
 
 static const struct pmap_devmap devmap[] = {
        {
-               KERNEL_IO_VBASE,
+               KERNEL_IO_IOREG_VBASE,
                BCM53XX_IOREG_PBASE,            /* 0x18000000 */
                BCM53XX_IOREG_SIZE,             /* 2MB */
                VM_PROT_READ|VM_PROT_WRITE,
                PTE_NOCACHE,
        },
        {
-               KERNEL_IO_VBASE + BCM53XX_IOREG_SIZE,
+               KERNEL_IO_ARMCORE_VBASE,
                BCM53XX_ARMCORE_PBASE,          /* 0x19000000 */
-               BCM53XX_ARMCORE_SIZE,           /* 16MB */
+               BCM53XX_ARMCORE_SIZE,           /* 1MB */
+               VM_PROT_READ|VM_PROT_WRITE,
+               PTE_NOCACHE,
+       },
+#if NPCI > 0
+       {
+               KERNEL_IO_PCIE0_OWIN_VBASE,
+               BCM53XX_PCIE0_OWIN_PBASE,       /* 0x08000000 */
+               BCM53XX_PCIE0_OWIN_SIZE,        /* 4MB */
                VM_PROT_READ|VM_PROT_WRITE,
                PTE_NOCACHE,
        },
+       {
+               KERNEL_IO_PCIE1_OWIN_VBASE,
+               BCM53XX_PCIE1_OWIN_PBASE,       /* 0x40000000 */
+               BCM53XX_PCIE1_OWIN_SIZE,        /* 4MB */
+               VM_PROT_READ|VM_PROT_WRITE,
+               PTE_NOCACHE,
+       },
+       {
+               KERNEL_IO_PCIE2_OWIN_VBASE,
+               BCM53XX_PCIE2_OWIN_PBASE,       /* 0x48000000 */
+               BCM53XX_PCIE2_OWIN_SIZE,        /* 4MB */
+               VM_PROT_READ|VM_PROT_WRITE,
+               PTE_NOCACHE,
+       },
+#endif /* NPCI > 0 */
        { 0, 0, 0, 0, 0 }
 };
 
@@ -162,7 +186,7 @@
 initarm(void *arg)
 {
        pmap_devmap_register(devmap);
-       bcm53xx_bootstrap(KERNEL_IO_VBASE);
+       bcm53xx_bootstrap(KERNEL_IO_IOREG_VBASE);
 
 #ifdef MULTIPROCESSOR
        uint32_t scu_cfg = bus_space_read_4(bcm53xx_armcore_bst, bcm53xx_armcore_bsh,
diff -r 9728e5643cbb -r 4135f3579d3f sys/arch/evbarm/bcm53xx/bcm53xx_start.S
--- a/sys/arch/evbarm/bcm53xx/bcm53xx_start.S   Fri Sep 07 11:52:30 2012 +0000
+++ b/sys/arch/evbarm/bcm53xx/bcm53xx_start.S   Fri Sep 07 11:53:49 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm53xx_start.S,v 1.2 2012/09/02 05:02:36 matt Exp $   */
+/*     $NetBSD: bcm53xx_start.S,v 1.3 2012/09/07 11:53:50 matt Exp $   */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -45,7 +45,7 @@
 #define        CONADDR         0x18000300
 #endif
 
-RCSID("$NetBSD: bcm53xx_start.S,v 1.2 2012/09/02 05:02:36 matt Exp $")
+RCSID("$NetBSD: bcm53xx_start.S,v 1.3 2012/09/07 11:53:50 matt Exp $")
 
 #undef VERBOSE_INIT_ARM
 #define VERBOSE_INIT_ARM
@@ -151,7 +151,7 @@
            L1_S_PROTO | L1_S_APv7_KRW  | L1_S_B | L1_S_C)
 
        /* Map the 2MB of primary peripherals */
-       MMU_INIT(KERNEL_IO_VBASE, BCM53XX_IOREG_PBASE,
+       MMU_INIT(KERNEL_IO_IOREG_VBASE, BCM53XX_IOREG_PBASE,
            (BCM53XX_IOREG_SIZE + L1_S_SIZE - 1) / L1_S_SIZE,
            L1_S_PROTO | L1_S_APv7_KRW)
 
@@ -161,8 +161,7 @@
            L1_S_PROTO | L1_S_APv7_KRW)
 
        /* Map the 1MB of armcore peripherals */
-       MMU_INIT(KERNEL_IO_VBASE + BCM53XX_IOREG_SIZE,
-           BCM53XX_ARMCORE_PBASE,
+       MMU_INIT(KERNEL_IO_ARMCORE_VBASE, BCM53XX_ARMCORE_PBASE,
            (BCM53XX_ARMCORE_SIZE + L1_S_SIZE - 1) / L1_S_SIZE,
            L1_S_PROTO | L1_S_APv7_KRW)
 
diff -r 9728e5643cbb -r 4135f3579d3f sys/arch/evbarm/bcm53xx/genassym.cf
--- a/sys/arch/evbarm/bcm53xx/genassym.cf       Fri Sep 07 11:52:30 2012 +0000
+++ b/sys/arch/evbarm/bcm53xx/genassym.cf       Fri Sep 07 11:53:49 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.1 2012/09/01 00:15:11 matt Exp $
+# $NetBSD: genassym.cf,v 1.2 2012/09/07 11:53:50 matt Exp $
 
 #-
 # Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -38,8 +38,8 @@
 define BCM53XX_IOREG_SIZE      BCM53XX_IOREG_SIZE
 define BCM53XX_ARMCORE_PBASE   BCM53XX_ARMCORE_PBASE
 define BCM53XX_ARMCORE_SIZE    BCM53XX_ARMCORE_SIZE
-define KERNEL_IO_VBASE         KERNEL_IO_VBASE
-define KERNEL_IO_VSIZE         KERNEL_IO_VSIZE
+define KERNEL_IO_IOREG_VBASE   KERNEL_IO_IOREG_VBASE
+define KERNEL_IO_ARMCORE_VBASE KERNEL_IO_ARMCORE_VBASE
 
 define LSR_TXRDY               LSR_TXRDY
 define LSR_TSRE                LSR_TSRE
diff -r 9728e5643cbb -r 4135f3579d3f sys/arch/evbarm/bcm53xx/platform.h
--- a/sys/arch/evbarm/bcm53xx/platform.h        Fri Sep 07 11:52:30 2012 +0000
+++ b/sys/arch/evbarm/bcm53xx/platform.h        Fri Sep 07 11:53:49 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: platform.h,v 1.1 2012/09/01 00:15:11 matt Exp $        */
+/*     $NetBSD: platform.h,v 1.2 2012/09/07 11:53:50 matt Exp $        */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -39,7 +39,11 @@
  * Kernel VM space: KERNEL_VM_BASE to 0xc0000000.  Leave 1MB unused.
  */
 #define        KERNEL_VM_BASE          (KERNEL_BASE + 0x40000000)
-#define        KERNEL_VM_TOP           (0xfff00000 - KERNEL_IO_VSIZE)
+#if BCM53XX_IO_SIZE >= L1_SS_SIZE
+#define        KERNEL_VM_TOP           ((0xfff00000 - BCM53XX_IO_SIZE) & -L1_SS_SIZE)
+#else
+#define        KERNEL_VM_TOP           (0xfff00000 - BCM53XX_IO_SIZE)
+#endif
 #define        KERNEL_VM_SIZE          (KERNEL_VM_TOP - KERNEL_VM_BASE)
 
 /*
@@ -47,8 +51,14 @@
  * address space, so we can't map 1:1 VA:PA.  So shove them just after the
  * top of the kernel VM.
  */
-#define        KERNEL_IO_VBASE         KERNEL_VM_TOP
-#define        KERNEL_IO_PBASE         BCM53XX_IOREG_PBASE
-#define        KERNEL_IO_VSIZE         BCM53XX_IO_SIZE
+
+#define        KERNEL_IO_VBASE                 KERNEL_VM_TOP
+
+#define        KERNEL_IO_PCIE0_OWIN_VBASE      KERNEL_IO_VBASE
+#define        KERNEL_IO_PCIE1_OWIN_VBASE      (KERNEL_IO_PCIE0_OWIN_VBASE + BCM53XX_PCIE0_OWIN_SIZE)
+#define        KERNEL_IO_PCIE2_OWIN_VBASE      (KERNEL_IO_PCIE1_OWIN_VBASE + BCM53XX_PCIE1_OWIN_SIZE)
+#define        KERNEL_IO_IOREG_VBASE           (KERNEL_IO_PCIE2_OWIN_VBASE + BCM53XX_PCIE2_OWIN_SIZE)
+#define        KERNEL_IO_ARMCORE_VBASE         (KERNEL_IO_IOREG_VBASE + BCM53XX_IOREG_SIZE)
+#define        KERNEL_IO_END_VBASE             (KERNEL_IO_ARMCORE_VBASE + BCM53XX_ARMCORE_SIZE)
 
 #endif /* _EVBARM_BCM53XX_PLATFORM_H */



Home | Main Index | Thread Index | Old Index