Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
On Sat, 31 Jan 2015 15:15:24 +0100 Marek Vasut ma...@denx.de wrote: On Saturday, January 31, 2015 at 02:26:16 PM, Lukasz Majewski wrote: On Fri, 30 Jan 2015 23:16:57 +0100 Marek Vasut ma...@denx.de wrote: On Monday, January 26, 2015 at 01:31:39 PM, Lukasz Majewski wrote: Hi Marek, On Monday, January 26, 2015 at 09:38:28 AM, Lukasz Majewski wrote: Hi Marek, Hi! [...] No, unless there's a convincing technical argument that the currently mainline DWC2 gadget driver (the s3c one) can absolutelly not be used for the broadcom SoC, I want to avoid having two drivers for the same IP core in mainline, sorry. Maybe it is a highest time to think about renaming s3c_* to dwc2_* and avoid further confusion. The time was ripe for a while now ;-) Do you want to do it or shall I send a patch ? I do know that I will test it :-), so feel free to send the patch. Hi! I'm dead busy until end of next week. Do you mind cooking such patch please? I will try to find some time slack to prepare patch. Thanks! Shall I pick it then ? For technical (testing) point of view it would be better for me to place it -dfu tree, and then send a PR to you. Best regards, LUkasz Majewski Best regards, Marek Vasut pgpGQTi43YQwK.pgp Description: OpenPGP digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
On Sunday, February 01, 2015 at 02:15:45 PM, Lukasz Majewski wrote: On Sat, 31 Jan 2015 15:15:24 +0100 Marek Vasut ma...@denx.de wrote: On Saturday, January 31, 2015 at 02:26:16 PM, Lukasz Majewski wrote: On Fri, 30 Jan 2015 23:16:57 +0100 Marek Vasut ma...@denx.de wrote: On Monday, January 26, 2015 at 01:31:39 PM, Lukasz Majewski wrote: Hi Marek, On Monday, January 26, 2015 at 09:38:28 AM, Lukasz Majewski wrote: Hi Marek, Hi! [...] No, unless there's a convincing technical argument that the currently mainline DWC2 gadget driver (the s3c one) can absolutelly not be used for the broadcom SoC, I want to avoid having two drivers for the same IP core in mainline, sorry. Maybe it is a highest time to think about renaming s3c_* to dwc2_* and avoid further confusion. The time was ripe for a while now ;-) Do you want to do it or shall I send a patch ? I do know that I will test it :-), so feel free to send the patch. Hi! I'm dead busy until end of next week. Do you mind cooking such patch please? I will try to find some time slack to prepare patch. Thanks! Shall I pick it then ? For technical (testing) point of view it would be better for me to place it -dfu tree, and then send a PR to you. Roger :) Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
On Fri, 30 Jan 2015 23:16:57 +0100 Marek Vasut ma...@denx.de wrote: On Monday, January 26, 2015 at 01:31:39 PM, Lukasz Majewski wrote: Hi Marek, On Monday, January 26, 2015 at 09:38:28 AM, Lukasz Majewski wrote: Hi Marek, Hi! [...] No, unless there's a convincing technical argument that the currently mainline DWC2 gadget driver (the s3c one) can absolutelly not be used for the broadcom SoC, I want to avoid having two drivers for the same IP core in mainline, sorry. Maybe it is a highest time to think about renaming s3c_* to dwc2_* and avoid further confusion. The time was ripe for a while now ;-) Do you want to do it or shall I send a patch ? I do know that I will test it :-), so feel free to send the patch. Hi! I'm dead busy until end of next week. Do you mind cooking such patch please? I will try to find some time slack to prepare patch. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot pgpepVIhAYpRu.pgp Description: OpenPGP digital signature ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
On Saturday, January 31, 2015 at 02:26:16 PM, Lukasz Majewski wrote: On Fri, 30 Jan 2015 23:16:57 +0100 Marek Vasut ma...@denx.de wrote: On Monday, January 26, 2015 at 01:31:39 PM, Lukasz Majewski wrote: Hi Marek, On Monday, January 26, 2015 at 09:38:28 AM, Lukasz Majewski wrote: Hi Marek, Hi! [...] No, unless there's a convincing technical argument that the currently mainline DWC2 gadget driver (the s3c one) can absolutelly not be used for the broadcom SoC, I want to avoid having two drivers for the same IP core in mainline, sorry. Maybe it is a highest time to think about renaming s3c_* to dwc2_* and avoid further confusion. The time was ripe for a while now ;-) Do you want to do it or shall I send a patch ? I do know that I will test it :-), so feel free to send the patch. Hi! I'm dead busy until end of next week. Do you mind cooking such patch please? I will try to find some time slack to prepare patch. Thanks! Shall I pick it then ? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
On Monday, January 26, 2015 at 01:31:39 PM, Lukasz Majewski wrote: Hi Marek, On Monday, January 26, 2015 at 09:38:28 AM, Lukasz Majewski wrote: Hi Marek, Hi! [...] No, unless there's a convincing technical argument that the currently mainline DWC2 gadget driver (the s3c one) can absolutelly not be used for the broadcom SoC, I want to avoid having two drivers for the same IP core in mainline, sorry. Maybe it is a highest time to think about renaming s3c_* to dwc2_* and avoid further confusion. The time was ripe for a while now ;-) Do you want to do it or shall I send a patch ? I do know that I will test it :-), so feel free to send the patch. Hi! I'm dead busy until end of next week. Do you mind cooking such patch please? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
On Wednesday, January 28, 2015 at 08:04:45 PM, Steve Rae wrote: On 15-01-27 03:00 PM, Marek Vasut wrote: On Monday, January 26, 2015 at 06:44:14 PM, Steve Rae wrote: [...] No, unless there's a convincing technical argument that the currently mainline DWC2 gadget driver (the s3c one) can absolutelly not be used for the broadcom SoC, I want to avoid having two drivers for the same IP core in mainline, sorry. [...] Sorry, at this point I have to push back a little. OK -- Thanks for this information Hi! do you plan to rework the series on top of the dwc2 (s3c) driver by any chance please ? Best regards, Marek Vasut I have it on my TODO list, but I am not going to be able to work on it (for weeks; if not months...) Sorry. But if someone else would rework the code, I can probably find some time to test it Aw, that's a bit sad. Porting the Altera stuff was a matter of a couple of hours, are you sure you won't give it a spin please ? :) Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
On 15-01-27 03:00 PM, Marek Vasut wrote: On Monday, January 26, 2015 at 06:44:14 PM, Steve Rae wrote: [...] No, unless there's a convincing technical argument that the currently mainline DWC2 gadget driver (the s3c one) can absolutelly not be used for the broadcom SoC, I want to avoid having two drivers for the same IP core in mainline, sorry. [...] Sorry, at this point I have to push back a little. OK -- Thanks for this information Hi! do you plan to rework the series on top of the dwc2 (s3c) driver by any chance please ? Best regards, Marek Vasut I have it on my TODO list, but I am not going to be able to work on it (for weeks; if not months...) Sorry. But if someone else would rework the code, I can probably find some time to test it Thanks, Steve ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
On Monday, January 26, 2015 at 06:44:14 PM, Steve Rae wrote: [...] No, unless there's a convincing technical argument that the currently mainline DWC2 gadget driver (the s3c one) can absolutelly not be used for the broadcom SoC, I want to avoid having two drivers for the same IP core in mainline, sorry. [...] Sorry, at this point I have to push back a little. OK -- Thanks for this information Hi! do you plan to rework the series on top of the dwc2 (s3c) driver by any chance please ? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
Hi Marek, On Monday, January 26, 2015 at 09:38:28 AM, Lukasz Majewski wrote: Hi Marek, Hi! [...] No, unless there's a convincing technical argument that the currently mainline DWC2 gadget driver (the s3c one) can absolutelly not be used for the broadcom SoC, I want to avoid having two drivers for the same IP core in mainline, sorry. Maybe it is a highest time to think about renaming s3c_* to dwc2_* and avoid further confusion. The time was ripe for a while now ;-) Do you want to do it or shall I send a patch ? I do know that I will test it :-), so feel free to send the patch. Best regards, Marek Vasut -- Best regards, Lukasz Majewski Samsung RD Institute Poland (SRPOL) | Linux Platform Group ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
On 15-01-24 03:47 AM, Marek Vasut wrote: On Saturday, January 24, 2015 at 12:48:15 AM, Steve Rae wrote: On 15-01-21 11:05 PM, Marek Vasut wrote: On Tuesday, January 20, 2015 at 11:42:08 PM, Steve Rae wrote: Implement the UDC support for the USB OTG interface. Signed-off-by: Steve Rae s...@broadcom.com --- General question -- this bcm controller you're adding here isn't by any chance a DWC2 controller, or is it ? There's already a driver for DWC2 in drivers/usb/gadget/s3c_udc_otg.c . This driver should really be properly renamed though ;-/ If this is not DWC2, do you know what controller this is please ? yes -- it is a DWC2 So, I have had a quick look at the s3c_udc_otg*.c code First observation is that there is a completely different philosophy in the implementation. For example, the the interrupt handler routine(s), Broadcom is using #defines (sysmap.h which BTW are autogenerated by our Device Team) whereas S3C is using a s3c_usbotg_reg structure for the 'address' and #defines for the 'data/masks'. I'm not suggesting that one is better than the other, they are just different. Hi! The later is accepted by U-Boot as the preferred way, so the s3c is doing things right. So, how do we proceed? At this point, the Altera SoCFPGA and Samsung Exynos both use this s3c driver to operate the DWC2 core in gadget mode. It should be trivial to add support for the boardcom SoC, just follow the Altera example. I would like to avoid situation where we have two drivers for a single IP block. - is the ultimate goal to get to a proper gadget driver for DWC2? (I don't really know enough about this yet, so I apologize for these questions) Yes, but we already have one to my knowledge. - is the S3C code a proper 'gadget' driver and/or is it a better starting point to get to a gadget driver? Yes, and it's thoroughly tested already. - I don't have enough time right now to really investigate the existing S3C and implement it on our board(s); they are significantly different and it looks like it will take a lot of effort - is there someone (Denx or community) that could assist me? Sure, just start asking the questions. - Could we continue to review this patchset and accept it; then establish a team to provide a DWC2 gadget that could be used going forward? No, unless there's a convincing technical argument that the currently mainline DWC2 gadget driver (the s3c one) can absolutelly not be used for the broadcom SoC, I want to avoid having two drivers for the same IP core in mainline, sorry. [...] Sorry, at this point I have to push back a little. OK -- Thanks for this information Steve Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
Hi Marek, On Saturday, January 24, 2015 at 12:48:15 AM, Steve Rae wrote: On 15-01-21 11:05 PM, Marek Vasut wrote: On Tuesday, January 20, 2015 at 11:42:08 PM, Steve Rae wrote: Implement the UDC support for the USB OTG interface. Signed-off-by: Steve Rae s...@broadcom.com --- General question -- this bcm controller you're adding here isn't by any chance a DWC2 controller, or is it ? There's already a driver for DWC2 in drivers/usb/gadget/s3c_udc_otg.c . This driver should really be properly renamed though ;-/ If this is not DWC2, do you know what controller this is please ? yes -- it is a DWC2 So, I have had a quick look at the s3c_udc_otg*.c code First observation is that there is a completely different philosophy in the implementation. For example, the the interrupt handler routine(s), Broadcom is using #defines (sysmap.h which BTW are autogenerated by our Device Team) whereas S3C is using a s3c_usbotg_reg structure for the 'address' and #defines for the 'data/masks'. I'm not suggesting that one is better than the other, they are just different. Hi! The later is accepted by U-Boot as the preferred way, so the s3c is doing things right. So, how do we proceed? At this point, the Altera SoCFPGA and Samsung Exynos both use this s3c driver to operate the DWC2 core in gadget mode. It should be trivial to add support for the boardcom SoC, just follow the Altera example. I would like to avoid situation where we have two drivers for a single IP block. - is the ultimate goal to get to a proper gadget driver for DWC2? (I don't really know enough about this yet, so I apologize for these questions) Yes, but we already have one to my knowledge. - is the S3C code a proper 'gadget' driver and/or is it a better starting point to get to a gadget driver? Yes, and it's thoroughly tested already. - I don't have enough time right now to really investigate the existing S3C and implement it on our board(s); they are significantly different and it looks like it will take a lot of effort - is there someone (Denx or community) that could assist me? Sure, just start asking the questions. - Could we continue to review this patchset and accept it; then establish a team to provide a DWC2 gadget that could be used going forward? No, unless there's a convincing technical argument that the currently mainline DWC2 gadget driver (the s3c one) can absolutelly not be used for the broadcom SoC, I want to avoid having two drivers for the same IP core in mainline, sorry. Maybe it is a highest time to think about renaming s3c_* to dwc2_* and avoid further confusion. [...] Sorry, at this point I have to push back a little. Best regards, Marek Vasut -- Best regards, Lukasz Majewski Samsung RD Institute Poland (SRPOL) | Linux Platform Group ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
On Monday, January 26, 2015 at 09:38:28 AM, Lukasz Majewski wrote: Hi Marek, Hi! [...] No, unless there's a convincing technical argument that the currently mainline DWC2 gadget driver (the s3c one) can absolutelly not be used for the broadcom SoC, I want to avoid having two drivers for the same IP core in mainline, sorry. Maybe it is a highest time to think about renaming s3c_* to dwc2_* and avoid further confusion. The time was ripe for a while now ;-) Do you want to do it or shall I send a patch ? Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
On Saturday, January 24, 2015 at 12:48:15 AM, Steve Rae wrote: On 15-01-21 11:05 PM, Marek Vasut wrote: On Tuesday, January 20, 2015 at 11:42:08 PM, Steve Rae wrote: Implement the UDC support for the USB OTG interface. Signed-off-by: Steve Rae s...@broadcom.com --- General question -- this bcm controller you're adding here isn't by any chance a DWC2 controller, or is it ? There's already a driver for DWC2 in drivers/usb/gadget/s3c_udc_otg.c . This driver should really be properly renamed though ;-/ If this is not DWC2, do you know what controller this is please ? yes -- it is a DWC2 So, I have had a quick look at the s3c_udc_otg*.c code First observation is that there is a completely different philosophy in the implementation. For example, the the interrupt handler routine(s), Broadcom is using #defines (sysmap.h which BTW are autogenerated by our Device Team) whereas S3C is using a s3c_usbotg_reg structure for the 'address' and #defines for the 'data/masks'. I'm not suggesting that one is better than the other, they are just different. Hi! The later is accepted by U-Boot as the preferred way, so the s3c is doing things right. So, how do we proceed? At this point, the Altera SoCFPGA and Samsung Exynos both use this s3c driver to operate the DWC2 core in gadget mode. It should be trivial to add support for the boardcom SoC, just follow the Altera example. I would like to avoid situation where we have two drivers for a single IP block. - is the ultimate goal to get to a proper gadget driver for DWC2? (I don't really know enough about this yet, so I apologize for these questions) Yes, but we already have one to my knowledge. - is the S3C code a proper 'gadget' driver and/or is it a better starting point to get to a gadget driver? Yes, and it's thoroughly tested already. - I don't have enough time right now to really investigate the existing S3C and implement it on our board(s); they are significantly different and it looks like it will take a lot of effort - is there someone (Denx or community) that could assist me? Sure, just start asking the questions. - Could we continue to review this patchset and accept it; then establish a team to provide a DWC2 gadget that could be used going forward? No, unless there's a convincing technical argument that the currently mainline DWC2 gadget driver (the s3c one) can absolutelly not be used for the broadcom SoC, I want to avoid having two drivers for the same IP core in mainline, sorry. [...] Sorry, at this point I have to push back a little. Best regards, Marek Vasut ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
On 15-01-21 11:05 PM, Marek Vasut wrote: On Tuesday, January 20, 2015 at 11:42:08 PM, Steve Rae wrote: Implement the UDC support for the USB OTG interface. Signed-off-by: Steve Rae s...@broadcom.com --- General question -- this bcm controller you're adding here isn't by any chance a DWC2 controller, or is it ? There's already a driver for DWC2 in drivers/usb/gadget/s3c_udc_otg.c . This driver should really be properly renamed though ;-/ If this is not DWC2, do you know what controller this is please ? yes -- it is a DWC2 So, I have had a quick look at the s3c_udc_otg*.c code First observation is that there is a completely different philosophy in the implementation. For example, the the interrupt handler routine(s), Broadcom is using #defines (sysmap.h which BTW are autogenerated by our Device Team) whereas S3C is using a s3c_usbotg_reg structure for the 'address' and #defines for the 'data/masks'. I'm not suggesting that one is better than the other, they are just different. So, how do we proceed? - is the ultimate goal to get to a proper gadget driver for DWC2? (I don't really know enough about this yet, so I apologize for these questions) - is the S3C code a proper 'gadget' driver and/or is it a better starting point to get to a gadget driver? - I don't have enough time right now to really investigate the existing S3C and implement it on our board(s); they are significantly different and it looks like it will take a lot of effort - is there someone (Denx or community) that could assist me? - Could we continue to review this patchset and accept it; then establish a team to provide a DWC2 gadget that could be used going forward? Note: this patchset is relatively small: 6938ae5 usb: fastboot: implement fastboot M drivers/usb/gadget/Makefile A drivers/usb/gadget/bcm_usb_gadget.c M include/configs/bcm28155_ap.h b85657d usb: update 'sysmap.h' M arch/arm/include/asm/arch-bcm281xx/sysmap.h d590d41 usb: add 'bcm_udc_otg' support A drivers/usb/gadget/bcm_udc_otg.c A drivers/usb/gadget/bcm_udc_otg.h 5f1d857 usb: gadget: fastboot: add CONFIG_FASTBOOT_NO_GADGET support M drivers/usb/gadget/f_fastboot.c Thanks in advance, Steve [...] [... snip ...] ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] usb: add 'bcm_udc_otg' support
On Tuesday, January 20, 2015 at 11:42:08 PM, Steve Rae wrote: Implement the UDC support for the USB OTG interface. Signed-off-by: Steve Rae s...@broadcom.com --- General question -- this bcm controller you're adding here isn't by any chance a DWC2 controller, or is it ? There's already a driver for DWC2 in drivers/usb/gadget/s3c_udc_otg.c . This driver should really be properly renamed though ;-/ If this is not DWC2, do you know what controller this is please ? [...] +#define FASTBOOT_INTERFACE_CLASS 0xff +#define FASTBOOT_INTERFACE_SUB_CLASS 0x42 +#define FASTBOOT_INTERFACE_PROTOCOL 0x03 + +#define wfld_set(addr, fld_val, fld_mask) \ + (writel(((readl(addr) ~(fld_mask)) | (fld_val)), (addr))) +#define wfld_clear(addr, fld_mask) \ + (writel((readl(addr) ~(fld_mask)), (addr))) The same functionality is implemented by clrsetbits32() and friends. +#define DEVICE_STRING_LANGUAGE_ID0x0409 /* English (United States) */ + +/* + * In high speed mode rx packets are 512 + * In full speed mode rx packets are 64 + */ +#define RX_ENDPOINT_MAXIMUM_PACKET_SIZE (0x0200) +#define TX_ENDPOINT_MAXIMUM_PACKET_SIZE (0x0040) No need for the brackets here. +#ifndef CONFIG_USB_BOARDNAME +#define CONFIG_USB_BOARDNAME Board +#endif + +#ifndef CONFIG_USB_CONFIGURATION +#define CONFIG_USB_CONFIGURATION Fastboot +#endif What is all this stuff doing in generic USB UDC driver please ? Or is this not a generic UDC driver ? [...] +static void usb_turn_off_vdp(void) +{ + /* Check if it is standard host port (SHP) */ + if (readl(HSOTG_CTRL_BASE_ADDR + HSOTG_CTRL_STATUS_OFFSET) + HSOTG_CTRL_STATUS_SHP_MASK) { + udelay(6); /* 50 ms + 20 % */ mdelay(60), this should be fixed all over the place please. + /* + * force turn off VDP, enable sw_ovwr_set to take over the + * bc11 switches directly + */ + wfld_set(HSOTG_CTRL_BASE_ADDR + HSOTG_CTRL_CFG_OFFSET, + BC11_CFG_VDP_OFF, + HSOTG_CTRL_CFG_OVWR_KEY_MASK | + HSOTG_CTRL_CFG_SW_OVWR_EN_MASK | + HSOTG_CTRL_CFG_OVWR_SET_M0_MASK | + HSOTG_CTRL_CFG_OVWR_SET_P0_MASK); + + udelay(160);/* Allow time for switches to disengage */ + } else { + udelay(12); /* 100 ms + 20 % */ + } +} [...] ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot