Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch Pull up following revision(s) (requested by tsut...



details:   https://anonhg.NetBSD.org/src/rev/128bbae43d91
branches:  netbsd-9
changeset: 461130:128bbae43d91
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Nov 16 16:55:46 2019 +0000

description:
Pull up following revision(s) (requested by tsutsui in ticket #430):

        sys/arch/arm/sa11x0/sa11x0_ost.c: revision 1.33
        sys/arch/zaurus/zaurus/autoconf.c: revision 1.13

Fix attach failure of zaudio(4) WM8731 (C7x0/860) and WM8750 (C1000/3x00).

The new MI iic(4) layer requires an explicit quirk info of PROBE_STRATEGY
via device properties.  Fixes PR kern/54658.

Should be pulled up to netbsd-9.

 -

Fix another attach failure of zaudio(4) WM8731 on Zaurus SL-C7x0/860.

When kernels were configured for both CPU_XSCALE_PXA270 and
CPU_XSCALE_PXA250, the OST freq value was not set until tc_init(9)
then all delay(9) during configure(9) returned immediately.

While here, use proper macro with description for readability.

Should be pulled up to netbsd-8 and netbsd-9.
(though zaudio(4) won't work on netbsd-8)

diffstat:

 sys/arch/arm/sa11x0/sa11x0_ost.c  |  23 ++++++++++++++++-------
 sys/arch/zaurus/zaurus/autoconf.c |  16 +++++++++++++---
 2 files changed, 29 insertions(+), 10 deletions(-)

diffs (97 lines):

diff -r 3e15a14188fb -r 128bbae43d91 sys/arch/arm/sa11x0/sa11x0_ost.c
--- a/sys/arch/arm/sa11x0/sa11x0_ost.c  Sat Nov 16 16:53:13 2019 +0000
+++ b/sys/arch/arm/sa11x0/sa11x0_ost.c  Sat Nov 16 16:55:46 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sa11x0_ost.c,v 1.32 2016/10/09 14:43:17 christos Exp $ */
+/*     $NetBSD: sa11x0_ost.c,v 1.32.20.1 2019/11/16 16:55:46 martin Exp $      */
 
 /*
  * Copyright (c) 1997 Mark Brinicombe.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sa11x0_ost.c,v 1.32 2016/10/09 14:43:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sa11x0_ost.c,v 1.32.20.1 2019/11/16 16:55:46 martin Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -80,14 +80,23 @@
 
 static struct saost_softc *saost_sc = NULL;
 
+#define PXA270_OST_FREQ                3250000         /* PXA270 uses 3.25MHz */
+#define SAOST_FREQ             3686400         /* Others use 3.6864MHz */
+#define SAOST_MAXFREQ          SAOST_FREQ
+
 #if defined(CPU_XSCALE_PXA270) && defined(CPU_XSCALE_PXA250)
+/*
+ * On dynamic configuration, assume fastest frequency for early delay(9)
+ * before tc_init(9), because longer delay(9) is almost harmless during
+ * device probe and initialization.
+ */
 #include <arm/xscale/pxa2x0cpu.h> 
-static uint32_t freq;
-#define TIMER_FREQUENCY         freq
+static uint32_t saost_freq = SAOST_MAXFREQ;
+#define TIMER_FREQUENCY                saost_freq
 #elif defined(CPU_XSCALE_PXA270)
-#define TIMER_FREQUENCY         3250000         /* PXA270 uses 3.25MHz */
+#define TIMER_FREQUENCY                PXA270_OST_FREQ
 #else
-#define TIMER_FREQUENCY         3686400         /* 3.6864MHz */
+#define TIMER_FREQUENCY                SAOST_FREQ
 #endif
 
 #ifndef STATHZ
@@ -230,7 +239,7 @@
        stathz = STATHZ;
        profhz = stathz;
 #if defined(CPU_XSCALE_PXA270) && defined(CPU_XSCALE_PXA250)
-       TIMER_FREQUENCY = (CPU_IS_PXA250) ? 3686400 : 3250000;
+       TIMER_FREQUENCY = (CPU_IS_PXA270) ? PXA270_OST_FREQ : SAOST_FREQ;
 #endif
        sc->sc_statclock_step = TIMER_FREQUENCY / stathz;
 
diff -r 3e15a14188fb -r 128bbae43d91 sys/arch/zaurus/zaurus/autoconf.c
--- a/sys/arch/zaurus/zaurus/autoconf.c Sat Nov 16 16:53:13 2019 +0000
+++ b/sys/arch/zaurus/zaurus/autoconf.c Sat Nov 16 16:55:46 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.12 2012/07/29 18:05:47 mlelstv Exp $    */
+/*     $NetBSD: autoconf.c,v 1.12.44.1 2019/11/16 16:55:46 martin Exp $        */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.12 2012/07/29 18:05:47 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.12.44.1 2019/11/16 16:55:46 martin Exp $");
 
 #include "opt_md.h"
 
@@ -43,6 +43,8 @@
 #include <sys/disk.h>
 #include <sys/kauth.h>
 
+#include <dev/i2c/i2cvar.h>
+
 #include <machine/intr.h>
 #include <machine/bootconfig.h>
 #include <machine/bootinfo.h>
@@ -219,5 +221,13 @@
 device_register(device_t dev, void *aux)
 {
 
-       /* Nothing to do */
+       /*
+        * I2C bus conntected to pxaiic(4) for zaudio(4) devices has
+        * limited capabilities.
+        */
+       if (device_is_a(dev, "iic") &&
+           device_is_a(dev->dv_parent, "ziic")) {
+               (void)prop_dictionary_set_cstring_nocopy(device_properties(dev),
+                   I2C_PROP_INDIRECT_PROBE_STRATEGY, I2C_PROBE_STRATEGY_NONE);
+       }
 }



Home | Main Index | Thread Index | Old Index