Page MenuHomeFreeBSD

Allwinner A31/A31s USB support
ClosedPublic

Authored by jmcneill on Feb 26 2016, 8:52 PM.
Tags
Referenced Files
Unknown Object (File)
Tue, Apr 9, 7:35 PM
Unknown Object (File)
Feb 9 2024, 2:30 AM
Unknown Object (File)
Feb 9 2024, 2:22 AM
Unknown Object (File)
Jan 24 2024, 2:09 AM
Unknown Object (File)
Jan 17 2024, 1:26 AM
Unknown Object (File)
Jan 10 2024, 1:34 AM
Unknown Object (File)
Nov 29 2023, 2:49 AM
Unknown Object (File)
Nov 29 2023, 12:19 AM

Details

Summary

This change adds support to the a10_ehci.c driver for A31/A31s and the necessary clock setup.

Diff Detail

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

Event Timeline

jmcneill_invisible.ca retitled this revision from to Allwinner A31/A31s USB support.
jmcneill_invisible.ca updated this object.
jmcneill_invisible.ca edited the test plan for this revision. (Show Details)
jmcneill_invisible.ca added a reviewer: ARM.
jmcneill_invisible.ca set the repository for this revision to rS FreeBSD src repository - subversion.
jmcneill_invisible.ca added a project: ARM.
manu_bidouilliste.com added inline comments.
sys/arm/allwinner/a10_ehci.c
236 ↗(On Diff #13809)

You can use ofw_bus_search_compatible with different ocd_data instead.

sys/arm/allwinner/a10_ehci.c
236 ↗(On Diff #13809)

Good idea, I'll do that

  • Removed hard-coded GPIO pin numbers from a10_ehci.c
  • Added new awusbphy driver to handle GPIO pin settings from FDT
  • Use compat data to handle differences between SoC families
  • Add A31 USB clock deactivate function

Should we rename now a10_ehci.c to aw_ehci.c ?
And start doing incremental renaming file for when we change the drivers ?

Should we rename now a10_ehci.c to aw_ehci.c ?
And start doing incremental renaming file for when we change the drivers ?

I think I'd rather rename it after. I'd have to rename all of the functions and #defines, and I don't really want to mix that up with functional changes.

  • Use GPIO_MAP_GPIOS to find pin number.

USB now works for me on A10, A20 and A31S.

  • Only activate EHCI and required PHY clocks, not OHCI or USB DRD.
  • Add EHCI clock ref count and only deactivate EHCI clocks when there are no users.
  • Rename a31_clk_usb_activate/deactivate to a31_clk_ehci_activate/deactivate.
sys/arm/allwinner/a31/a31_clk.c
308 ↗(On Diff #13847)

What about if two CPUs both called this function at the same time? One would enable the clock, but the other would assume the clock is already enabled then start to use the hardware.

345 ↗(On Diff #13847)

What about if one CPU calls this, then while this is being run another CPU calls the activate code? We could have two CPUs both trying to access the registers, one to disable, the other to enable.

sys/arm/allwinner/a31/a31_clk.c
308 ↗(On Diff #13847)

Good point, I will replace this with a lock.

Protect EHCI clock reference counter with a lock.

andrew added a reviewer: andrew.
andrew added inline comments.
sys/arm/allwinner/a10_ehci.c
79 ↗(On Diff #13848)

ocd_data is already uintptr_t, there should be no need for that cast.

This revision is now accepted and ready to land.Feb 29 2016, 11:31 AM
jmcneill edited edge metadata.

Remove redundant cast of ocd_data to uintptr_t

This revision now requires review to proceed.Feb 29 2016, 10:05 PM
This revision was automatically updated to reflect the committed changes.