P9_11 set output low on power up

99 views
Skip to first unread message

Faby

unread,
Feb 27, 2020, 10:14:17 AM2/27/20
to BeagleBoard
Hi,
I would like to set low the logic level on the P9_11 during the power on, so before the linux kernel has bees loaded.
I do not have experince with tree device and boot loader so I am here to ask your help.
For what I was able to discover and collecting fragmentated informations, I have to modify the file "/boot/dtbs/4.14.71-bone-rt-r17/am335x-boneblack-uboot.dtb".
This file should be responsable for give the earlier informations during the power on start up of the system.
I have decompiled this file and added:

pinmux_P9_11_gpio_pd_pin {
  pinctrl-single,pins = <0x70 0x27>;
  phandle = <0x180>;
};
P9_11_pinmux {
  compatible = "bone-pinmux-helper";
  status = "okay";
  pinctrl-names = "default", "gpio", "gpio_pu", "gpio_pd", "gpio_input", "uart";
  pinctrl-0 = <0x17d>;
  pinctrl-1 = <0x17e>;
  pinctrl-2 = <0x17f>;
  pinctrl-3 = <0x180>;
  pinctrl-4 = <0x181>;
  pinctrl-5 = <0x182>;
};
P9_11 {
  gpio-name = "P9_11";
  gpio = <0x35 0x1e 0x0>;
  output;
  dir-changeable;
};

So, I guess, the system in power up will be able to set up and drive this PIN.

Due to the lack of specific knowledge in this area now I am stuck, I don't know how to precede.

Please help.

Robert Nelson

unread,
Feb 27, 2020, 10:16:07 AM2/27/20
to Beagle Board

Fabrizio Borrello

unread,
Feb 27, 2020, 11:20:30 AM2/27/20
to BeagleBoard
Hi Robert, thank you for the fast reply.

I hade :

P9_11 {
   gpio-name = "P9_11";
   gpio = <0x35 0x1e 0x0>;
   output;
   dir-changeable;
}

Following your directions I modify the initial code as follow:

P9_11 {
                gpio-hog;
                gpios = <11 GPIO_ACTIVE_HIGH>;
                output-low;

                gpio-name = "P9_11";
                gpio = <0x35 0x1e 0x0>;
                dir-changeable;
            };

Is now correct?

Robert Nelson

unread,
Feb 27, 2020, 11:24:42 AM2/27/20
to Beagle Board
On Thu, Feb 27, 2020 at 10:20 AM Fabrizio Borrello
<borrello...@gmail.com> wrote:
>
> Hi Robert, thank you for the fast reply.
>
> I hade :
>
> P9_11 {
> gpio-name = "P9_11";
> gpio = <0x35 0x1e 0x0>;
> output;
> dir-changeable;
> }
>
> Following your directions I modify the initial code as follow:
>
> P9_11 {
> gpio-hog;
> gpios = <11 GPIO_ACTIVE_HIGH>;
> output-low;
> gpio-name = "P9_11";
> gpio = <0x35 0x1e 0x0>;
> dir-changeable;
> };
>
> Is now correct?

No, you can't combine those two..

If all you need is to set the logic level on startup, use gpio-hog..

Fabrizio Borrello

unread,
Feb 27, 2020, 8:43:11 PM2/27/20
to BeagleBoard
Hi Robert,

I apologize for having misunderstood your directions.

I found the controller declaration and attached as a child  the gpio hog as follow:

gpio@44e07000 {
compatible = "ti,omap4-gpio";
ti,hwmods = "gpio1";
gpio-controller;
#gpio-cells = <0x2>;
interrupt-controller;
#interrupt-cells = <0x2>;
reg = <0x44e07000 0x1000>;
interrupts = <0x60>;
gpio-line-names = "MDIO_DATA", "MDIO_CLK", "SPI0_SCLK", "SPI0_D0", "SPI0_D1", "SPI0_CS0", "SPI0_CS1", "ECAP0_IN_PWM0_OUT", "LCD_DATA12", "LCD_DATA13", "LCD_DATA14", "LCD_DATA15", "UART1_CTSN", "UART1_RTSN", "UART1_RXD", "UART1_TXD", "GMII1_TXD3", "GMII1_TXD2", "USB0_DRVVBUS", "XDMA_EVENT_INTR0", "XDMA_EVENT_INTR1", "GMII1_TXD1", "GPMC_AD8", "GPMC_AD9", "NC", "NC", "GPMC_AD10", "GPMC_AD11", "GMII1_TXD0", "RMII1_REFCLK", "GPMC_WAIT0", "GPMC_WPN";
linux,phandle = <0x32>;
phandle = <0x32>;
};

P9_11 {
gpio-hog;
gpios = <11 GPIO_ACTIVE_LOW>;
output-low;
};

I am not sure about the value of 'gpios'.
I read that: "gpios: Store the GPIO information (id, flags, ...). Shall contain the number of cells specified in its parent node (GPIO controller node)".
In this case the parent node contains: "#gpio-cells = <0x2>;", but I have no idea what to write in.

Robert Nelson

unread,
Feb 27, 2020, 9:49:56 PM2/27/20
to Beagle Board, borrello...@gmail.com
On Thu, Feb 27, 2020 at 7:43 PM Fabrizio Borrello
<borrello...@gmail.com> wrote:
>
> Hi Robert,
>
> I apologize for having misunderstood your directions.
>
> I found the controller declaration and attached as a child the gpio hog as follow:
>
> gpio@44e07000 {
> compatible = "ti,omap4-gpio";
> ti,hwmods = "gpio1";
> gpio-controller;
> #gpio-cells = <0x2>;
> interrupt-controller;
> #interrupt-cells = <0x2>;
> reg = <0x44e07000 0x1000>;
> interrupts = <0x60>;
> gpio-line-names = "MDIO_DATA", "MDIO_CLK", "SPI0_SCLK", "SPI0_D0", "SPI0_D1", "SPI0_CS0", "SPI0_CS1", "ECAP0_IN_PWM0_OUT", "LCD_DATA12", "LCD_DATA13", "LCD_DATA14", "LCD_DATA15", "UART1_CTSN", "UART1_RTSN", "UART1_RXD", "UART1_TXD", "GMII1_TXD3", "GMII1_TXD2", "USB0_DRVVBUS", "XDMA_EVENT_INTR0", "XDMA_EVENT_INTR1", "GMII1_TXD1", "GPMC_AD8", "GPMC_AD9", "NC", "NC", "GPMC_AD10", "GPMC_AD11", "GMII1_TXD0", "RMII1_REFCLK", "GPMC_WAIT0", "GPMC_WPN";
> linux,phandle = <0x32>;
> phandle = <0x32>;
> };
>
> P9_11 {
> gpio-hog;
> gpios = <11 GPIO_ACTIVE_LOW>;
> output-low;
> };
>
> I am not sure about the value of 'gpios'.
> I read that: "gpios: Store the GPIO information (id, flags, ...). Shall contain the number of cells specified in its parent node (GPIO controller node)".
> In this case the parent node contains: "#gpio-cells = <0x2>;", but I have no idea what to write in.

https://github.com/derekmolloy/boneDeviceTree/blob/master/docs/BeagleboneBlackP8HeaderTable.pdf
https://github.com/derekmolloy/boneDeviceTree/blob/master/docs/BeagleboneBlackP9HeaderTable.pdf

P9.11 = gpio0[30]

If you edit a base device tree you'd do:

&gpio0 {
some_unique_name {
gpio-hog;
gpios = <30 GPIO_ACTIVE_HIGH>;
output-low;
line-name = "SOME_OTHER_UNIQUE_NAME";
};
};

if your doing an overlay you'd do:

fragment@15 {
target = <&gpio0>;
__overlay__ {
some_unique_name {
gpio-hog;
gpios = <30 GPIO_ACTIVE_HIGH>;
output-low;
line-name = "SOME_OTHER_UNIQUE_NAME";
};
};
};
Message has been deleted

Fabrizio Borrello

unread,
Feb 27, 2020, 10:09:34 PM2/27/20
to BeagleBoard
I put right at the end of the DTS file:

&gpio0 {
        adc_reset_pin {
                gpio-hog;
                gpios = <30 GPIO_ACTIVE_HIGH>;
                output-low;
                line-name = "ADC_RESET_PIN_POWER_ON";
        };
};

Than if this time is correct I will compile in DTB a test, right?

Robert Nelson

unread,
Feb 27, 2020, 10:16:30 PM2/27/20
to Beagle Board
On Thu, Feb 27, 2020 at 9:09 PM Fabrizio Borrello
<borrello...@gmail.com> wrote:
>
> I put right at the end of the DTS file:
>
> &gpio0 {
> adc_reset_pin {
> gpio-hog;
> gpios = <30 GPIO_ACTIVE_HIGH>;
> output-low;
> line-name = "ADC_RESET_PIN_POWER_ON";
> };
> };
>
> Than if this time is correct I will compile in DTB a test, right?

Correct, just stick it at the bottom..

Fabrizio Borrello

unread,
Feb 28, 2020, 6:07:11 AM2/28/20
to BeagleBoard
Hello Mr. Robert,

I am still having troubles but before ask you for help, I'd like to thank you for your time I really appreciate that.

I tried to compile the .dts file and this is what I got:

COMMAND
root@beaglebone:/boot/dtbs/4.14.71-bone-rt-r17# dtc -I dts -O dtb -o am335x-boneblack-uboot.dtb am335x-boneblack-uboot.dts

RESPONSE
Error: am335x-boneblack-uboot.dts:2703.20-21 syntax error
FATAL ERROR: Unable to parse input tree 

LINE 2703 content:
  gpios = <30 GPIO_ACTIVE_HIGH>;

Robert Nelson

unread,
Feb 28, 2020, 10:01:35 AM2/28/20
to Beagle Board, borrello...@gmail.com
On Fri, Feb 28, 2020 at 5:07 AM Fabrizio Borrello
<borrello...@gmail.com> wrote:
>
> Hello Mr. Robert,
>
> I am still having troubles but before ask you for help, I'd like to thank you for your time I really appreciate that.
>
> I tried to compile the .dts file and this is what I got:
>
> COMMAND
> root@beaglebone:/boot/dtbs/4.14.71-bone-rt-r17# dtc -I dts -O dtb -o am335x-boneblack-uboot.dtb am335x-boneblack-uboot.dts
>
> RESPONSE
> Error: am335x-boneblack-uboot.dts:2703.20-21 syntax error
> FATAL ERROR: Unable to parse input tree
>
> LINE 2703 content:
> gpios = <30 GPIO_ACTIVE_HIGH>;

That same file is available under:

/opt/source/dtb-4.14-ti/

Then you just issue :

make
sudo make install
sudo reboot

Faby

unread,
Feb 28, 2020, 5:39:02 PM2/28/20
to BeagleBoard
Hello,

I add into the file am335x-boneblack-uboot.dts located at /opt/source/dtb-4.14-ti/src/arm, right at the very end as follow:
&gpio0 {
  adc_reset_pin {
    gpio-hog;
    gpios = <30 GPIO_ACTIVE_HIGH>;
    output-low;
    line-name = "ADC_RESET_PIN_POWER_ON";
    };
};

then I followed the commands sequence:
make
sudo make install
sudo reboot

After reboot I checked if the file am335x-boneblack-uboot.dtb located at /boot/dtbs/4.14.71-bone-rt-17 hat the gpio-hog inside.

And Yes it is there under the controller:

gpio@44e07000 {
compatible = "ti,omap4-gpio";
ti,hwmods = "gpio1";
gpio-controller;
#gpio-cells = <0x2>;
interrupt-controller;
#interrupt-cells = <0x2>;
reg = <0x44e07000 0x1000>;
interrupts = <0x60>;
gpio-line-names = "MDIO_DATA", "MDIO_CLK", "SPI0_SCLK", "SPI0_D0", "SPI0_D1", "SPI0_CS0", "SPI0_CS1", "ECAP0_IN_PWM0_OUT", "LCD_DATA12", "LCD_DATA13", "LCD_DATA14", "LCD_DATA15", "UART1_CTSN", "UART1_RTSN", "UART1_RXD", "UART1_TXD", "GMII1_TXD3", "GMII1_TXD2", "USB0_DRVVBUS", "XDMA_EVENT_INTR0", "XDMA_EVENT_INTR1", "GMII1_TXD1", "GPMC_AD8", "GPMC_AD9", "NC", "NC", "GPMC_AD10", "GPMC_AD11", "GMII1_TXD0", "RMII1_REFCLK", "GPMC_WAIT0", "GPMC_WPN";
linux,phandle = <0x35>;
phandle = <0x35>;

adc_reset_pin {
gpio-hog;
gpios = <0x1e 0x0>;
output-low;
line-name = "ADC_RESET_PIN_POWER_ON";
};
};
On Monday I will test the it. 
Thank you so much for your help and for supporting my request till here.
Have a nice WE.

Fabrizio Borrello

unread,
Mar 2, 2020, 2:48:54 AM3/2/20
to BeagleBoard
Hello,

this morning I tried to see if the pin9_11 on power-up remain to logic level 0 but it continues to go up immediately after power up and it never changes its state.

Faby

unread,
Mar 3, 2020, 12:34:06 PM3/3/20
to BeagleBoard
Today I tried with an overlay and it works, but with about 12 seconds of delay.
That is not the expected result, but finally somethings moves.
Any suggestion or advise would be great. 

evilwulfie

unread,
Mar 3, 2020, 1:25:32 PM3/3/20
to beagl...@googlegroups.com



If you need a pin set one way or another on boot buffer it
use a tristate gate pull it high or low  then after your overlay is loaded
enable the buffer so you have control
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/dd055288-5b97-472b-9697-a20612d10ca2%40googlegroups.com.

Faby

unread,
Mar 5, 2020, 1:23:18 AM3/5/20
to BeagleBoard
Good morning,

thank you for contribute.

Could you please enrich your advice with details, due to the lack of knowledge on this area I do not understand what and how I could follow your directions.
To unsubscribe from this group and stop receiving emails from it, send an email to beagl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages