On Mon, Jan 5, 2015 at 2:19 PM, Mark Kettenis <[email protected]> wrote:
>> From: sven falempin <[email protected]>
>> Date: Mon, 5 Jan 2015 13:29:41 -0500
>>
>> On Thu, Dec 11, 2014 at 7:47 AM, Stuart Henderson <[email protected]> wrote:
>> >
>> > On 2014/12/11 07:41, sven falempin wrote:
>> > > Thank you all,
>> > >
>> > > I grep(ed) -r NCT6 in sys and didn't find wbsio, I guess those
>> > > christmass holydays will be much welcome !
>> > >
>> > > Does the wbsio detect the watchdog in the apu card ?
>> >
>> > No, as the manual says, "Only the hardware monitoring function is
>> > currently supported", and at present, and this driver doesn't attach
>> > on the APU.
>>
>>
>>
>> First of all , Happy new gregorian Year 2015 !
>> I hope you all survived the longest night of the year :-)
>>
>> Jan  5 12:36:56 unicornD /bsd: HOIHOIHOI wbsio_probe: id 0xc4
>> Jan  5 12:36:56 unicornD /bsd: >>> probe for wbsio* clone into wbsio0
>> Jan  5 12:36:56 unicornD /bsd: wbsio0 at isa0 port 0x2e/2 rev 0x52
>> Jan  5 12:36:56 unicornD /bsd: >>> probing for lm*
>> Jan  5 12:36:56 unicornD /bsd: >>> lm probe returned 0
>>
>> Nothing really interesting so far , but I can read the revision number .
>>
>> What's next ?
>
> Hmm, chris@ just added the NCT5104D chip, which happens to have the
> same ID :(.  That will conflict with this diff.

To get thing straight the driver should read the complete ID, it 16 bit length :

 wbsio0 at isa0 port 0x2e/2: NCT6106D: complete devid? 0xc452 rev 0x52

Index: wbsio.c
===================================================================
RCS file: /cvs/src/sys/dev/isa/wbsio.c,v
retrieving revision 1.8
diff -u -p -r1.8 wbsio.c
--- wbsio.c     1 Jul 2012 02:15:09 -0000       1.8
+++ wbsio.c     7 Jan 2015 16:01:09 -0000
@@ -51,6 +51,7 @@ struct cfattach wbsio_ca = {
        sizeof(struct wbsio_softc),
        wbsio_probe,
        wbsio_attach
+       //?? ,wbsio_activate
 };
 struct cfdriver wbsio_cd = {
@@ -112,6 +113,7 @@ wbsio_probe(struct device *parent, void
        case WBSIO_ID_W83637HF:
        case WBSIO_ID_W83697HF:
        case WBSIO_ID_NCT6776F:
+       case WBSIO_ID_NCT6106D:
                ia->ipa_nio = 1;
                ia->ipa_io[0].length = WBSIO_IOSIZE;
                ia->ipa_nmem = 0;
@@ -130,7 +132,7 @@ wbsio_attach(struct device *parent, stru
        struct isa_attach_args *ia = aux;
        struct isa_attach_args nia;
        u_int8_t devid, reg, reg0, reg1;
-       u_int16_t iobase;
+       u_int16_t edevid,iobase;
        /* Map ISA I/O space */
        sc->sc_iot = ia->ia_iot;
@@ -173,8 +175,19 @@ wbsio_attach(struct device *parent, stru
        case WBSIO_ID_NCT6776F:
                printf(": NCT6776F");
                break;
+       case WBSIO_ID_NCT6106D:
+               printf(": NCT6106D");
+               break;
+    default:
+           printf(": devid? 0x%02x", devid);
+               break;
        }
+       /* Read complete device ID */
+       edevid = wbsio_conf_read(sc->sc_iot, sc->sc_ioh, WBSIO_ID) << 8
+                 | wbsio_conf_read(sc->sc_iot, sc->sc_ioh, WBSIO_ID + 1) ;
+    printf(": complete devid? 0x%04x", edevid);
+
        /* Read device revision */
        reg = wbsio_conf_read(sc->sc_iot, sc->sc_ioh, WBSIO_REV);
        printf(" rev 0x%02x", reg);
Index: wbsioreg.h
===================================================================
RCS file: /cvs/src/sys/dev/isa/wbsioreg.h,v
retrieving revision 1.3
diff -u -p -r1.3 wbsioreg.h
--- wbsioreg.h  1 Jul 2012 02:15:09 -0000       1.3
+++ wbsioreg.h  7 Jan 2015 16:01:09 -0000
@@ -43,6 +43,7 @@
 #define WBSIO_ID_W83637HF      0x70
 #define WBSIO_ID_W83697HF      0x60
 #define WBSIO_ID_NCT6776F      0xc3
+#define WBSIO_ID_NCT6106D      0xc4

Shall i go from current and remove the 8 bit id ? shall we read the
second byte only if the first is a NCT device ?

>
> Seems the NCT5104D is basically a stripped down NCT6106D that has just
> the watchdog timer, 4 UARTs and GPIO.  Perhaps some sort of probe is
> needed to see if a logical device is actually there.  I guess we
> already have one in place for the hardware monitoring function since
> we check the I/O address before attaching lm(4).
>






-- 
---------------------------------------------------------------------------------------------------------------------
() ascii ribbon campaign - against html e-mail
/\

Reply via email to