Jump to content

Change GPIO boot state on OPI ONE


Alireza

Recommended Posts

Mainline or legacy?

 

In the legacy kernel, this is handled by the fex file during boot.

 

There are three sections in the .fex where you can set the GPIO states, I'm currently researching which one is the preferred way.

 

1)

[boot_init_gpio]
used = 1
gpio0  =  port:PL07<1><default><default><0>
gpio1  =  port:PG11<1><default><default><1>

The GPIO pin configuration is defined in the fex guide http://linux-sunxi.org/Fex_Guide#Port_Definitions

tl;dr: the first <n> is the direction, the last <n> is the value.

 

2)

[gpio_init]
pin_1 = port:PA16<1><default><default><1>
pin_2 = port:PG04<1><default><default><1>
pin_4 = port:PL07<0><default><default><default>

3)

 

[gpio_para]
gpio_used = 1
gpio_num = 2
gpio_pin_1 = port:PG00<0><default><default><default>
gpio_pin_2 = port:PG01<0><default><default><default>

This is used by the SUNXI_GPIO kernel module, which seems to be deprecated.

Link to comment
Share on other sites

Sorry, I mixed my own problem with yours.

 

The answer to your question: the Orange Pi One has the I2C (twi) SCL on PA18. I don't know if the pullup resistor is internal or external. If it is internal, then disabling the I2C peripheral should also disconnect the resistor.

Otherwise you want to set that GPIO pin to low, you will have to disable the I2C device in the fex file, then somehow initialize the GPIO to a low state at boot. I don't know how to do this yet, my solutions don't work.

Link to comment
Share on other sites

On 2/14/2018 at 6:42 PM, PCBela said:

Sorry, I mixed my own problem with yours.

 

The answer to your question: the Orange Pi One has the I2C (twi) SCL on PA18. I don't know if the pullup resistor is internal or external. If it is internal, then disabling the I2C peripheral should also disconnect the resistor.

Otherwise you want to set that GPIO pin to low, you will have to disable the I2C device in the fex file, then somehow initialize the GPIO to a low state at boot. I don't know how to do this yet, my solutions don't work.

Thank you dear

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines