Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/sociox DRT about config messages



details:   https://anonhg.NetBSD.org/src/rev/af9003bfa572
branches:  trunk
changeset: 970502:af9003bfa572
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Wed Mar 25 23:20:38 2020 +0000

description:
DRT about config messages

diffstat:

 sys/arch/arm/sociox/sni_emmc.c |   8 ++++--
 sys/arch/arm/sociox/sni_i2c.c  |  48 +++++++++++++++++++++--------------------
 2 files changed, 30 insertions(+), 26 deletions(-)

diffs (162 lines):

diff -r 66089df6821e -r af9003bfa572 sys/arch/arm/sociox/sni_emmc.c
--- a/sys/arch/arm/sociox/sni_emmc.c    Wed Mar 25 22:15:53 2020 +0000
+++ b/sys/arch/arm/sociox/sni_emmc.c    Wed Mar 25 23:20:38 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sni_emmc.c,v 1.5 2020/03/25 22:15:53 nisimura Exp $    */
+/*     $NetBSD: sni_emmc.c,v 1.6 2020/03/25 23:20:38 nisimura Exp $    */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sni_emmc.c,v 1.5 2020/03/25 22:15:53 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sni_emmc.c,v 1.6 2020/03/25 23:20:38 nisimura Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -132,6 +132,7 @@
        }
 
        aprint_naive("\n");
+       aprint_normal_dev(self, "Socionext eMMC controller\n");
        aprint_normal_dev(self, "interrupting on %s\n", intrstr);
 
        sc->sc.sc_dev = self;
@@ -199,6 +200,7 @@
        }
 
        aprint_naive("\n");
+       aprint_normal_dev(self, "Socionext eMMC controller\n");
 
        sc->sc.sc_dev = self;
        sc->sc.sc_dmat = aa->aa_dmat;
@@ -227,7 +229,7 @@
        sc->sc.sc_flags |= SDHC_FLAG_32BIT_ACCESS;
        sc->sc.sc_clkbase = 50000;      /* Default to 50MHz */
 
-       aprint_normal_dev(sc->sc.sc_dev, "Socionext eMMC controller\n");
+       aprint_normal_dev(sc->sc.sc_dev, "doing sdhc_host() ...\n");
 #if 0
        error = sdhc_host_found(&sc->sc, sc->sc_iot, sc->sc_ioh, sc->sc_ios);
 #endif
diff -r 66089df6821e -r af9003bfa572 sys/arch/arm/sociox/sni_i2c.c
--- a/sys/arch/arm/sociox/sni_i2c.c     Wed Mar 25 22:15:53 2020 +0000
+++ b/sys/arch/arm/sociox/sni_i2c.c     Wed Mar 25 23:20:38 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sni_i2c.c,v 1.5 2020/03/25 22:15:53 nisimura Exp $     */
+/*     $NetBSD: sni_i2c.c,v 1.6 2020/03/25 23:20:38 nisimura Exp $     */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sni_i2c.c,v 1.5 2020/03/25 22:15:53 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sni_i2c.c,v 1.6 2020/03/25 23:20:38 nisimura Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -61,7 +61,6 @@
 struct sniiic_softc {
        device_t                sc_dev;
        struct i2c_controller   sc_ic;
-       device_t                sc_i2cdev;
        bus_space_tag_t         sc_iot;
        bus_space_handle_t      sc_ioh;
        bus_addr_t              sc_iob;
@@ -70,8 +69,7 @@
        kmutex_t                sc_lock;
        kmutex_t                sc_mtx;
        kcondvar_t              sc_cv;
-       int                     sc_opflags;
-       bool                    sc_busy;
+       volatile bool           sc_busy;
        int                     sc_phandle;
 };
 
@@ -81,6 +79,8 @@
 CFATTACH_DECL_NEW(sniiic_acpi, sizeof(struct sniiic_softc),
     sniiic_acpi_match, sniiic_acpi_attach, NULL, NULL);
 
+void sni_i2c_common_i(struct sniiic_softc *);
+
 static int sni_i2c_acquire_bus(void *, int);
 static void sni_i2c_release_bus(void *, int);
 static int sni_i2c_exec(void *, i2c_op_t, i2c_addr_t, const void *,
@@ -148,7 +148,6 @@
        }
 
        aprint_naive("\n");
-       aprint_normal_dev(self, "Socionext I2C controller\n");
        aprint_normal_dev(self, "interrupting on %s\n", intrstr);
 
        sc->sc_dev = self;
@@ -156,15 +155,8 @@
        sc->sc_ioh = ioh;
        sc->sc_iob = addr;
        sc->sc_ios = size;
-       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
-       mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_BIO);
-       cv_init(&sc->sc_cv, device_xname(self));
 
-       iic_tag_init(&sc->sc_ic);
-       sc->sc_ic.ic_cookie = sc;
-       sc->sc_ic.ic_acquire_bus = sni_i2c_acquire_bus;
-       sc->sc_ic.ic_release_bus = sni_i2c_release_bus;
-       sc->sc_ic.ic_exec = sni_i2c_exec;
+       sni_i2c_common_i(sc);
 
        fdtbus_register_i2c_controller(self, phandle, &sni_i2c_funcs);
 #if 0
@@ -226,22 +218,14 @@
        }
 
        aprint_naive("\n");
-       aprint_normal_dev(self, "Socionext I2C controller\n");
 
        sc->sc_dev = self;
        sc->sc_iot = aa->aa_memt;
        sc->sc_ioh = ioh;
        sc->sc_iob = mem->ar_base;
        sc->sc_ios = mem->ar_length;
-       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
-       mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_NET);
-       cv_init(&sc->sc_cv, device_xname(self));
 
-       iic_tag_init(&sc->sc_ic);       
-       sc->sc_ic.ic_cookie = sc;
-       sc->sc_ic.ic_acquire_bus = sni_i2c_acquire_bus;
-       sc->sc_ic.ic_release_bus = sni_i2c_release_bus;
-       sc->sc_ic.ic_exec = sni_i2c_exec;
+       sni_i2c_common_i(sc);
 
        memset(&iba, 0, sizeof(iba));
        iba.iba_tag = &sc->sc_ic;
@@ -258,6 +242,24 @@
        return;
 }
 
+void
+sni_i2c_common_i(struct sniiic_softc *sc)
+{
+
+       aprint_normal_dev(sc->sc_dev, "Socionext I2C controller\n");
+
+       iic_tag_init(&sc->sc_ic);
+       sc->sc_ic.ic_cookie = sc;
+       sc->sc_ic.ic_acquire_bus = sni_i2c_acquire_bus;
+       sc->sc_ic.ic_release_bus = sni_i2c_release_bus;
+       sc->sc_ic.ic_exec = sni_i2c_exec;
+       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
+       mutex_init(&sc->sc_mtx, MUTEX_DEFAULT, IPL_BIO);
+       cv_init(&sc->sc_cv, device_xname(sc->sc_dev));
+
+       /* no attach here */
+}
+
 static int
 sni_i2c_acquire_bus(void *opaque, int flags)
 {



Home | Main Index | Thread Index | Old Index