
Dear Mr. Frysinger,
the Blackfin U-Boot GPIO command (see "arch/blackfin/cpu/cmd_gpio.c") specifies the port/pin naming in the form "[p][port]<#>", e.g. PF11. The pin portion of the specified GPIO is limited to 0..15. While this is correct for Blackfins with different bank names (e.g. BF537 with PF, PG, PH), it's not sufficient for Blackfins with linear naming like the BF561 (PF0..PF47).
Based on the port name and the pin number, it's transformed into linear GPIO numbering, which is passed to the GPIO routines (e.g. PG1 @ BF537 => 16+1).
Therefore simply changing the limit from 15 to MAX_BLACKFIN_GPIOS resp. MAX_RESOURCES is not an option (for all Blackfins).
I see three possible solutions: - Introduce a new define MAX_BLACKFIN_GPIO_PORT_NUMBER or similar in all arch/blackfin/include/asm/mach-bfxxx/gpio.h and use that for the check. Name suggestions are welcome. - #ifdef the check based on BFxxx_FAMILY resp. CONFIG_BFxxx. Not sure about the best defines here. And it's ugly. - Add another port naming specification to cmd_gpio like "P42".
I'd opt for the first approach, but before submitting a patch, I'd like to hear your opinion first.
N.B.: Didn't have a closer look at the portmux stuff.
Best regards, A. Pretzsch