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)
Tue, May 14, 8:01 AM
Unknown Object (File)
Mon, May 13, 1:51 AM
Unknown Object (File)
Wed, May 8, 10:13 PM
Unknown Object (File)
Tue, Apr 30, 11:48 PM
Unknown Object (File)
Thu, Apr 25, 1:33 PM
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
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
127

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

268

You have DEFAULT_CAPS as a mask to check against.

288

gp_flags = flags and remove the line above.

322

I don't see this property in the binding docs

369

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

469

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
268

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.

322

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.