[PATCH] bsps/arm/beagle: bugfix clearing gpio bit

Jens Gollasch jens.gollasch at lss-lighting.de
Tue Apr 16 08:19:17 UTC 2024


Hi,

it seems there is a bug in rtems_gpio_bsp_clear; mmio_set reads back the 
GPIO_DATAOUT register, so other active gpios are cleared too.
To clear a bit its necessary to use mmio_write.

---
  bsps/arm/beagle/gpio/bbb-gpio.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bsps/arm/beagle/gpio/bbb-gpio.c 
b/bsps/arm/beagle/gpio/bbb-gpio.c
index bd081fae5a..06f7275301 100644
--- a/bsps/arm/beagle/gpio/bbb-gpio.c
+++ b/bsps/arm/beagle/gpio/bbb-gpio.c
@@ -96,7 +96,7 @@ rtems_status_code rtems_gpio_bsp_set(uint32_t bank, 
uint32_t pin)

  rtems_status_code rtems_gpio_bsp_clear(uint32_t bank, uint32_t pin)
  {
-  mmio_set(bbb_reg(bank, AM335X_GPIO_CLEARDATAOUT), BIT(pin));
+  mmio_write(bbb_reg(bank, AM335X_GPIO_CLEARDATAOUT), BIT(pin));

    return RTEMS_SUCCESSFUL;
  }

-- 
Jens Gollasch
Licht-, Steuer- und Schaltanlagenbau GmbH
NL Dresden
Warnemünder Straße 1, 01109 Dresden
Tel.: 0351/79565691
mail: jens.gollasch at lss-lighting.de
www.lss-lighting.de

-------------------------------------------------------------------
LSS Licht-, Steuer- und Schaltanlagenbau GmbH
Gesellschaft mit beschränkter Haftung
Sitz der Gesellschaft: Am Eichenberg 1, 04600 Altenburg
Registergericht: AmtsgerichtJena, HRB 206496
Geschäftsführer: Markus Kaminski
Steuer-Nummer: 161/113/04371; Finanzamt Altenburg
USt-ID: DE 150 516 887
-------------------------------------------------------------------



More information about the devel mailing list