[U-Boot] Blackfin: cmd_gpio port/pin naming

Andreas Pretzsch apr at cn-eng.de
Fri Jan 7 21:50:30 CET 2011


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

-- 

carpe noctem engineering
Ingenieurbuero fuer Hard- & Software-Entwicklung Andreas Pretzsch
Dipl.-Ing. (FH) Andreas Pretzsch          Tel. +49-(0)731-5521572
Hahnengasse 3                             Fax: +49-(0)731-5521573
89073 Ulm, Germany                        email: apr at cn-eng.de



More information about the U-Boot mailing list