From owner-freebsd-arm@freebsd.org Thu Jan 26 03:29:58 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87FF9CC287B for ; Thu, 26 Jan 2017 03:29:58 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25179EC0 for ; Thu, 26 Jan 2017 03:29:57 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: b52faeff-e377-11e6-9357-bffcd86bd944 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id b52faeff-e377-11e6-9357-bffcd86bd944; Thu, 26 Jan 2017 03:29:57 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v0Q3TjiY002419; Wed, 25 Jan 2017 20:29:45 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1485401385.30533.59.camel@freebsd.org> Subject: Re: BBB uarts & pps dts definitions From: Ian Lepore To: Tony Hain , freebsd-arm@freebsd.org Date: Wed, 25 Jan 2017 20:29:45 -0700 In-Reply-To: <03a801d2776e$cae997e0$60bcc7a0$@tndh.net> References: <03a801d2776e$cae997e0$60bcc7a0$@tndh.net> Content-Type: multipart/mixed; boundary="=-rrWnCRfX9mAl0WmUVWjm" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2017 03:29:58 -0000 --=-rrWnCRfX9mAl0WmUVWjm Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit On Wed, 2017-01-25 at 16:54 -0800, Tony Hain wrote: > Hi, > > [...] > > I figured it would be simpler to start debugging with the serial port first > since there was an example for the working console port. My original intent > was to use uart5 since it was also on P8, but given gpioctl is only listing > the first 32 I switched to uart1  (P9-26). Simply changing the "disabled" to > "okay" for the uart was sufficient to make it show up as /dev/ttyu1, but not > enough to make it work. Taking hints from various dts files for uart1, I > have: >       uart1_pins:  pinmux_uart1_pins { >                 pinctrl-single,pins = <0x180 0x020 0x184 0x0>; >                  linux,phandle = <0x1>; >                  phandle = <0x1>; >         }; > ... >                 serial@48022000 { >                         compatible = "ti,am3352-uart", "ti,omap3-uart"; >                         ti,hwmods = "uart2"; >                         clock-frequency = <0x2dc6c00>; >                         reg = <0x48022000 0x2000>; >                         interrupts = <0x49>; > //                    status = "disabled"; >                         status = "okay"; >                         dmas = <0x29 0x1c 0x0 0x29 0x1d 0x0>; >                         dma-names = "tx", "rx"; > >                         pinctrl-names = "default"; >                         pinctrl-0 = <&uart1_pins>; >                 }; > I am getting a duplication error for the phandle lines. I realize the > existing devices have unique hex values for those, but the only references > search is turning up and downloadable dtb files I can find have the phandle > for that uart as 0x1. Is there a reason that all the uarts are not listed > with the correct values & commented out in the default DTS? In addition, > uart4 & 5 don't have the dma lines that the others have ...  and those lines > don't appear in the reference linux dts files so I can't tell what they are > for. Comments in the dts hinting at where to look for references for other > values would make it easier to clone a working device for another one.  > I don't know anything about the dts overlay stuff, I haven't had time to learn about it yet. Back when I was first working on the dmtpps driver, before I made it configure the timer input pin for itself, I was just modifying the main dts source in sys/gnu/dts/arm/am335x-boneblack.dts to enable uart1 and timer4 for testing.  I'll attach the patch I used to enable them and configure the pins. -- Ian --=-rrWnCRfX9mAl0WmUVWjm Content-Disposition: inline; filename="am335x-boneblack.dts_uart1_timer4.diff" Content-Type: text/x-patch; name="am335x-boneblack.dts_uart1_timer4.diff"; charset="us-ascii" Content-Transfer-Encoding: 7bit Index: sys/gnu/dts/arm/am335x-boneblack.dts =================================================================== --- sys/gnu/dts/arm/am335x-boneblack.dts (revision 312786) +++ sys/gnu/dts/arm/am335x-boneblack.dts (working copy) @@ -64,8 +64,33 @@ AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr0 */ >; }; + uart1_pins: uart1_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x978, PIN_INPUT | MUX_MODE0) /* cts */ + AM33XX_IOPAD(0x97C, PIN_OUTPUT | MUX_MODE0) /* rts */ + AM33XX_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0) /* rxd */ + AM33XX_IOPAD(0x984, PIN_OUTPUT | MUX_MODE0) /* txd */ + >; + }; + timer4_pins: timer4_pins { + pinctrl-single,pins = < + AM33XX_IOPAD(0x890, (PIN_INPUT | MUX_MODE2)) /* timer4 */ + >; + }; }; +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + status = "okay"; +}; + +&timer4 { + pinctrl-names = "default"; + pinctrl-0 = <&timer4_pins>; + status = "okay"; +}; + &lcdc { status = "okay"; port { --=-rrWnCRfX9mAl0WmUVWjm--