Subject: port-macppc/15505: 1.5.3_ALPHA, enable power of modem
To: None <gnats-bugs@gnats.netbsd.org>
From: None <makoto@ki.nu>
List: netbsd-bugs
Date: 02/06/2002 12:51:41
>Number:         15505
>Category:       port-macppc
>Synopsis:       obio.c change for modem power
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-macppc-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 05 19:52:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Makoto Fujiwara
>Release:        NetBSD 1.5.2, 1.5.3_ALPHA
>Organization:
	 www.ki.nu
>Environment:
	
	System: 
	NetBSD harry 1.5.3_ALPHA NetBSD 1.5.3_ALPHA (GENERIC-insecure-modem) #0: 
	Tue Feb 5 14:22:55 JST 2002 
	makoto@harry:/export/src-netbsd-1-5/sys/arch/macppc/compile/GENERIC-insecure-modem 
	macppc
>Description:
	
	From the epoch, the power line of the modem has been disabled if NetBSD is running.
>How-To-Repeat:
	
	(1) Have model with internal modem, for example, G4/400 AGP, iBook/SE 366.
	(2) Run any NetBSD/macppc
	(3) change (on -> off) tty00 line  at /etc/ttys, kill -1 1,
            ... This is not necessay if the fix attached is NO applied,
	(4) # chown uucp /dev/tty00
	    # cu -l /dev/tty00 -s 115200
	    # at
             ... no response,
             (type ~. to exit)
>Fix:
	
	Based on the mail from Timm Wetzel,
	  http://mail-index.netbsd.org/port-macppc/2001/09/18/0001.html
	  I have patch for 1.5.3_ALPHA. It works for both of 
	KeyLargo internal modem in G4 and iBook/SE 366.

--- sys/arch/macppc/dev/obio.c-1.9.4.1	Sun Jan 27 16:11:56 2002
+++ sys/arch/macppc/dev/obio.c	Tue Feb  5 14:12:50 2002
@@ -129,6 +129,19 @@
 
 	printf(": addr 0x%x\n", ca.ca_baseaddr);
 
+	/* XXX Enable internal modem (KeyLargo) */
+	if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_KEYLARGO) {
+	  printf("enabling KeyLargo internal modem\n");
+	  out32rb(ca.ca_baseaddr + 0x40, 
+		  in32rb(ca.ca_baseaddr + 0x40) & ~((u_int32_t)1<<25)); /* power modem on */
+	}
+	/* XXX completely untested */
+        /* XXX Enable internal modem (Pangea) */
+	if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_PANGEA_MACIO) {
+	  out8(ca.ca_baseaddr + 0x006a + 0x03, 0x04); /* set reset */
+	  out8(ca.ca_baseaddr + 0x006a + 0x02, 0x04); /* power modem on */
+	  out8(ca.ca_baseaddr + 0x006a + 0x03, 0x05); /* unset reset */
+	}
 	for (child = OF_child(node); child; child = OF_peer(child)) {
 		namelen = OF_getprop(child, "name", name, sizeof(name));
 		if (namelen < 0)


>Release-Note:
>Audit-Trail:
>Unformatted: