LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-17-2019, 09:37 AM   #1
ApolloPT
Member
 
Registered: Apr 2012
Distribution: Debian, CentOS, Kali
Posts: 33

Rep: Reputation: Disabled
Question Unable to find Parallel port of CH382_2S1P on LinuxCNC as parport


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,

[ 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,

[ 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?
 
Old 07-18-2019, 07:42 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,323
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
I have a feeling that this is way over my head, but I'll take stab at a few ideas.

A web search tells me that this CH382 is a PCI card.

What make/model computer is it in. Did you verify that the card is properly seated?

Also, Debian 7 reached end-of-life over a year ago.
 
Old 07-19-2019, 03:32 AM   #3
ApolloPT
Member
 
Registered: Apr 2012
Distribution: Debian, CentOS, Kali
Posts: 33

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by frankbell View Post
I have a feeling that this is way over my head, but I'll take stab at a few ideas.

A web search tells me that this CH382 is a PCI card.

What make/model computer is it in. Did you verify that the card is properly seated?

Also, Debian 7 reached end-of-life over a year ago.
Yes, it is properly seated, I can see it through lspci.

I know, this system has being used since a while.

Its a PCI card, with a parallel port in his front: http://sector.ba/dodatne-kartice/236...309085649.html

I found a way to add that module driver in parport through modprobe(https://www.kernel.org/doc/html/late...e/parport.html), but if I add the iobase of Serial Board, in /etc/modprobe.d/alsa-base.conf it doesnt associate, like,

alias parport_lowlevel parport_pc
options parport_pc io=0xd8c0,0xd8c8 irq=18,auto

but, if I remove the "d" from it, it adds and I can see two parports,

[ 16.232672] parport 0x8c0 (WARNING): CTR: wrote 0x0c, read 0xff
[ 16.232676] parport 0x8c0 (WARNING): DATA: wrote 0xaa, read 0xff
[ 16.232678] parport 0x8c0: You gave this address, but there is probably no parallel port there!
[ 16.232689] parport0: PC-style at 0x8c0, irq 18 [PCSPP,TRISTATE]
[ 16.232695] parport0: irq 18 in use, resorting to polled operation
[ 16.326560] parport 0x8c8 (WARNING): CTR: wrote 0x0c, read 0xff
[ 16.326564] parport 0x8c8 (WARNING): DATA: wrote 0xaa, read 0xff
[ 16.326566] parport 0x8c8: You gave this address, but there is probably no parallel port there!
[ 16.326578] parport1: PC-style at 0x8c8, irq 0 [PCSPP,TRISTATE]
[ 16.326594] parport1: irq 0 in use, resorting to polled operation
[ 16.422720] lp0: using parport0 (polling).
[ 16.422751] lp1: using parport1 (polling).

I assume that the address of both io's where not well added, but I am still digging on it, but for now I think that the driver module was not set well, because it meantions 2 serial ports instead of 1 parallel port.

Last edited by ApolloPT; 07-19-2019 at 03:35 AM.
 
Old 07-19-2019, 05:39 AM   #4
ApolloPT
Member
 
Registered: Apr 2012
Distribution: Debian, CentOS, Kali
Posts: 33

Original Poster
Rep: Reputation: Disabled
I have retried with the supposed driver CH382_1P but seems like it does a probe and choose the CH382_2S1P =/, but in any case it was supposed to show a parallel port address, and those two are from two serial ports ... I think that there are two connections in the PCB, without any pins, but it has 10 hols instead of 9 to place pins, a Serial Port only uses 9.
 
Old 07-26-2019, 10:54 AM   #5
ApolloPT
Member
 
Registered: Apr 2012
Distribution: Debian, CentOS, Kali
Posts: 33

Original Poster
Rep: Reputation: Disabled
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 [size=256]
Memory at f6ff8000 (32-bit, prefetchable) [size=32K]
I/O ports at dc00 [size=4]
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Downloading Debian Wheezy for LinuxCNC and running into install troubles dbanks77 Debian 23 04-13-2018 10:25 PM
Looking to learn Linux and LinuxCNC so I can make a CNC router wmaraines LinuxQuestions.org Member Intro 1 02-17-2016 04:02 PM
Trying to setup LinuxCNC but cant see the 'Back' or 'Next' buttons on bottom of screen LinuxPi Linux - Newbie 2 07-25-2013 07:45 PM
LXer: Nvidia and ARM: It's a parallel, parallel, parallel world LXer Syndicated Linux News 0 03-21-2013 06:10 PM
CNC Mill Software - "LinuxCNC" odimachkie Linux - Software 2 01-31-2012 04:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 06:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration