This change adds support to the a10_ehci.c driver for A31/A31s and the necessary clock setup.
Details
- Reviewers
andrew - Group Reviewers
ARM - Commits
- rS296284: Add support for Allwinner A31/A31s EHCI controller and USB PHY.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
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 ?
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.
- 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. |
sys/arm/allwinner/a10_ehci.c | ||
---|---|---|
79 ↗ | (On Diff #13848) | ocd_data is already uintptr_t, there should be no need for that cast. |