-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
Add support for USB Host High Speed Port HSIC phy. Signed-off-by: Cristian Birsan <cristian.birsan@microchip.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -18,13 +18,18 @@ | |||
#include <linux/platform_device.h> | ||||
#include <linux/usb.h> | ||||
#include <linux/usb/hcd.h> | ||||
#include <linux/usb/phy.h> | ||||
#include <linux/usb/of.h> | ||||
|
||||
#include "ehci.h" | ||||
|
||||
#define DRIVER_DESC "EHCI Atmel driver" | ||||
|
||||
static const char hcd_name[] = "ehci-atmel"; | ||||
|
||||
#define EHCI_INSNREG(index) ((index) * 4 + 0x90) | ||||
#define EHCI_INSNREG08_HSIC_EN BIT(2) | ||||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cristibirsan
Author
|
#define EHCI_INSNREG00(base) (base + 0x90) |
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
LeSpocky
Sep 10, 2021
As far as I can tell the registers defined in linux/usb/ehci_def.h
follow the ECHI 1.0 and 1.1 spec. Last common register in the spec is 44h PORTSC. If 90h is really a common base for multiple USB host IPs, then why not add a define with link to source spec or datasheet document? Otherwise that 90h is just an undocumented literal. 🤷🏼
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
cristibirsan
Sep 10, 2021
•
edited
Loading
Author
edited
INSNREG08 has the offset 0xB0. Having in mind that this is the 8th register and the length is 4 bytes, one can compute the base offset like: 0xB0 - 0x20 = 0x90. I can ask for a datasheet update but you have to be patient ... it might take some time until a new version is published.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
LeSpocky
Sep 6, 2021
- What about the previous state of the register?
- Should the flag be reset on driver remove?
- Other drivers use
ehci_writel()
, that's probably not needed here, but should it be uniform over different usb host ehci drivers?
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
cristibirsan
Sep 6, 2021
Author
HSIC_EN is the only bit in the UHPHS_INSNREG08 register, other bits are zero out of reset. We do not care about the previous state.
If this mode is used, it won't change when the driver is removed. In the end the hardware connected to this port will still be a HSIC device. Also it can't be unplugged.
The platform for this glue driver is little endian and writel() will do the job. The same is used in the above example already accepted in upstream but ehci_writel() can be also used.
This is AT91 / SAMA5 specific, right? I would propose something like
AT91_UHPHS_INSNREG08
andAT91_UHPHS_HSIC_EN
instead.Also that 0x90 literal is somewhat obscure, it does not appear in the SAMA5D2 datasheet.