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)
Feb 29 2024, 7:14 AM
Unknown Object (File)
Jan 18 2024, 5:21 PM
Unknown Object (File)
Jan 13 2024, 9:15 AM
Unknown Object (File)
Jan 12 2024, 3:55 AM
Unknown Object (File)
Jan 8 2024, 9:16 PM
Unknown Object (File)
Dec 10 2023, 6:31 PM
Unknown Object (File)
Oct 18 2023, 10:31 AM
Unknown Object (File)
Oct 10 2023, 6:24 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
172

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

264

ditto.

301

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.