Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips/ralink Add a static bus_space_handle_t for the...



details:   https://anonhg.NetBSD.org/src/rev/68bd740cb077
branches:  trunk
changeset: 329026:68bd740cb077
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Apr 30 00:51:01 2014 +0000

description:
Add a static bus_space_handle_t for the core (sysctl) registers.

diffstat:

 sys/arch/mips/ralink/ralink_bus.c |  12 ++++++++++--
 sys/arch/mips/ralink/ralink_var.h |   7 ++++---
 2 files changed, 14 insertions(+), 5 deletions(-)

diffs (58 lines):

diff -r 2ccdf8278d1f -r 68bd740cb077 sys/arch/mips/ralink/ralink_bus.c
--- a/sys/arch/mips/ralink/ralink_bus.c Wed Apr 30 00:09:29 2014 +0000
+++ b/sys/arch/mips/ralink/ralink_bus.c Wed Apr 30 00:51:01 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ralink_bus.c,v 1.2 2011/07/28 15:38:49 matt Exp $      */
+/*     $NetBSD: ralink_bus.c,v 1.3 2014/04/30 00:51:01 matt Exp $      */
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -69,7 +69,7 @@
 #include "locators.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ralink_bus.c,v 1.2 2011/07/28 15:38:49 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_bus.c,v 1.3 2014/04/30 00:51:01 matt Exp $");
 #define        _MIPS_BUS_DMA_PRIVATE
 
 #include <sys/param.h>
@@ -91,10 +91,18 @@
        ._dmatag_ops = _BUS_DMATAG_OPS_INITIALIZER,
 };
 
+const bus_space_handle_t ra_sysctl_bsh =
+    (bus_space_handle_t) RA_IOREG_VADDR(RA_SYSCTL_BASE, 0);
+
 void
 ra_bus_init(void)
 {
        ra_bus_bus_mem_init(&ra_bus_memt, NULL);
+#ifdef DIAGNOSTIC
+       bus_space_handle_t bsh = 0xdeadfa11;
+       bus_space_map(&ra_bus_memt, RA_SYSCTL_BASE, 0x100, 0, &bsh);
+       KASSERT(ra_sysctl_bsh == bsh);
+#endif
 }
 
 /*
diff -r 2ccdf8278d1f -r 68bd740cb077 sys/arch/mips/ralink/ralink_var.h
--- a/sys/arch/mips/ralink/ralink_var.h Wed Apr 30 00:09:29 2014 +0000
+++ b/sys/arch/mips/ralink/ralink_var.h Wed Apr 30 00:51:01 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ralink_var.h,v 1.5 2012/02/01 02:05:14 matt Exp $      */
+/*     $NetBSD: ralink_var.h,v 1.6 2014/04/30 00:51:01 matt Exp $      */
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -41,8 +41,9 @@
 
 extern void ra_gpio_toggle_LED(void *);
 
-extern struct mips_bus_space     ra_bus_memt;
-extern struct mips_bus_dma_tag  ra_bus_dmat;
+extern struct mips_bus_space   ra_bus_memt;
+extern struct mips_bus_dma_tag ra_bus_dmat;
+extern const bus_space_handle_t        ra_sysctl_bsh;
 
 struct mainbus_attach_args {
        const char     *ma_name;



Home | Main Index | Thread Index | Old Index