Beaglebone Black pinmuxing

O'Connor, Daniel darius at dons.net.au
Fri Aug 17 02:11:02 UTC 2018



> On 16 Aug 2018, at 22:12, Dr. Rolf Jansen <rj at obsigna.com> wrote:
>> Am 15.08.2018 um 23:56 schrieb O'Connor, Daniel <darius at dons.net.au>:
> 
> Only recently I need to pass over all the very same obstacles as you need to do now, in order to get a DAC-I2C module enabled and working on my BBB. In my case, the curial point was to get the pinmuxing straight and correctly linked to the respective I2C node. My BeableBone Black is running on FreeBSD 12-ALPHA1. Note, there are major differences in the DT between 11 and 12, and therefore depending on your FreeBSD version the following hints may not fully apply.
> 
> 1. The overlay needs 2 fragments, one for the pinmuxing node and
>   another one for node which would use the pins
> 2. The overlay must contain a __local_fixups__ section, because this
>   will let the dtbo loader to link the custom pinmux correctly to your
>   customized node

OK, I'll go back to trying an overlay once I get it working by editing am335x-boneblack.dts

> 3. I am almost sure, that MODE6 is incorrect in your case, however, I
>   am ready to learn otherwise. I looked up the modes for my project
>   in the Database of Pins of the bonescript project on GitHup (which
>   is maintained by one of the BBB developers):
>   https://github.com/jadonk/bonescript/
> 
>   P9_13 starts on line 1271 of the bone.js file:
>   https://github.com/jadonk/bonescript/blob/master/src/bone.js#L1271
> 
>   P9_11 starts on line 1226 of the bone.js file:
>   https://github.com/jadonk/bonescript/blob/master/src/bone.js#L1226
> 
>   AFAIK, the field options contains the array of pinmux modes, starting
>   at 0. MODE6 is NA in the case of P9_13 and urat4_rxd in the case of
>   P9_11. You said, you need gpmc_wpn and gpmc_wait0 respectively, and
>   this would be MODE0 for both pins.

I had a look at http://www.ti.com/lit/ds/symlink/am3358.pdf (section 4.2) and it shows GPMC_WAIT0 is uart4_rxd in mode 6, and GPMC_WPn is uart4_txd in mode 6.

I think bone.js is incorrect for UART4_TXD - it certainly differs from UART4_RXD.

Other UART pins look correct.

> 4. In order to find out the input/output flags, I consulted the file:
>   https://svnweb.freebsd.org/base/head/sys/gnu/dts/include/dt-bindings/pinctrl/am33xx.h?view=co
> 
>   Now, I guess, that P9_13 would be simply PIN_OUTPUT, which means flag 0x00,
>   and P19_11 would be PIN_INPUT =
>     = (INPUT_EN | PULL_DISABLE) =
>     = ((1 << 5)| (1 << 3))
>     = 0x28

I think the UART receiver should have a pull up otherwise it would be susceptible to noise if uncommitted, so I used 0x36 (because 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";

Does FreeBSD used these names?

I noticed Linux has them as #defines for pinmuxing which makes things simpler.

Thanks.

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum




More information about the freebsd-arm mailing list