Like this ?
Index: wbsio.c
===================================================================
RCS file: /cvs/src/sys/dev/isa/wbsio.c,v
retrieving revision 1.9
diff -u -p -r1.9 wbsio.c
--- wbsio.c 2 Jan 2015 23:02:54 -0000 1.9
+++ wbsio.c 8 Jan 2015 17:33:46 -0000
@@ -110,9 +110,12 @@ wbsio_probe(struct device *parent, void
case WBSIO_ID_W83627DHGP:
case WBSIO_ID_W83627UHG:
case WBSIO_ID_W83637HF:
- case WBSIO_ID_W83697HF:
- case WBSIO_ID_NCT6776F:
- case WBSIO_ID_NCT5104D:
+ case WBSIO_ID_W83697HF:
+ case WBSIO_ID_NCT5104D & WBSIO_ID_NCT6106D:
+ case WBSIO_ID_NCT6775F:
+ case WBSIO_ID_NCT6776F:
+ case WBSIO_ID_NCT6779D:
+ case WBSIO_ID_NCT6791D:
ia->ipa_nio = 1;
ia->ipa_io[0].length = WBSIO_IOSIZE;
ia->ipa_nmem = 0;
@@ -170,13 +173,34 @@ wbsio_attach(struct device *parent, stru
break;
case WBSIO_ID_W83697HF:
printf(": W83697HF");
- break;
- case WBSIO_ID_NCT6776F:
- printf(": NCT6776F");
- break;
- case WBSIO_ID_NCT5104D:
- printf(": NCT5104D");
- break;
+ break;
+ case WBSIO_ID_NCT5104D: /*WBSIO_ID_NCT6106D*/
+ case WBSIO_ID_NCT6775F:
+ case WBSIO_ID_NCT6776F:
+ case WBSIO_ID_NCT6779D:
+ case WBSIO_ID_NCT6791D:
+ /* Read complete device ID, push ext before */
+ devid |= wbsio_conf_read(sc->sc_iot, sc->sc_ioh,
WBSIO_ID + 1) << 8;
+ switch (devid >> 8) {
+ case WBSIO_ID_NCT5104D:
+ printf(": NCT5104D");
+ break;
+ case WBSIO_ID_NCT6106D_EXT:
+ printf(": NCT6106D");
+ break;
+ case WBSIO_ID_NCT6775F_EXT:
+ printf(": NCT6775F");
+ break;
+ case WBSIO_ID_NCT6776F_EXT:
+ printf(": NCT6776F");
+ break;
+ case WBSIO_ID_NCT6779D_EXT:
+ printf(": NCT6779D");
+ break;
+ case WBSIO_ID_NCT6791D_EXT:
+ printf(": NCT6791D");
+ break;
+ }
}
/* Read device revision */
Index: wbsioreg.h
===================================================================
RCS file: /cvs/src/sys/dev/isa/wbsioreg.h,v
retrieving revision 1.4
diff -u -p -r1.4 wbsioreg.h
--- wbsioreg.h 2 Jan 2015 23:02:54 -0000 1.4
+++ wbsioreg.h 8 Jan 2015 17:33:46 -0000
@@ -42,8 +42,18 @@
#define WBSIO_ID_W83627SF 0x59
#define WBSIO_ID_W83637HF 0x70
#define WBSIO_ID_W83697HF 0x60
-#define WBSIO_ID_NCT6776F 0xc3
-#define WBSIO_ID_NCT5104D 0xc4
+#define WBSIO_ID_NCT5104D 0xc4
+#define WBSIO_ID_NCT5104D_EXT 0x52
+#define WBSIO_ID_NCT6106D 0xc4
+#define WBSIO_ID_NCT6106D_EXT 0x50
+#define WBSIO_ID_NCT6775F 0xb4
+#define WBSIO_ID_NCT6775F_EXT 0x70
+#define WBSIO_ID_NCT6776F 0xc3
+#define WBSIO_ID_NCT6776F_EXT 0x30
+#define WBSIO_ID_NCT6779D 0xc5
+#define WBSIO_ID_NCT6779D_EXT 0x60
+#define WBSIO_ID_NCT6791D 0xc8
+#define WBSIO_ID_NCT6791D_EXT 0x00
/* Logical Device Number (LDN) Assignments */
#define WBSIO_LDN_HM 0x0b
On Thu, Jan 8, 2015 at 11:13 AM, sven falempin <[email protected]> wrote:
> Please tell me the way you'd like
>
> Index: dev/isa/wbsio.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/isa/wbsio.c,v
> retrieving revision 1.8
> diff -u -p -r1.8 wbsio.c
> --- dev/isa/wbsio.c 1 Jul 2012 02:15:09 -0000 1.8
> +++ dev/isa/wbsio.c 8 Jan 2015 16:04:55 -0000
>
> @@ -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;
> @@ -129,8 +131,8 @@ wbsio_attach(struct device *parent, stru
> struct wbsio_softc *sc = (void *)self;
> struct isa_attach_args *ia = aux;
> struct isa_attach_args nia;
> - u_int8_t devid, reg, reg0, reg1;
> - u_int16_t iobase;
> + u_int8_t reg, reg0, reg1;
> + u_int16_t devid, iobase;
>
> /* Map ISA I/O space */
> sc->sc_iot = ia->ia_iot;
> @@ -169,9 +171,33 @@ wbsio_attach(struct device *parent, stru
> break;
> case WBSIO_ID_W83697HF:
> printf(": W83697HF");
> - break;
> - case WBSIO_ID_NCT6776F:
> - printf(": NCT6776F");
> + break;
> + case WBSIO_ID_NCT6776F:
> + case WBSIO_ID_NCT6106D:
> + case WBSIO_ID_NCT6775F:
> + case WBSIO_ID_NCT6779D:
> + case WBSIO_ID_NCT6791D:
> + /* Read complete device ID, push ext before */
> + devid |= wbsio_conf_read(sc->sc_iot, sc->sc_ioh, WBSIO_ID + 1) << 8;
> + switch (devid >> 8) {
> + case WBSIO_ID_NCT6106D_EXT:
> + printf(": NCT6106D");
> + break;
> + case WBSIO_ID_NCT6776F_EXT:
> + printf(": NCT6776F");
> + break;
> + case WBSIO_ID_NCT6775F_EXT:
> + printf(": NCT6775F");
> + break;
> + case WBSIO_ID_NCT6779D_EXT:
> + printf(": NCT6779D");
> + break;
> + case WBSIO_ID_NCT6791D_EXT:
> + printf(": NCT6791D");
> + break;
> + }
> + default:
> + printf(": devid? 0x%02x", devid);
> break;
> }
>
> Index: dev/isa/wbsioreg.h
> ===================================================================
> RCS file: /cvs/src/sys/dev/isa/wbsioreg.h,v
> retrieving revision 1.3
> diff -u -p -r1.3 wbsioreg.h
> --- dev/isa/wbsioreg.h 1 Jul 2012 02:15:09 -0000 1.3
> +++ dev/isa/wbsioreg.h 8 Jan 2015 16:04:55 -0000
> @@ -43,6 +43,16 @@
> #define WBSIO_ID_W83637HF 0x70
> #define WBSIO_ID_W83697HF 0x60
> #define WBSIO_ID_NCT6776F 0xc3
> +#define WBSIO_ID_NCT6776F_EXT 0x30
> +#define WBSIO_ID_NCT6106D 0xc4
> +#define WBSIO_ID_NCT6106D_EXT 0x50
> +#define WBSIO_ID_NCT6775F 0xb4
> +#define WBSIO_ID_NCT6775F_EXT 0x70
> +#define WBSIO_ID_NCT6779D 0xc5
> +#define WBSIO_ID_NCT6779D_EXT 0x60
> +#define WBSIO_ID_NCT6791D 0xc8
> +#define WBSIO_ID_NCT6791D_EXT 0x00
> +
>
> /* Logical Device Number (LDN) Assignments */
> #define WBSIO_LDN_HM 0x0b
>
> On Wed, Jan 7, 2015 at 11:03 AM, sven falempin <[email protected]>
> wrote:
>> 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
>> /\
>
>
>
> --
> ---------------------------------------------------------------------------------------------------------------------
> () ascii ribbon campaign - against html e-mail
> /\
--
---------------------------------------------------------------------------------------------------------------------
() ascii ribbon campaign - against html e-mail
/\