Page MenuHomeFreeBSD

Add GPIO support for QorIQ boards.
ClosedPublic

Authored by dgr_semihalf.com on Apr 9 2020, 3:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 12, 2:13 AM
Unknown Object (File)
Thu, Nov 28, 9:06 PM
Unknown Object (File)
Wed, Nov 27, 3:45 PM
Unknown Object (File)
Nov 17 2024, 12:40 AM
Unknown Object (File)
Nov 3 2024, 10:13 AM
Unknown Object (File)
Oct 21 2024, 2:20 PM
Unknown Object (File)
Oct 3 2024, 10:55 PM
Unknown Object (File)
Oct 2 2024, 2:18 PM
Subscribers

Details

Summary

Tested on and targeted for LS1046A.
The driver implements the following features:

  • setting direction of each pin (IN or OUT)
  • setting the mode of output pins (PUSHPULL or OPENDRAIN)
  • setting the state of each output pin (1 or 0)
  • reading the state of each input pin (1 or 0)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/conf/files.arm64
196 ↗(On Diff #70373)

Do not depend on gpio, add a new driver name to GENERIC and depend on this (and the SOC_ option).

Added SOC_NXP_LS1046A dependency.

sys/arm64/qoriq/ls1046_gpio.c
126 ↗(On Diff #71201)

Could you add the gpio_pin_access_32/gpio_pin_config_32 while you're at it please ?

267 ↗(On Diff #71201)

You have DEFAULT_CAPS as a mask to check against.

287 ↗(On Diff #71201)

gp_flags = flags and remove the line above.

321 ↗(On Diff #71201)

I don't see this property in the binding docs

368 ↗(On Diff #71201)

You should right the pin name, as a default do :
snprintf(name, GPIOMAXNAME, "pin %d", pin);

468 ↗(On Diff #71201)

You should lock and use the internal function to avoid any race.

Thanks, I'll prepare patch in the coming days.

Added pin_access_32 and pin_config_32 functions.
Changed get_name function to generate "pin <pin_number>" as name.
Additional minor fixes.

sys/arm64/qoriq/ls1046_gpio.c
267 ↗(On Diff #71201)

This part did not check if capabilities are supported but checked if some impossible condition doesn't happen, such as both input and output flag set.
Since this could have gotten confusing I moved the check outside pin count check and added comment.

321 ↗(On Diff #71201)

I removed it.

Hi, if you have any more comments or remarks, please let me know. Thanks.

sys/conf/files.arm64
196 ↗(On Diff #70373)

This comment still applies, add a new ls1046_gpio driver in GENERIC and depend on it here.

Add ls1046_gpio device in kernel config. Replace SOC_NXP_LS1046 with SOC_NXP_LS.

This revision is now accepted and ready to land.May 22 2020, 8:32 PM
This revision was automatically updated to reflect the committed changes.