Page MenuHomeFreeBSD

mvebu_gpio: fix gpio pin configuration update
ClosedPublic

Authored by mw on Mar 3 2021, 6:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 10:41 PM
Unknown Object (File)
Sun, Apr 21, 10:41 PM
Unknown Object (File)
Sun, Apr 21, 10:41 PM
Unknown Object (File)
Sun, Apr 21, 10:37 PM
Unknown Object (File)
Sun, Apr 21, 8:17 PM
Unknown Object (File)
Sat, Apr 20, 7:23 AM
Unknown Object (File)
Feb 29 2024, 7:14 AM
Unknown Object (File)
Jan 18 2024, 5:21 PM
Subscribers

Details

Summary

The GPIO pins have single corresponding bits in the
configuration registers. Hitherto accessor was
writing entire word with SYSCON_WRITE_4 instead of
doing a proper update with SYSCON_MODIFY_4.
Moreover the used mask had incorrect value.

Fix both issues and add the helper routine
gpio_pin_modify for accessing affected registers.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

mw requested review of this revision.Mar 3 2021, 6:35 PM

write is expected (moreover these are WO ->thus not suitable for SYSCON_MODIFY operation).

sys/arm/mv/mvebu_gpio.c
164

No, this change is wrong. GPIO have their own register for setting or clearing pin direction. Full register write is right at this place.

256

ditto.

293

ditto

mw marked 3 inline comments as done.Mar 3 2021, 9:46 PM

Confirmed with the specs and agree. Updating.

mw edited the summary of this revision. (Show Details)

@mmel you can commit this patch, it's basically your change. I only want it to be in the tree :)

This revision was not accepted when it landed; it landed in state Needs Review.Mar 4 2021, 4:55 PM
This revision was automatically updated to reflect the committed changes.