In my custom audio cape device tree fragment the modes are setup like thus.
pinctrl-single,pins = <
0x1ac 0x00 /* mcasp0_ahclkx, OUTPUT | MODE0 /
0x194 0x20 / mcasp0_fsx, INPUT | MODE0 /
0x190 0x20 / mcasp0_aclkx, INPUT | MODE0 /
0x198 0x20 / mcasp0_axr0, INPUT | MODE0 /
0x1a8 0x20 / mcasp0_axr1, INPUT | MODE0 /
0x19c 0x02 / mcasp0_axr2, OUTPUT | MODE2 /
0x1a4 0x02 / mcasp0_axr3, OUTPUT | MODE2 */
;
[-- text/plain, encoding 7bit, charset: ISO-8859-15, 23 lines --]
cl@isbd.net writes:
In the BBB System Reference Manual the P8 and P9 pinouts are
documented with 7 modes for each pin which provide different uses for
the pins.
All of the actual software and descriptions I can find about the BBB
hardware just talk about the Device Tree and Device Tree overlays. I
have already (sort) begun to understand the Device Tree system and I
have actually done a (trivial) recompile of the Device Tree to change
one of the I2C clock frequencies.
Do the modes in the manual have any relevance at all now? I.e. can I
actually start the system in a specified mode? Or are they just
history, or what?
If you are writing a device tree you will need to refer to the pin modes
to configure the pinmux.
OK, but I can’t really find out how the PinMux/Modes are referred to
in the device tree. In fact it seems very difficult to find how the
entries in the Device Tree are mapped to the actual pins, I get the
feeling that it’s actually rather simpler than it appears at first
sight but I’m still at the rather lost stage.
The other trouble is that if you look for ‘how to enable the UARTs on
BBB’ there are many ways of doing it:-
Edit the device tree in /boot/uboot/dtbs - this will (as I
understand it) remap things at boot time.
Create a Device Tree Template for just the things to change, this
‘overlays’ the Device Tree so is possible at run time (again, my
understanding)
Edit the uEnv.txt file, I assume this controls the above but it’s
far from clear.
I’d love to find a document or tutorial that describes how this all
hangs together but there doesn’t seem to be anything other than the
(huge) processor documentation which is vey much reference material
and (as I referred to above) various blogs etc. showing how to do one
particular thing but without any attempt to explain it.