I found many of the examples provided at hipstercircuits to be a bit overwhelming; especially if you're just looking to adjust the pins to mode 7. If anyone reading this is having the same issue, the following link may help: http://bbbadventures.blogspot.ca/2013/06/pinmuxing.html It provides the most basic template.
Should the link above break, here's the snippet provided (with a few tweaks for clarity):
/*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/plugin/;
/ { compatible = "ti,beaglebone", "ti,beaglebone-black";
/* identification */
part-number = "pinctrl-test-0";
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
pinctrl_test: pinctrl_test_0_pins {
pinctrl-single,pins = <
0x030 0x07 /* P8_12 OUTPUT | MODE7 */
0x034 0x07 /* P8_11 OUTPUT | MODE7 */
/* Add more pins here */
>;
};
};
};
fragment@1 {
target = <&ocp>;
__overlay__ {
test_helper: helper {
compatible = "bone-pinmux-helper";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_test>;
status = "okay";
};
};
};
};
When adding more pins to the above snippet, you can use the following tables to identify which hex values match the pins:
Each pin is set by appending an additional entry into pinctrl-single,pins. The format looks like this:
[offset] [mode]
Example: 0x030 0x07
In the two tables linked above refer to the third column, entitled "ADDR/OFFSET", for the offset value.
I hope this helps :)
Edit: I should also mention that the answers provided by Martin and Don are both excellent should help cover the rest of the important details.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…