Full Version: how to change for init status of gpio
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i use the A64(512MB).
i knew the status of gpio in testing that pin 26(pi-2) is high in boot.
i wanna change it default low in boot.

Plz tell me to find a way.

You can find the default hardware state of pins in the A64 datasheet, then it depends what is connected to the pins on the board (check schematics)... which pins are we talking about? The earliest point in time where you can change pin states is if you enable GPIO support in the u-boot SPL (secondary program loader)...
thanks for your reply.

i have a question about configuration compared the Raspberry pi.
raspberry pi can change the state of pin using the dtoverlay command in config.txt file.
Isn't it possible in A64?

In the Raspberry Pi, modify the config.txt file and it can change the state of pin high or low.
(ex. dtoverlay=lirc-rpi:gpio_out_=16,gpio_in_pin=17,gpio _in_pull=down)

if you know the way, reply plz.

The standard way to do it if you are ok with devicetree changes is to edit the board devicetree to override the default pin config. Keep in mind that there are two devicetrees, u-boot uses it's own and linux another - they are mostly the same, but not 100%, and you have to update both depending on how early you need your GPIO setup... check in the /boot folder for the Pine64 devicetree (dtb) file. You can convert that to text with dtc (device tree compiler), make your changes, and convert it back to dtb. The other option is to use the u-boot boot script to change the dtb on the fly - u-boot has the fdt read/write commands to do that...
thanks again, xalius.

Your explain mean changing the default pin config is two way.
I will do two way.

appreciate your advice.
I have two further questions.
I try to convert the dtb to dts. and check the dts file. but there is not about changing the status of default gpio.
so I didn't make it that you told me the one way.

and the other way is using a u-boot.
I have searched the way for installing a u-boot but I can't find the way.

Could you tell me the site of installing a u-boot in a64.
additionally, if you can check the first question, tell me the way plz.


1.) Can you upload your dts to pastebin?

2.) For u-boot it depends which version you are using? Are you running BSP (Linux 3.10.x) or mainline (Linux 4.x.y)? What image are you using?
Thanks for quick answer.

1)I uploaded my dts file. I ask you to check the uploaded file.

2)My Linux version is 3.10.107-pine64.