config-pin default values

272 views
Skip to first unread message

TJF

unread,
Oct 19, 2018, 6:05:18 AM10/19/18
to BeagleBoard
With kernel 4.14.x on Beaglebone Black board (may Green and White as well) after boot the pin P9_11 is in muxmode

GPIO INPUT PULLUP

, while the config-pin default is

GPIO INPUT PULLDOWN

Why that difference? Shouldn't the boot mode and the default mode be equal? 13 further pins show that difference.

Charles Steinkuehler

unread,
Oct 19, 2018, 10:58:20 AM10/19/18
to beagl...@googlegroups.com
The default mode for P9_11 is an input with pull-up enabled:

https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/master/cape-universal-00A0.dts#L392-L393

The default pin modes for cape universal were set to match the reset
defaults of the AM3358, so loading the universal device-tree overlay
would not cause any physical change in the pin state. The reset
default states are listed in the AM3358 data-sheet (which is a
different document than the AM335x TRM). Most pins are are generally
GPIO inputs with either a pull-up or pull-down (pin dependent) after
reset.

--
Charles Steinkuehler
cha...@steinkuehler.net

TJF

unread,
Oct 19, 2018, 12:11:15 PM10/19/18
to BeagleBoard
Thanks for the answer, Charles. In the default overlay it's PULLDOWN:


And this is what anybody gets when not installing your cape universal device tree blob. My question is still why?

Charles Steinkuehler

unread,
Oct 19, 2018, 12:20:39 PM10/19/18
to beagl...@googlegroups.com
You'll have to ask RCN, but it looks to me like all the pins were set
to pull-down (except for the I2C pins, anyway). I was careful to
match the power-on reset defaults, since I rely on some of those weak
bias resistors to help insure hardware powers up in a "safe" state.
>> cha...@steinkuehler.net <javascript:>
>>
>


--
Charles Steinkuehler
cha...@steinkuehler.net

Robert Nelson

unread,
Oct 19, 2018, 12:24:38 PM10/19/18
to Beagle Board
On Fri, Oct 19, 2018 at 11:20 AM Charles Steinkuehler
<cha...@steinkuehler.net> wrote:
>
> You'll have to ask RCN, but it looks to me like all the pins were set
> to pull-down (except for the I2C pins, anyway). I was careful to
> match the power-on reset defaults, since I rely on some of those weak
> bias resistors to help insure hardware powers up in a "safe" state.

Honestly, i just threw a coin, now that i know what you actually did,
yeap, time to change it back....

Regards,

--
Robert Nelson
https://rcn-ee.com/

TJF

unread,
Oct 19, 2018, 12:31:33 PM10/19/18
to BeagleBoard
Here's a list of the related pis:

P9_11
P9_13
P9_12
P8_26
P8_07
P8_08
P8_10
P8_09
P9_22
P9_21
P9_18
P9_17
P9_26
P9_24

And P9_42 (GPIO3_18) is mode 0x24 after boot (not 0x27).
And i2c2 (P9_19, P9_20) are mode 0x33 after boot (not 0x3B).

Regards

Robert Nelson

unread,
Oct 19, 2018, 12:39:33 PM10/19/18
to Beagle Board
On Fri, Oct 19, 2018 at 11:31 AM TJF <jeli.f...@gmail.com> wrote:
>
> Here's a list of the related pis:
>
> P9_11
> P9_13
> P9_12
> P8_26
> P8_07
> P8_08
> P8_10
> P8_09
> P9_22
> P9_21
> P9_18
> P9_17
> P9_26
> P9_24
>
> And P9_42 (GPIO3_18) is mode 0x24 after boot (not 0x27).
> And i2c2 (P9_19, P9_20) are mode 0x33 after boot (not 0x3B).

Thanks!

I'll use that data for comparsion, but sadly that isn't maintainable,
we need to find the flag in "AM335x.json"..

https://github.com/RobertCNelson/bb.org-overlays/tree/master/tools/pinmux-generator

http://processors.wiki.ti.com/index.php/TI_PinMux_Tool

I'm digging into AM335x.json right now for the default states.. Such
that they are properly set for BeagleBone Black, BeagleBone Blue,
Green, Wireless, and PocketBeagle..

Robert Nelson

unread,
Oct 19, 2018, 12:45:23 PM10/19/18
to Beagle Board
Got it, from http://www.ti.com/lit/ds/symlink/am3358.pdf

from:

U5 : ULCD_VSYNC : L

it looks like "pupdStateAfterHHV":"PD" is the match....

{"type":"PinCommonInfo","devicePinID":"ID_1977","controlRegisterOffset":"0x08e0","pupdStateDuringHHV":"OFF","pupdStateAfterHHV":"PD","type":"PinCommonInfo","pinModeInfo":[{"peripheralPinID":"ID_1978","mode":"0","interfaceName":"LCDC","signalName":"lcd_vsync","ioDir":"O"},{"peripheralPinID":"ID_1765","mode":"1","interfaceName":"GPMC","signalName":"gpmc_a8","ioDir":"O"},{"peripheralPinID":"ID_1707","mode":"2","interfaceName":"GPMC","signalName":"gpmc_a1","ioDir":"O"},{"peripheralPinID":"ID_1979","mode":"3","interfaceName":"ECAT_PRUSS1","signalName":"pr1_edio_data_in2","ioDir":"I"},{"peripheralPinID":"ID_1980","mode":"4","interfaceName":"ECAT_PRUSS1","signalName":"pr1_edio_data_out2","ioDir":"O"},{"peripheralPinID":"ID_1981","mode":"5","interfaceName":"PRU1_PRUSS1","signalName":"pr1_pru1_pru_r30[8]","ioDir":"O"},{"peripheralPinID":"ID_1982","mode":"6","interfaceName":"PRU1_PRUSS1","signalName":"pr1_pru1_pru_r31[8]","ioDir":"I"},
{"peripheralPinID":"ID_1983","mode":"7","interfaceName":"GPIO2","signalName":"gpio2[22]","ioDir":"IO"}]},"ID_1856"

Robert Nelson

unread,
Oct 19, 2018, 1:49:34 PM10/19/18
to Beagle Board, jeli.f...@gmail.com
On Fri, Oct 19, 2018 at 11:31 AM TJF <jeli.f...@gmail.com> wrote:
>
> Here's a list of the related pis:
>
> P9_11
> P9_13
> P9_12
> P8_26
> P8_07
> P8_08
> P8_10
> P8_09
> P9_22
> P9_21
> P9_18
> P9_17
> P9_26
> P9_24

Okay ^ these are fixed:

https://github.com/beagleboard/bb.org-overlays/commit/440ada6aa74a1e935c77b06537f8bea9b7198418

>
> And P9_42 (GPIO3_18) is mode 0x24 after boot (not 0x27).
> And i2c2 (P9_19, P9_20) are mode 0x33 after boot (not 0x3B).

Starting on these..

TJF

unread,
Oct 19, 2018, 1:59:44 PM10/19/18
to BeagleBoard
Thanks for the fast response.

No changes for PocketBeagle.dts or BeagleBone_Blue.dts? (P9_11 = P2_05 = DSM2_3)

Regards

Robert Nelson

unread,
Oct 19, 2018, 2:15:54 PM10/19/18
to Beagle Board, jeli.f...@gmail.com
On Fri, Oct 19, 2018 at 12:59 PM TJF <jeli.f...@gmail.com> wrote:
>
> Thanks for the fast response.
>
> No changes for PocketBeagle.dts or BeagleBone_Blue.dts? (P9_11 = P2_05 = DSM2_3)

Not yet, still figuring out:

> And P9_42 (GPIO3_18) is mode 0x24 after boot (not 0x27).

We want "gpio" by default right? 0x24 is spi_clk..

> And i2c2 (P9_19, P9_20) are mode 0x33 after boot (not 0x3B).

I think 0x3B is 0x33 + slew control on, re-reading the am335x manual..

u-boot sets it as:

https://github.com/u-boot/u-boot/blob/master/board/ti/am335x/mux.c#L107

TJF

unread,
Oct 19, 2018, 2:35:30 PM10/19/18
to BeagleBoard


Am Freitag, 19. Oktober 2018 20:15:54 UTC+2 schrieb RobertCNelson:
On Fri, Oct 19, 2018 at 12:59 PM TJF <jeli.f...@gmail.com> wrote:
>
> Thanks for the fast response.
>
> No changes for PocketBeagle.dts or BeagleBone_Blue.dts? (P9_11 = P2_05 = DSM2_3)

Not yet, still figuring out:

Sorry, I wont be impatient.


> And P9_42 (GPIO3_18) is mode 0x24 after boot (not 0x27).

We want "gpio" by default right? 0x24 is spi_clk..

0x24 is 'mmc0_sdwp' (mode 4 on ball 0x68, ZCZ ball B12).

Robert Nelson

unread,
Oct 19, 2018, 2:48:10 PM10/19/18
to Beagle Board, jeli.f...@gmail.com
On Fri, Oct 19, 2018 at 1:35 PM TJF <jeli.f...@gmail.com> wrote:
>
>
>
> Am Freitag, 19. Oktober 2018 20:15:54 UTC+2 schrieb RobertCNelson:
>>
>> On Fri, Oct 19, 2018 at 12:59 PM TJF <jeli.f...@gmail.com> wrote:
>> >
>> > Thanks for the fast response.
>> >
>> > No changes for PocketBeagle.dts or BeagleBone_Blue.dts? (P9_11 = P2_05 = DSM2_3)
>>
>> Not yet, still figuring out:
>
>
> Sorry, I wont be impatient.
>
>>
>> > And P9_42 (GPIO3_18) is mode 0x24 after boot (not 0x27).
>>
>> We want "gpio" by default right? 0x24 is spi_clk..
>
>
> 0x24 is 'mmc0_sdwp' (mode 4 on ball 0x68, ZCZ ball B12).

Ah right, i ripped that one out of the kernel..

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/am335x-bone-common.dtsi?h=v4.19-rc8&id=5d1c115241e4aa0034ddf44693c6bd2e89e10831

u-boot must still be setting it..

having a random shared pin tied to mmc's write protect is only asking
for trouble.. gpio default mode best, i need to rip that pin out of
u-boot..

https://github.com/u-boot/u-boot/blob/master/board/ti/am335x/mux.c#L61-L81


>> > And i2c2 (P9_19, P9_20) are mode 0x33 after boot (not 0x3B).
>>
>> I think 0x3B is 0x33 + slew control on, re-reading the am335x manual..

This was just pull-up disabled, fixed:

https://github.com/beagleboard/bb.org-overlays/commit/9ccfba49c83b9e2ddf8d46eae7c517bd4ed36d9e

TJF

unread,
Oct 19, 2018, 2:55:07 PM10/19/18
to BeagleBoard


Am Freitag, 19. Oktober 2018 20:35:30 UTC+2 schrieb TJF:
We want "gpio" by default right? 0x24 is spi_clk..

From my point of view "default" should be the state after boot. It mustn't be "gpio".


I think 0x3B is 0x33 + slew control on, re-reading the am335x manual..

0x3B is invalid. It's 0b11000 for resistors. Only 0b10000=PULLUP, 0b01000=NOPULL and 0b00000=PULLDOWN are defined. (0x33 is valid ->slew controll off, RX on, PULLUP, mode 3)

Robert Nelson

unread,
Oct 19, 2018, 3:10:25 PM10/19/18
to Beagle Board
On Fri, Oct 19, 2018 at 1:55 PM TJF <jeli.f...@gmail.com> wrote:
>
>
>
> Am Freitag, 19. Oktober 2018 20:35:30 UTC+2 schrieb TJF:
>>
>> We want "gpio" by default right? 0x24 is spi_clk..
>
>
> From my point of view "default" should be the state after boot. It mustn't be "gpio".
>
>>
>>> I think 0x3B is 0x33 + slew control on, re-reading the am335x manual..
>
>
> 0x3B is invalid. It's 0b11000 for resistors. Only 0b10000=PULLUP, 0b01000=NOPULL and 0b00000=PULLDOWN are defined. (0x33 is valid ->slew controll off, RX on, PULLUP, mode 3)

Fixed:
https://github.com/RobertCNelson/Bootloader-Builder/commit/6d59b42c453132178a21504ab07fce26196356cd
Reply all
Reply to author
Forward
0 new messages