Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Dec 1997 14:57:34 +0900 (JST)
From:      hosokawa@ntc.keio.ac.jp (HOSOKAWA Tatsumi)
To:        nate@mt.sri.com
Cc:        mobile@freebsd.org, hosokawa@ntc.keio.ac.jp
Subject:   Re: Multifunction PC-card support
Message-ID:  <199712150557.OAA02926@afs.ntc.mita.keio.ac.jp>
In-Reply-To: Your message of "Sun, 14 Dec 1997 21:17:57 -0700". <199712150417.VAA03645@mt.sri.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In article <199712150417.VAA03645@mt.sri.com>
nate@mt.sri.com writes:

>> > I started the implementation of multifunction PC-card support on
>> > FreeBSD based on extended PC-card specification.
>> 
>> I'd be very intersted in knowing how you are doing that, and how you
>> plan on changing things in /sys/pccard.  I'm sure Mike is as well, since
>> this is functionality FreeBSD sorely needs.

I only started reading CIS tupples of Mariner card.  But unfortunately
pccardc dumpcis says that this card has following CIS tupples.

--------------------------------------------------------------------------
Configuration data for card in slot 0
Tuple #1, code = 0x1 (Common memory descriptor), length = 2
    000:  00 ff
	Common memory device information:
		Device number 1, type No device, WPS = OFF
		Speed = No speed, Memory block size = reserved, 32 units
Tuple #2, code = 0x15 (Version 1 info), length = 56
    000:  04 01 4d 6f 74 6f 72 6f 6c 61 2c 20 49 6e 63 2e
    010:  00 4d 41 52 49 4e 45 52 20 4d 4f 44 45 4d 2f 46
    020:  41 58 2f 4c 41 4e 00 56 65 72 2e 20 31 2e 32 2e
    030:  30 34 30 38 39 36 00 ff
	Version = 4.1, Manuf = [Motorola, Inc.],card vers = [MARINER MODEM/FAX/LAN]
	Addit. info = [Ver. 1.2.040896],[]
Tuple #3, code = 0x20 (Manufacturer ID), length = 4
    000:  09 01 01 05
	PCMCIA ID = 0x109, OEM ID = 0x501
Tuple #4, code = 0x21 (Functional ID), length = 2
    000:  02 00
	Serial port/modem
Tuple #5, code = 0x22 (Functional EXT), length = 4
    000:  00 02 0f 1c
	Serial interface extension:
		16550 UART, Parity - Space,Mark,Odd,Even,
Tuple #6, code = 0x22 (Functional EXT), length = 11
    000:  01 1f 1e 00 04 00 00 00 04 00 00
	Modem interface capabilities:
Tuple #7, code = 0x22 (Functional EXT), length = 14
    000:  02 06 00 3f 1c 02 03 1f 06 00 00 b5 20 00
	Data modem services available:
Tuple #8, code = 0x22 (Functional EXT), length = 9
    000:  06 1f 1e 00 04 00 00 04 00
	Modem interface capabilities:
Tuple #9, code = 0x22 (Functional EXT), length = 10
    000:  13 06 00 0f 00 00 00 b5 20 00
Tuple #10, code = 0x22 (Functional EXT), length = 10
    000:  23 06 00 0f 00 00 00 b5 20 00
Tuple #11, code = 0x1a (Configuration map), length = 5
    000:  01 45 20 80 77
	Reg len = 2, config register addr = 0x8020, last config = 0x45
	Registers: XXX-XXX- 
Tuple #12, code = 0x1b (Configuration entry), length = 18
    000:  c5 01 99 71 55 1e 4e 23 aa 60 f8 03 07 30 bc 9e
    010:  28 00
	Config index = 0x5(default)
	Interface byte = 0x1 (I/O)
	Vcc pwr:
		Nominal operating supply voltage: 5 x 1V
		Max current average over 1 second: 1.5 x 100mA
		Max current average over 10 ms: 4.5 x 100mA
		Power down supply current: 2 x 100uA
	Card decodes 10 address lines, 8 Bit I/O only
		I/O address # 1: block start = 0x3f8 block length = 0x8
		IRQ modes: Level
		IRQs:  2 3 4 5 7 9 10 11 12 15
	Max twin cards = 0
	Misc attr: (Audio-BVD2) (Power down supported)
