On 06/30/2014 08:30 AM, Sascha Hauer wrote: >> + if (usb->mode == USB_DR_MODE_HOST && >> + IS_ENABLED(CONFIG_USB_MVEBU_HOST)) { >> + ret = regulator_enable(usb->vbus); >> + if (ret) >> + return ret; >> + ret = ehci_register(dev, &usb->ehci); >> + if (ret) >> + regulator_disable(usb->vbus); >> + } else if (usb->mode == USB_DR_MODE_PERIPHERAL && >> + IS_ENABLED(CONFIG_USB_MVEBU_DEVICE)) { >> + ret = regulator_disable(usb->vbus); >> + if (ret) >> + return ret; >> + ret = ci_udc_register(dev, usb->base); >> + } else { >> + dev_err(dev, "Unsupported USB role\n"); >> + ret = -ENODEV; >> + } > > This should probably be shared between i.MX and mvebu. I have a patch > somewhere which implements a device parameter to switch between host and > device mode. It could be used for both i.MX and mvebu. Yes. As Jason already mentioned we probably should have a pure ChipIdea probe() without any vendor-specific stuff. For Marvell SoCs there is a set of registers that has to be configured for DMA accesses, but I think we can move them into the bus driver instead. We could have a list of compatibles and register offsets in bus/mvebu.c that takes care of the registers on MVEBU for fooHCI IP. I'll have to double-check if the register content is retained during clk gating. Having a ChipIdea probe() will also allow i.MX to reuse the same function after it has set up the Freescale specific stuff. > Otherwise the series looks fine to me. Ok. BTW, I have a similar patch set for SDHCI that I'll send as RFC in a day or two. Sebastian _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox