DragonFly kernel List (threaded) for 2007-05
DragonFly BSD
DragonFly kernel List (threaded) for 2007-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

getting sio.c to work with sony-ericsson GC89


From: Chris Turner <c.turner@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 19 May 2007 23:06:44 -0400

hello all,

I've recently been trying to get the EDGE/GPRS portion of the GC89
working under 1.8.x, but have been having some troubles ..

The card attaches fine as a regular 'com' port under OpenBSD 4
and can handle a 15minute PPP session, but unfortunately the com/sio
and cardbus differences between DF/Free and Net/Open are quite
different so I'm having trouble nailing down the problem.. thinking this
should be a 'sio' though, as it appears to be a Broadcom 4344 '16550'
kind of thing.

Initially, the card was 'unable to drain sio0', but after hacking
around that test on the odd chance that it probed with no spare data,
it doesn't seem to work in any case.

diff against sio.c attached, only other changes were to add the card
to pcidevs (not included here), add tons of printk's in various
places and set:

device cbb
device pccard
device cardbus
device sio

in my CONFIG. I also tried this without ACPI and the results were the same.

Relavent portion of my dmesg, openbsd4 dmesg [1]_, and sio.c patch
attached. Please note that this card is a 2 function 802.11 and
EDGE/GPRS device, I'm currently only concerned with the EDGE portion on
'function 1'.

any suggestions or other patches welcome, please let me know if more
data is needed.

Thanks,

- Chris

. . [1] from a different machine/cbb but based on the partial probe
   I don't suspect that's the problem


dkcsum: wd1 matches BIOS drive 0x81
dkcsum: wd2 matches BIOS drive 0x82
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302
Broadcom, 802.11b CardBus, 8.0 (manufacturer 0x2d0, product 0x406) "Broadcom BCM43XG" rev 0x03 at cardbus0 dev 0 function 0 not configured
pccom3 at cardbus0 dev 0 function 1: irq 9: ns16550a, 16 byte fifo
cd0(atapiscsi0:0:0): Check Condition (error 0x70) on opcode 0x0
    SENSE KEY: Not Ready
     ASC/ASCQ: Medium Not Present
pccom3 detached
ad4s1: type 0xa5, start 0, end = 19536047, size 19536048 : OK
ad4s2: type 0xa5, start 19536363, end = 273508703, size 253972341 : OK
sched_ithd: stray interrupt 7
ad4s1: type 0xa5, start 0, end = 19536047, size 19536048 : OK
ad4s2: type 0xa5, start 19536363, end = 273508703, size 253972341 : OK
sched_ithd: stray interrupt 7
ad4s1: type 0xa5, start 0, end = 19536047, size 19536048 : OK
ad4s2: type 0xa5, start 19536363, end = 273508703, size 253972341 : OK
sched_ithd: stray interrupt 7
ad4s1: type 0xa5, start 0, end = 19536047, size 19536048 : OK
ad4s2: type 0xa5, start 19536363, end = 273508703, size 253972341 : OK
ad4s1: type 0xa5, start 0, end = 19536047, size 19536048 : OK
ad4s2: type 0xa5, start 19536363, end = 273508703, size 253972341 : OK
sched_ithd: stray interrupt 7
ad4s1: type 0xa5, start 0, end = 19536047, size 19536048 : OK
ad4s2: type 0xa5, start 19536363, end = 273508703, size 253972341 : OK
sched_ithd: stray interrupt 7
ad4s1: type 0xa5, start 0, end = 19536047, size 19536048 : OK
ad4s2: type 0xa5, start 19536363, end = 273508703, size 253972341 : OK
sched_ithd: stray interrupt 7
ad4s1: type 0xa5, start 0, end = 19536047, size 19536048 : OK
ad4s2: type 0xa5, start 19536363, end = 273508703, size 253972341 : OK
bge0: gigabit link up
sched_ithd: stray interrupt 7
sched_ithd: stray interrupt 7
splash: image decoder found: daemon_saver
sched_ithd: stray interrupt 7
sched_ithd: stray interrupt 7
sched_ithd: stray interrupt 7
acpi_ec0: info: new max delay is 11000 us
sched_ithd: stray interrupt 7
sched_ithd: stray interrupt 7
read_device Vendor was not FFFFFFFF
read_device: got memory
attachcard: dinfo == c1daa208
found->	vendor=0x14e4, dev=0x4325, revid=0x03
	class=[NETWORK]02-80-00, hdrtype=0x00, mfdev=1
	cmdreg=0x0000, statreg=0x0000, cachelnsz=0 (dwords)
	lattimer=0xa8 (5040 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
	intpin=a, irq=255
device_add_child_ordered:551: (null) at cardbus with order 0 as unit -1
make_device:481: (null) at cardbus as unit -1
resource list init
device set ivars
cardbus do cis
pcib6: device cardbus0 requested decoded memory range 0x88000000-0xffffffff
Product version: 8.0
Product name: Broadcom | 802.11b CardBus | 8.0 | 
Manufacturer ID: d0020604
Function Extension: 0406000fde5d0a09
Functions: Network Adaptor, Multi-Functioned
Function Extension: 0107
function extension lan
function lan tech
Function Extension: 0240420f00
function extension lan
Function Extension: 0280841e00
function extension lan
Function Extension: 0260ec5300
function extension lan
Function Extension: 02c0d8a700
function extension lan
Function Extension: 0307
function extension lan
function lan media
Function Extension: 0501
function extension lan
function lan conn
cardbus0: Opening BAR: type=MEM, bar=10, len=1000
CIS reading done
pcib6: device cardbus0 requested decoded memory range 0x88000000-0xffffffff
cardbus0: Non-prefetchable memory at 88001000-88001fff
pcib6: device cardbus0 requested decoded memory range 0x88001000-0x88001fff
cardbus0: Non-prefetchable memory rid=10 at 88001000-88001fff (1000)
device_probe_child found next matching
device_probe_child:671: Trying fwohci
devclass_find_internal:119: looking for fwohci to create
devclass_add_device:428: (null) in devclass fwohci
devclass_alloc_unit:377: unit -1 in devclass fwohci
devclass_alloc_unit:417: now: unit 1 in devclass fwohci
devclass_delete_device:457: fwohci in devclass fwohci
device_probe_child found next matching
device_probe_child:671: Trying uhci
devclass_find_internal:119: looking for uhci to create
devclass_add_device:428: (null) in devclass uhci
devclass_alloc_unit:377: unit -1 in devclass uhci
devclass_alloc_unit:417: now: unit 0 in devclass uhci
devclass_delete_device:457: uhci in devclass uhci
device_probe_child found next matching
device_probe_child:671: Trying ohci
devclass_find_internal:119: looking for ohci to create
devclass_add_device:428: (null) in devclass ohci
devclass_alloc_unit:377: unit -1 in devclass ohci
devclass_alloc_unit:417: now: unit 2 in devclass ohci
devclass_delete_device:457: ohci in devclass ohci
device_probe_child found next matching
device_probe_child:671: Trying sio
devclass_find_internal:119: looking for sio to create
devclass_add_device:428: (null) in devclass sio
devclass_alloc_unit:377: unit -1 in devclass sio
devclass_alloc_unit:417: now: unit 0 in devclass sio
sio_pci_probe ()
sio_pci_probe() : 432514e4
sio_pci_probe () : id->desc == NULL
devclass_delete_device:457: sio in devclass sio
device_probe_child found next matching
device_probe_child:671: Trying ahc
devclass_find_internal:119: looking for ahc to create
devclass_add_device:428: (null) in devclass ahc
devclass_alloc_unit:377: unit -1 in devclass ahc
devclass_alloc_unit:417: now: unit 0 in devclass ahc
devclass_delete_device:457: ahc in devclass ahc
device_probe_child found next matching
device_probe_child:671: Trying ahd
devclass_find_internal:119: looking for ahd to create
devclass_add_device:428: (null) in devclass ahd
devclass_alloc_unit:377: unit -1 in devclass ahd
devclass_alloc_unit:417: now: unit 0 in devclass ahd
devclass_delete_device:457: ahd in devclass ahd
device_probe_and_attach : child returned error
cardbus0: <unknown card> (vendor=0x14e4, dev=0x4325) at 0.0 irq 11
probe & attach failed
read_device Vendor was not FFFFFFFF
read_device: got memory
attachcard: dinfo == c1daa298
found->	vendor=0x14e4, dev=0x4344, revid=0x03
	class=[SIMPLECOMM]07-00-02, hdrtype=0x00, mfdev=0
	cmdreg=0x0000, statreg=0x0000, cachelnsz=0 (dwords)
	lattimer=0xa8 (5040 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
	intpin=a, irq=255
device_add_child_ordered:551: (null) at cardbus with order 0 as unit -1
make_device:481: (null) at cardbus as unit -1
resource list init
device set ivars
cardbus do cis
cardbus0: Resource not specified in CIS: id=10, size=100
cardbus0: IO port at 1100-11ff
cardbus0: IO port rid=10 at 1100-11ff
device_probe_child found next matching
device_probe_child:671: Trying fwohci
devclass_find_internal:119: looking for fwohci to create
devclass_add_device:428: (null) in devclass fwohci
devclass_alloc_unit:377: unit -1 in devclass fwohci
devclass_alloc_unit:417: now: unit 1 in devclass fwohci
devclass_delete_device:457: fwohci in devclass fwohci
device_probe_child found next matching
device_probe_child:671: Trying uhci
devclass_find_internal:119: looking for uhci to create
devclass_add_device:428: (null) in devclass uhci
devclass_alloc_unit:377: unit -1 in devclass uhci
devclass_alloc_unit:417: now: unit 0 in devclass uhci
devclass_delete_device:457: uhci in devclass uhci
device_probe_child found next matching
device_probe_child:671: Trying ohci
devclass_find_internal:119: looking for ohci to create
devclass_add_device:428: (null) in devclass ohci
devclass_alloc_unit:377: unit -1 in devclass ohci
devclass_alloc_unit:417: now: unit 2 in devclass ohci
devclass_delete_device:457: ohci in devclass ohci
device_probe_child found next matching
device_probe_child:671: Trying sio
devclass_find_internal:119: looking for sio to create
devclass_add_device:428: (null) in devclass sio
devclass_alloc_unit:377: unit -1 in devclass sio
devclass_alloc_unit:417: now: unit 0 in devclass sio
sio_pci_probe ()
sio_pci_probe() : 434414e4
sio_pci_probe () :  device set desc
sio_pci_probe () :  return sioprobe id->rid 10
sioprobe(): com: d02a00c8 , com->bst: 0, com->bsh: 1100, com->rclk: 1c2000
sioprobe(): iobase: 1100
sioprobe(): iobase: 1100, siocniobase: 0
sioprobe(): unlocking com
sio0: irq maps: 0x1 0x1 0x1 0x1
sio0: probe failed test(s): 0 1 2 4 6 7 9
devclass_delete_device:457: sio in devclass sio
device_probe_child found next matching
device_probe_child:671: Trying ahc
devclass_find_internal:119: looking for ahc to create
devclass_add_device:428: (null) in devclass ahc
devclass_alloc_unit:377: unit -1 in devclass ahc
devclass_alloc_unit:417: now: unit 0 in devclass ahc
devclass_delete_device:457: ahc in devclass ahc
device_probe_child found next matching
device_probe_child:671: Trying ahd
devclass_find_internal:119: looking for ahd to create
devclass_add_device:428: (null) in devclass ahd
devclass_alloc_unit:377: unit -1 in devclass ahd
devclass_alloc_unit:417: now: unit 0 in devclass ahd
devclass_delete_device:457: ahd in devclass ahd
device_probe_and_attach : child returned error
cardbus0: <unknown card> (vendor=0x14e4, dev=0x4344) at 0.1 irq 11
probe & attach failed
HACKIN attachcard: dinfo == NULL
HACKIN attachcard: dinfo == NULL
HACKIN attachcard: dinfo == NULL
HACKIN attachcard: dinfo == NULL
HACKIN attachcard: dinfo == NULL
HACKIN attachcard: dinfo == NULL
cbb0: CardBus card activation failed
Index: sio.c
===================================================================
RCS file: /nbsd/dcvs/src/sys/dev/serial/sio/sio.c,v
retrieving revision 1.38
diff -u -r1.38 sio.c
--- sio.c	22 Dec 2006 23:26:24 -0000	1.38
+++ sio.c	20 May 2007 02:16:43 -0000
@@ -357,6 +357,7 @@
 	{ 0x7101135e, "SeaLevel Ultra 530.PCI Single Port Serial", 0x18 },
 	{ 0x0000151f, "SmartLink 5634PCV SurfRider", 0x10 },
 	{ 0x98459710, "Netmos Nm9845 PCI Bridge with Dual UART", 0x10 },
+	{ 0x434414e4, "Broadcom 4344 Gizmomabob", 0x10 },
 	{ 0x00000000, NULL, 0 }
 };
 
@@ -413,13 +414,26 @@
 	u_int32_t	type;
 	struct pci_ids	*id;
 
+kprintf("sio_pci_probe ()\n");
+
 	type = pci_get_devid(dev);
+
+kprintf("sio_pci_probe() : %x\n", type);
+
 	id = pci_ids;
-	while (id->type && id->type != type)
+	while (id->type && id->type != type) {
+
 		id++;
-	if (id->desc == NULL)
+
+}
+	if (id->desc == NULL) {
+
+kprintf("sio_pci_probe () : id->desc == NULL\n");
 		return (ENXIO);
+	}
+kprintf("sio_pci_probe () :  device set desc\n");
 	device_set_desc(dev, id->desc);
+kprintf("sio_pci_probe () :  return sioprobe id->rid %x\n", id->rid);
 	return (sioprobe(dev, id->rid, 0UL));
 }
 #endif /* NPCI > 0 */
