From nobody@FreeBSD.org  Sat Apr 13 10:24:37 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 787EA764
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 13 Apr 2013 10:24:37 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 6B66AB65
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 13 Apr 2013 10:24:37 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r3DAOaK9051679
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 13 Apr 2013 10:24:36 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r3DAOal0051678;
	Sat, 13 Apr 2013 10:24:36 GMT
	(envelope-from nobody)
Message-Id: <201304131024.r3DAOal0051678@red.freebsd.org>
Date: Sat, 13 Apr 2013 10:24:36 GMT
From: Petko Bordjukov <bordjukov@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [mips] [gpio] GPIO and RF LED do not function on UBNT Routerstation
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         177832
>Category:       kern
>Synopsis:       [mips] [gpio] [patch] GPIO and RF LED do not function on UBNT Routerstation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    loos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 13 10:30:00 UTC 2013
>Closed-Date:    Wed Aug 28 14:56:44 UTC 2013
>Last-Modified:  Wed Aug 28 14:56:44 UTC 2013
>Originator:     Petko Bordjukov
>Release:        10.0-CURRENT
>Organization:
>Environment:
FreeBSD rtrf3n 10.0-CURRENT FreeBSD 10.0-CURRENT #39 r249144M: Fri Apr  5 14:04:07 EEST 2013     root@virtbsd10:/usr/obj/mips.mips/usr/src/sys/ROUTERSTATION  mips
>Description:
The current configuration of the kernel for the UBNT Routerstation does not allow proper GPIO control.
>How-To-Repeat:
# echo 1 > /dev/led/rf

or

# gpioctl -f /dev/gpioc0 -l
>Fix:
Copy over to ROUTERSTATION.hints the portion of RSPRO.hints that remedies this issue.

Patch attached with submission follows:

Index: ROUTERSTATION.hints
===================================================================
--- ROUTERSTATION.hints	(revision 249406)
+++ ROUTERSTATION.hints	(working copy)
@@ -12,6 +12,24 @@
 # Uncomment this hint for RS (not PRO)
 hint.arge.1.phymask=0x30000
 
+# Don't flip on anything that isn't already enabled.
+# This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're
+# not used here.
+hint.gpio.0.function_set=0x00000000
+hint.gpio.0.function_clear=0x00000000
+
+# These are the GPIO LEDs and buttons which can be software controlled.
+hint.gpio.0.pinmask=0x000000ff
+
+# GPIO 0: Pin 1
+# GPIO 1: Pin 2
+# GPIO 2: RF LED
+# GPIO 3: Pin 3
+# GPIO 4: Pin 4
+# GPIO 5: Pin 5
+# GPIO 6: Pin 6
+# GPIO 7: Pin 7
+
 # RF led
 hint.gpioled.0.at="gpiobus0"
 hint.gpioled.0.name="rf"


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-mips 
Responsible-Changed-By: adrian 
Responsible-Changed-When: Fri May 10 00:47:06 UTC 2013 
Responsible-Changed-Why:  
Change to maintainer. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=177832 
Responsible-Changed-From-To: freebsd-mips->loos 
Responsible-Changed-By: loos 
Responsible-Changed-When: Mon Aug 19 13:20:16 UTC 2013 
Responsible-Changed-Why:  
I will take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=177832 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/177832: commit references a PR
Date: Wed, 28 Aug 2013 14:43:16 +0000 (UTC)

 Author: loos
 Date: Wed Aug 28 14:43:04 2013
 New Revision: 254989
 URL: http://svnweb.freebsd.org/changeset/base/254989
 
 Log:
   Add the default hints to make the GPIO pins, rf led and reset switch work
   out of the box on RouterStation.
   
   PR:	177832
   Submitted by:	Petko Bordjukov (bordjukov@gmail.com)
   Approved by:	adrian (mentor)
 
 Modified:
   head/sys/mips/conf/ROUTERSTATION.hints
 
 Modified: head/sys/mips/conf/ROUTERSTATION.hints
 ==============================================================================
 --- head/sys/mips/conf/ROUTERSTATION.hints	Wed Aug 28 14:39:24 2013	(r254988)
 +++ head/sys/mips/conf/ROUTERSTATION.hints	Wed Aug 28 14:43:04 2013	(r254989)
 @@ -23,6 +23,24 @@ hint.arge.1.mdio=mdioproxy1	# .. off of 
  hint.ukswitch.0.at="mdio0"
  hint.ukswitch.0.phymask=0x30000
  
 +# Don't flip on anything that isn't already enabled.
 +# This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're
 +# not used here.
 +hint.gpio.0.function_set=0x00000000
 +hint.gpio.0.function_clear=0x00000000
 +
 +# These are the GPIO LEDs and buttons which can be software controlled.
 +hint.gpio.0.pinmask=0x000000ff
 +
 +# GPIO 0: Pin 1
 +# GPIO 1: Pin 2
 +# GPIO 2: RF LED
 +# GPIO 3: Pin 3
 +# GPIO 4: Pin 4
 +# GPIO 5: Pin 5
 +# GPIO 6: Pin 6
 +# GPIO 7: Pin 7
 +
  # RF led
  hint.gpioled.0.at="gpiobus0"
  hint.gpioled.0.name="rf"
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: loos 
State-Changed-When: Wed Aug 28 14:56:43 UTC 2013 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=177832 
>Unformatted:
