0
linda

Pine64: Unable to export GPIO 64 - 67

Recommended Posts

Armbianmonitor:

How can I use / release the ports PC0-PC3 (GPIO 64 - 67) in kernel 4.19?

 

In my project I am using the ports PC0-PC3 (GPIO 64 - 67) for in-circuit programming (with avrdude). Everything was fine until I switched from kernel 4.14 to kernel 4.19.

 

Now the ports are already in use. (Although according to the pine64 schematics nothing is connected to those ports)

 

sudo cat /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pins
...
pin 64 (PC0): device 1c68000.spi function spi0 group PC0
pin 65 (PC1): device 1c68000.spi function spi0 group PC1
pin 66 (PC2): device 1c68000.spi function spi0 group PC2
pin 67 (PC3): device 1c68000.spi function spi0 group PC3
...

In kernel 4.14 the ports were unclaimed:

sudo cat /sys/kernel/debug/pinctrl/1c20800.pinctrl/pinmux-pins

...

pin 64 (PC0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 65 (PC1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 66 (PC2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 67 (PC3): (MUX UNCLAIMED) (GPIO UNCLAIMED)

...

 

How can I free the ports so I can use kernel 4.19 in my project?

 

Here is the related information from armbianmonitor -u:

[ 5222.922107] sun50i-a64-pinctrl 1c20800.pinctrl: pin PC3 already requested by 1c68000.spi; cannot claim for 1c20800.pinctrl:67 [ 5222.922122] sun50i-a64-pinctrl 1c20800.pinctrl: pin-67 (1c20800.pinctrl:67) status -22

 

Thanks for any information in advance.

Share this post


Link to post
Share on other sites
7 hours ago, linda said:

sun50i-a64-pinctrl 1c20800.pinctrl: pin PC3 already requested by 1c68000.spi;

Install DT compiler from here : http://ftp.debian.org/debian/pool/main/d/device-tree-compiler/device-tree-compiler_1.4.7-3_arm64.deb

Decompile DTB into DTS :

dtc -I dtb -O dts -o sun50i-a64-pine64-plus.dts /boot/dtb/allwinner/sun50i-a64-pine64-plus.dtb

Edit the file sun50i-a64-pine64-plus.dts by changing "status" from "okay" to "disabled" of the "spi@1c68000" node and save.

Recompile the DTB from this modified DTS :

dtc -I dts -O dtb -o  /boot/dtb/allwinner/sun50i-a64-pine64-plus.dtb sun50i-a64-pine64-plus.dts

Then, reboot ... The GPIOs will be available ...

Share this post


Link to post
Share on other sites

I have changed the DT file after the instructions and now I can use the ports again for my in-circuit programming!


Many Thanks!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
0