Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Aug 2018 11:16:54 +0930
From:      "O'Connor, Daniel" <darius@dons.net.au>
To:        "Dr. Rolf Jansen" <rj@obsigna.com>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: Beaglebone Black pinmuxing
Message-ID:  <3B199FD0-479D-49C5-8E6F-DDE3D447EB03@dons.net.au>
In-Reply-To: <56756FA3-8FD7-44A4-A2D8-054E7C86744B@obsigna.com>
References:  <13360A40-3381-4AF9-8EC5-C8E9B00CCABD@dons.net.au> <56756FA3-8FD7-44A4-A2D8-054E7C86744B@obsigna.com>

next in thread | previous in thread | raw e-mail | index | archive | help


> On 16 Aug 2018, at 22:12, Dr. Rolf Jansen <rj@obsigna.com> wrote:
>> Am 15.08.2018 um 23:56 schrieb O'Connor, Daniel <darius@dons.net.au>:
>=20
> 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.
>=20
> 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/
>=20
>   P9_13 starts on line 1271 of the bone.js file:
>   https://github.com/jadonk/bonescript/blob/master/src/bone.js#L1271
>=20
>   P9_11 starts on line 1226 of the bone.js file:
>   https://github.com/jadonk/bonescript/blob/master/src/bone.js#L1226
>=20
>   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/pinct=
rl/am33xx.h?view=3Dco
>=20
>   Now, I guess, that P9_13 would be simply PIN_OUTPUT, which means =
flag 0x00,
>   and P19_11 would be PIN_INPUT =3D
>     =3D (INPUT_EN | PULL_DISABLE) =3D
>     =3D ((1 << 5)| (1 << 3))
>     =3D 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:
>=20
> /dts-v1/;
> /plugin/;
>=20
> / {
> 	compatible =3D "ti,am335x-bone-black", "ti,am335x-bone", =
"ti,am33xx";
>=20
> 	exclusive-use =3D "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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B199FD0-479D-49C5-8E6F-DDE3D447EB03>