How can I edit pinmux for BeagleBone Black on linux kernel 3.17?

I can look in /sys/kernel/debug/pinctrl/44e10800.pinmux/pins and see the contact I'm interested in:

 pin 38 (44e10898.0) 00000037 pinctrl-single 

This corresponds to GPIO[2]4 or P8.10 .

I am using Fedora 21 with the kernel 3.17.7-300.fc21.armv7hl .

I want to change the multiplexer to 0x27 . In words, this would establish that the pin has an internal push-pull resistor (before it was pulled).

Desired Result:

 pin 38 (44e10898.0) 00000027 pinctrl-single 

What can be done?

Note. There is no /sys/devices/bone_capemgr.* , since this does not apply to Angstrom. A typical DTO approach exports changes by modifying the cape dispatcher. This is not an option.

Edit: after researching from tad thoughts, I did: dtc -I dtb -O dts -o ~/am335x-boneblack.dts /boot/dtb-3.17.7-300.fc21.armv7hl/am335x-boneblack.dtb . I edited this file to:

 ... pinmux@44e10800 { ... example { pinctrl-single,pins = <0x898 0x27>; }; }; ... 

Then I compiled it using dtc , ran it in /boot/dtb-3.17.7-300.fc21.armv7hl/ and rebooted. However, nothing has changed. What's happening?

Edit:

As pointed out by Charles Steinküler, 0x800 needs to be subtracted from the offset, and “something” needs to be referenced by “example”.

If I add 0x098 0x27 to my entry for user_leds_s0 , then the desired behavior is observed:

 ... user_leds_s0 { pinctrl-single,pins = <0x54 0x7 0x58 0x17 0x5c 0x7 0x60 0x170 0x098 0x27>; linux,phandle = <0x3f>; phandle = <0x3f>; }; ... 

Now everything is all right, and I need where I need to go. However, this output is not user_led. It should be in a separate area. So what do I need to do to get the "example" field or the like?

+6
source share
2 answers

I believe that the cape manager material was not transferred through the 3.8 kernel. Not sure if this is planned or not, but at the same time you can edit the tree of flat devices. The easiest way I've found (and I'm still looking for the best way) is to grab the repository in

https://github.com/RobertCNelson/dtb-rebuilder

In the src / arm directory, edit the file am335x-bone-common-pinmux.dtsi. In it you can find "P8_10_default_pin:". This section indicates that pinmux uses 0x37 as the default setting. Change it to 0x27 and save.

Now create a new compiled device tree (.dtb) file by running make. On ubuntu, "make install" puts all the files in the right place. I'm not sure about Fedora where they are going, but digging into / boot / should be interesting. On ubuntu the right spot

 /boot/dtbs/`uname -r`/ 

In my case, I run 3.14.26-ti-r43. After rebooting (and outputting output), the aforementioned change allows outputting to the receiver, and the open state (value) is 0.

 root@arm :~# grep 898 /sys/kernel/debug/pinctrl/44e10800.pinmux/pins pin 38 (44e10898.0) 00000027 pinctrl-single root@arm :~# echo 36 > /sys/class/gpio/export root@arm :~# cat /sys/class/gpio/gpio36/value 0 

I am sure there is a more elegant way to achieve the goal, but it works for me.

+3
source

If you use Robert Nelson kernels (or those from BeagleBoard), pinmux must be under the control of the pinmux-helper driver, which allows you to set temporary pinmux register settings to various predefined values. Locate the file /sys/devices/ocp./P8_10_pinmux./state. If this exists, you can change the output to input with output down:

 # echo gpio_pd > /sys/devices/ocp.*/P8_10_pinmux.*/state 

... or if you are using one of the Debian RCN collections or have installed my universal overlay, you can simply:

 $ config-pin P8.10 in- 

The overlay (for kernels 3.8.13) and the config-pin utility (for any kernel with similar pinmux-helper device entries) can be found here: https://github.com/cdsteinkuehler/beaglebone-universal-io

+1
source

Source: https://habr.com/ru/post/980843/


All Articles