Beaglebone Black pinmuxing
Kyle Evans
kevans at freebsd.org
Thu Aug 16 12:55:24 UTC 2018
On Thu, Aug 16, 2018 at 7:42 AM, Dr. Rolf Jansen <rj at obsigna.com> wrote:
>> Am 15.08.2018 um 23:56 schrieb O'Connor, Daniel <darius at dons.net.au>:
>>
>> Hi,
>> I have a BBB with a GPS engine attached to UART4 (P9_11 - UART4 Rx, P9_13 - UART4 Tx) but I am having trouble communicating with it.
>>
>> I have tried both an overlay and editing the main DTS file directly but while the UART is probed and attached I can't see any data coming in, nor see any go out (by putting a 'scope probe on P9_13 while sending data out cuau2).
>>
>> By my reading of the TRM and some googling P9_13 is gpmc_wait0 who's pinmux offset is 0x870, P9_11 is gpmc_wpn, offset 0x874. The pinmuxes get 0x800 subtracted from this (based on what is already in the DTS file)
>>
>> This is the overlay source..
>> root at generic:/ # cat /boot/dtb/overlays/am335x-beaglebone-uart4a.dtso
>> /dts-v1/;
>> /plugin/;
>>
>> / {
>> compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
>>
>> fragment at 1 {
>> target = <&uart4>;
>> __overlay__ {
>> status = "okay";
>> pinctrl-names = "default";
>> pinctrl-0 = <
>> 0x074 0x06 // gpmc_wpn.uart4_txd_mux2 -> mode 6
>> 0x070 0x2e // gpmc_wait0.uart4_rxd_mux2 -> mode 6
>>> ;
>> };
>> };
>> };
>>
[Puts on overlay police hat =)]
The above corresponds to:
/dts-v1/;
/plugin/;
/ {
compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
};
&uart4 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <
0x074 0x06 // gpmc_wpn.uart4_txd_mux2 -> mode 6
0x070 0x2e // gpmc_wait0.uart4_rxd_mux2 -> mode 6
>;
};
> Said all this, I suggest to try the following overlay - note, I am definitely not the authoritative expert:
>
> /dts-v1/;
> /plugin/;
>
> / {
> compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
>
> exclusive-use = "P9.11","P9.13","uart4";
>
> fragment at 0 {
> target = <&am33xx_pinmux>;
> __overlay__ {
> gpmc_uart4_pins: pinmux_gpmc_uart4_pins {
> pinctrl-single,pins = <
> 0x74 0x00 /* UART4_TXD, PIN_OUTPUT | MODE0 */
> 0x70 0x28 /* UART4_RXD, PIN_INPUT | MODE0 */
> >;
> };
> };
> };
>
> fragment at 1 {
> target = <&uart4>;
> __overlay__ {
> status = "okay";
> pinctrl-names = "default";
> pinctrl-0 = <&gpmc_uart4_pins>;
> };
> };
>
> __local_fixups__ {
> fragment at 1 {
> __overlay__ {
> pinctrl-0 = <0x0>;
> };
> };
> };
> };
>
This one would be:
/dts-v1/;
/plugin/;
/ {
compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
exclusive-use = "P9.11","P9.13","uart4";
};
&am33xx_pinmux {
gpmc_uart4_pins: pinmux_gpmc_uart4_pins {
pinctrl-single,pins = <
0x74 0x00 /* UART4_TXD, PIN_OUTPUT | MODE0 */
0x70 0x28 /* UART4_RXD, PIN_INPUT | MODE0 */
>;
};
};
&uart4 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&gpmc_uart4_pins>;
};
Both of the above to be compiled with dtc -@ if you're using
/usr/bin/dtc on x86 until [1] gets pulled upstream (though I may
commit it to FreeBSD earlier if it doesn't get pulled before the
freeze). -@ may not be a bad idea if you're planning on slapping other
overlays on top so that they may also do symbol resolution on the
overlay.
We support this syntax for overlays now, and I highly recommend using
it -- it's a pretty great quality of life improvement over
hand-crafting fragments. =)
[Takes off overlay police hat]
Thanks,
Kyle Evans
[1] https://github.com/davidchisnall/dtc/pull/46
More information about the freebsd-arm
mailing list