Tuple #13, code = 0x1b (Configuration entry), length = 7
    000:  25 08 aa 60 f8 02 07
	Config index = 0x25
	Card decodes 10 address lines, 8 Bit I/O only
		I/O address # 1: block start = 0x2f8 block length = 0x8
Tuple #14, code = 0x1b (Configuration entry), length = 7
    000:  35 08 aa 60 e8 03 07
	Config index = 0x35
	Card decodes 10 address lines, 8 Bit I/O only
		I/O address # 1: block start = 0x3e8 block length = 0x8
Tuple #15, code = 0x1b (Configuration entry), length = 7
    000:  45 08 aa 60 e8 02 07
	Config index = 0x5(default)
	Card decodes 10 address lines, 8 Bit I/O only
		I/O address # 1: block start = 0x2e8 block length = 0x8
Tuple #16, code = 0xff (Terminator), length = 0
2 slots found
--------------------------------------------------------------------------

PC-card standard says that Multifunction CIS has CISTPL_LONGLINK_MFC
(0x06) tupple.  According to this output, this card has no 0x06
longlink tupples in it.  Morever, it says that this card is "Serial
port/modem" only (ID of multifunction card is 0).  I think that this
card is NOT compatible with PC-card standard multifunction support.

Therefore, some sort of dirty hack is needed.  According to tupple
#11, configuration register of a function (maybe it's serial function,
because this card is can be used as serial card without modification
of FreeBSD PC-card support) is placed at 0x8020.

Looked round attribute memory 0x8020 by pccardc rdattr, I found:

--------------------------------------------------------------------------
7fc0: ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 
7fd0: ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 
7fe0: ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 
7ff0: ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 
8000: 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
8010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
8020: 45 00 80 00 22 00 00 00 00 00 00 00 00 00 00 00 
8030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
8040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
8050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
8060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
--------------------------------------------------------------------------

0x8020 seems to be configuration registers of PC-card, but 0x8000 also
seems to be configuration registers.  So, I think that 0x8000 is
configuration registers of another function (maybe Ethernet).

Also looking round attribute memory of this CIS, I found another
garbage bytes follows normal CIS tupples.

--------------------------------------------------------------------------
0160: 02 00 07 00 1b 00 07 00 35 00 08 00 aa 00 60 00 
0170: e8 00 03 00 07 00 1b 00 07 00 45 00 08 00 aa 00 
0180: 60 00 e8 00 02 00 07 00 ff 00 ff 00 00 00 00 00 
                              ~~ end of CIS (0xff)
0190: 06 00 af 00 ba 00 47 00 0c 00 57 00 a4 00 58 00 
01a0: 00 00 01 00 07 00 57 00 04 00 07 00 90 00 b3 00 
01b0: 1f 00 7a 00 af 00 30 00 af 00 00 00 4b 00 8f 00 
01c0: ef 00 11 00 c9 00 34 00 00 00 04 00 00 00 30 00 
01d0: af 00 57 00 a5 00 ab 00 77 00 f6 00 2f 00 07 00 
01e0: 04 00 00 00 00 00 af 00 b5 00 91 00 27 00 f6 00 
01f0: 2f 00 04 00 04 00 af 00 c7 00 d6 00 27 00 b6 00 
0200: ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 
0210: ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 
0220: ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 
0230: ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 
0240: ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 
--------------------------------------------------------------------------

I don't know how to decode this enigma, and perhaps it's really a
garbage :-<.  If you can decode this, please tell me the truth :-).

Anyway, according to PC-card standard, multifunction IRQ shareing can
be identified by searching all function's Intr bit of configuration
option register.  PC-card support of FreeBSD already has pcicintr()
first level interrupt handler. So I think it's not difficult to add
the code that identify which function's Intr bit, dispatch the
interrupt request to the appropriate second-level interrupt handler.

Moreover, according to PC-card standard bit 2-0 of config index of
multifunction card means,

bit 0: enable/disable this function
bit 1: number of I/O addresss used
bit 2: enables IREQ# routing

So, default config index 0x05 means that it enable this function and
enable IREQ# routing.  All config index has 0x05 bits, so I 'feel'
this card partly compatible with PC-card standard.

I'll hack this card and try to write first level interrupt handler
this month.

--
HOSOKAWA, Tatsumi
Network Technology Center
Keio University
hosokawa@ntc.keio.ac.jp



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712150557.OAA02926>