[ltp] Some experiences with serial ports, internal modem and IR port on TP600E.

Tom Grydeland linux-thinkpad@www.bm-soft.com
Fri, 23 Feb 2001 17:18:05 +0100 (MET)



I said I'd report in more detail on Tuesday, guess I missed that :-)

Some experiences with serial ports, internal modem and IR port on TP600E.
=========================================================================

Summary:
--------

+ I have been able to use all of the following on my TP600E:

  * Built-in DB9 serial port
  * Built-in MWAVE modem
  * Built-in Sound card
  * PC-Card ethernet and PC-Card modem 

+ I have not yet been able to see anything on the Built-in IR port, but that
  might be a fault of my own.  I haven't given up yet.

+ On a suggestion from Till Straumann, I configured (I should say I've
  *tried* to configure) the DB9 serial port and the IR port to share the
  IRQ 4 interrupt.  The intended configuration is as follows:

    DB9:	COM1	/dev/ttyS0	0x03f8	IRQ 4
    MWAVE/UART:	COM2	/dev/ttyS1	0x02f8	IRQ 3
    IR:		COM3	/dev/ttyS2	0x03e8	IRQ 4 (DMA 3)

  This is the configuration I've asked for using setpnp -b and rebooting,
  but I'm not yet convinced what configuration I'm actually obtaining.
  In particular, I don't know whether the IR port is configured for IRQ 3
  or IRQ 4.

+ I don't use the parallel port for anything, so I've disabled that,
  leaving IRQ 7 for the MIDI processor and IRQ 9 for any PC-cards. The
  MWAVE DSP uses IRQ 10.

+ I start/stop/configure the MWAVE modem using the rc script from IBM,
  except that the UARTIO is set to 0x2F8.  Together with IRQ 4, this
  points to /dev/ttyS1.

# /etc/rc.d/init.d/mwaved start
Starting Mwave modem:
    Loading kernel module:                                 [  OK  ]
    Starting Mwave Manager:                                [  OK  ]
    Configuring serial port:/dev/ttyS1                     [  OK  ]

(contents of /proc/mwave listed below)

+ When booting, or loading the serial modem, the lines appearing in the
  log are one of:

    kernel: ttyS00 at 0x03f8 (irq = 4) is a 16550A 
    kernel: ttyS02 at 0x03e8 (irq = 4) is a 16550A 

    kernel: ttyS00 at 0x03f8 (irq = 4) is a 16550A 
    kernel: ttyS01 at 0x02f8 (irq = 3) is a 16550A 
  
  so far, I've never seen all three of them appear at once, but that's OK.

+ As far as I've been able to go with the IR port:
  tpctl --rs1=dis --rs2=irq4 --rs2=en
  setpnp 13 irq 4
  setserial /dev/ttyS2 irq 4 autoconfig
  irattach /dev/ttyS2 -s 1

  The log reports:
    kernel: Serial driver version 4.27 with no serial options enabled 
    kernel: ttyS02 at 0x03e8 (irq = 4) is a 16550A 
    irattach: Serial connection established.
    kernel: IrDA: Registered device irda0 
  
  Setting the Palm to serial via IR, I try to sync
    pilot-xfer -p /dev/ircomm0 -l
  but none of the devices appear to see each other.  irdaping and irdadump
  do not produce any output, but I might be using these tools incorrectly.

  Similarly, trying the FIR driver:
    rmmod serial
    modprobe irda0
    irattach irda0 -s 1

  the nsc-ircc module gets loaded, but I still cannot see any IR traffic.

    kernel: nsc-ircc, Found chip at base=0x02e 
    kernel: nsc-ircc, driver loaded (Dag Brattli) 
    kernel: IrDA: Registered device irda0 
    kernel: nsc-ircc, Using dongle: HP HSDL-2300, HP HSDL-3600/H SDL-3610 
    irattach: executing: '/sbin/modprobe irda0'
    irattach: executing: 'echo 1 > /proc/sys/net/irda/discovery'
    irattach: Starting device irda0
    kernel: nsc-ircc, unable to allocate dma=0 
    kernel: Trying to free free IRQ4 
    irattach: executing: 'echo ska > /proc/sys/net/irda/devname'
    kernel: IrCOMM protocol (Dag Brattli) 


