(SOLVED) Unable to find Parallel port of CH382_2S1P on LinuxCNC as parport

marafado88

New Member
I have compiled and loaded, the driver that came with this PCI-E, but after loading the driver, I notice that there was no parport tagged to any of those 3 ports (1 parallel and another with 2 Serials), doing,

dmesg

only the following info about the WCH device driver is displayed,

Code:
    [    9.568977] =====================  WCH Device Driver Module Install  =====================
    [    9.568979]
    [    9.568980] WCH Info : Loading WCH Multi-I/O Board Driver Module
    [    9.568982]                                                        -- Date : 2014/07/02
    [    9.568985]                                                        -- Version : 3.0.0.1
    [    9.568986]
    [    9.568987] /home/user/Downloads/LPC_DRV_1P/LINUX/driver/wch_main.c : wch_pci_board_probe
    [    9.569041]
    [    9.569043] WCH Info : Found WCH CH382_2S1P Series Board (2S),
    [    9.569045]            bus number:4, device number:0
    [    9.569046]
    [    9.569047] ------------------->pci board probe success
    [    9.569049] /home/user/Downloads/LPC_DRV_1P/LINUX/driver/wch_main.c : wch_get_pci_board_conf
    [    9.569050] ------------------->pci board conf success
    [    9.569052] /home/user/Downloads/LPC_DRV_1P/LINUX/driver/wch_main.c : wch_assign_resource
    [    9.569070] ------------------->pci assign success
    [    9.569071] /home/user/Downloads/LPC_DRV_1P/LINUX/driver/wch_main.c : wch_ser_port_table_init
    [    9.569073] ------------------->ser port table init success
    [    9.569075] /home/user/Downloads/LPC_DRV_1P/LINUX/driver/wch_main.c : wch_register_irq
    [    9.569092] ------------------->pci register irq success
    [    9.569094] /home/user/Downloads/LPC_DRV_1P/LINUX/driver/wch_serial.c : wch_ser_register_driver
    [    9.580905] ------------------->ser register driver success
    [    9.580908] /home/user/Downloads/LPC_DRV_1P/LINUX/driver/wch_serial.c : wch_ser_register_ports
    [    9.580922]
    [    9.580924] ======== board info ========
    [    9.580926]  name         : CH382_2S1P
    [    9.580928]  board_enum   : 16
    [    9.580930]  board_number : 0
    [    9.580931]  irq          : 18
    [    9.580933]  vector_mask  : 0xffffffff
    [    9.580935]  bar[0]       : 0xd800
    [    9.580937]  bar[1]       : 0xf6ff8000
    [    9.580939]  bar[2]       : 0xdc00
    [    9.580940]  bar[3]       : 0x0
    [    9.580942]  bar[4]       : 0x0
    [    9.580944]  bar[5]       : 0x0
    [    9.580945] ----------------------------
    [    9.580947] ============================
    [    9.580949]
    [    9.580950]
    [    9.580951] ======== serial info ========
    [    9.580953]  number       : 0
    [    9.580955]  name         : CH382_2S1P
    [    9.580957]  iobase       : 0xd8c0
    [    9.580958]  chip_iobase  : 0x0
    [    9.580960]  irq          : 18
    [    9.580961]  vector       : 0xd8e9
    [    9.580962]  vector_mask  : 0xffffffff
    [    9.580964]  chip_flag    : 0x10
    [    9.580966]  port_flag    : 0x0
    [    9.580967] ----------------------------
    [    9.580969]  number       : 1
    [    9.580970]  name         : CH382_2S1P
    [    9.580972]  iobase       : 0xd8c8
    [    9.580973]  chip_iobase  : 0x0
    [    9.580975]  irq          : 18
    [    9.580976]  vector       : 0xd8e9
    [    9.580978]  vector_mask  : 0xffffffff
    [    9.580979]  chip_flag    : 0x10
    [    9.580981]  port_flag    : 0x0
    [    9.580983] ----------------------------
    [    9.580986] ============================
    [    9.580988]
    [    9.580989] ================================================================================
and another entrie for,

Code:
[   16.051526] ppdev: user-space parallel port driver
also on /dev, I have from ttyWCH0 to ttyWCH256.

System specs:

**Kernel version:** Linux cnc2-pc 3.4-9-rtai-686-pae #1 SMP PREEMPT Debian 3.4.55-4linuxcnc i686 GNU/Linux

**Debian version:** 7.11

Do you know how can I discover the parallel port address and how to set it as parport 0?
 


atanere

Well-Known Member

marafado88

New Member
So, those drivers that came from the manifacturer was not necessary, and was giving wrong IO address's from want I notice after.

To solve this i have used only modprobe, and restored all the system for a state before I tried to install those drivers.

To start I have listed all the PCIs first, doing,

lspci -v

Then I notice that I had 2 address's for that PCI,

04:00.0 Serial controller: Device 1c00:3250 (rev 10) (prog-if 05 [16850])
Subsystem: Device 1c00:3250
Flags: fast devsel, IRQ 18
I/O ports at d800
Memory at f6ff8000 (32-bit, prefetchable) [size=32K]
I/O ports at dc00
Expansion ROM at f7fe0000 [disabled] [size=32K]
Capabilities: <access denied>


And tried first with IO d800 but no success, and then with dc00 where I was able to use this parallel port.

To add the IO address, I made,

sudo /etc/modprobe.d/alsa-base.conf

and then in the end of this file I add the following lines,

# LPC parport to PCI-E card
alias parport_low level parport_pc
options parport_pc io=0xdc00 irq=18,auto


and made a save and quit, and then,

sudo reboot

after I got the system back again, to confirm made a,

dmesg | grep par

and there was finally my LPC,

[ 15.531022] parport0: PC-style at 0xdc00, irq 18 [PCSPP,TRISTATE]
[ 15.626720] lp0: using parport0 (interrupt-driven).
[ 16.232244] ppdev: user-space parallel port driver


Then I made a test under LinuxCNC and was able to communicate through LP connection using parport0.

I hope that it could help others since I didnt found anything on internet to solve this.
 

atanere

Well-Known Member
@marafado88, thanks for the update and detailed solution! :cool::D

Cheers
 

Members online


Latest posts

Top