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)
Sat, Apr 20, 11:01 AM
Unknown Object (File)
Sat, Apr 20, 11:01 AM
Unknown Object (File)
Sat, Apr 20, 11:01 AM
Unknown Object (File)
Sat, Apr 20, 11:00 AM
Unknown Object (File)
Sat, Apr 20, 10:57 AM
Unknown Object (File)
Sat, Apr 20, 10:57 AM
Unknown Object (File)
Sat, Apr 20, 10:44 AM
Unknown Object (File)
Fri, Apr 19, 4:50 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

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/conf/files.arm64
196

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

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

267

You have DEFAULT_CAPS as a mask to check against.

287

gp_flags = flags and remove the line above.

321

I don't see this property in the binding docs

368

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

468

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

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

I removed it.

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

sys/conf/files.arm64
196

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.