Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/oea Fix isa(4) support for ofw.



details:   https://anonhg.NetBSD.org/src/rev/c7f259fc7b0a
branches:  trunk
changeset: 753006:c7f259fc7b0a
user:      kiyohara <kiyohara%NetBSD.org@localhost>
date:      Sun Mar 14 10:03:49 2010 +0000

description:
Fix isa(4) support for ofw.
  ofw not initialized bus_space for isa(4).
  It tested on ofppc(PegasosII).

diffstat:

 sys/arch/powerpc/oea/ofw_consinit.c   |  12 ++++--------
 sys/arch/powerpc/oea/ofwoea_machdep.c |  20 ++++++++++++++++----
 2 files changed, 20 insertions(+), 12 deletions(-)

diffs (111 lines):

diff -r 6fcefbcc101c -r c7f259fc7b0a sys/arch/powerpc/oea/ofw_consinit.c
--- a/sys/arch/powerpc/oea/ofw_consinit.c       Sun Mar 14 09:52:00 2010 +0000
+++ b/sys/arch/powerpc/oea/ofw_consinit.c       Sun Mar 14 10:03:49 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_consinit.c,v 1.9 2010/03/10 18:36:05 kiyohara Exp $ */
+/* $NetBSD: ofw_consinit.c,v 1.10 2010/03/14 10:03:49 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.9 2010/03/10 18:36:05 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.10 2010/03/14 10:03:49 kiyohara Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -219,9 +219,9 @@
                return;
        }
 
-#if NAKBD > 0
        memset(name, 0, sizeof(name));
        OF_getprop(OF_parent(node), "name", name, sizeof(name));
+#if NAKBD > 0
        if (strcmp(name, "adb") == 0) {
                printf("console keyboard type: ADB\n");
                akbd_cnattach();
@@ -229,8 +229,6 @@
        }
 #endif
 #if NADBKBD > 0
-       memset(name, 0, sizeof(name));
-       OF_getprop(OF_parent(node), "name", name, sizeof(name));
        if (strcmp(name, "adb") == 0) {
                printf("console keyboard type: ADB\n");
                adbkbd_cnattach();
@@ -238,9 +236,7 @@
        }
 #endif
 #if NPCKBC > 0
-       memset(name, 0, sizeof(name));
-       OF_getprop(OF_parent(node), "name", name, sizeof(name));
-       if (strcmp(name, "keyboard") == 0) {
+       if (strcmp(name, "isa") == 0) {
                printf("console keyboard type: PC Keyboard\n");
                pckbc_cnattach(&genppc_isa_io_space_tag, IO_KBD, KBCMDP,
                    PCKBC_KBD_SLOT);
diff -r 6fcefbcc101c -r c7f259fc7b0a sys/arch/powerpc/oea/ofwoea_machdep.c
--- a/sys/arch/powerpc/oea/ofwoea_machdep.c     Sun Mar 14 09:52:00 2010 +0000
+++ b/sys/arch/powerpc/oea/ofwoea_machdep.c     Sun Mar 14 10:03:49 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofwoea_machdep.c,v 1.19 2010/03/10 18:36:05 kiyohara Exp $ */
+/* $NetBSD: ofwoea_machdep.c,v 1.20 2010/03/14 10:03:49 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.19 2010/03/10 18:36:05 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofwoea_machdep.c,v 1.20 2010/03/14 10:03:49 kiyohara Exp $");
 
 #include "opt_ppcarch.h"
 #include "opt_compat_netbsd.h"
@@ -167,6 +167,8 @@
                            sizeof(model_name));
                model_init();
        }
+       /* Initialize bus_space */
+       ofwoea_bus_space_init();
 
        ofwoea_consinit();
 
@@ -583,6 +585,10 @@
                 */
                if (range == -1) {
                        /* we found a rangeless isa bus */
+                       if (iomem == RANGE_IO)
+                               size = 0x10000;
+                       else
+                               size = 0x1000000;
                }
                DPRINTF("found isa stuff\n");
                for (i=0; i < range; i++)
@@ -595,7 +601,10 @@
                                        DPRINTF("found IO\n");
                                        tag->pbs_offset = list[i].addr;
                                        tag->pbs_limit = size;
-                                       error = bus_space_init(tag, name, NULL, 0);
+                                       error = bus_space_init(tag, name,
+                                           ex_storage[exmap],
+                                           sizeof(ex_storage[exmap]));
+                                       exmap++;
                                        return error;
                                }
                } else {
@@ -605,7 +614,10 @@
                                        DPRINTF("found mem\n");
                                        tag->pbs_offset = list[i].addr;
                                        tag->pbs_limit = size;
-                                       error = bus_space_init(tag, name, NULL, 0);
+                                       error = bus_space_init(tag, name,
+                                           ex_storage[exmap],
+                                           sizeof(ex_storage[exmap]));
+                                       exmap++;
                                        return error;
                                }
                }



Home | Main Index | Thread Index | Old Index