12 #include <linux/kernel.h>
19 #include <linux/module.h>
30 .drivers = {
"fsl-ehci",
NULL,
NULL, },
35 .drivers = {
"fsl-usb2-otg",
"fsl-ehci",
"fsl-usb2-udc", },
39 .dr_mode =
"peripheral",
40 .drivers = {
"fsl-usb2-udc",
NULL,
NULL, },
47 const unsigned char *prop;
52 for (i = 0; i <
ARRAY_SIZE(dr_mode_data); i++) {
54 return &dr_mode_data[i];
57 pr_warn(
"%s: Invalid 'dr_mode' property, fallback to host mode\n",
59 return &dr_mode_data[0];
81 const char *
name,
int id)
94 pdev->
dev.parent = &ofdev->
dev;
96 pdev->
dev.coherent_dma_mask = ofdev->
dev.coherent_dma_mask;
97 *pdev->
dev.dma_mask = *ofdev->
dev.dma_mask;
117 return ERR_PTR(retval);
120 static const struct of_device_id fsl_usb2_mph_dr_of_match[];
122 static int usb_get_ver_info(
struct device_node *np)
164 const unsigned char *prop;
165 static unsigned int idx;
203 pdata->
phy_mode = determine_usb_phy(prop);
208 dev_warn(&ofdev->
dev,
"Could not get controller version\n");
218 if (IS_ERR(usb_dev)) {
219 dev_err(&ofdev->
dev,
"Can't register usb device\n");
220 return PTR_ERR(usb_dev);
239 #ifdef CONFIG_PPC_MPC512x
241 #define USBGENCTRL 0x200
242 #define GC_WU_INT_CLR (1 << 5)
243 #define GC_ULPI_SEL (1 << 4)
244 #define GC_PPP (1 << 3)
245 #define GC_PFP (1 << 2)
246 #define GC_WU_ULPI_EN (1 << 1)
247 #define GC_WU_IE (1 << 1)
249 #define ISIPHYCTRL 0x204
250 #define PHYCTRL_PHYE (1 << 4)
251 #define PHYCTRL_BSENH (1 << 3)
252 #define PHYCTRL_BSEN (1 << 2)
253 #define PHYCTRL_LSFE (1 << 1)
254 #define PHYCTRL_PXE (1 << 0)
263 base = pdev->
resource->start & 0xf000;
266 else if (base == 0x4000)
271 snprintf(clk_name,
sizeof(clk_name),
"usb%d_clk", clk_num);
290 out_be32(pdata->
regs + ISIPHYCTRL, PHYCTRL_PHYE | PHYCTRL_PXE);
310 .big_endian_mmio = 1,
312 .have_sysif_regs = 0,
314 .init = fsl_usb2_mpc5121_init,
315 .exit = fsl_usb2_mpc5121_exit,
320 .have_sysif_regs = 1,
323 static const struct of_device_id fsl_usb2_mph_dr_of_match[] = {
324 { .compatible =
"fsl-usb2-mph", .data = &fsl_usb2_mpc8xxx_pd, },
325 { .compatible =
"fsl-usb2-dr", .data = &fsl_usb2_mpc8xxx_pd, },
326 #ifdef CONFIG_PPC_MPC512x
327 { .compatible =
"fsl,mpc5121-usb2-dr", .data = &fsl_usb2_mpc5121_pd, },
334 .name =
"fsl-usb2-mph-dr",
336 .of_match_table = fsl_usb2_mph_dr_of_match,
338 .probe = fsl_usb2_mph_dr_of_probe,