* IR on lombard?
@ 1999-10-26 4:57 chris mccraw
1999-10-26 9:29 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 5+ messages in thread
From: chris mccraw @ 1999-10-26 4:57 UTC (permalink / raw)
To: linuxppc-dev
hi folks,
i've got a 333mhz g3 powerbook on which i'd dearly love to get serial-IR
working. that is to say, use of the IR port like a serial port so that i
can talk to it with a palmpilot which is IR equipped.
the modem (on ttyS0) works a-ok...
this functionality seems to have been present or at least touched on for
the wallstreet powerbooks judging from the code in
drivers/macintosh/macserial.c
but my (weak) attempts to force the second serial port into the role of
wallstreet powerbook_ir seem to have failed.
i did get the kernel to print "(powerbook IR)" next to the serial port init
by forcing zss->is_pwbk_ir to "1" in macserial.c (around line 2270)
but with no effect on the actual performance of the port.
turning on serial debugging shows that performing operations on /dev/ttyS1
seem successful (the port is opened, speed set, etc) but it doesn't answer
the pilot (as an x86 laptop with serial-IR did), nor show any actual
traffic over the port when i send it a few bits from the pilot.
i'm also not even sure that the second serial port detected on boot is
in fact the IR port...that's just a guess i cannot confirm or deny
after reading all the info i could find on the paddington and the pbg3-1999
on apple's site.
i am working with 2.2.13 from paul's tree synced this afternoon.
so, does anyone know if serial/IR is supposed to work on the lombards, or
have further suggestions for me to poke at it with?
much in your debt,
chris
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: IR on lombard?
1999-10-26 4:57 chris mccraw
@ 1999-10-26 9:29 ` Benjamin Herrenschmidt
1999-10-26 11:38 ` Michael Schmitz
0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 1999-10-26 9:29 UTC (permalink / raw)
To: chris mccraw, linuxppc-dev
On Mon, Oct 25, 1999, chris mccraw <chrism@brahma.ticam.utexas.edu> wrote:
>this functionality seems to have been present or at least touched on for
>the wallstreet powerbooks judging from the code in
> drivers/macintosh/macserial.c
>but my (weak) attempts to force the second serial port into the role of
>wallstreet powerbook_ir seem to have failed.
On my wallstreet, ttyS1 is automatically recognized as an IR port, isn't
this the case on your machine ? In this case, I'm interested in a dump of
the device tree portion that contains the escc nodes on your machine.
Also, the code for enabling the IR led is a big guess from spying MacOS,
I'm not 100% sure it's correct. (I'm sure MacOS will send this PMU
command whenever the port B is opened on my wallstreet) but it is
probably not enough. Most IR tranceiver also need to be configured by
sending a special sequence via the flow control lines to configure it to
the appropriate baudrate. ideally, one should either find out which kind
of tranceiver is in the machine, or with an oscilloscope, spy the
sequence sent by MacOS so we can reproduce it.
>i did get the kernel to print "(powerbook IR)" next to the serial port init
>by forcing zss->is_pwbk_ir to "1" in macserial.c (around line 2270)
>but with no effect on the actual performance of the port.
>
>turning on serial debugging shows that performing operations on /dev/ttyS1
>seem successful (the port is opened, speed set, etc) but it doesn't answer
>the pilot (as an x86 laptop with serial-IR did), nor show any actual
>traffic over the port when i send it a few bits from the pilot.
>
>i'm also not even sure that the second serial port detected on boot is
>in fact the IR port...that's just a guess i cannot confirm or deny
>after reading all the info i could find on the paddington and the pbg3-1999
>on apple's site.
If you have only two ports and the first on is the internal modem, then
the second one is the IR port. Again, you should have more details in the
device tree node of this port.
>i am working with 2.2.13 from paul's tree synced this afternoon.
>
>so, does anyone know if serial/IR is supposed to work on the lombards, or
>have further suggestions for me to poke at it with?
>
>much in your debt,
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: IR on lombard?
1999-10-26 9:29 ` Benjamin Herrenschmidt
@ 1999-10-26 11:38 ` Michael Schmitz
0 siblings, 0 replies; 5+ messages in thread
From: Michael Schmitz @ 1999-10-26 11:38 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: chris mccraw, linuxppc-dev
> >this functionality seems to have been present or at least touched on for
> >the wallstreet powerbooks judging from the code in
> > drivers/macintosh/macserial.c
> >but my (weak) attempts to force the second serial port into the role of
> >wallstreet powerbook_ir seem to have failed.
>
> On my wallstreet, ttyS1 is automatically recognized as an IR port, isn't
> this the case on your machine ? In this case, I'm interested in a dump of
> the device tree portion that contains the escc nodes on your machine.
ttyS1 isn't recognized as IR port on my lombard. How do I dump the device
tree?
Michael
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: IR on lombard?
@ 1999-10-26 12:44 Benjamin Herrenschmidt
1999-10-27 13:41 ` Michael Schmitz
0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 1999-10-26 12:44 UTC (permalink / raw)
To: Michael Schmitz, linuxppc-dev
On Tue, Oct 26, 1999, Michael Schmitz
<schmitz@amber.biophys.uni-duesseldorf.de> wrote:
>ttyS1 isn't recognized as IR port on my lombard. How do I dump the device
>tree?
Get lsprop from ftp://devel.linuxppc.org/users/paulus/misc
and use it from /proc/device-tree
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: IR on lombard?
1999-10-26 12:44 IR on lombard? Benjamin Herrenschmidt
@ 1999-10-27 13:41 ` Michael Schmitz
0 siblings, 0 replies; 5+ messages in thread
From: Michael Schmitz @ 1999-10-27 13:41 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
> >ttyS1 isn't recognized as IR port on my lombard. How do I dump the device
> >tree?
>
> Get lsprop from ftp://devel.linuxppc.org/users/paulus/misc
>
> and use it from /proc/device-tree
Ok, here's a patch for proper IrDA detection on the Lombard:
--- drivers/macintosh/macserial.c.org Wed Oct 27 00:16:02 1999
+++ drivers/macintosh/macserial.c Wed Oct 27 00:50:09 1999
@@ -2237,7 +2237,7 @@
struct mac_zschannel *zs_chan_a)
{
struct device_node *ch = zss->dev_node;
- char *conn;
+ char *conn, *slot_name;
int len;
zss->irq = ch->intrs[0].line;
@@ -2264,6 +2264,15 @@
should do no harm anyway */
conn = get_property(ch, "AAPL,connector", &len);
zss->is_pwbk_ir = conn && (strcmp(conn, "infrared") == 0);
+
+ /*
+ * MSch: tested on Lombard; the AAPL,connector property does't exist there
+ * so we evaluate the slot-names property instead.
+ */
+ slot_name = get_property(ch, "slot-names", &len);
+ if (slot_name && len > 4 && (unsigned char) slot_name[3] == 1) {
+ zss->is_pwbk_ir |= (strncmp(&slot_name[4], "IrDA", len-4) == 0);
+ }
if (zss->has_dma) {
zss->dma_priv = NULL;
It seems that the slot-names property is relevant on the Lombard. I'm too
lazy to turn the above slot-names evaluation into a proper OF probe
function. The first four bytes seem too hold the number of names, followed
by that many null terminated strings. Modem and IrDA have a single slot
name of Modem and IrDA (surprise, surprise).
With this patch, the second SCC port is properly identified as IR port,
but that's as far as I can test it. The serial driver contains code to
enable the IR LED, but I recall BenH saying that the PMU hook may need
work on the Lombard.
I might get an IrDA equipped printer soon, until then please try the
above patch and experiment with ttyS1.
Michael
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1999-10-27 13:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-10-26 12:44 IR on lombard? Benjamin Herrenschmidt
1999-10-27 13:41 ` Michael Schmitz
-- strict thread matches above, loose matches on Subject: below --
1999-10-26 4:57 chris mccraw
1999-10-26 9:29 ` Benjamin Herrenschmidt
1999-10-26 11:38 ` Michael Schmitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).