Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbppc/mpc85xx Support a little bus_space for mappi...



details:   https://anonhg.NetBSD.org/src/rev/cb2078c3ac34
branches:  trunk
changeset: 762200:cb2078c3ac34
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Feb 17 13:57:12 2011 +0000

description:
Support a little bus_space for mapping the GUR registers since some
devices use little endian registers.  Add MPC8533 support.

diffstat:

 sys/arch/evbppc/mpc85xx/autoconf.c |   5 +++--
 sys/arch/evbppc/mpc85xx/machdep.c  |  16 +++++++++++++---
 2 files changed, 16 insertions(+), 5 deletions(-)

diffs (90 lines):

diff -r 8f3850c224fc -r cb2078c3ac34 sys/arch/evbppc/mpc85xx/autoconf.c
--- a/sys/arch/evbppc/mpc85xx/autoconf.c        Thu Feb 17 13:55:44 2011 +0000
+++ b/sys/arch/evbppc/mpc85xx/autoconf.c        Thu Feb 17 13:57:12 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.2 2011/01/18 01:10:25 matt Exp $        */
+/*     $NetBSD: autoconf.c,v 1.3 2011/02/17 13:57:12 matt Exp $        */
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.2 2011/01/18 01:10:25 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.3 2011/02/17 13:57:12 matt Exp $");
 
 #define __INTR_PRIVATE
 
@@ -121,6 +121,7 @@
        ma.ma_name = "cpunode";
        ma.ma_node = 0;
        ma.ma_memt = curcpu()->ci_softc->cpu_bst;
+       ma.ma_le_memt = curcpu()->ci_softc->cpu_le_bst;
        ma.ma_dmat = &booke_bus_dma_tag;
 
        config_found_sm_loc(self, "mainbus", NULL, &ma, mainbus_print, NULL);
diff -r 8f3850c224fc -r cb2078c3ac34 sys/arch/evbppc/mpc85xx/machdep.c
--- a/sys/arch/evbppc/mpc85xx/machdep.c Thu Feb 17 13:55:44 2011 +0000
+++ b/sys/arch/evbppc/mpc85xx/machdep.c Thu Feb 17 13:57:12 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.4 2011/02/13 05:03:27 matt Exp $ */
+/*     $NetBSD: machdep.c,v 1.5 2011/02/17 13:57:12 matt Exp $ */
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -128,6 +128,12 @@
        .pbs_limit = GUR_SIZE,
 };
 
+struct powerpc_bus_space gur_le_bst = {
+       .pbs_flags = _BUS_SPACE_LITTLE_ENDIAN|_BUS_SPACE_MEM_TYPE,
+       .pbs_offset = GUR_BASE,
+       .pbs_limit = GUR_SIZE,
+};
+
 const bus_space_handle_t gur_bsh = (bus_space_handle_t)(uintptr_t)(GUR_BASE);
 
 #ifdef CADMUS
@@ -522,6 +528,7 @@
 {
        svr &= ~0x80000;        /* clear security bit */
        switch (svr >> 8) {
+       case SVR_MPC8533 >> 8: return "MPC8533";
        case SVR_MPC8536v1 >> 8: return "MPC8536";
        case SVR_MPC8541v1 >> 8: return "MPC8541";
        case SVR_MPC8543v2 >> 8: return "MPC8543";
@@ -696,7 +703,9 @@
        CTASSERT(offsetof(struct tlb_md_ops, md_tlb_mapiodev) == 0);
        cpu_md_ops.md_tlb_ops = (const void *)&early_tlb_mapiodev;
        bus_space_init(&gur_bst, NULL, NULL, 0);
+       bus_space_init(&gur_le_bst, NULL, NULL, 0);
        cpu->cpu_bst = &gur_bst;
+       cpu->cpu_le_bst = &gur_le_bst;
        cpu->cpu_bsh = gur_bsh;
 
        /*
@@ -735,6 +744,7 @@
         * Now find out how much memory is attached
         */
        pmemsize = memprobe(endkernel);
+       cpu->cpu_highmem = pmemsize;
                printf(" memprobe=%zuMB", (size_t) (pmemsize >> 20));
 
        /*
@@ -1020,13 +1030,13 @@
        switch (svr) {
 #if defined(MPC8536)
        case SVR_MPC8536v1 >> 16:
-               mpc85xx_pci_setup("pci1-interrupt-map", 0x001800, IST_LEVEL,
+               mpc85xx_pci_setup("pci0-interrupt-map", 0x001800, IST_LEVEL,
                    1, 2, 3, 4);
                break;
 #endif
 #if defined(MPC8544)
        case SVR_MPC8544v1 >> 16:
-               mpc85xx_pci_setup("pci1-interrupt-map", 0x001800, IST_LEVEL,
+               mpc85xx_pci_setup("pci0-interrupt-map", 0x001800, IST_LEVEL,
                    0, 1, 2, 3);
                break;
 #endif



Home | Main Index | Thread Index | Old Index