Created attachment 164293 [details] Support Advantech PCI-1602A, PCI-1602B and PCI-1603 with RS-422 and RS-485 auto-turnaround Advantech have a PCI-1602 rev B board, updating the Advantech PCI-1602 which is currently supported by puc(4). The PCI-1602B also has the same PCI ID as the PCI-1603 but has different configuration requirements. The attached patch supports all three boards, and configures the PCI-1602B board to correctly do RS-422/RS-485 auto-turnaround.
A commit references this bug: Author: marius Date: Sun Jan 10 18:11:24 UTC 2016 New revision: 293642 URL: https://svnweb.freebsd.org/changeset/base/293642 Log: - Add support for Advantech PCI-1602 Rev. B1 and PCI-1603 cards. [1] - Add a description of Advantech PCI-1602 Rev. A boards. [1] - Properly set up REG_ACR also for PCI-1602 Rev. A based on what the Advantech-supplied Linux driver does. - Additionally use the macros of <dev/ic/ns16550.h> to replace existing magic values and get rid of trivial comments. - Fix the style of some comments. PR: 205359 [1] Submitted by: Jan Mikkelsen (original patch) [1] Changes: head/sys/dev/ic/ns16550.h head/sys/dev/puc/pucdata.c
Please give r293642 a try, which uses a generalized version of puc_config_advantech() suitable to be extended for additional Advantech cards.
(In reply to Marius Strobl from comment #2) Thanks for the update Marius. I will import into our tree and test.
A commit references this bug: Author: marius Date: Wed May 10 20:12:23 UTC 2017 New revision: 318151 URL: https://svnweb.freebsd.org/changeset/base/318151 Log: MFC: r293642 - Add support for Advantech PCI-1602 Rev. B1 and PCI-1603 cards. [1] - Add a description of Advantech PCI-1602 Rev. A boards. [1] - Properly set up REG_ACR also for PCI-1602 Rev. A based on what the Advantech-supplied Linux driver does. - Additionally use the macros of <dev/ic/ns16550.h> to replace existing magic values and get rid of trivial comments. - Fix the style of some comments. PR: 205359 [1] Submitted by: Jan Mikkelsen (original patch) [1] Changes: stable/10/sys/dev/ic/ns16550.h stable/10/sys/dev/puc/pucdata.c