config-pin change of pin name format, and what does the result mean for 'config-pin -l'?

The config-pin command used to accept (for example) P8-5, P8-05 or P8_05 but now it only accepts the P8_05 format, this had me confused for a while! It also now fails on non-modifiable pins whereas it used to output something useful like “Pin is not modifyable: P8_01 GND”.

However, ignoring that, can anyone explain what the output means, for example:-

chris@odinfb$ config-pin -l P8_04

Available modes for P8_04 are: default gpio gpio_pu gpio_pd

What does ‘default’ mean?

So the original config-pin was a bash script with a large amount of assumptions, the newer sorta-sorta-not replacment is based on c and dynamicly generates the options…

For P8_04, that line is generated from the source: https://github.com/beagleboard/BeagleBoard-DeviceTrees/blob/v5.10.x-ti-unified/src/arm/am335x-bone-common-univ.dtsi#L29-L33

	/* P8_04 (ZCZ ball T9) gpmc_ad7 (emmc) */
	BONE_PIN(P8_04, default, P8_04(PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE7))
	BONE_PIN(P8_04, gpio, P8_04(PIN_OUTPUT | INPUT_EN | MUX_MODE7))
	BONE_PIN(P8_04, gpio_pu, P8_04(PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE7))
	BONE_PIN(P8_04, gpio_pd, P8_04(PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE7))

Most of the default's are the normal default state of the pin at reset (pulled from TI’s datasheet), they will vary… For P8_04, default just happen to be the same as gpio_pd…

As this usually comes up in this conversation:

The old config-pin is located here: https://github.com/beagleboard/bb.org-overlays/blob/master/tools/beaglebone-universal-io/config-pin

The new c version: https://github.com/beagleboard/bb.org-overlays/blob/master/tools/pmunts_muntsos/config-pin.c

Our original goal with config-pin, was to make it work on all future boards… While this worked great on am335x, the am57xx has some nasty bugs where it’s preferred to do it in u-boot… Then while bringing up the arm64 devices, mainline libgpiod actually has some normal gpio state options. and then with riscv64…

Yeah, i think we’d really just like to help push libgpiod to get a generic pin thing working for all boards going forward…

Regards,

:-), did I scratch an irritating spot!

Whatever, I still want to know what default means.

What I actually want to know is which gpio pins I can use without hassle from a default system boot. I.e. I want to be able to turn it on and, programmatically, use GPIO pins without risking stopping things working.

I know (I think) that I can’t use the GPIO pins that do things with the EMMC, on the other hand I think I can use the ones used for UART and LCD (as long as I don’t wan to use UART or LCD, obviously). But it’s incredibly difficult to find information which provides this information.

Most of the default’s are the normal default state of the pin at reset (pulled from TI’s datasheet)

Inside TI AM335x Device Manual, they lists a default state each pin will be in after a power on reset. That’s the ‘default’ option…

The gpio you want to watch out for, are the SYSBOOT pins, they are listed in the schematic…

Regards,

The gpio you want to watch out for, are the SYSBOOT pins, they are listed in the schematic…

Doesn’t one have to steer clear of the EMMC related ones as well if one is using the EMMC? E.g. P8-3 to P8-6 ?

Also what mode (as in columns mode0 to mode7 in the reference manual) is default if one doesn’t modify anything after installation?

Correct…

See: https://www.ti.com/document-viewer/AM3358/datasheet/pin-attributes-sprs7173199#sprs7173199

( RESET REL. MODE and BALL RESET STATE )

Regards,