Date: Wed, 25 Jan 2017 20:29:45 -0700 From: Ian Lepore <ian@freebsd.org> To: Tony Hain <tony@tndh.net>, freebsd-arm@freebsd.org Subject: Re: BBB uarts & pps dts definitions Message-ID: <1485401385.30533.59.camel@freebsd.org> In-Reply-To: <03a801d2776e$cae997e0$60bcc7a0$@tndh.net> References: <03a801d2776e$cae997e0$60bcc7a0$@tndh.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1485401385.30533.59.camel>