Re: [U-Boot] [RFC PATCH 0/7] RFC: dm: Add USB support
Hi Simon, On Sat, Jan 31, 2015 at 12:34 AM, Simon Glass s...@chromium.org wrote: This series adds basic driver model support to USB. The intent is to permit the various subsystems (OHCI, EHCI, XHCI) to co-exist and allow any number of USB ports of different types. So far the absolute limit on the number of USB devices is only slightly relaxed. Only USB controllers have a real driver model device. USB devices (including the hub in the controller) are not modelled as driver model devices. This is for two reasons: - it is easier since we don't need to bind a whole lot of devices when scanning - the two main USB devices (block devices and Ethernet) don't have driver mode support yet anyway, so it would be pointless. However the recent network RFC has encouraged me to send this. The basic approach is to set up the driver model structures in parallel to what already exists rather than to replace them. This allows both driver model and legacy to be used for USB, although not with the same board. So far only XHCI is supported. As an example the Exynos XHCI driver is converted to driver model. I would appreciate comments before going further. Caveats: - sandbox code is incomplete and there are no tests - 'usb stop' does not remove existing devices (I have not yet settled on the best approach) - the usb.h changes need to be split correctly into the patches once they are final This series is available at u-boot-dm/usb-working. Just ran a quick test on smdk5250. I used Below is what i get : -- SMDK5250 # usb start starting USB... USBRegister 2000140 NbrPorts 2 Starting the controller USB XHCI 1.00 0: scanning bus 0 for devices... cannot reset port 1!? 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found SMDK5250 # usb start starting USB... USB0: scanning bus 0 for devices... BUG: failure at drivers/usb/host/xhci-mem.c:666/xhci_setup_addressable_virt_dev()! BUG! resetting ... -- The first time when scanning bus 0 for devices... cannot reset port 1!? comes. This seems to be smdk issue only which i am looking into currently. But the second time when i run usb start, the setup itself hits a NULL pointer it seems. However just tot of u-boot-dm doesn't give this issue. The device gets detected when usb reset is used after doing a usb start first time. Even with my patch series, i hit a NULL pointer BUG, when doing a usb reset -- SMDK5250 # usb reset resetting USB... Host not halted after 16000 microseconds. BUG: failure at drivers/usb/host/xhci-mem.c:83/xhci_ring_free()! BUG! resetting ... -- However i could understand why this is coming, since usb_lowlevel_stop() called in xhci.c; at that time xhci's data structures are not initialized, and we hit this BUG. I will check further on snow. Simon Glass (7): dm: usb: Add a uclass for USB controllers dm: usb: Support driver model in exynos XHCI dm: usb: Adjust users of the USB stack to work with driver model dm: usb: WIP sandbox USB implementation dm: core: Add a function to get the uclass data for a device arm: Show relocated PC/LR in the register dump dm: exynos: Enable driver model for snow XHCI Makefile | 1 + arch/arm/lib/interrupts.c| 13 +- arch/sandbox/dts/sandbox.dts | 20 +++ arch/sandbox/include/asm/processor.h | 0 common/cmd_usb.c | 74 --- common/usb.c | 28 +++-- common/usb_hub.c | 13 +- common/usb_storage.c | 148 +- drivers/core/device.c| 10 ++ drivers/usb/dev/Makefile | 10 ++ drivers/usb/dev/sandbox-flash.c | 95 +++ drivers/usb/dev/sandbox-hub.c| 116 ++ drivers/usb/dev/usb-emul-uclass.c| 16 +++ drivers/usb/eth/usb_ether.c | 46 +-- drivers/usb/host/Makefile| 5 + drivers/usb/host/usb-sandbox.c | 151 +++ drivers/usb/host/usb-uclass.c| 227 ++ drivers/usb/host/xhci-exynos5.c | 115 +- drivers/usb/host/xhci.c | 229 --- drivers/usb/host/xhci.h | 24 include/configs/sandbox.h| 3 + include/configs/snow.h | 1 + include/dm/device.h | 10 ++ include/dm/uclass-id.h | 2 + include/usb.h| 76 +++-
Re: [U-Boot] [RFC PATCH 0/7] RFC: dm: Add USB support
On Tuesday, February 10, 2015 at 06:28:30 AM, Simon Glass wrote: Hi Marek, Hi! [...] Hi! I'll look at this by the end of next week, I will be free by then. It's not possible for me to do it earlier, sorry. Does this still work for you please? Definitely, that sounds good. I was planning to leave it a week or two anyway, although I might fiddle more with the sandbox side in the meantime. I skimmed through the series finally, it looks mostly good for but a few minor coding style things. I would prefer if this went in for the next MW, what do you think please ? Sounds good, hopefully we can bring in wider driver support too. I'd like to get this lot in before thinking too hard about how to deal with actual devices! Maybe we can target getting this series cleaned up and into u-boot-dm/next by end of Feb? I'll be happy to see it there, yes. Thank you! Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH 0/7] RFC: dm: Add USB support
Hi Marek, On 9 February 2015 at 14:02, Marek Vasut ma...@denx.de wrote: On Friday, January 30, 2015 at 11:41:33 PM, Simon Glass wrote: Hi Marek, Hi! On 30 January 2015 at 15:16, Marek Vasut ma...@denx.de wrote: On Friday, January 30, 2015 at 08:04:50 PM, Simon Glass wrote: This series adds basic driver model support to USB. The intent is to permit the various subsystems (OHCI, EHCI, XHCI) to co-exist and allow any number of USB ports of different types. So far the absolute limit on the number of USB devices is only slightly relaxed. Only USB controllers have a real driver model device. USB devices (including the hub in the controller) are not modelled as driver model devices. This is for two reasons: - it is easier since we don't need to bind a whole lot of devices when scanning - the two main USB devices (block devices and Ethernet) don't have driver mode support yet anyway, so it would be pointless. However the recent network RFC has encouraged me to send this. The basic approach is to set up the driver model structures in parallel to what already exists rather than to replace them. This allows both driver model and legacy to be used for USB, although not with the same board. So far only XHCI is supported. As an example the Exynos XHCI driver is converted to driver model. I would appreciate comments before going further. Caveats: - sandbox code is incomplete and there are no tests - 'usb stop' does not remove existing devices (I have not yet settled on the best approach) - the usb.h changes need to be split correctly into the patches once they are final This series is available at u-boot-dm/usb-working. Hi! I'll look at this by the end of next week, I will be free by then. It's not possible for me to do it earlier, sorry. Does this still work for you please? Definitely, that sounds good. I was planning to leave it a week or two anyway, although I might fiddle more with the sandbox side in the meantime. I skimmed through the series finally, it looks mostly good for but a few minor coding style things. I would prefer if this went in for the next MW, what do you think please ? Sounds good, hopefully we can bring in wider driver support too. I'd like to get this lot in before thinking too hard about how to deal with actual devices! Maybe we can target getting this series cleaned up and into u-boot-dm/next by end of Feb? Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH 0/7] RFC: dm: Add USB support
On Friday, January 30, 2015 at 11:41:33 PM, Simon Glass wrote: Hi Marek, Hi! On 30 January 2015 at 15:16, Marek Vasut ma...@denx.de wrote: On Friday, January 30, 2015 at 08:04:50 PM, Simon Glass wrote: This series adds basic driver model support to USB. The intent is to permit the various subsystems (OHCI, EHCI, XHCI) to co-exist and allow any number of USB ports of different types. So far the absolute limit on the number of USB devices is only slightly relaxed. Only USB controllers have a real driver model device. USB devices (including the hub in the controller) are not modelled as driver model devices. This is for two reasons: - it is easier since we don't need to bind a whole lot of devices when scanning - the two main USB devices (block devices and Ethernet) don't have driver mode support yet anyway, so it would be pointless. However the recent network RFC has encouraged me to send this. The basic approach is to set up the driver model structures in parallel to what already exists rather than to replace them. This allows both driver model and legacy to be used for USB, although not with the same board. So far only XHCI is supported. As an example the Exynos XHCI driver is converted to driver model. I would appreciate comments before going further. Caveats: - sandbox code is incomplete and there are no tests - 'usb stop' does not remove existing devices (I have not yet settled on the best approach) - the usb.h changes need to be split correctly into the patches once they are final This series is available at u-boot-dm/usb-working. Hi! I'll look at this by the end of next week, I will be free by then. It's not possible for me to do it earlier, sorry. Does this still work for you please? Definitely, that sounds good. I was planning to leave it a week or two anyway, although I might fiddle more with the sandbox side in the meantime. I skimmed through the series finally, it looks mostly good for but a few minor coding style things. I would prefer if this went in for the next MW, what do you think please ? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [RFC PATCH 0/7] RFC: dm: Add USB support
This series adds basic driver model support to USB. The intent is to permit the various subsystems (OHCI, EHCI, XHCI) to co-exist and allow any number of USB ports of different types. So far the absolute limit on the number of USB devices is only slightly relaxed. Only USB controllers have a real driver model device. USB devices (including the hub in the controller) are not modelled as driver model devices. This is for two reasons: - it is easier since we don't need to bind a whole lot of devices when scanning - the two main USB devices (block devices and Ethernet) don't have driver mode support yet anyway, so it would be pointless. However the recent network RFC has encouraged me to send this. The basic approach is to set up the driver model structures in parallel to what already exists rather than to replace them. This allows both driver model and legacy to be used for USB, although not with the same board. So far only XHCI is supported. As an example the Exynos XHCI driver is converted to driver model. I would appreciate comments before going further. Caveats: - sandbox code is incomplete and there are no tests - 'usb stop' does not remove existing devices (I have not yet settled on the best approach) - the usb.h changes need to be split correctly into the patches once they are final This series is available at u-boot-dm/usb-working. Simon Glass (7): dm: usb: Add a uclass for USB controllers dm: usb: Support driver model in exynos XHCI dm: usb: Adjust users of the USB stack to work with driver model dm: usb: WIP sandbox USB implementation dm: core: Add a function to get the uclass data for a device arm: Show relocated PC/LR in the register dump dm: exynos: Enable driver model for snow XHCI Makefile | 1 + arch/arm/lib/interrupts.c| 13 +- arch/sandbox/dts/sandbox.dts | 20 +++ arch/sandbox/include/asm/processor.h | 0 common/cmd_usb.c | 74 --- common/usb.c | 28 +++-- common/usb_hub.c | 13 +- common/usb_storage.c | 148 +- drivers/core/device.c| 10 ++ drivers/usb/dev/Makefile | 10 ++ drivers/usb/dev/sandbox-flash.c | 95 +++ drivers/usb/dev/sandbox-hub.c| 116 ++ drivers/usb/dev/usb-emul-uclass.c| 16 +++ drivers/usb/eth/usb_ether.c | 46 +-- drivers/usb/host/Makefile| 5 + drivers/usb/host/usb-sandbox.c | 151 +++ drivers/usb/host/usb-uclass.c| 227 ++ drivers/usb/host/xhci-exynos5.c | 115 +- drivers/usb/host/xhci.c | 229 --- drivers/usb/host/xhci.h | 24 include/configs/sandbox.h| 3 + include/configs/snow.h | 1 + include/dm/device.h | 10 ++ include/dm/uclass-id.h | 2 + include/usb.h| 76 +++- include/usb_defs.h | 14 ++- 26 files changed, 1294 insertions(+), 153 deletions(-) create mode 100644 arch/sandbox/include/asm/processor.h create mode 100644 drivers/usb/dev/Makefile create mode 100644 drivers/usb/dev/sandbox-flash.c create mode 100644 drivers/usb/dev/sandbox-hub.c create mode 100644 drivers/usb/dev/usb-emul-uclass.c create mode 100644 drivers/usb/host/usb-sandbox.c create mode 100644 drivers/usb/host/usb-uclass.c -- 2.2.0.rc0.207.ga3a616c ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH 0/7] RFC: dm: Add USB support
Hi Marek, On 30 January 2015 at 15:16, Marek Vasut ma...@denx.de wrote: On Friday, January 30, 2015 at 08:04:50 PM, Simon Glass wrote: This series adds basic driver model support to USB. The intent is to permit the various subsystems (OHCI, EHCI, XHCI) to co-exist and allow any number of USB ports of different types. So far the absolute limit on the number of USB devices is only slightly relaxed. Only USB controllers have a real driver model device. USB devices (including the hub in the controller) are not modelled as driver model devices. This is for two reasons: - it is easier since we don't need to bind a whole lot of devices when scanning - the two main USB devices (block devices and Ethernet) don't have driver mode support yet anyway, so it would be pointless. However the recent network RFC has encouraged me to send this. The basic approach is to set up the driver model structures in parallel to what already exists rather than to replace them. This allows both driver model and legacy to be used for USB, although not with the same board. So far only XHCI is supported. As an example the Exynos XHCI driver is converted to driver model. I would appreciate comments before going further. Caveats: - sandbox code is incomplete and there are no tests - 'usb stop' does not remove existing devices (I have not yet settled on the best approach) - the usb.h changes need to be split correctly into the patches once they are final This series is available at u-boot-dm/usb-working. Hi! I'll look at this by the end of next week, I will be free by then. It's not possible for me to do it earlier, sorry. Does this still work for you please? Definitely, that sounds good. I was planning to leave it a week or two anyway, although I might fiddle more with the sandbox side in the meantime. Regards, Simon ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [RFC PATCH 0/7] RFC: dm: Add USB support
On Friday, January 30, 2015 at 08:04:50 PM, Simon Glass wrote: This series adds basic driver model support to USB. The intent is to permit the various subsystems (OHCI, EHCI, XHCI) to co-exist and allow any number of USB ports of different types. So far the absolute limit on the number of USB devices is only slightly relaxed. Only USB controllers have a real driver model device. USB devices (including the hub in the controller) are not modelled as driver model devices. This is for two reasons: - it is easier since we don't need to bind a whole lot of devices when scanning - the two main USB devices (block devices and Ethernet) don't have driver mode support yet anyway, so it would be pointless. However the recent network RFC has encouraged me to send this. The basic approach is to set up the driver model structures in parallel to what already exists rather than to replace them. This allows both driver model and legacy to be used for USB, although not with the same board. So far only XHCI is supported. As an example the Exynos XHCI driver is converted to driver model. I would appreciate comments before going further. Caveats: - sandbox code is incomplete and there are no tests - 'usb stop' does not remove existing devices (I have not yet settled on the best approach) - the usb.h changes need to be split correctly into the patches once they are final This series is available at u-boot-dm/usb-working. Hi! I'll look at this by the end of next week, I will be free by then. It's not possible for me to do it earlier, sorry. Does this still work for you please? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot