ox16cf950: Forcing Standard Serial IO-Port

2005-01-14
2013-04-08
  • Felix E. Klee

    Felix E. Klee - 2005-01-14

    Hi,

    I recently acquired a single port RS-232 PC card:

       Label: DeLock PCMCIA Adapter 1x Seriell, 16-Bit PC-Card
       Chip: ox16cf950

    The card works fine under LINUX with minicom.  However, it always grabs a *non*-standard IO-port (e.g. 0x100, 0x2f0, 0x300, or 0x400).  Here's what I mean by standard IO ports:

              IO Port
    COM1 IRQ4   0x3f8 0x3ff   
    COM2 IRQ3   0x2f8 0x2ff   
    COM3 IRQ4   0x3e8 0x3ef   
    COM4 IRQ3   0x2e8 0x2ef

    To avoid this problem I edited the file

        /etc/pcmcia/config.opts (included by /etc/pcmcia/config)

    and tried out the following options (one by one - not at the same time):

        include port 0x2f8-0x2ff
        include port 0x3f8-0x3ff
        include port 0x3e8-0x3ef
        include port 0x2e8-0x2ef

    However, the card doesn't accept this.  With each one of the above settings the card configuration completely fails.  The error message:

        serial_cs: RequestIO: No more items

    Some additional info:

    * I'm using Slackware 9.1 with kernel 2.4.24 with PCMCIA-CS 3.2.5.

    * I tried the card under Windows 2000. 

    Am I doing something wrong?  If not, any idea why the card may behave like it does?  Perhaps I have to reprogram it (there's an EPROM tool available from Oxford Semiconductor for that purpose)?

    Felix

    PS: Is there a mailing list for PCMCIA-CS?  I'm allergic to web fora.

     
    • David Hinds

      David Hinds - 2005-01-18

      Why do you care if the IO ports are "non-standard", if the card works fine?  My first reaction is "get over it"!

      I believe that the Oxford Semiconductor UART actually uses a block of 16 IO ports, instead of the 8 used by regular UARTs.  So it is impossible to fit it into one of the "standard" IO port ranges.

      "cardctl config" will show the full range of ports allocated for the card.  And "dump_cis" will show information about what configurations are supported.

      -- Dave

       
      • Felix E. Klee

        Felix E. Klee - 2005-01-19

        The problem is that I want to run Win4Lin for some Windows-Applications that access the serial port and, AFAICS, Win4Lin can only deal with standard ports.  To have the card's port (IRQ: 4, IO port: 0x400) mapped to /dev/ttyS0, I modified config.h and config_cs.c accordingly (I substituted 0x3f8 with 0x400).  But this, as expected, didn't improve things.  A symbolic link from ttyS0 to ttyS4 would probably have had the same effect.

        Below you find the output of "cardctl config" and of "dump_cis".  I would appreciate it if you could have a look at that output and tell me whether you believe that it's possible to run the card as Com1-4.  Unfortunately, I'm no expert on this issue.

        In addition I attached the output of "setserial /dev/ttyS0" and of "cat /proc/tty/driver/serial" so that you can see how I have the card configured, currently.

        ~> dump_cis
        Socket 0:
          dev_info
            NULL 0ns, 512b
          manfid 0x0279, 0x950b
          funcid serial_port [post]
          serial_interface
            uart 16550 [space/mark/odd/even] [5/6/7/8] [1/1.5/2]
          vers_1 7.1, "CF CARD", "GENERIC", "", ""
          config base 0x00f8 mask 0x000f last_index 0x04
          cftable_entry 0x01 [default]
            [rdybsy]
            Vcc Vnom 3300mV
            io 0x03f8-0x0407 [lines=8] [8bit] [range]
            irq mask 0xffff [level] [shared]
          cftable_entry 0x02
            io 0x0000-0x7fff [lines=15] [8bit]
          cftable_entry 0x03 [default]
            [rdybsy]
            Vcc Vnom 5V
            io 0x03f8-0x0407 [lines=8] [8bit] [range]
            irq mask 0xffff [level] [shared]
          cftable_entry 0x04
            io 0x0000-0x7fff [lines=15] [8bit]

        ~> cardctl config
        Socket 0:
          Vcc 3.3V  Vpp1 0.0V  Vpp2 0.0V
          interface type is "memory and I/O"
          irq 4 [exclusive] [level]
          speaker output is enabled
          function 0:
            config base 0x00f8
              option 0x42 status 0x08 pin 0x00 copy 0x00
            io 0x0400-0x040f [8bit]

        ~> setserial /dev/ttyS0
        /dev/ttyS0, UART: 16950/954, Port: 0x0400, IRQ: 4

        ~> cat /proc/tty/driver/serial
        serinfo:1.0 driver:5.05c revision:2001-07-08
        0: uart:16C950/954 port:400 irq:4 baud:9600 tx:0 rx:0

         
        • David Hinds

          David Hinds - 2005-01-19

          > I modified config.h and config_cs.c accordingly (I substituted 0x3f8 with 0x400)

          This makes absolutely no sense to me.  What files are you talking about and what did you change exactly??

          You could try including an IO range of 0x3f8-0x407.  I think that would work if the 0x3f8-0x3ff port range is not already in use by a built-in port.  Otherwise, you are out of luck, without rewriting the resource allocator.

          A quick google indicates that win4lin does support mapping any Linux serial device to the Windows COM1 or COM2 device.

          http://www.netraverse.com/support/docs/guide/chap6.php

          -- Dave

           
          • Felix E. Klee

            Felix E. Klee - 2005-01-24

            > > I modified config.h and config_cs.c accordingly (I substituted 0x3f8 with
            > 0x400)
            >
            > This makes absolutely no sense to me.  What files are you talking
            > about and what did you change exactly??

            I replaced 0x3f8 by 0x400 in the following files (path relative to the
            kernel 2.4.24 source tree's root directory).

            drivers/char/serial.c
            include/asm-i386/serial.h

            And I restricted allocatable IO ports by specifying the following port
            option in config.opts and uncommenting/removing all others:

            include port 0x400-0x410

            The result is that the card's serial port is being bound to the device
            /dev/ttyS0 upon insertion.  A symlink from "/dev/ttyS0" to "/dev/ttyS4"
            (the device file that was used before the changes) would probably have
            had the same effect.  Anyways, the above changes didn't make any
            difference.

            If I don't make the above changes to the kernel modules and if I
            restrict allocatable IO ports to 0x3f8-0x407, then the card is not
            accepted at all:

            serial_cs: RequestIO: No more items

            I conclude that the card simply doesn't support interfacing with port
            0x3f8.  Other standard port/IRQ combinations (0x2F8/3, 0x3E8/4, 0x2e8/3)
            also don't seem to be supported.  That this is not a problem on the host
            computer's side is suggested by inserting my Xircom RM56G serial modem
            card: It happily takes port 0x3f8 and IRQ 4 (without the above
            modifications to the kernel, of course).

            > A quick google indicates that win4lin does support mapping any Linux
            > serial device to the Windows COM1 or COM2 device.

            Unfortunately, the Win4Lin documentation in a way sometimes suggests
            features that aren't available.  If one looks a bit deeper and plays
            around with the software, one finds out that the port number for the
            serial port configuration is hard coded.  This is also confirmed by
            answers I got from Win4Lin support and from developers on the mailing
            list.  Here's a paragraph extracted from a posting to that list (which
            is, however, a bit dated):

            Currently the Win4Lin access to the serial ports is via the "Mserial"
            driver modules.  This is hardwired for standard COM1 and COM2:
               COM1: IRQ4 and 3f8-3ff
               COM2: IRQ3 and 2f8-2ff
            Currently there is no way to change these settings so creating
            new nodes or definitions will not have an effect.
            There are no COM3 or COM4 setings in the driver.

            What is especially misleading at first sight is that fact that one may
            specify IRQs and IO ports in the Win4Lin serial port configuration.
            However, these IRQs and IO ports are those that are visible from within
            the OS running in the virtual machine.  They're linked to IRQ4/3f8-3ff
            (COM1) or IRQ3/2f8-2ff (COM2).

            Two final question that I'd like to have answered before I buy a new
            card:

            * Am I right in that it is not possible to have my card use COM1 or COM2
              (perhaps I've been overlooking some configuration feature all the
              time)?

            * May the firmware of the card be the reason for this behavior?

            Felix

             
            • David Hinds

              David Hinds - 2005-01-28

              Well, here's one more thing to try, but I make no promises.  Put this in a file:

                dev_info NULL 0ns, 512b
                manfid 0x0279, 0x950b
                funcid serial_port [post] 
                vers_1 7.1, "CF CARD", "GENERIC", "", ""
                config base 0x00f8 mask 0x000f last_index 0x04
                cftable_entry 0x01 [default] [rdybsy]
                  Vcc Vnom 3300mV
                  io 0x03f8-0x03ff, 0x0400-0x0407 [lines=8] [8bit] [range]
                  irq mask 0xffff [level] [shared]

              Convert this to a binary with the "pack_cis" command and put it in /etc/pcmcia/cis, and add the following to /etc/pcmcia/config.opts:

                card "My Card"
                  manfid 0x0279, 0x950b
                  cis "cis/mycard.dat"
                  bind "serial_cs"

               
              • Felix E. Klee

                Felix E. Klee - 2005-03-13

                > Well, here's one more thing to try, but I make no promises.  Put this in
                > a file: [...]

                By using your suggestion and restricting port range [1] to 0x3f8-0x3ff I
                got the card into being registered as COM1.  From /var/log/messages:

                ttyS00 at port 0x03f8 (irq = 4) is a 8250

                However, it doesn't work: When trying to access the serial port using
                minicom (with a cell phone acting as a modem attached), I get the error
                message "minicom: cannot open /dev/ttys0: Input/output error".  And even
                if it would work: An (emulated) 8250 is dog slow.

                So, I've ordered a new RS232 PC-Card: The SL232 from Hacker Datentechnik
                in Germany [2].  This card has a 16C550 UART.

                Anyways, thanks again for your generous help!

                PS: Sorry for answering so late.  I actually tried your suggestion the
                same day that I received.  Procrastination is the source of all
                evil. ;-)

                [1] Otherwise the card, as explained earlier, will be hooked to
                    /dev/ttyS4 which is not what I want.

                [2] http://www.hacker-technology.com/3387/3456.html

                 
                • Felix E. Klee

                  Felix E. Klee - 2005-03-15

                  > "minicom: cannot open /dev/ttys0: Input/output error"

                  Sorry, I made a mistake: I did specify "/dev/ttys0" instead of "/dev/ttyS0" when repating the test on Sunday.  IIRC, when I originally tried out your suggestion, I specified "/dev/ttyS0" and the problem was that I simply couldn't communicate with the externally attached cell phone.  If you want, I can repeat the test.  If not, I probalby won't since today my SL232-R arrived and this one works fine, AFAICS: Upon insertion it registers as COM1 without any me having to apply any tricks.

                   
                  • Felix E. Klee

                    Felix E. Klee - 2005-03-17

                    > I can repeat the test.

                    Just did it today, with another serial device: an ELSA MicroLink 56k Internet modem.  As expected, with the DeLock card (ox16cf950) registered as COM1 [1], I cannot establish any communications using any of the standard data rates offered by minicom 2.00.0.  Not even 300 Bps works, although the modem does support it (I verified that with my new card).

                    [1] ttyS00 at port 0x03f8 (irq = 4) is a 8250

                     

Log in to post a comment.