+ When I tried unloading the nsc-ircc module, the system hung. :-(

+ I had added the mwaved startup script to runlevels 3 and 5, but when I
  rebooted, the system hung upon starting mwaved.

+ I started in runlevel 1, disabled mwaved, and switched to runlevel 3,
  and from there, I can start mwaved just fine.
 


Kernel configuration
--------------------

I am using kernel 2.2.18 with no patches.  Nothing special in the
configuration.  I have enabled all of the APM stuff except that
CONFIG_APM_IGNORE_USER_SUSPEND is not set.  Serial support compiled as a
module.

For sound, I use the OSS/Free drivers supplied with the kernel, options
CONFIG_SOUND, CONFIG_SOUND_CS4281, CONFIG_SOUND_OSS, CONFIG_SOUND_MPU401,
CONFIG_SOUND_PSS, CONFIG_SOUND_CS4232 and CONFIG_SOUND_YM3812 compiled as
modules (I don't know if all of these are meaningful)

PCMCIA package
--------------

I have version 3.1.24.  Must be compiled with PnP BIOS support enabled in
order to use the (ls|set)pnp programs from the debug-tools subdirectory.

tpctl package
-------------

I have version 1.0 (for kernels 2.2.x).  Compiled out-of-the-box.

irda-utils
----------

I have version 0.9.13 of the irda-utils.


the /etc/conf.modules file
--------------------------
alias parport_lowlevel parport_pc
pre-install pcmcia_core /etc/rc.d/init.d/pcmcia start

alias char-major-14	cs4232
alias sound             cs4232
pre-install sound insmod sound dmabuf=1
alias midi              opl3
options opl3            io=0x388
options cs4232 io=0x530 irq=5 dma=1 dma2=0 mpuio=0x330 mpuirq=7

# IrDA
alias tty-ldisc-11	irtty
alias char-major-161	ircomm-tty
# These values are hard-coded in irattach (not instance order)
alias irda-dongle-0 tekram              # Tekram IrMate IR-210B
alias irda-dongle-1 esi                 # ESI JetEye
alias irda-dongle-2 actisys             # Actisys IR-220L
alias irda-dongle-3 actisys             # Actisys IR-220L+
alias irda-dongle-4 girbil              # Greenwich GIrBIL
alias irda-dongle-5 litelink            # Parallax LiteLink
alias irda-dongle-6 airport             # Adaptec Airport 1000 and 2000
# IrNET module...
alias char-major-10-187 irnet           # Official allocation of IrNET

# NSC IR controller in the TP600E
alias   irda0    nsc-ircc
options nsc-ircc dongle_id=0x08


# alias sound off
alias net-pf-3 off      # no ax25 module available (yet)
alias net-pf-4 off      # don't use the ipx module
alias net-pf-5 off      # don't use the appletalk module
alias net-pf-17 af_packet


keep
path[pcmcia]=/lib/modules/default
path[pcmcia]=/lib/modules/preferred

keep
options thinkpad enable_smapi=1 enable_superio=1 enable_rtcmosram=1

path[thinkpad]=/lib/modules/`uname -r`

alias char-major-10-170 thinkpad

# MWAVE driver by IBM
options mwavedd dspirq=10 dspio=0x130 uartirq=3 uartio=0x2f8

#################################################################
# Stuff below this line is out of date

# ALSA portion
# alias char-major-116 snd
# alias snd-card-0 snd-card-cs4236
# 
# alias snd-minor-oss-0 snd-card-cs4236
# alias snd-minor-oss-1 snd-opl3
# alias snd-minor-oss-3 snd-pcm1-oss

# options snd-card-cs4236 snd_port=0x534 snd_cport=0x120 snd_irq=5 snd_dma1=1 snd_dma2=0 snd_fm_port=0x388 snd_mpu_irq=9
# snd_mpu_irq=9 snd_mpu_port=0x300

# OSS/Lite portion
# alias char-major-14      soundcore
# alias sound-slot-0       snd-card-0
# alias sound-service-0-0  snd-mixer-oss
# alias sound-service-0-1  snd-seq-oss
# alias sound-service-0-3  snd-pcm1-oss
# alias sound-service-0-12 snd-pcm1-oss

The contents of /etc/pcmcia/config.opts:
----------------------------------------
#
# Local PCMCIA Configuration File
#
#----------------------------------------------------------------------
# System resources available for PCMCIA devices

# These from Thomas Hood
include port 0x100-0x4ff, port 0x800-0x8ff, port 0xc00-0xcff
include memory 0xc0000-0xfffff
include memory 0xa0000000-0xa0ffffff, memory 0x60000000-0x60ffffff

# include port 0x100-0x4ff, port 0x1000-0x17ff
# include memory 0xc0000-0xfffff, memory 0xa0000000-0xa0ffffff
#
# Extra port range for IBM Token Ring
#
include port 0xa00-0xaff
#
# Resources we should not use, even if they appear to be available
#
# First built-in serial port or IR port
exclude irq 4
exclude port 0x3e8-0x3ef
exclude port 0x3f8-0x3ff

# CS4239 sound card uses two interrupts, 5 and 7
exclude irq 5
exclude irq 7
exclude port 0x220-0x223      # Sound Blaster interface
exclude port 0x330-0x333      # MPU-401 UART
exclude port 0x388-0x38b      # Yamaha OPL-3 FM interface
exclude port 0x530-0x537      # CS423x sound registers
exclude port 0x538-0x53f      # CS423x control registers

# IRQ 9 has been left specifically for PCMCIA
# exclude irq 9

# 3780i DSP based Mwave/ACP modem
# Needs one IRQ for the DSP, plus one IRQ and ioports for the serial interface
exclude irq 10                # DSP
exclude port 0x130-0x13f      # DSP
exclude irq 3                 # UART
exclude port 0x2f8-0x2ff      # UART


When the following was listed, the serial port (DB9) was in use talking to
a GPS receiver, and the internal modem was live.  When using a PC-card, it
does use IRQ 9.

The contents of /proc/mwave:
----------------------------
DSP_IRQ  10
DSP_DMA  7
DSP_IO   0x0130
UART_IRQ 3
UART_IO  0x02f8

The contents of /proc/modules:
------------------------------
mwavedd                26924   2
ppp                    19916   2 (autoclean)
slhc                    4268   1 (autoclean) [ppp]
cs4232                  2408   0
uart401                 5904   0 [cs4232]
ad1848                 15984   0 [cs4232]
sound                  56364   0 [cs4232 uart401 ad1848]
soundcore               2148   6 [sound]
serial                 18324   2
superio                 5040   0 (autoclean) (unused)
thinkpad                2640   0 (autoclean) [superio]
ds                      6120   2
i82365                 21620   2
pcmcia_core            49984   0 [ds i82365]
nls_cp437               3676   2 (autoclean)
vfat                    9348   1 (autoclean)
fat                    30240   1 (autoclean) [vfat]

The contents of /proc/interrupts:
---------------------------------
           CPU0       
  0:   10941604          XT-PIC  timer
  1:     189550          XT-PIC  keyboard
  2:          0          XT-PIC  cascade
  3:      60697          XT-PIC  serial
  4:     171506          XT-PIC  serial
  5:    1257043          XT-PIC  Crystal audio controller
  7:          4          XT-PIC  MPU-401 UART
  8:         13          XT-PIC  rtc
 10:        178          XT-PIC  mwavedsp
 11:         30          XT-PIC  usb-uhci, i82365
 12:     679282          XT-PIC  PS/2 Mouse
 13:          1          XT-PIC  fpu
 14:     111932          XT-PIC  ide0
 15:        118          XT-PIC  ide1
NMI:          0

The contents of /proc/ioports:
------------------------------
0000-001f : dma1
0020-003f : pic1
0040-005f : timer
0060-006f : keyboard
0070-007f : rtc
0080-008f : dma page reg
00a0-00bf : pic2
00c0-00df : dma2
00f0-00ff : fpu
0130-013f : mwave_3780i
0170-0177 : ide1
01f0-01f7 : ide0
02f8-02ff : serial(set)
0330-0333 : MPU-401 UART
0376-0376 : ide1
03c0-03df : vga+
03e8-03ef : serial(auto)
03f6-03f6 : ide0
03f8-03ff : serial(set)
0530-0533 : Crystal audio controller
8400-8413 : usb-uhci
fcf0-fcf7 : ide0
fcf8-fcff : ide1

The contents of /proc/dma:
--------------------------
 0: Crystal audio controller
 1: Crystal audio controller
 4: cascade

The output of tpctl --dull --rx:
--------------------------------
resource state:                                       current
   floppy controller:                                 enable  0x3f0 IRQ6
   parallel port:                                     disable 0x3bc IRQ0 COMP
   serial port 1:                                     enable  0x3f8 IRQ4
   serial port 2:                                     disable 0x3e8 IRQ4

The output of setserial:
------------------------
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4

The output of lspnp -v:
-----------------------
00 PNP0000 AT programmable interrupt controller
	io 0x0020-0x0021
	io 0x00a0-0x00a1
	irq 2

01 PNP0200 AT DMA controller
	io 0x0000-0x000f
	io 0x0080-0x008f
	io 0x00c0-0x00df
	dma 4

02 PNP0100 AT system timer
	irq 0
	io 0x0040-0x0043

03 PNP0b00 AT real-time clock
	irq 8
	io 0x0070-0x0073

04 PNP0800 AT-style speaker sound
	io 0x0061-0x0061

05 PNP0303 IBM enhanced keyboard (101/102-key, PS/2 mouse support)
	irq 1
	io 0x0060-0x0060
	io 0x0064-0x0064

06 IBM3780 PS/2 TrackPoint
	irq 12

07 PNP0c04 Math coprocessor
	io 0x00f0-0x00ff
	irq 13

08 PNP0700 PC standard floppy disk controller
	irq 6
	io 0x03f0-0x03f5
	dma 2

09 PNP0a03 PCI bus
	io 0x0cf8-0x0cff

0a PNP0c02 Motherboard resources
	io 0x0022-0x0022
	io 0x002e-0x002f
	io 0x0092-0x0092
	io 0x00b2-0x00b3
	io 0x04d0-0x04d1
	io 0x15e0-0x15ef
	io 0xef00-0xefaf
	mem 0x00000000-0x0009ffff
	mem 0x000f0000-0x000fffff
	mem 0x00100000-0x07ffffff
	mem 0xffff0000-0xffffffff

0b PNP0400 Standard LPT printer port
	irq disabled
	io disabled

0d PNP0501 16550A-compatible COM port
	irq 4
	io 0x03f8-0x03ff

0e CSC0100 multimedia controller: audio
	io 0x0530-0x0537
	io 0x0388-0x038b
	io 0x0220-0x0233
	irq 5
	dma 1
	dma 0

0f CSC0110 multimedia controller: audio
	io 0x0538-0x053f

10 CSC0101 multimedia controller: audio
	io disabled

11 CSC0103 multimedia controller: audio
	io 0x0330-0x0333
	irq 7

12 IBM3765 multimedia controller: audio
	io 0x0130-0x013f
	io 0x02f8-0x02ff
	irq 3
	irq 10
	dma 7

13 IBM0071 IBM Thinkpad infrared port
	irq 3
	io 0x03e8-0x03ef
	dma 3

14 PNP0e03 Intel 82365-compatible CardBus controller
	io 0x0000-0x0001

17 PNP0680 Standard bus mastering IDE hard disk controller
	irq 14
	io 0x01f0-0x01f7
	io 0x03f6-0x03f7
	io 0xfcf0-0xfcf7

19 PNP0680 Standard bus mastering IDE hard disk controller
	irq 15
	io 0x0170-0x0177
	io 0x0376-0x0376
	io 0xfcf8-0xfcff

1b PNP0c02 Motherboard resources
	mem disabled



-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


----- The Linux ThinkPad mailing list -----
The linux-thinkpad mailing list home page is at:
http://www.bm-soft.com/~bm/tp_mailing.html