jtag: drivers: bcm2835gpio: don't allow GPIOs > 31
Current code assumes all the GPIO signals are manipulated via a single 32-bit register so using higher GPIOs silently fails. Fix the check instead of trying to handle additional GPIOs (available on Raspberry Pi Compute Modules) as that would slow the driver down. Change-Id: Ib3b5864afb3b972d952f9b74665201cd93924959 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6658 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
parent
4afd8852bb
commit
da434d7d59
|
@ -3207,6 +3207,8 @@ able to coexist nicely with both sysfs bitbanging and various
|
||||||
peripherals' kernel drivers. The driver restores the previous
|
peripherals' kernel drivers. The driver restores the previous
|
||||||
configuration on exit.
|
configuration on exit.
|
||||||
|
|
||||||
|
GPIO numbers >= 32 can't be used for performance reasons.
|
||||||
|
|
||||||
See @file{interface/raspberrypi-native.cfg} for a sample config and
|
See @file{interface/raspberrypi-native.cfg} for a sample config and
|
||||||
pinout.
|
pinout.
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,7 @@ static int bcm2835gpio_speed(int speed)
|
||||||
|
|
||||||
static int is_gpio_valid(int gpio)
|
static int is_gpio_valid(int gpio)
|
||||||
{
|
{
|
||||||
return gpio >= 0 && gpio <= 53;
|
return gpio >= 0 && gpio <= 31;
|
||||||
}
|
}
|
||||||
|
|
||||||
COMMAND_HANDLER(bcm2835gpio_handle_jtag_gpionums)
|
COMMAND_HANDLER(bcm2835gpio_handle_jtag_gpionums)
|
||||||
|
|
Loading…
Reference in New Issue