@@ -584,6 +598,10 @@
 		rclk = DEFAULT_RCLK;
 	com->rclk = rclk;
 
+kprintf("sioprobe(): com: %x , com->bst: %x, com->bsh: %x, com->rclk: %x\n",
+	com, com->bst, com->bsh, com->rclk);
+
+
 #if 0
 	/*
 	 * XXX this is broken - when we are first called, there are no
@@ -634,6 +652,9 @@
 	mcr_image = MCR_IENABLE;
 #ifdef COM_MULTIPORT
 	if (COM_ISMULTIPORT(flags)) {
+
+kprintf("sioprobe(): COM_ISMULTIPORT enter..\n");
+
 		Port_t xiobase;
 		u_long io;
 
@@ -663,6 +684,8 @@
 	bzero(failures, sizeof failures);
 	iobase = rman_get_start(port);
 
+kprintf("sioprobe(): iobase: %x\n", iobase); /* Port_t */
+
 	/*
 	 * We don't want to get actual interrupts, just masked ones.
 	 * Interrupts from this line should already be masked in the ICU,
@@ -678,6 +701,7 @@
 	 * get highest baudrates.
 	 */
 	if (COM_TI16754(flags)) {
+kprintf("sioprobe(): enter COM_TI16754\n");
 		u_char cfcr, efr;
 
 		cfcr = sio_getreg(com, com_cfcr);
@@ -705,6 +729,10 @@
 	 * XXX what about the UART bug avoided by waiting in comparam()?
 	 * We don't want to to wait long enough to drain at 2 bps.
 	 */
+
+kprintf("sioprobe(): iobase: %x, siocniobase: %x\n",
+	iobase, siocniobase);
+
 	if (iobase == siocniobase) {
 		DELAY((16 + 1) * 1000000 / (comdefaultrate / 10));
 	} else {
@@ -725,12 +753,15 @@
 			break;
 		(void)sio_getreg(com, com_data);
 	}
+#if 0
+/* debug hack.. what if probes empty? */
 	if (fn == 256) {
 		kprintf("sio%d: can't drain, serial port might "
 			"not exist, disabling\n", device_get_unit(dev));
 		com_unlock();
 		return (ENXIO);
 	}
+#endif
 
 	/*
 	 * Enable the interrupt gate and disable device interupts.  This
@@ -784,6 +815,7 @@
 	 * for IIR_TXRDY implementation ( Palido 321s, DC-1S... )
 	 */
 	if (COM_NOPROBE(flags)) {
+kprintf("sioprobe(): COM_NOPROBE enter\n");
 		/* Reading IIR register twice */
 		for (fn = 0; fn < 2; fn ++) {
 			DELAY(10000);
@@ -848,6 +880,7 @@
 	irqmap[3] = isa_irq_pending();
 	failures[9] = (sio_getreg(com, com_iir) & IIR_IMASK) - IIR_NOPEND;
 
+kprintf("sioprobe(): unlocking com\n");
 	com_unlock();
 
 	irqs = irqmap[1] & ~irqmap[0];
@@ -878,6 +911,7 @@
 		}
 	bus_release_resource(dev, SYS_RES_IOPORT, rid, port);
 	return (iobase == siocniobase ? 0 : result);
+
 }
 
 #ifdef COM_ESP
@@ -3093,6 +3127,7 @@
 
 DRIVER_MODULE(sio, isa, sio_isa_driver, sio_devclass, 0, 0);
 #if NPCI > 0
+DRIVER_MODULE(sio, cardbus, sio_pci_driver, sio_devclass, 0, 0);
 DRIVER_MODULE(sio, pci, sio_pci_driver, sio_devclass, 0, 0);
 #endif
 #if NPUC > 0


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]