Discussion:
modem support MT9234ZPX-PCIE-NV
(too old to reply)
Willy Offermans
2011-05-21 09:33:23 UTC
Permalink
Dear FreeBSD friends,

I need support with a MultiTech modem, MT9234ZPX-PCIE-NV
(http://www.multitech.com/en_US/PRODUCTS/Families/MultiModemZPX/)

The modem is recognised during the boot event:

<snip>
pci6: <simple comms, UART> at device 0.0 (no driver attached)
</snip>

and also appears in the list of found hardware over the PCI bus:

<snip>
***@pci0:6:0:0: class=0x070002 card=0x20262205 chip=0x015213a8 rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
</snip>

However, as the boot process already mentions, there is no driver attached
and I cannot get the modem to appear as an accessible and functional
device. Is there someone, who can help me to get this modem to work?
--
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,
De jrus wah,

Willy

*************************************
W.K. Offermans
Home: +31 45 544 49 44
Mobile: +31 681 15 87 68
e-mail: ***@Offermans.Rompen.nl
Jeremy Chadwick
2011-05-22 07:30:46 UTC
Permalink
Post by Willy Offermans
Dear FreeBSD friends,
I need support with a MultiTech modem, MT9234ZPX-PCIE-NV
(http://www.multitech.com/en_US/PRODUCTS/Families/MultiModemZPX/)
<snip>
pci6: <simple comms, UART> at device 0.0 (no driver attached)
</snip>
<snip>
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
</snip>
However, as the boot process already mentions, there is no driver attached
and I cannot get the modem to appear as an accessible and functional
device. Is there someone, who can help me to get this modem to work?
It would be helpful if you could specify what FreeBSD version you're
using.

Assuming 8.2 or RELENG_8: no promises, but puc(4) is probably what
you're looking for. I would try adding:

puc_load="yes"

To your /boot/loader.conf, then see what happens after booting. uart(4)
may auto-attach to that. Again, no promises.
--
| Jeremy Chadwick ***@parodius.com |
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP 4BD6C0CB |
Daniel O'Connor
2011-05-22 08:50:45 UTC
Permalink
Post by Jeremy Chadwick
Post by Willy Offermans
However, as the boot process already mentions, there is no driver attached
and I cannot get the modem to appear as an accessible and functional
device. Is there someone, who can help me to get this modem to work?
It would be helpful if you could specify what FreeBSD version you're
using.
Assuming 8.2 or RELENG_8: no promises, but puc(4) is probably what
puc_load="yes"
To your /boot/loader.conf, then see what happens after booting. uart(4)
may auto-attach to that. Again, no promises.
I have my doubts it would work though, most likely it's a soft modem which will only work with proprietary drivers.

I couldn't find any details on the web page though so you might get lucky I suppose :)

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
Willy Offermans
2011-05-25 14:11:40 UTC
Permalink
Dear Daniel and FreeBSD friends,
Post by Daniel O'Connor
Post by Jeremy Chadwick
Post by Willy Offermans
However, as the boot process already mentions, there is no driver attached
and I cannot get the modem to appear as an accessible and functional
device. Is there someone, who can help me to get this modem to work?
It would be helpful if you could specify what FreeBSD version you're
using.
Assuming 8.2 or RELENG_8: no promises, but puc(4) is probably what
puc_load="yes"
To your /boot/loader.conf, then see what happens after booting. uart(4)
may auto-attach to that. Again, no promises.
I have my doubts it would work though, most likely it's a soft modem which will only work with proprietary drivers.
I couldn't find any details on the web page though so you might get lucky I suppose :)
--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
According to the manufacturer
(http://www.multitech.com/en_US/PRODUCTS/Families/MultiModemZPX/)
it is not a soft modem, but a ``hardware'' modem. It says: Built-in
processor does the work, so your computer doesn't have to. I do not know if
this is sufficient to work under FreeBSD, but it seems to indicate that it
does not need any proprietary driver.
--
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,

Willy

*************************************
W.K. Offermans
Home: +31 45 544 49 44
Mobile: +31 681 15 87 68
e-mail: ***@Offermans.Rompen.nl
Daniel O'Connor
2011-05-25 14:32:53 UTC
Permalink
Post by Willy Offermans
According to the manufacturer
(http://www.multitech.com/en_US/PRODUCTS/Families/MultiModemZPX/)
it is not a soft modem, but a ``hardware'' modem. It says: Built-in
processor does the work, so your computer doesn't have to. I do not know if
this is sufficient to work under FreeBSD, but it seems to indicate that it
does not need any proprietary driver.
Ahh, sounds promising..
You could just try adding the device IDs to the PUC driver and seeing what happens.

Failing that ask Multitech if they can help you out.

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
Willy Offermans
2011-05-25 14:06:06 UTC
Permalink
Hello Jeremy and FreeBSD friends,
Post by Jeremy Chadwick
Post by Willy Offermans
Dear FreeBSD friends,
I need support with a MultiTech modem, MT9234ZPX-PCIE-NV
(http://www.multitech.com/en_US/PRODUCTS/Families/MultiModemZPX/)
<snip>
pci6: <simple comms, UART> at device 0.0 (no driver attached)
</snip>
<snip>
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
</snip>
However, as the boot process already mentions, there is no driver attached
and I cannot get the modem to appear as an accessible and functional
device. Is there someone, who can help me to get this modem to work?
It would be helpful if you could specify what FreeBSD version you're
using.
Assuming 8.2 or RELENG_8: no promises, but puc(4) is probably what
puc_load="yes"
To your /boot/loader.conf, then see what happens after booting. uart(4)
may auto-attach to that. Again, no promises.
--
| Parodius Networking http://www.parodius.com/ |
| UNIX Systems Administrator Mountain View, CA, USA |
| Making life hard for others since 1977. PGP 4BD6C0CB |
I'm using FreeBSD 7.2-RELEASE-p2. I have enclosed the dmesg.boot file.

puc was already incorporated into the kernel:

kosmos# kldload -v puc
kldload: can't load puc: File exists

So I assume puc has already been loaded.
--
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,
De jrus wah,

Willy

*************************************
Dr. W.K. Offermans
CAT Postdoctoral Fellow
CAT Catalytic Center
Institut für Technische und Makromolekulare Chemie
RWTH Aachen
Worringerweg 1, Raum 38C-150
D-52074 Aachen, Germany
Phone: +49 241 80 28592
Fax: +49 241 80 22593
Home: +31 45 544 49 44
Mobile: +31 681 15 87 68
e-mail: ***@Offermans.Rompen.nl
e-mail: ***@CatalyticCenter.RWTH-Aachen.de

Powered by ....

(__)
\\\'',)
\/ \ ^
.\._/_)

www.FreeBSD.org
Daniel O'Connor
2011-05-25 15:25:45 UTC
Permalink
Post by Willy Offermans
I'm using FreeBSD 7.2-RELEASE-p2. I have enclosed the dmesg.boot file.
kosmos# kldload -v puc
kldload: can't load puc: File exists
So I assume puc has already been loaded.
You could try editing /usr/src/sys/dev/puc/pucdata.c to add your card's ID and then rebuild & reload the puc module.

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
John Baldwin
2011-05-25 16:36:51 UTC
Permalink
Post by Willy Offermans
Dear FreeBSD friends,
I need support with a MultiTech modem, MT9234ZPX-PCIE-NV
(http://www.multitech.com/en_US/PRODUCTS/Families/MultiModemZPX/)
<snip>
pci6: <simple comms, UART> at device 0.0 (no driver attached)
</snip>
<snip>
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
</snip>
However, as the boot process already mentions, there is no driver attached
and I cannot get the modem to appear as an accessible and functional
device. Is there someone, who can help me to get this modem to work?
Try this patch to sys/dev/uart/uart_bus_pci.c:

Index: uart_bus_pci.c
===================================================================
--- uart_bus_pci.c (revision 222248)
+++ uart_bus_pci.c (working copy)
@@ -110,6 +110,7 @@ static struct pci_id pci_ns8250_ids[] = {
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950
UART",
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
+{ 0x13a8, 0x0152, 0x2205, 0x2026, "MultiTech MultiModem ZPX", 0x10 },
{ 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 },
--
John Baldwin
Willy Offermans
2011-05-26 19:02:05 UTC
Permalink
Dear John and FreeBSD friends,
Post by Willy Offermans
Post by Willy Offermans
Dear FreeBSD friends,
I need support with a MultiTech modem, MT9234ZPX-PCIE-NV
(http://www.multitech.com/en_US/PRODUCTS/Families/MultiModemZPX/)
<snip>
pci6: <simple comms, UART> at device 0.0 (no driver attached)
</snip>
<snip>
rev=0x02 hdr=0x00
Post by Willy Offermans
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
</snip>
However, as the boot process already mentions, there is no driver attached
and I cannot get the modem to appear as an accessible and functional
device. Is there someone, who can help me to get this modem to work?
Index: uart_bus_pci.c
===================================================================
--- uart_bus_pci.c (revision 222248)
+++ uart_bus_pci.c (working copy)
@@ -110,6 +110,7 @@ static struct pci_id pci_ns8250_ids[] = {
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950
UART",
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
+{ 0x13a8, 0x0152, 0x2205, 0x2026, "MultiTech MultiModem ZPX", 0x10 },
{ 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 },
--
John Baldwin
I have applied your suggested patch.

Upon reboot the system showed an extra serial device:
crw-rw---- 1 uucp dialer 0, 36 May 26 19:13 /dev/cuau0
crw-rw---- 1 uucp dialer 0, 37 May 26 19:00 /dev/cuau0.init
crw-rw---- 1 uucp dialer 0, 38 May 26 19:00 /dev/cuau0.lock
crw-rw---- 1 uucp dialer 0, 55 May 26 19:00 /dev/cuau1
crw-rw---- 1 uucp dialer 0, 56 May 26 19:00 /dev/cuau1.init
crw-rw---- 1 uucp dialer 0, 57 May 26 19:00 /dev/cuau1.lock
crw-rw---- 1 uucp dialer 0, 61 May 26 19:00 /dev/cuau2
crw-rw---- 1 uucp dialer 0, 62 May 26 19:00 /dev/cuau2.init
crw-rw---- 1 uucp dialer 0, 63 May 26 19:00 /dev/cuau2.lock

the boot messages concerning uart were:

uart0: failed to enable port mapping!
uart0: failed to enable port mapping!
uart0: <16750 or compatible> mem 0xfbfffc00-0xfbffffff irq 16 at device 0.0 on pci6
uart0: [FILTER]
uart1: <16550 or compatible> port 0x3f8-0x3ff irq 4 on acpi0
uart1: [FILTER]
uart2: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0
uart2: [FILTER]

pciconf -lv gave the following:

***@pci0:6:0:0: class=0x070002 card=0x20262205 chip=0x015213a8 rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART

However minicom was not able to initialise the modem properly. I only saw
some ooo.oo signs.

HylaFAX could find the modem, but was not able to initialise it:

HylaFAX scheduler on localhost: Running
Modem modem (+31455******): Waiting for modem to come ready

In the debug.log:

May 26 20:57:05 kosmos HylaFAX[2889]: Parsing hostPort(): "EPRT"
May 26 20:57:05 kosmos HylaFAX[2889]: Parsing "|1|127.0.0.1|62073|"
May 26 20:57:05 kosmos HylaFAX[2889]: `-> s.length() = 19
May 26 20:57:05 kosmos HylaFAX[2889]: `-> s[0] = '|'
May 26 20:57:05 kosmos HylaFAX[2889]: `-> s[2] = '|'
May 26 20:57:05 kosmos HylaFAX[2889]: `-> s[18] = '|'
May 26 20:57:05 kosmos HylaFAX[2889]: Looks like extended syntax: "|1|127.0.0.1|62073|" [7C: |]
May 26 20:57:05 kosmos HylaFAX[2889]: `-> Got a: 127.0.0.1[13]
May 26 20:57:05 kosmos HylaFAX[2889]: `-> Got a: 62073[19]
May 26 20:57:05 kosmos HylaFAX[2889]: Parsed: Family 1 Address 127.0.0.1 Port 62073
May 26 20:57:06 kosmos HylaFAX[2891]: Parsing hostPort(): "EPRT"
May 26 20:57:06 kosmos HylaFAX[2891]: Parsing "|1|127.0.0.1|60536|"
May 26 20:57:06 kosmos HylaFAX[2891]: `-> s.length() = 19
May 26 20:57:06 kosmos HylaFAX[2891]: `-> s[0] = '|'
May 26 20:57:06 kosmos HylaFAX[2891]: `-> s[2] = '|'
May 26 20:57:06 kosmos HylaFAX[2891]: `-> s[18] = '|'
May 26 20:57:06 kosmos HylaFAX[2891]: Looks like extended syntax: "|1|127.0.0.1|60536|" [7C: |]
May 26 20:57:06 kosmos HylaFAX[2891]: `-> Got a: 127.0.0.1[13]
May 26 20:57:06 kosmos HylaFAX[2891]: `-> Got a: 60536[19]
May 26 20:57:06 kosmos HylaFAX[2891]: Parsed: Family 1 Address 127.0.0.1 Port 60536


So it looks promising, but the goal has not been achieved yet.

Is there something that needs to be done?
--
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,

Willy

*************************************
W.K. Offermans
Home: +31 45 544 49 44
Mobile: +31 681 15 87 68
e-mail: ***@Offermans.Rompen.nl
John Baldwin
2011-05-26 20:13:48 UTC
Permalink
Post by Willy Offermans
Dear John and FreeBSD friends,
Post by Willy Offermans
Post by Willy Offermans
Dear FreeBSD friends,
I need support with a MultiTech modem, MT9234ZPX-PCIE-NV
(http://www.multitech.com/en_US/PRODUCTS/Families/MultiModemZPX/)
<snip>
pci6: <simple comms, UART> at device 0.0 (no driver attached)
</snip>
<snip>
rev=0x02 hdr=0x00
Post by Willy Offermans
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
</snip>
However, as the boot process already mentions, there is no driver attached
and I cannot get the modem to appear as an accessible and functional
device. Is there someone, who can help me to get this modem to work?
Index: uart_bus_pci.c
===================================================================
--- uart_bus_pci.c (revision 222248)
+++ uart_bus_pci.c (working copy)
@@ -110,6 +110,7 @@ static struct pci_id pci_ns8250_ids[] = {
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950
UART",
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
+{ 0x13a8, 0x0152, 0x2205, 0x2026, "MultiTech MultiModem ZPX", 0x10 },
{ 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 },
--
John Baldwin
I have applied your suggested patch.
crw-rw---- 1 uucp dialer 0, 36 May 26 19:13 /dev/cuau0
crw-rw---- 1 uucp dialer 0, 37 May 26 19:00 /dev/cuau0.init
crw-rw---- 1 uucp dialer 0, 38 May 26 19:00 /dev/cuau0.lock
crw-rw---- 1 uucp dialer 0, 55 May 26 19:00 /dev/cuau1
crw-rw---- 1 uucp dialer 0, 56 May 26 19:00 /dev/cuau1.init
crw-rw---- 1 uucp dialer 0, 57 May 26 19:00 /dev/cuau1.lock
crw-rw---- 1 uucp dialer 0, 61 May 26 19:00 /dev/cuau2
crw-rw---- 1 uucp dialer 0, 62 May 26 19:00 /dev/cuau2.init
crw-rw---- 1 uucp dialer 0, 63 May 26 19:00 /dev/cuau2.lock
uart0: failed to enable port mapping!
uart0: failed to enable port mapping!
uart0: <16750 or compatible> mem 0xfbfffc00-0xfbffffff irq 16 at device 0.0 on pci6
uart0: [FILTER]
Hmm, can you get 'pciconf -lb' output?

Hmm, wow, I wonder how uart(4) works at all. It tries to reuse it's softc
structure in uart_bus_attach() that was setup in uart_bus_probe(). Since it
doesn't return 0 from its probe routine, that is forbidden. I guess it
accidentally works because of the hack where we call DEVICE_PROBE() again
to make sure the device description is correct.
--
John Baldwin
Mike Tancsa
2011-05-26 21:01:00 UTC
Permalink
Post by John Baldwin
Hmm, can you get 'pciconf -lb' output?
Hmm, wow, I wonder how uart(4) works at all. It tries to reuse it's softc
structure in uart_bus_attach() that was setup in uart_bus_probe(). Since it
doesn't return 0 from its probe routine, that is forbidden. I guess it
accidentally works because of the hack where we call DEVICE_PROBE() again
to make sure the device description is correct.
I think this is a similar card. Had it laying about for a while and
popped it in. cu -l to it, attaches, but I am not able to interact with it.

***@pci0:5:0:0: class=0x070002 card=0x20282205 chip=0x015213a8
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
bar [10] = type Memory, range 32, base 0xe8950000, size 1024, enabled


NetBSD supposedly has support for this card

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/pci/pucdata.c.diff?r1=1.43&r2=1.44


---Mike
--
-------------------
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, ***@sentex.net
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada http://www.tancsa.com/
Willy Offermans
2011-05-27 07:37:13 UTC
Permalink
Post by Mike Tancsa
Post by John Baldwin
Hmm, can you get 'pciconf -lb' output?
Hmm, wow, I wonder how uart(4) works at all. It tries to reuse it's softc
structure in uart_bus_attach() that was setup in uart_bus_probe(). Since it
doesn't return 0 from its probe routine, that is forbidden. I guess it
accidentally works because of the hack where we call DEVICE_PROBE() again
to make sure the device description is correct.
I think this is a similar card. Had it laying about for a while and
popped it in. cu -l to it, attaches, but I am not able to interact with it.
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
bar [10] = type Memory, range 32, base 0xe8950000, size 1024, enabled
NetBSD supposedly has support for this card
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dev/pci/pucdata.c.diff?r1=1.43&r2=1.44
---Mike
--
-------------------
Mike Tancsa, tel +1 519 651 3400
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada http://www.tancsa.com/
I guess you refer to this part:

+ { "EXAR XR17D152",
+ { 0x13a8, 0x0152, 0, 0 },
+ { 0xffff, 0xffff, 0, 0 },
+ {
+ { PUC_PORT_TYPE_COM, 0x10, 0x0000, COM_FREQ * 8 },
+ { PUC_PORT_TYPE_COM, 0x10, 0x0200, COM_FREQ * 8 },
+ },
+ },

I also found this link, but I cannot do anything with the entries. Maybe a
developer can use this.
--
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,

Willy

*************************************
W.K. Offermans
Home: +31 45 544 49 44
Mobile: +31 681 15 87 68
e-mail: ***@Offermans.Rompen.nl
John Baldwin
2011-05-27 12:24:27 UTC
Permalink
Post by Mike Tancsa
Post by John Baldwin
Hmm, can you get 'pciconf -lb' output?
Hmm, wow, I wonder how uart(4) works at all. It tries to reuse it's softc
structure in uart_bus_attach() that was setup in uart_bus_probe(). Since it
doesn't return 0 from its probe routine, that is forbidden. I guess it
accidentally works because of the hack where we call DEVICE_PROBE() again
to make sure the device description is correct.
I think this is a similar card. Had it laying about for a while and
popped it in. cu -l to it, attaches, but I am not able to interact with it.
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
bar [10] = type Memory, range 32, base 0xe8950000, size 1024, enabled
NetBSD supposedly has support for this card
Oh, hmm, looks like the clock has an unusual multiplier. Does it work if you
use 'cu -l -s 1200' to talk at 9600 for example? (In general use speed / 8
as the speed to '-s'.)

Also, is your card a modem or a dual-port card?
--
John Baldwin
Mike Tancsa
2011-05-27 12:33:23 UTC
Permalink
Post by John Baldwin
Oh, hmm, looks like the clock has an unusual multiplier. Does it work if you
use 'cu -l -s 1200' to talk at 9600 for example? (In general use speed / 8
as the speed to '-s'.)
Also, is your card a modem or a dual-port card?
Its a 3G modem.

---Mike
--
-------------------
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, ***@sentex.net
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada http://www.tancsa.com/
Willy Offermans
2011-05-27 14:38:37 UTC
Permalink
Dear John and FreeBSD friends,
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
Hmm, can you get 'pciconf -lb' output?
Hmm, wow, I wonder how uart(4) works at all. It tries to reuse it's softc
structure in uart_bus_attach() that was setup in uart_bus_probe(). Since
it
Post by Mike Tancsa
Post by John Baldwin
doesn't return 0 from its probe routine, that is forbidden. I guess it
accidentally works because of the hack where we call DEVICE_PROBE() again
to make sure the device description is correct.
I think this is a similar card. Had it laying about for a while and
popped it in. cu -l to it, attaches, but I am not able to interact with it.
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
bar [10] = type Memory, range 32, base 0xe8950000, size 1024, enabled
NetBSD supposedly has support for this card
Oh, hmm, looks like the clock has an unusual multiplier. Does it work if you
use 'cu -l -s 1200' to talk at 9600 for example? (In general use speed / 8
as the speed to '-s'.)
Also, is your card a modem or a dual-port card?
--
John Baldwin
It is a modem.

As suggested:

kosmos# cu -l /dev/cuau0 -s 1200
Stale lock on cuau0 PID=3642... overriding.
Connected
at&F
OK
atdt0045*******
NO DIALTONE

The last message can be explained. There is no line connected yet. But this
looks very promising again. What do you exactly mean with ``Oh, hmm, looks
like the clock has an unusual multiplier.'' What kind of multiplier are you
talking about?

How to proceed?

B.t.w. cu looks like a nice tool. I was not aware of its existence.
--
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,
De jrus wah,

Willy

*************************************
W.K. Offermans
Home: +31 45 544 49 44
Mobile: +31 681 15 87 68
e-mail: ***@Offermans.Rompen.nl
John Baldwin
2011-05-27 14:44:08 UTC
Permalink
Post by Willy Offermans
Dear John and FreeBSD friends,
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
Hmm, can you get 'pciconf -lb' output?
Hmm, wow, I wonder how uart(4) works at all. It tries to reuse it's softc
structure in uart_bus_attach() that was setup in uart_bus_probe(). Since
it
Post by Mike Tancsa
Post by John Baldwin
doesn't return 0 from its probe routine, that is forbidden. I guess it
accidentally works because of the hack where we call DEVICE_PROBE() again
to make sure the device description is correct.
I think this is a similar card. Had it laying about for a while and
popped it in. cu -l to it, attaches, but I am not able to interact with it.
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
bar [10] = type Memory, range 32, base 0xe8950000, size 1024, enabled
NetBSD supposedly has support for this card
Oh, hmm, looks like the clock has an unusual multiplier. Does it work if you
use 'cu -l -s 1200' to talk at 9600 for example? (In general use speed / 8
as the speed to '-s'.)
Also, is your card a modem or a dual-port card?
--
John Baldwin
It is a modem.
kosmos# cu -l /dev/cuau0 -s 1200
Stale lock on cuau0 PID=3642... overriding.
Connected
at&F
OK
atdt0045*******
NO DIALTONE
Ok, try this updated patch. After this you should be able to use the correct
speed:

Index: uart_bus_pci.c
===================================================================
--- uart_bus_pci.c (revision 222285)
+++ uart_bus_pci.c (working copy)
@@ -110,6 +110,8 @@ static struct pci_id pci_ns8250_ids[] = {
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950 UART",
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
+{ 0x13a8, 0x0152, 0x2205, 0x2026, "MultiTech MultiModem ZPX", 0x10,
+ 8 * DEFAULT_RCLK },
{ 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 },
--
John Baldwin
Willy Offermans
2011-05-30 09:27:32 UTC
Permalink
Hello John and FreeBSD friends,
Post by John Baldwin
Post by Willy Offermans
Dear John and FreeBSD friends,
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
Hmm, can you get 'pciconf -lb' output?
Hmm, wow, I wonder how uart(4) works at all. It tries to reuse it's softc
structure in uart_bus_attach() that was setup in uart_bus_probe(). Since
it
Post by Mike Tancsa
Post by John Baldwin
doesn't return 0 from its probe routine, that is forbidden. I guess it
accidentally works because of the hack where we call DEVICE_PROBE() again
to make sure the device description is correct.
I think this is a similar card. Had it laying about for a while and
popped it in. cu -l to it, attaches, but I am not able to interact with it.
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
bar [10] = type Memory, range 32, base 0xe8950000, size 1024, enabled
NetBSD supposedly has support for this card
Oh, hmm, looks like the clock has an unusual multiplier. Does it work if you
use 'cu -l -s 1200' to talk at 9600 for example? (In general use speed / 8
as the speed to '-s'.)
Also, is your card a modem or a dual-port card?
--
John Baldwin
It is a modem.
kosmos# cu -l /dev/cuau0 -s 1200
Stale lock on cuau0 PID=3642... overriding.
Connected
at&F
OK
atdt0045*******
NO DIALTONE
Ok, try this updated patch. After this you should be able to use the correct
Index: uart_bus_pci.c
===================================================================
--- uart_bus_pci.c (revision 222285)
+++ uart_bus_pci.c (working copy)
@@ -110,6 +110,8 @@ static struct pci_id pci_ns8250_ids[] = {
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950 UART",
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
+{ 0x13a8, 0x0152, 0x2205, 0x2026, "MultiTech MultiModem ZPX", 0x10,
+ 8 * DEFAULT_RCLK },
{ 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 },
--
John Baldwin
Hello John,

After inserting the magic line into uart_bus_pci.c, things start to be
really good. Minicom is now able to communicate with the device in a proper
way. Hereafter you can see some response from the modem.

<snip>
AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0
OK
at
OK
ati
Agere OCM V.92 MT9234ZPX-PCIE Internal Data/Fax/Voice Modem Version 1.02d

OK
at&F
OK
atdt0,0455444944
NO DIALTONE
</snip>

Of course there is no dialtone, since the telephone line is not connected
yet. I will ask the people on the remote site to connect the line as soon
as possible.

The status of HylaFAX is also as expected:

kosmos# faxstat
HylaFAX scheduler on localhost: Running
Modem cuau0 (+31455667077): Running and idle

As soon as the line is established and as soon as I have established a
proper setup with HylaFAX and performed some tests, I will report about the
results again.

I would like to thank you for your support so far. It was of great help and
without it I would certainly not have succeed. However, since it does not
seem to be so difficult, it would be wise to put the setup into
http://www.freebsd.org/doc/handbook/serial.html. Other users would benefit
from it. The structure you have provided in your magic line would also need
some explanation. The data concerns the description of the chip and the
card I guess and can be gained by `pciconf -lv`

***@pci0:6:0:0: class=0x070002 card=0x20262205 chip=0x015213a8 rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART


A more detailed explanation would not harm. The data 0x10 and
8 * DEFAULT_RCLK are still totally miraculous to me.
--
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,

Willy

*************************************
W.K. Offermans
Home: +31 45 544 49 44
Mobile: +31 681 15 87 68
e-mail: ***@Offermans.Rompen.nl
John Baldwin
2011-05-31 15:06:08 UTC
Permalink
Post by Willy Offermans
Hello John and FreeBSD friends,
Post by John Baldwin
Post by Willy Offermans
Dear John and FreeBSD friends,
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
Hmm, can you get 'pciconf -lb' output?
Hmm, wow, I wonder how uart(4) works at all. It tries to reuse it's softc
structure in uart_bus_attach() that was setup in uart_bus_probe(). Since
it
Post by Mike Tancsa
Post by John Baldwin
doesn't return 0 from its probe routine, that is forbidden. I guess it
accidentally works because of the hack where we call DEVICE_PROBE() again
to make sure the device description is correct.
I think this is a similar card. Had it laying about for a while and
popped it in. cu -l to it, attaches, but I am not able to interact with it.
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
bar [10] = type Memory, range 32, base 0xe8950000, size 1024, enabled
NetBSD supposedly has support for this card
Oh, hmm, looks like the clock has an unusual multiplier. Does it work if you
use 'cu -l -s 1200' to talk at 9600 for example? (In general use speed / 8
as the speed to '-s'.)
Also, is your card a modem or a dual-port card?
--
John Baldwin
It is a modem.
kosmos# cu -l /dev/cuau0 -s 1200
Stale lock on cuau0 PID=3642... overriding.
Connected
at&F
OK
atdt0045*******
NO DIALTONE
Ok, try this updated patch. After this you should be able to use the correct
Index: uart_bus_pci.c
===================================================================
--- uart_bus_pci.c (revision 222285)
+++ uart_bus_pci.c (working copy)
@@ -110,6 +110,8 @@ static struct pci_id pci_ns8250_ids[] = {
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950 UART",
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
+{ 0x13a8, 0x0152, 0x2205, 0x2026, "MultiTech MultiModem ZPX", 0x10,
+ 8 * DEFAULT_RCLK },
{ 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 },
--
John Baldwin
The structure you have provided in your magic line would also need
some explanation. The data concerns the description of the chip and the
card I guess and can be gained by `pciconf -lv`
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
A more detailed explanation would not harm. The data 0x10 and
8 * DEFAULT_RCLK are still totally miraculous to me.
0x10 is the resource id for the first PCI BAR (rids for PCI device resources
use the offset in PCI config space of the associated BAR). It would perhaps
be more obvious if uart(4) and puc(4) used PCIR_BAR(0) rather than 0x10.
Bumping the clock by a multiple of 8 was based on looking at the change in
NetBSD that Mike Tancsa pointed to and that you verified by noting that
'cu -s 1200' connected at 9600 (9600 / 1200 == 8).

One question though, would you be able to test the patch for puc(4) that I
sent to Mike Tancsa to see if your modem works with puc(4)? The puc(4)
patch is more general and if it works fine for your modem I'd rather just
commit that.
--
John Baldwin
Willy Offermans
2011-06-03 12:38:55 UTC
Permalink
Dear John and FreeBSD friends,
Post by John Baldwin
Post by Willy Offermans
Hello John and FreeBSD friends,
Post by John Baldwin
Post by Willy Offermans
Dear John and FreeBSD friends,
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
Hmm, can you get 'pciconf -lb' output?
Hmm, wow, I wonder how uart(4) works at all. It tries to reuse it's softc
structure in uart_bus_attach() that was setup in uart_bus_probe(). Since
it
Post by Mike Tancsa
Post by John Baldwin
doesn't return 0 from its probe routine, that is forbidden. I guess it
accidentally works because of the hack where we call DEVICE_PROBE() again
to make sure the device description is correct.
I think this is a similar card. Had it laying about for a while and
popped it in. cu -l to it, attaches, but I am not able to interact with it.
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
bar [10] = type Memory, range 32, base 0xe8950000, size 1024, enabled
NetBSD supposedly has support for this card
Oh, hmm, looks like the clock has an unusual multiplier. Does it work if you
use 'cu -l -s 1200' to talk at 9600 for example? (In general use speed / 8
as the speed to '-s'.)
Also, is your card a modem or a dual-port card?
--
John Baldwin
It is a modem.
kosmos# cu -l /dev/cuau0 -s 1200
Stale lock on cuau0 PID=3642... overriding.
Connected
at&F
OK
atdt0045*******
NO DIALTONE
Ok, try this updated patch. After this you should be able to use the correct
Index: uart_bus_pci.c
===================================================================
--- uart_bus_pci.c (revision 222285)
+++ uart_bus_pci.c (working copy)
@@ -110,6 +110,8 @@ static struct pci_id pci_ns8250_ids[] = {
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950 UART",
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
+{ 0x13a8, 0x0152, 0x2205, 0x2026, "MultiTech MultiModem ZPX", 0x10,
+ 8 * DEFAULT_RCLK },
{ 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 },
--
John Baldwin
The structure you have provided in your magic line would also need
some explanation. The data concerns the description of the chip and the
card I guess and can be gained by `pciconf -lv`
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
A more detailed explanation would not harm. The data 0x10 and
8 * DEFAULT_RCLK are still totally miraculous to me.
0x10 is the resource id for the first PCI BAR (rids for PCI device resources
use the offset in PCI config space of the associated BAR). It would perhaps
be more obvious if uart(4) and puc(4) used PCIR_BAR(0) rather than 0x10.
Bumping the clock by a multiple of 8 was based on looking at the change in
NetBSD that Mike Tancsa pointed to and that you verified by noting that
'cu -s 1200' connected at 9600 (9600 / 1200 == 8).
One question though, would you be able to test the patch for puc(4) that I
sent to Mike Tancsa to see if your modem works with puc(4)? The puc(4)
patch is more general and if it works fine for your modem I'd rather just
commit that.
--
John Baldwin
I have applied the suggested patch.

The outcome was a new /usr/src/sys/dev/puc/pucdata.c file, which I have
enclosed.

Upon compiling the new kernel, I encountered the following error:

cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -Werror /usr/src/sys/dev/puc/pucdata.c
cc1: warnings being treated as errors
/usr/src/sys/dev/puc/pucdata.c:535: warning: overflow in implicit constant
conversion
/usr/src/sys/dev/puc/pucdata.c:541: warning: overflow in implicit constant
conversion
/usr/src/sys/dev/puc/pucdata.c:547: warning: overflow in implicit constant
conversion
*** Error code 1

Stop in /usr/obj/usr/src/sys/KOSMOS.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.

I guess, I was not lucky. Did I miss something?

``cc1: warnings being treated as errors'' might also be released.
--
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,
De jrus wah,

Willy

*************************************
Dr. W.K. Offermans
CAT Postdoctoral Fellow
CAT Catalytic Center
Institut für Technische und Makromolekulare Chemie
RWTH Aachen
Worringerweg 1, Raum 38C-150
D-52074 Aachen, Germany
Phone: +49 241 80 28592
Fax: +49 241 80 22593
Home: +31 45 544 49 44
Mobile: +31 681 15 87 68
e-mail: ***@Offermans.Rompen.nl
e-mail: ***@CatalyticCenter.RWTH-Aachen.de

Powered by ....

(__)
\\\'',)
\/ \ ^
.\._/_)

www.FreeBSD.org
John Baldwin
2011-06-03 13:50:50 UTC
Permalink
Post by Willy Offermans
Dear John and FreeBSD friends,
Post by John Baldwin
Post by Willy Offermans
Hello John and FreeBSD friends,
Post by John Baldwin
Post by Willy Offermans
Dear John and FreeBSD friends,
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
Hmm, can you get 'pciconf -lb' output?
Hmm, wow, I wonder how uart(4) works at all. It tries to reuse it's softc
structure in uart_bus_attach() that was setup in
uart_bus_probe(). Since
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
it
Post by Mike Tancsa
Post by John Baldwin
doesn't return 0 from its probe routine, that is forbidden.
I guess it
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
accidentally works because of the hack where we call DEVICE_PROBE() again
to make sure the device description is correct.
I think this is a similar card. Had it laying about for a while and
popped it in. cu -l to it, attaches, but I am not able to interact with it.
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
bar [10] = type Memory, range 32, base 0xe8950000, size 1024, enabled
NetBSD supposedly has support for this card
Oh, hmm, looks like the clock has an unusual multiplier. Does it work if you
use 'cu -l -s 1200' to talk at 9600 for example? (In general use speed / 8
as the speed to '-s'.)
Also, is your card a modem or a dual-port card?
--
John Baldwin
It is a modem.
kosmos# cu -l /dev/cuau0 -s 1200
Stale lock on cuau0 PID=3642... overriding.
Connected
at&F
OK
atdt0045*******
NO DIALTONE
Ok, try this updated patch. After this you should be able to use the correct
Index: uart_bus_pci.c
===================================================================
--- uart_bus_pci.c (revision 222285)
+++ uart_bus_pci.c (working copy)
@@ -110,6 +110,8 @@ static struct pci_id pci_ns8250_ids[] = {
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950 UART",
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
+{ 0x13a8, 0x0152, 0x2205, 0x2026, "MultiTech MultiModem ZPX", 0x10,
+ 8 * DEFAULT_RCLK },
{ 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 },
--
John Baldwin
The structure you have provided in your magic line would also need
some explanation. The data concerns the description of the chip and the
card I guess and can be gained by `pciconf -lv`
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
A more detailed explanation would not harm. The data 0x10 and
8 * DEFAULT_RCLK are still totally miraculous to me.
0x10 is the resource id for the first PCI BAR (rids for PCI device resources
use the offset in PCI config space of the associated BAR). It would perhaps
be more obvious if uart(4) and puc(4) used PCIR_BAR(0) rather than 0x10.
Bumping the clock by a multiple of 8 was based on looking at the change in
NetBSD that Mike Tancsa pointed to and that you verified by noting that
'cu -s 1200' connected at 9600 (9600 / 1200 == 8).
One question though, would you be able to test the patch for puc(4) that I
sent to Mike Tancsa to see if your modem works with puc(4)? The puc(4)
patch is more general and if it works fine for your modem I'd rather just
commit that.
--
John Baldwin
I have applied the suggested patch.
The outcome was a new /usr/src/sys/dev/puc/pucdata.c file, which I have
enclosed.
Hmm, there was a newer puc patch. Please try this one instead:

Index: pucdata.c
===================================================================
--- pucdata.c (revision 222565)
+++ pucdata.c (working copy)
@@ -48,8 +48,8 @@ __FBSDID("$FreeBSD$");
#include <dev/puc/puc_bfe.h>

static puc_config_f puc_config_amc;
-static puc_config_f puc_config_cronyx;
static puc_config_f puc_config_diva;
+static puc_config_f puc_config_exar;
static puc_config_f puc_config_icbook;
static puc_config_f puc_config_quatech;
static puc_config_f puc_config_syba;
@@ -548,11 +548,25 @@ const struct puc_cfg puc_pci_devices[] = {
PUC_PORT_8S, 0x18, 0, 8,
},

+ { 0x13a8, 0x0152, 0xffff, 0,
+ "Exar XR17C/D152",
+ DEFAULT_RCLK * 8,
+ PUC_PORT_2S, 0x10, 0, -1,
+ .config_function = puc_config_exar
+ },
+
+ { 0x13a8, 0x0154, 0xffff, 0,
+ "Exar XR17C154",
+ DEFAULT_RCLK * 8,
+ PUC_PORT_4S, 0x10, 0, -1,
+ .config_function = puc_config_exar
+ },
+
{ 0x13a8, 0x0158, 0xffff, 0,
- "Cronyx Omega2-PCI",
+ "Exar XR17C158",
DEFAULT_RCLK * 8,
PUC_PORT_8S, 0x10, 0, -1,
- .config_function = puc_config_cronyx
+ .config_function = puc_config_exar
},

{ 0x13a8, 0x0258, 0xffff, 0,
@@ -1014,28 +1028,28 @@ puc_config_amc(struct puc_softc *sc, enum puc_cfg_
}

static int
-puc_config_cronyx(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
+puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
intptr_t *res)
{
+ const struct puc_cfg *cfg = sc->sc_cfg;
+
if (cmd == PUC_CFG_GET_OFS) {
- *res = port * 0x200;
+ if (cfg->subdevice == 0x1282) /* Everest SP */
+ port <<= 1;
+ else if (cfg->subdevice == 0x104b) /* Maestro SP2 */
+ port = (port == 3) ? 4 : port;
+ *res = port * 8 + ((port > 2) ? 0x18 : 0);
return (0);
}
return (ENXIO);
}

static int
-puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
+puc_config_exar(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
intptr_t *res)
{
- const struct puc_cfg *cfg = sc->sc_cfg;
-
if (cmd == PUC_CFG_GET_OFS) {
- if (cfg->subdevice == 0x1282) /* Everest SP */
- port <<= 1;
- else if (cfg->subdevice == 0x104b) /* Maestro SP2 */
- port = (port == 3) ? 4 : port;
- *res = port * 8 + ((port > 2) ? 0x18 : 0);
+ *res = port * 0x200;
return (0);
}
return (ENXIO);
--
John Baldwin
Willy Offermans
2011-06-03 19:02:52 UTC
Permalink
Hello John and FreeBSD friends,
Post by John Baldwin
Post by Willy Offermans
Dear John and FreeBSD friends,
Post by John Baldwin
Post by Willy Offermans
Hello John and FreeBSD friends,
Post by John Baldwin
Post by Willy Offermans
Dear John and FreeBSD friends,
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
Hmm, can you get 'pciconf -lb' output?
Hmm, wow, I wonder how uart(4) works at all. It tries to
reuse it's softc
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
structure in uart_bus_attach() that was setup in
uart_bus_probe(). Since
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
it
Post by Mike Tancsa
Post by John Baldwin
doesn't return 0 from its probe routine, that is forbidden.
I guess it
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
accidentally works because of the hack where we call
DEVICE_PROBE() again
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
to make sure the device description is correct.
I think this is a similar card. Had it laying about for a while
and
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Mike Tancsa
popped it in. cu -l to it, attaches, but I am not able to
interact with it.
chip=0x015213a8
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Mike Tancsa
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
bar [10] = type Memory, range 32, base 0xe8950000, size
1024, enabled
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Mike Tancsa
NetBSD supposedly has support for this card
Oh, hmm, looks like the clock has an unusual multiplier. Does it
work if you
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
use 'cu -l -s 1200' to talk at 9600 for example? (In general use
speed / 8
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
as the speed to '-s'.)
Also, is your card a modem or a dual-port card?
--
John Baldwin
It is a modem.
kosmos# cu -l /dev/cuau0 -s 1200
Stale lock on cuau0 PID=3642... overriding.
Connected
at&F
OK
atdt0045*******
NO DIALTONE
Ok, try this updated patch. After this you should be able to use the
correct
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Index: uart_bus_pci.c
===================================================================
--- uart_bus_pci.c (revision 222285)
+++ uart_bus_pci.c (working copy)
@@ -110,6 +110,8 @@ static struct pci_id pci_ns8250_ids[] = {
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus
16950 UART",
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem",
0x10 },
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
+{ 0x13a8, 0x0152, 0x2205, 0x2026, "MultiTech MultiModem ZPX", 0x10,
+ 8 * DEFAULT_RCLK },
{ 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10
},
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
--
John Baldwin
The structure you have provided in your magic line would also need
some explanation. The data concerns the description of the chip and the
card I guess and can be gained by `pciconf -lv`
rev=0x02 hdr=0x00
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
A more detailed explanation would not harm. The data 0x10 and
8 * DEFAULT_RCLK are still totally miraculous to me.
0x10 is the resource id for the first PCI BAR (rids for PCI device
resources
Post by Willy Offermans
Post by John Baldwin
use the offset in PCI config space of the associated BAR). It would
perhaps
Post by Willy Offermans
Post by John Baldwin
be more obvious if uart(4) and puc(4) used PCIR_BAR(0) rather than 0x10.
Bumping the clock by a multiple of 8 was based on looking at the change in
NetBSD that Mike Tancsa pointed to and that you verified by noting that
'cu -s 1200' connected at 9600 (9600 / 1200 == 8).
One question though, would you be able to test the patch for puc(4) that I
sent to Mike Tancsa to see if your modem works with puc(4)? The puc(4)
patch is more general and if it works fine for your modem I'd rather just
commit that.
--
John Baldwin
I have applied the suggested patch.
The outcome was a new /usr/src/sys/dev/puc/pucdata.c file, which I have
enclosed.
Index: pucdata.c
===================================================================
--- pucdata.c (revision 222565)
+++ pucdata.c (working copy)
@@ -48,8 +48,8 @@ __FBSDID("$FreeBSD$");
#include <dev/puc/puc_bfe.h>
static puc_config_f puc_config_amc;
-static puc_config_f puc_config_cronyx;
static puc_config_f puc_config_diva;
+static puc_config_f puc_config_exar;
static puc_config_f puc_config_icbook;
static puc_config_f puc_config_quatech;
static puc_config_f puc_config_syba;
@@ -548,11 +548,25 @@ const struct puc_cfg puc_pci_devices[] = {
PUC_PORT_8S, 0x18, 0, 8,
},
+ { 0x13a8, 0x0152, 0xffff, 0,
+ "Exar XR17C/D152",
+ DEFAULT_RCLK * 8,
+ PUC_PORT_2S, 0x10, 0, -1,
+ .config_function = puc_config_exar
+ },
+
+ { 0x13a8, 0x0154, 0xffff, 0,
+ "Exar XR17C154",
+ DEFAULT_RCLK * 8,
+ PUC_PORT_4S, 0x10, 0, -1,
+ .config_function = puc_config_exar
+ },
+
{ 0x13a8, 0x0158, 0xffff, 0,
- "Cronyx Omega2-PCI",
+ "Exar XR17C158",
DEFAULT_RCLK * 8,
PUC_PORT_8S, 0x10, 0, -1,
- .config_function = puc_config_cronyx
+ .config_function = puc_config_exar
},
{ 0x13a8, 0x0258, 0xffff, 0,
@@ -1014,28 +1028,28 @@ puc_config_amc(struct puc_softc *sc, enum puc_cfg_
}
static int
-puc_config_cronyx(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
+puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
intptr_t *res)
{
+ const struct puc_cfg *cfg = sc->sc_cfg;
+
if (cmd == PUC_CFG_GET_OFS) {
- *res = port * 0x200;
+ if (cfg->subdevice == 0x1282) /* Everest SP */
+ port <<= 1;
+ else if (cfg->subdevice == 0x104b) /* Maestro SP2 */
+ port = (port == 3) ? 4 : port;
+ *res = port * 8 + ((port > 2) ? 0x18 : 0);
return (0);
}
return (ENXIO);
}
static int
-puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
+puc_config_exar(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
intptr_t *res)
{
- const struct puc_cfg *cfg = sc->sc_cfg;
-
if (cmd == PUC_CFG_GET_OFS) {
- if (cfg->subdevice == 0x1282) /* Everest SP */
- port <<= 1;
- else if (cfg->subdevice == 0x104b) /* Maestro SP2 */
- port = (port == 3) ? 4 : port;
- *res = port * 8 + ((port > 2) ? 0x18 : 0);
+ *res = port * 0x200;
return (0);
}
return (ENXIO);
--
John Baldwin
<snip>
...
puc0: <Exar XR17C/D152> mem 0xfbfffc00-0xfbffffff irq 16 at device 0.0 on pci6
puc0: failed to enable port mapping!
puc0: [FILTER]
uart0: <16750 or compatible> on puc0
uart0: [FILTER]
uart1: <16750 or compatible> on puc0
uart1: [FILTER]
...
</snip>

As I already pointed out, I do not have a line connected to the modem yet.
This connection will hopefully be established tomorrow. After some rigorous
testing I will post a mail with the on stream results. On the other hand,
if someone knows some off stream testing procedures, then I'm happy to hear
about that. For the time being I have started minicom and issued:

AT
AT&F
ATI

All with positive and already mentioned results.
--
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,

Willy

*************************************
W.K. Offermans
Home: +31 45 544 49 44
Mobile: +31 681 15 87 68
e-mail: ***@Offermans.Rompen.nl
Clifton Royston
2011-06-03 20:13:20 UTC
Permalink
Post by Willy Offermans
Hello John and FreeBSD friends,
..
Post by Willy Offermans
<snip>
....
puc0: <Exar XR17C/D152> mem 0xfbfffc00-0xfbffffff irq 16 at device 0.0 on pci6
puc0: failed to enable port mapping!
puc0: [FILTER]
uart0: <16750 or compatible> on puc0
uart0: [FILTER]
uart1: <16750 or compatible> on puc0
uart1: [FILTER]
....
</snip>
As I already pointed out, I do not have a line connected to the modem yet.
This connection will hopefully be established tomorrow. After some rigorous
testing I will post a mail with the on stream results. On the other hand,
if someone knows some off stream testing procedures, then I'm happy to hear
about that. ...
Many if not most modems supporting a Hayes-style command set include
several loopback points (digital and analog) which you can turn on via
specific command. Those commands are all non-standardized, so I can't
tell you the commands for yours, but if you can look through a user
manual or command reference you should be able to find them.

Turning on loopback should allow you to do some basic verification
tests, e.g. pipe a file of random binary values into it while
concurrently reading it, and verify that you get the same contents.
Personally, I'd try to get the digital loopback working first, then if
that's OK try the analog loopback point.

-- Clifton
--
Clifton Royston -- ***@iandicomputing.com / ***@volcano.org
President - I and I Computing * http://www.iandicomputing.com/
Custom programming, network design, systems and network consulting services
John Baldwin
2011-06-03 21:03:14 UTC
Permalink
Post by Willy Offermans
Hello John and FreeBSD friends,
Post by John Baldwin
Post by Willy Offermans
Dear John and FreeBSD friends,
Post by John Baldwin
Post by Willy Offermans
Hello John and FreeBSD friends,
Post by John Baldwin
Post by Willy Offermans
Dear John and FreeBSD friends,
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
Hmm, can you get 'pciconf -lb' output?
Hmm, wow, I wonder how uart(4) works at all. It tries to
reuse it's softc
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
structure in uart_bus_attach() that was setup in
uart_bus_probe(). Since
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
it
Post by Mike Tancsa
Post by John Baldwin
doesn't return 0 from its probe routine, that is forbidden.
I guess it
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
accidentally works because of the hack where we call
DEVICE_PROBE() again
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
to make sure the device description is correct.
I think this is a similar card. Had it laying about for a while
and
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Mike Tancsa
popped it in. cu -l to it, attaches, but I am not able to
interact with it.
chip=0x015213a8
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Mike Tancsa
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
bar [10] = type Memory, range 32, base 0xe8950000, size
1024, enabled
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Mike Tancsa
NetBSD supposedly has support for this card
Oh, hmm, looks like the clock has an unusual multiplier. Does it
work if you
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
use 'cu -l -s 1200' to talk at 9600 for example? (In general use
speed / 8
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
as the speed to '-s'.)
Also, is your card a modem or a dual-port card?
--
John Baldwin
It is a modem.
kosmos# cu -l /dev/cuau0 -s 1200
Stale lock on cuau0 PID=3642... overriding.
Connected
at&F
OK
atdt0045*******
NO DIALTONE
Ok, try this updated patch. After this you should be able to use the
correct
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
Index: uart_bus_pci.c
===================================================================
--- uart_bus_pci.c (revision 222285)
+++ uart_bus_pci.c (working copy)
@@ -110,6 +110,8 @@ static struct pci_id pci_ns8250_ids[] = {
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus
16950 UART",
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem",
0x10 },
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
+{ 0x13a8, 0x0152, 0x2205, 0x2026, "MultiTech MultiModem ZPX", 0x10,
+ 8 * DEFAULT_RCLK },
{ 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10
},
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
Post by John Baldwin
--
John Baldwin
The structure you have provided in your magic line would also need
some explanation. The data concerns the description of the chip and the
card I guess and can be gained by `pciconf -lv`
rev=0x02 hdr=0x00
Post by Willy Offermans
Post by John Baldwin
Post by Willy Offermans
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
A more detailed explanation would not harm. The data 0x10 and
8 * DEFAULT_RCLK are still totally miraculous to me.
0x10 is the resource id for the first PCI BAR (rids for PCI device
resources
Post by Willy Offermans
Post by John Baldwin
use the offset in PCI config space of the associated BAR). It would
perhaps
Post by Willy Offermans
Post by John Baldwin
be more obvious if uart(4) and puc(4) used PCIR_BAR(0) rather than 0x10.
Bumping the clock by a multiple of 8 was based on looking at the change in
NetBSD that Mike Tancsa pointed to and that you verified by noting that
'cu -s 1200' connected at 9600 (9600 / 1200 == 8).
One question though, would you be able to test the patch for puc(4) that I
sent to Mike Tancsa to see if your modem works with puc(4)? The puc(4)
patch is more general and if it works fine for your modem I'd rather just
commit that.
--
John Baldwin
I have applied the suggested patch.
The outcome was a new /usr/src/sys/dev/puc/pucdata.c file, which I have
enclosed.
Index: pucdata.c
===================================================================
--- pucdata.c (revision 222565)
+++ pucdata.c (working copy)
@@ -48,8 +48,8 @@ __FBSDID("$FreeBSD$");
#include <dev/puc/puc_bfe.h>
static puc_config_f puc_config_amc;
-static puc_config_f puc_config_cronyx;
static puc_config_f puc_config_diva;
+static puc_config_f puc_config_exar;
static puc_config_f puc_config_icbook;
static puc_config_f puc_config_quatech;
static puc_config_f puc_config_syba;
@@ -548,11 +548,25 @@ const struct puc_cfg puc_pci_devices[] = {
PUC_PORT_8S, 0x18, 0, 8,
},
+ { 0x13a8, 0x0152, 0xffff, 0,
+ "Exar XR17C/D152",
+ DEFAULT_RCLK * 8,
+ PUC_PORT_2S, 0x10, 0, -1,
+ .config_function = puc_config_exar
+ },
+
+ { 0x13a8, 0x0154, 0xffff, 0,
+ "Exar XR17C154",
+ DEFAULT_RCLK * 8,
+ PUC_PORT_4S, 0x10, 0, -1,
+ .config_function = puc_config_exar
+ },
+
{ 0x13a8, 0x0158, 0xffff, 0,
- "Cronyx Omega2-PCI",
+ "Exar XR17C158",
DEFAULT_RCLK * 8,
PUC_PORT_8S, 0x10, 0, -1,
- .config_function = puc_config_cronyx
+ .config_function = puc_config_exar
},
{ 0x13a8, 0x0258, 0xffff, 0,
@@ -1014,28 +1028,28 @@ puc_config_amc(struct puc_softc *sc, enum puc_cfg_
}
static int
-puc_config_cronyx(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
+puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
intptr_t *res)
{
+ const struct puc_cfg *cfg = sc->sc_cfg;
+
if (cmd == PUC_CFG_GET_OFS) {
- *res = port * 0x200;
+ if (cfg->subdevice == 0x1282) /* Everest SP */
+ port <<= 1;
+ else if (cfg->subdevice == 0x104b) /* Maestro SP2 */
+ port = (port == 3) ? 4 : port;
+ *res = port * 8 + ((port > 2) ? 0x18 : 0);
return (0);
}
return (ENXIO);
}
static int
-puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
+puc_config_exar(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
intptr_t *res)
{
- const struct puc_cfg *cfg = sc->sc_cfg;
-
if (cmd == PUC_CFG_GET_OFS) {
- if (cfg->subdevice == 0x1282) /* Everest SP */
- port <<= 1;
- else if (cfg->subdevice == 0x104b) /* Maestro SP2 */
- port = (port == 3) ? 4 : port;
- *res = port * 8 + ((port > 2) ? 0x18 : 0);
+ *res = port * 0x200;
return (0);
}
return (ENXIO);
--
John Baldwin
<snip>
....
puc0: <Exar XR17C/D152> mem 0xfbfffc00-0xfbffffff irq 16 at device 0.0 on pci6
puc0: failed to enable port mapping!
puc0: [FILTER]
uart0: <16750 or compatible> on puc0
uart0: [FILTER]
uart1: <16750 or compatible> on puc0
uart1: [FILTER]
....
</snip>
As I already pointed out, I do not have a line connected to the modem yet.
This connection will hopefully be established tomorrow. After some rigorous
testing I will post a mail with the on stream results. On the other hand,
if someone knows some off stream testing procedures, then I'm happy to hear
AT
AT&F
ATI
All with positive and already mentioned results.
Ok. So it looks like your modem does indeed have two functioning UARTs. Do
you have any idea what might be on the second UART?
--
John Baldwin
Mike Tancsa
2011-05-27 14:45:35 UTC
Permalink
Post by John Baldwin
Oh, hmm, looks like the clock has an unusual multiplier. Does it work if you
use 'cu -l -s 1200' to talk at 9600 for example? (In general use speed / 8
as the speed to '-s'.)
Also, is your card a modem or a dual-port card?
If I add in the device IDs, I am not able to talk to it at any speed.
However, the port that is exposed, might just not be echoing back chars
and the second port which is not showing up, might be the "control port" ?

***@pci0:5:0:0: class=0x070002 card=0x20282205 chip=0x015213a8
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
--
-------------------
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, ***@sentex.net
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada http://www.tancsa.com/
John Baldwin
2011-05-27 16:03:31 UTC
Permalink
Post by Mike Tancsa
Post by John Baldwin
Oh, hmm, looks like the clock has an unusual multiplier. Does it work if you
use 'cu -l -s 1200' to talk at 9600 for example? (In general use speed / 8
as the speed to '-s'.)
Also, is your card a modem or a dual-port card?
If I add in the device IDs, I am not able to talk to it at any speed.
However, the port that is exposed, might just not be echoing back chars
and the second port which is not showing up, might be the "control port" ?
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
Possibly. Did you try adding it via puc instead?
--
John Baldwin
Mike Tancsa
2011-05-27 17:55:50 UTC
Permalink
Post by John Baldwin
Post by Willy Offermans
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
Possibly. Did you try adding it via puc instead?
Yes, same result. But I am not sure what values to plugin for some of
the options.

I tried this is uart

1(ich10)# diff -u uart_bus_pci.c.orig uart_bus_pci.c
--- uart_bus_pci.c.orig 2011-05-24 17:10:21.000000000 -0400
+++ uart_bus_pci.c 2011-05-27 10:49:05.000000000 -0400
@@ -110,6 +110,8 @@
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus
16950 UART",
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
+{ 0x13a8, 0x0152, 0x2205, 0x2028, "MultiTech MultiModem ZPX", 0x10,
+ 8 * DEFAULT_RCLK },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 },
{ 0x9710, 0x9901, 0xa000, 0x1000,
1(ich10)#

Then I removed the entry from uart and added the following for pucdata.c


{ 0x13a8, 0x0152, 0xffff, 0,
"Exar Multitech",
DEFAULT_RCLK * 8,
PUC_PORT_2S, 0x10, 0, -1,
},

But it does not seem to want to attach ?

---Mike
--
-------------------
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, ***@sentex.net
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada http://www.tancsa.com/
John Baldwin
2011-05-27 19:18:41 UTC
Permalink
Post by Mike Tancsa
Post by John Baldwin
Post by Willy Offermans
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
Possibly. Did you try adding it via puc instead?
Yes, same result. But I am not sure what values to plugin for some of
the options.
I tried this is uart
1(ich10)# diff -u uart_bus_pci.c.orig uart_bus_pci.c
--- uart_bus_pci.c.orig 2011-05-24 17:10:21.000000000 -0400
+++ uart_bus_pci.c 2011-05-27 10:49:05.000000000 -0400
@@ -110,6 +110,8 @@
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus
16950 UART",
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
+{ 0x13a8, 0x0152, 0x2205, 0x2028, "MultiTech MultiModem ZPX", 0x10,
+ 8 * DEFAULT_RCLK },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 },
{ 0x9710, 0x9901, 0xa000, 0x1000,
1(ich10)#
Then I removed the entry from uart and added the following for pucdata.c
{ 0x13a8, 0x0152, 0xffff, 0,
"Exar Multitech",
DEFAULT_RCLK * 8,
PUC_PORT_2S, 0x10, 0, -1,
},
Use '0x200' rather than -1.
--
John Baldwin
John Baldwin
2011-05-27 19:33:21 UTC
Permalink
Post by Mike Tancsa
Post by John Baldwin
Post by Willy Offermans
rev=0x02 hdr=0x00
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
Possibly. Did you try adding it via puc instead?
Yes, same result. But I am not sure what values to plugin for some of
the options.
I tried this is uart
1(ich10)# diff -u uart_bus_pci.c.orig uart_bus_pci.c
--- uart_bus_pci.c.orig 2011-05-24 17:10:21.000000000 -0400
+++ uart_bus_pci.c 2011-05-27 10:49:05.000000000 -0400
@@ -110,6 +110,8 @@
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus
16950 UART",
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
+{ 0x13a8, 0x0152, 0x2205, 0x2028, "MultiTech MultiModem ZPX", 0x10,
+ 8 * DEFAULT_RCLK },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 },
{ 0x9710, 0x9901, 0xa000, 0x1000,
1(ich10)#
Then I removed the entry from uart and added the following for pucdata.c
{ 0x13a8, 0x0152, 0xffff, 0,
"Exar Multitech",
DEFAULT_RCLK * 8,
PUC_PORT_2S, 0x10, 0, -1,
},
But it does not seem to want to attach ?
Actually, can you just try this:

Index: pucdata.c
===================================================================
--- pucdata.c (revision 222364)
+++ pucdata.c (working copy)
@@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$");
#include <dev/puc/puc_bfe.h>

static puc_config_f puc_config_amc;
-static puc_config_f puc_config_cronyx;
static puc_config_f puc_config_diva;
static puc_config_f puc_config_icbook;
static puc_config_f puc_config_quatech;
@@ -548,11 +547,22 @@ const struct puc_cfg puc_pci_devices[] = {
PUC_PORT_8S, 0x18, 0, 8,
},

+ { 0x13a8, 0x0152, 0xffff, 0,
+ "Exar XR17C/D152",
+ DEFAULT_RCLK * 8,
+ PUC_PORT_2S, 0x10, 0, 0x200,
+ },
+
+ { 0x13a8, 0x0154, 0xffff, 0,
+ "Exar XR17C154",
+ DEFAULT_RCLK * 8,
+ PUC_PORT_4S, 0x10, 0, 0x200,
+ },
+
{ 0x13a8, 0x0158, 0xffff, 0,
- "Cronyx Omega2-PCI",
+ "Exar XR17C158",
DEFAULT_RCLK * 8,
- PUC_PORT_8S, 0x10, 0, -1,
- .config_function = puc_config_cronyx
+ PUC_PORT_8S, 0x10, 0, 0x200,
},

{ 0x13a8, 0x0258, 0xffff, 0,
@@ -1014,17 +1024,6 @@ puc_config_amc(struct puc_softc *sc, enum puc_cfg_
}

static int
-puc_config_cronyx(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
- intptr_t *res)
-{
- if (cmd == PUC_CFG_GET_OFS) {
- *res = port * 0x200;
- return (0);
- }
- return (ENXIO);
-}
-
-static int
puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
intptr_t *res)
{
--
John Baldwin
Mike Tancsa
2011-05-27 19:39:21 UTC
Permalink
Post by John Baldwin
Index: pucdata.c
Hi,
Patch applies, but it doesnt compile on RELENG_8

patch < p
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: pucdata.c
|===================================================================
|--- pucdata.c (revision 222364)
|+++ pucdata.c (working copy)
--------------------------
Patching file pucdata.c using Plan A...
Hunk #1 succeeded at 48.
Hunk #2 succeeded at 546 (offset -1 lines).
Hunk #3 succeeded at 949 (offset -75 lines).
done


===> puc (all)
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE
-nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include
/usr/obj/usr/src/sys/ipsec/opt_global.h -I. -I@ -I@/contrib/altq
-finline-limit=8000 --param inline-unit-growth=100 --param
large-function-growth=1000 -fno-common -g -I/usr/obj/usr/src/sys/ipsec
-mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx
-mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector
-std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes
-Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign
-fformat-extensions -c /usr/src/sys/modules/puc/../../dev/puc/pucdata.c
cc1: warnings being treated as errors
/usr/src/sys/modules/puc/../../dev/puc/pucdata.c:552: warning: overflow
in implicit constant conversion
/usr/src/sys/modules/puc/../../dev/puc/pucdata.c:558: warning: overflow
in implicit constant conversion
/usr/src/sys/modules/puc/../../dev/puc/pucdata.c:564: warning: overflow
in implicit constant conversion
*** Error code 1

Stop in /usr/src/sys/modules/puc.
*** Error code 1

Stop in /usr/src/sys/modules.
*** Error code 1

Stop in /usr/obj/usr/src/sys/ipsec.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
--
-------------------
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, ***@sentex.net
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada http://www.tancsa.com/
John Baldwin
2011-05-27 20:24:34 UTC
Permalink
Post by Mike Tancsa
Post by John Baldwin
Index: pucdata.c
Hi,
Patch applies, but it doesnt compile on RELENG_8
Ugh, looks like the offset can't handle 0x200, try this instead:

Index: pucdata.c
===================================================================
--- pucdata.c (revision 222364)
+++ pucdata.c (working copy)
@@ -48,8 +48,8 @@ __FBSDID("$FreeBSD$");
#include <dev/puc/puc_bfe.h>

static puc_config_f puc_config_amc;
-static puc_config_f puc_config_cronyx;
static puc_config_f puc_config_diva;
+static puc_config_f puc_config_exar;
static puc_config_f puc_config_icbook;
static puc_config_f puc_config_quatech;
static puc_config_f puc_config_syba;
@@ -548,11 +548,25 @@ const struct puc_cfg puc_pci_devices[] = {
PUC_PORT_8S, 0x18, 0, 8,
},

+ { 0x13a8, 0x0152, 0xffff, 0,
+ "Exar XR17C/D152",
+ DEFAULT_RCLK * 8,
+ PUC_PORT_2S, 0x10, 0, -1,
+ .config_function = puc_config_exar
+ },
+
+ { 0x13a8, 0x0154, 0xffff, 0,
+ "Exar XR17C154",
+ DEFAULT_RCLK * 8,
+ PUC_PORT_4S, 0x10, 0, -1,
+ .config_function = puc_config_exar
+ },
+
{ 0x13a8, 0x0158, 0xffff, 0,
- "Cronyx Omega2-PCI",
+ "Exar XR17C158",
DEFAULT_RCLK * 8,
PUC_PORT_8S, 0x10, 0, -1,
- .config_function = puc_config_cronyx
+ .config_function = puc_config_exar
},

{ 0x13a8, 0x0258, 0xffff, 0,
@@ -1014,28 +1028,28 @@ puc_config_amc(struct puc_softc *sc, enum puc_cfg_
}

static int
-puc_config_cronyx(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
+puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
intptr_t *res)
{
+ const struct puc_cfg *cfg = sc->sc_cfg;
+
if (cmd == PUC_CFG_GET_OFS) {
- *res = port * 0x200;
+ if (cfg->subdevice == 0x1282) /* Everest SP */
+ port <<= 1;
+ else if (cfg->subdevice == 0x104b) /* Maestro SP2 */
+ port = (port == 3) ? 4 : port;
+ *res = port * 8 + ((port > 2) ? 0x18 : 0);
return (0);
}
return (ENXIO);
}

static int
-puc_config_diva(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
+puc_config_exar(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
intptr_t *res)
{
- const struct puc_cfg *cfg = sc->sc_cfg;
-
if (cmd == PUC_CFG_GET_OFS) {
- if (cfg->subdevice == 0x1282) /* Everest SP */
- port <<= 1;
- else if (cfg->subdevice == 0x104b) /* Maestro SP2 */
- port = (port == 3) ? 4 : port;
- *res = port * 8 + ((port > 2) ? 0x18 : 0);
+ *res = port * 0x200;
return (0);
}
return (ENXIO);
--
John Baldwin
Mike Tancsa
2011-05-27 20:38:41 UTC
Permalink
Post by John Baldwin
Post by Mike Tancsa
Post by John Baldwin
Index: pucdata.c
Hi,
Patch applies, but it doesnt compile on RELENG_8
Index: pucdata.c
===================================================================
Thanks! that applies cleanly and I see both ports now. However, I still
cannot interact with the modem. Let me fire up LINUX

0(ich10)# patch < p
Hmm... Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: pucdata.c
|===================================================================
|--- pucdata.c (revision 222364)
|+++ pucdata.c (working copy)
--------------------------
Patching file pucdata.c using Plan A...
Hunk #1 succeeded at 48.
Hunk #2 succeeded at 547 (offset -1 lines).
Hunk #3 succeeded at 953 (offset -75 lines).
done
0(ich10)#


puc0: <Exar XR17C/D152> mem 0xe8950000-0xe89503ff irq 21 at device 0.0
on pci5
puc0: [FILTER]
uart2: <16750 or compatible> on puc0
uart2: [FILTER]
uart3: <16750 or compatible> on puc0
uart3: [FILTER]
--
-------------------
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, ***@sentex.net
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada http://www.tancsa.com/
Willy Offermans
2011-05-27 07:32:38 UTC
Permalink
Dear John and FreeBSD friends,
Post by John Baldwin
Post by Willy Offermans
Dear John and FreeBSD friends,
Post by Willy Offermans
Post by Willy Offermans
Dear FreeBSD friends,
I need support with a MultiTech modem, MT9234ZPX-PCIE-NV
(http://www.multitech.com/en_US/PRODUCTS/Families/MultiModemZPX/)
<snip>
pci6: <simple comms, UART> at device 0.0 (no driver attached)
</snip>
<snip>
rev=0x02 hdr=0x00
Post by Willy Offermans
vendor = 'Exar Corp.'
device = 'XR17C/D152 Dual PCI UART'
class = simple comms
subclass = UART
</snip>
However, as the boot process already mentions, there is no driver attached
and I cannot get the modem to appear as an accessible and functional
device. Is there someone, who can help me to get this modem to work?
Index: uart_bus_pci.c
===================================================================
--- uart_bus_pci.c (revision 222248)
+++ uart_bus_pci.c (working copy)
@@ -110,6 +110,7 @@ static struct pci_id pci_ns8250_ids[] = {
{ 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950
UART",
0x10, 16384000 },
{ 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 },
+{ 0x13a8, 0x0152, 0x2205, 0x2026, "MultiTech MultiModem ZPX", 0x10 },
{ 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 },
{ 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 },
{ 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 },
--
John Baldwin
I have applied your suggested patch.
crw-rw---- 1 uucp dialer 0, 36 May 26 19:13 /dev/cuau0
crw-rw---- 1 uucp dialer 0, 37 May 26 19:00 /dev/cuau0.init
crw-rw---- 1 uucp dialer 0, 38 May 26 19:00 /dev/cuau0.lock
crw-rw---- 1 uucp dialer 0, 55 May 26 19:00 /dev/cuau1
crw-rw---- 1 uucp dialer 0, 56 May 26 19:00 /dev/cuau1.init
crw-rw---- 1 uucp dialer 0, 57 May 26 19:00 /dev/cuau1.lock
crw-rw---- 1 uucp dialer 0, 61 May 26 19:00 /dev/cuau2
crw-rw---- 1 uucp dialer 0, 62 May 26 19:00 /dev/cuau2.init
crw-rw---- 1 uucp dialer 0, 63 May 26 19:00 /dev/cuau2.lock
uart0: failed to enable port mapping!
uart0: failed to enable port mapping!
uart0: <16750 or compatible> mem 0xfbfffc00-0xfbffffff irq 16 at device 0.0 on pci6
uart0: [FILTER]
Hmm, can you get 'pciconf -lb' output?
Hmm, wow, I wonder how uart(4) works at all. It tries to reuse it's softc
structure in uart_bus_attach() that was setup in uart_bus_probe(). Since it
doesn't return 0 from its probe routine, that is forbidden. I guess it
accidentally works because of the hack where we call DEVICE_PROBE() again
to make sure the device description is correct.
--
John Baldwin
I guess this is the interesting part:

***@pci0:6:0:0: class=0x070002 card=0x20262205 chip=0x015213a8 rev=0x02 hdr=0x00
bar [10] = type Memory, range 32, base 0xfbfffc00, size 1024, enabled
--
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,

Willy

*************************************
W.K. Offermans
Home: +31 45 544 49 44
Mobile: +31 681 15 87 68
e-mail: ***@Offermans.Rompen.nl
Loading...