Skip to contentSkip to conversation

Introduce fastboot support for dragonboard410c

PATCH New Ramon Fried 3 participants 31 messages Sep 21, 2018 – Oct 1, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover Introduce fastboot support for dragonboard410c

This set of patches introduce fastboot support for Qualcomm db410c.
As part of the patch, a small quirk is added to ci_udc through a weaklly linked function.

Changes in v2:
Added a new patch that was left out somehow. all other patches are the same.

Ramon Fried (14):
ehci: Replace board_prepare_usb with board_usb_init
ehci: msm: Add missing platdata
dts: db410c: add alias for USB
db410c: serial# env using msm board serial
phy: db410c: Add MSM USB PHY driver
dts: db410c: Add bindings for MSM USB phy
configs: db410c: Enable USB PHY
ehci: msm: switch to generic PHY uclass
ehci: msm: use init_type in probe usb:ci_udc: Introduce init_after_reset phy function
usb: ehci-msm: Add init_after_reset for CI_UDC
DB410c: Enable fastboot support
db410c: automatically launch fastboot usb:ci_udc: don't overwrite configuration on pullup

 MAINTAINERS                                   |   1 +
 arch/arm/dts/dragonboard410c.dts              |  11 ++
 arch/arm/mach-snapdragon/Kconfig              |   1 +
 .../dragonboard410c/dragonboard410c.c         |  17 ++-
 configs/dragonboard410c_defconfig             |  11 ++
 drivers/phy/Kconfig                           |   8 ++
 drivers/phy/Makefile                          |   1 +
 drivers/phy/msm8916-usbh-phy.c                | 109 ++++++++++++++++++
 drivers/usb/gadget/ci_udc.c                   |   9 +-
 drivers/usb/host/Kconfig                      |   3 +-
 drivers/usb/host/ehci-msm.c                   |  78 +++++--------
 11 files changed, 192 insertions(+), 57 deletions(-)
 create mode 100644 drivers/phy/msm8916-usbh-phy.c
Signature · 1 line
2.18.0
#1 lore raw

PATCH v2 1/14 ehci: Replace board_prepare_usb with board_usb_init

Use standard board_usb_init() instead of the specific board_prepare_usb.

---

Changes in v2: None

 board/qualcomm/dragonboard410c/dragonboard410c.c | 4 ++--
 drivers/usb/host/ehci-msm.c                      | 9 ++-------
 2 files changed, 4 insertions(+), 9 deletions(-)
board/qualcomm/dragonboard410c/dragonboard410c.c +2 -2
index 53e231e55a..e8a3ed0450 100644
@@ -44,7 +44,7 @@ int dram_init_banksize(void)
 	return 0;
 }
 
-int board_prepare_usb(enum usb_init_type type)
+int board_usb_init(int index, enum usb_init_type init)
 {
 	static struct udevice *pmic_gpio;
 	static struct gpio_desc hub_reset, usb_sel;
@@ -93,7 +93,7 @@ int board_prepare_usb(enum usb_init_type type)
 		}
 	}
 
-	if (type == USB_INIT_HOST) {
+	if (init == USB_INIT_HOST) {
 		/* Start USB Hub */
 		dm_gpio_set_dir_flags(&hub_reset,
 				      GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
drivers/usb/host/ehci-msm.c +2 -7
index 17bfa7c02f..db982624dc 100644
@@ -38,11 +38,6 @@ struct msm_ehci_priv {
 	struct ulpi_viewport ulpi_vp; /* ULPI Viewport */
 };
 
-int __weak board_prepare_usb(enum usb_init_type type)
-{
-	return 0;
-}
-
 static void setup_usb_phy(struct msm_ehci_priv *priv)
 {
 	/* Select and enable external configuration with USB PHY */
@@ -102,7 +97,7 @@ static int ehci_usb_probe(struct udevice *dev)
 	hcor = (struct ehci_hcor *)((phys_addr_t)hccr +
 			HC_LENGTH(ehci_readl(&(hccr)->cr_capbase)));
 
-	ret = board_prepare_usb(USB_INIT_HOST);
+	ret = board_usb_init(0, USB_INIT_HOST);
 	if (ret < 0)
 		return ret;
 
@@ -124,7 +119,7 @@ static int ehci_usb_remove(struct udevice *dev)
 
 	reset_usb_phy(p);
 
-	ret = board_prepare_usb(USB_INIT_DEVICE); /* Board specific hook */
+	ret = board_usb_init(0, USB_INIT_DEVICE); /* Board specific hook */
 	if (ret < 0)
 		return ret;
 
Signature · 1 line
2.18.0
#2 lore raw

PATCH v2 1/14 ehci: Replace board_prepare_usb with board_usb_init

Quoted 3 lines · Ramon Fried

Use standard board_usb_init() instead of the specific board_prepare_usb.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/99c6625c/attachment.sig>
#3 lore raw

PATCH v2 2/14 ehci: msm: Add missing platdata

In reply to Ramon Fried

platdata_auto_alloc_size was not initialized in structure. Caused null pointer dereference when configuring device as gadget.

---

Changes in v2: None

 drivers/usb/host/ehci-msm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/host/ehci-msm.c +1 -0
index db982624dc..e7fb76d6da 100644
@@ -167,5 +167,6 @@ U_BOOT_DRIVER(usb_ehci) = {
 	.remove = ehci_usb_remove,
 	.ops	= &ehci_usb_ops,
 	.priv_auto_alloc_size = sizeof(struct msm_ehci_priv),
+	.platdata_auto_alloc_size = sizeof(struct usb_platdata),
 	.flags	= DM_FLAG_ALLOC_PRIV_DMA,
 };
Signature · 1 line
2.18.0
#4 lore raw

PATCH v2 2/14 ehci: msm: Add missing platdata

Quoted 5 lines · Ramon Fried

platdata_auto_alloc_size was not initialized in structure. Caused null pointer dereference when configuring device as gadget.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/5c6d7673/attachment.sig>
#5 lore raw

PATCH v2 3/14 dts: db410c: add alias for USB

In reply to Ramon Fried

Alias is required so req-seq will be filled.

---

Changes in v2: None

 arch/arm/dts/dragonboard410c.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/dragonboard410c.dts +4 -0
index f4f7c350ec..75f28300b7 100644
@@ -18,6 +18,10 @@
 	#address-cells = <0x2>;
 	#size-cells = <0x2>;
 
+	aliases {
+		usb0 = "/soc/ehci at 78d9000";
+	};
+
 	memory {
 		device_type = "memory";
 		reg = <0 0x80000000 0 0x3da00000>;
Signature · 1 line
2.18.0
#6 lore raw

PATCH v2 3/14 dts: db410c: add alias for USB

Quoted 3 lines · Ramon Fried

Alias is required so req-seq will be filled.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/4eee64cd/attachment.sig>
#7 lore raw

PATCH v2 4/14 db410c: serial# env using msm board serial

In reply to Ramon Fried

The serial# environment variable needs to be
defined so it will be used by fastboot as serial
for the endpoint descriptor.

---

Changes in v2: None

 arch/arm/mach-snapdragon/Kconfig                 |  1 +
 board/qualcomm/dragonboard410c/dragonboard410c.c | 10 ++++++++++
 2 files changed, 11 insertions(+)
arch/arm/mach-snapdragon/Kconfig +1 -0
index bfd99db6e2..e562d693c6 100644
@@ -14,6 +14,7 @@ choice
 
 config TARGET_DRAGONBOARD410C
 	bool "96Boards Dragonboard 410C"
+	select BOARD_LATE_INIT
 	help
 	  Support for 96Boards Dragonboard 410C. This board complies with
 	  96Board Open Platform Specifications. Features:
board/qualcomm/dragonboard410c/dragonboard410c.c +10 -0
index e8a3ed0450..b2a72bce38 100644
@@ -151,6 +151,16 @@ int board_init(void)
 	return 0;
 }
 
+int board_late_init(void)
+{
+	char serial[16];
+
+	memset(serial, 0, 16);
+	snprintf(serial, 13, "%x", msm_board_serial());
+	env_set("serial#", serial);
+	return 0;
+}
+
 /* Fixup of DTB for Linux Kernel
  * 1. Fixup installed DRAM.
  * 2. Fixup WLAN/BT Mac address:
Signature · 1 line
2.18.0
#8 lore raw

PATCH v2 4/14 db410c: serial# env using msm board serial

Quoted 5 lines · Ramon Fried

The serial# environment variable needs to be
defined so it will be used by fastboot as serial
for the endpoint descriptor.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/fe7bf8e4/attachment-0001.sig>
#9 lore raw

PATCH v2 5/14 phy: db410c: Add MSM USB PHY driver

In reply to Ramon Fried

Add a PHY driver for the Qualcomm dragonboard 410c which allows switching on/off and resetting the phy connected to the EHCI controllers and USBHS controller.

---

Changes in v2: None

 MAINTAINERS                    |   1 +
 drivers/phy/Kconfig            |   8 +++
 drivers/phy/Makefile           |   1 +
 drivers/phy/msm8916-usbh-phy.c | 109 +++++++++++++++++++++++++++++++++
 4 files changed, 119 insertions(+)
 create mode 100644 drivers/phy/msm8916-usbh-phy.c
MAINTAINERS +1 -0
index 39d28e5d45..1a5b543dc7 100644
@@ -209,6 +209,7 @@ S:	Maintained
 F:	arch/arm/mach-snapdragon/
 F:	drivers/gpio/msm_gpio.c
 F:	drivers/mmc/msm_sdhci.c
+F:	drivers/phy/msm8916-usbh-phy.c
 F:	drivers/serial/serial_msm.c
 F:	drivers/smem/msm_smem.c
 F:	drivers/usb/host/ehci-msm.c
drivers/phy/Kconfig +8 -0
index e0822bb775..bcc8e22795 100644
@@ -139,4 +139,12 @@ config MESON_GXL_USB_PHY
 	  This is the generic phy driver for the Amlogic Meson GXL
 	  USB2 and USB3 PHYS.
 
+config MSM8916_USB_PHY
+	bool "Qualcomm MSM8916 USB PHY support"
+	depends on PHY
+	help
+          Support the USB PHY in msm8916
+
+	  This PHY is found on qualcomm dragonboard410c development board.
+
 endmenu
drivers/phy/Makefile +1 -0
index 178fb4530e..1e1e4ca11e 100644
@@ -15,3 +15,4 @@ obj-$(CONFIG_STI_USB_PHY) += sti_usb_phy.o
 obj-$(CONFIG_PHY_RCAR_GEN2) += phy-rcar-gen2.o
 obj-$(CONFIG_PHY_STM32_USBPHYC) += phy-stm32-usbphyc.o
 obj-$(CONFIG_MESON_GXL_USB_PHY) += meson-gxl-usb2.o meson-gxl-usb3.o
+obj-$(CONFIG_MSM8916_USB_PHY) += msm8916-usbh-phy.o
drivers/phy/msm8916-usbh-phy.c new file +109 -0

109 lines not on this page · raw message

Signature · 1 line
2.18.0
#10 lore raw

PATCH v2 5/14 phy: db410c: Add MSM USB PHY driver

Quoted 5 lines · Ramon Fried

Add a PHY driver for the Qualcomm dragonboard 410c which allows switching on/off and resetting the phy connected to the EHCI controllers and USBHS controller.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/e976045a/attachment.sig>
#11 lore raw

PATCH v2 6/14 dts: db410c: Add bindings for MSM USB phy

In reply to Ramon Fried

---

Changes in v2: None

 arch/arm/dts/dragonboard410c.dts | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/dts/dragonboard410c.dts +7 -0
index 75f28300b7..fa348bc621 100644
@@ -97,6 +97,13 @@
 		ehci at 78d9000 {
 			compatible = "qcom,ehci-host";
 			reg = <0x78d9000 0x400>;
+			phys = <&ehci_phy>;
+		};
+
+		ehci_phy: ehci_phy at 78d9000 {
+			compatible = "qcom,apq8016-usbphy";
+			reg = <0x78d9000 0x400>;
+			#phy-cells = <0>;
 		};
 
 		sdhci at 07824000 {
Signature · 1 line
2.18.0
#12 lore raw

PATCH v2 6/14 dts: db410c: Add bindings for MSM USB phy

Quoted 1 line · Ramon Fried

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/3409b144/attachment.sig>
#13 lore raw

PATCH v2 7/14 configs: db410c: Enable USB PHY

In reply to Ramon Fried

Enable USB PHY driver.
Also fixed the alphabetically ordering of the config.

---

Changes in v2: None

 configs/dragonboard410c_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/dragonboard410c_defconfig +1 -0
index 96a831443a..0d9008deb7 100644
@@ -29,6 +29,7 @@ CONFIG_LED_GPIO=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_MSM=y
+CONFIG_PHY=y
 CONFIG_PINCTRL=y
 CONFIG_PINCONF=y
 CONFIG_DM_PMIC=y
Signature · 1 line
2.18.0
#14 lore raw

PATCH v2 7/14 configs: db410c: Enable USB PHY

Quoted 4 lines · Ramon Fried

Enable USB PHY driver.
Also fixed the alphabetically ordering of the config.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/9410480c/attachment.sig>
#15 lore raw

PATCH v2 8/14 ehci: msm: switch to generic PHY uclass

In reply to Ramon Fried

All the underlying USB PHY was handled in the ehci driver. Use the generic phy API instead.

---

Changes in v2: None

 drivers/usb/host/Kconfig    |  3 +--
 drivers/usb/host/ehci-msm.c | 52 +++++++------------------------------
 2 files changed, 10 insertions(+), 45 deletions(-)
drivers/usb/host/Kconfig +1 -2
index b4dd005651..a213c918bc 100644
@@ -167,12 +167,11 @@ config USB_EHCI_MSM
 	bool "Support for Qualcomm on-chip EHCI USB controller"
 	depends on DM_USB
 	select USB_ULPI_VIEWPORT
+	select MSM8916_USB_PHY
 	default n
 	---help---
 	  Enables support for the on-chip EHCI controller on Qualcomm
 	  Snapdragon SoCs.
-	  This driver supports combination of Chipidea USB controller
-	  and Synapsys USB PHY in host mode only.
 
 config USB_EHCI_PCI
 	bool "Support for PCI-based EHCI USB controller"
drivers/usb/host/ehci-msm.c +9 -43

81 lines not on this page · raw message

Signature · 1 line
2.18.0
#16 lore raw

PATCH v2 8/14 ehci: msm: switch to generic PHY uclass

Quoted 4 lines · Ramon Fried

All the underlying USB PHY was handled in the ehci driver. Use the generic phy API instead.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/2369e9e2/attachment.sig>
#17 lore raw

PATCH v2 9/14 ehci: msm: use init_type in probe

In reply to Ramon Fried

Change ehci_usb_probe() function to initialize the USB according to the init_type provided.

---

Changes in v2: None

 drivers/usb/host/ehci-msm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/usb/host/ehci-msm.c +4 -2
index a27a5833dd..00d6bb8231 100644
@@ -49,6 +49,7 @@ static int ehci_usb_probe(struct udevice *dev)
 {
 	struct msm_ehci_priv *p = dev_get_priv(dev);
 	struct usb_ehci *ehci = p->ehci;
+	struct usb_platdata *plat = dev_get_platdata(dev);
 	struct ehci_hccr *hccr;
 	struct ehci_hcor *hcor;
 	int ret;
@@ -61,11 +62,12 @@ static int ehci_usb_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
-	ret = board_usb_init(0, USB_INIT_HOST);
+	ret = board_usb_init(0, plat->init_type);
 	if (ret < 0)
 		return ret;
 
-	return ehci_register(dev, hccr, hcor, &msm_ehci_ops, 0, USB_INIT_HOST);
+	return ehci_register(dev, hccr, hcor, &msm_ehci_ops, 0,
+			     plat->init_type);
 }
 
 static int ehci_usb_remove(struct udevice *dev)
Signature · 1 line
2.18.0
#18 lore raw

PATCH v2 9/14 ehci: msm: use init_type in probe

Quoted 4 lines · Ramon Fried

Change ehci_usb_probe() function to initialize the USB according to the init_type provided.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/e2f4f225/attachment.sig>
#19 lore raw

PATCH v2 10/14 usb:ci_udc: Introduce init_after_reset phy function

In reply to Ramon Fried

MSM variant of Chipidea must reinitalize the phy after controller reset.
Introduce ci_init_after_reset() weak function that can be used to achieve the above init.

---

Changes in v2: None

 drivers/usb/gadget/ci_udc.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/usb/gadget/ci_udc.c +6 -0
index 2b9dbf06b9..8d23fab3b7 100644
@@ -104,6 +104,10 @@ static struct usb_ep_ops ci_ep_ops = {
 	.free_request   = ci_ep_free_request,
 };
 
+__weak void ci_init_after_reset(struct ehci_ctrl *ctrl)
+{
+}
+
 /* Init values for USB endpoints. */
 static const struct usb_ep ci_ep_init[5] = {
 	[0] = {	/* EP 0 */
@@ -887,6 +891,8 @@ static int ci_pullup(struct usb_gadget *gadget, int is_on)
 		writel(USBCMD_ITC(MICRO_8FRAME) | USBCMD_RST, &udc->usbcmd);
 		udelay(200);
 
+		ci_init_after_reset(controller.ctrl);
+
 		writel((unsigned long)controller.epts, &udc->epinitaddr);
 
 		/* select DEVICE mode */
Signature · 1 line
2.18.0
#20 lore raw

PATCH v2 10/14 usb:ci_udc: Introduce init_after_reset phy function

Quoted 6 lines · Ramon Fried

MSM variant of Chipidea must reinitalize the phy after controller reset.
Introduce ci_init_after_reset() weak function that can be used to achieve the above init.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/f2f8e24e/attachment.sig>
#21 lore raw

PATCH v2 10/14 usb:ci_udc: Introduce init_after_reset phy function

In reply to Ramon Fried

Hi Ramon,

Quoted 29 lines

MSM variant of Chipidea must reinitalize the phy after controller reset.
Introduce ci_init_after_reset() weak function that can be used to achieve the above init.

---

Changes in v2: None

 drivers/usb/gadget/ci_udc.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/usb/gadget/ci_udc.c +4 -0
index 2b9dbf06b9..8d23fab3b7 100644
@@ -104,6 +104,10 @@ static struct usb_ep_ops ci_ep_ops = {
 	.free_request   = ci_ep_free_request,
 };
 
+__weak void ci_init_after_reset(struct ehci_ctrl *ctrl)
+{
+}
+
 /* Init values for USB endpoints. */
 static const struct usb_ep ci_ep_init[5] = {
 	[0] = {	/* EP 0 */

drivers/usb/gadget/ci_udc.c static int ci_pullup(struct usb_gadget *gadget, · line 898

Quoted 8 lines
drivers/usb/gadget/ci_udc.c +2 -0
@@ -887,6 +891,8 @@ static int ci_pullup(struct usb_gadget *gadget,
 int is_on) writel(USBCMD_ITC(MICRO_8FRAME) | USBCMD_RST,
 &udc->usbcmd); udelay(200);
 
+		ci_init_after_reset(controller.ctrl);
+
 		writel((unsigned long)controller.epts,
 &udc->epinitaddr); 
 		/* select DEVICE mode */

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181001/17f09992/attachment.sig>

#22 lore raw

PATCH v2 11/14 usb: ehci-msm: Add init_after_reset for CI_UDC

In reply to Ramon Fried

MSM uses the chipidea controller IP, however it requires to reinit the phy after controller reset. in EHCI mode there's a dedicated callback for it.
In device mode however there's no such callback.
Add implementaion of ci_init_after_reset() to implement the above requirement in case CI_UDC driver is used.

---

Changes in v2: None

 drivers/usb/host/ehci-msm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/usb/host/ehci-msm.c +12 -0
index 00d6bb8231..5c257ccf4d 100644
@@ -121,6 +121,18 @@ static int ehci_usb_ofdata_to_platdata(struct udevice *dev)
 	return 0;
 }
 
+#if defined(CONFIG_CI_UDC)
+/* Little quirk that MSM needs with Chipidea controller
+ * Must reinit phy after reset
+ */
+void ci_init_after_reset(struct ehci_ctrl *ctrl)
+{
+	struct msm_ehci_priv *p = ctrl->priv;
+
+	generic_phy_reset(&p->phy);
+}
+#endif
+
 static const struct udevice_id ehci_usb_ids[] = {
 	{ .compatible = "qcom,ehci-host", },
 	{ }
Signature · 1 line
2.18.0
#23 lore raw

PATCH v2 11/14 usb: ehci-msm: Add init_after_reset for CI_UDC

Quoted 8 lines · Ramon Fried

MSM uses the chipidea controller IP, however it requires to reinit the phy after controller reset. in EHCI mode there's a dedicated callback for it.
In device mode however there's no such callback.
Add implementaion of ci_init_after_reset() to implement the above requirement in case CI_UDC driver is used.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/54218e7e/attachment.sig>
#24 lore raw

PATCH v2 12/14 DB410c: Enable fastboot support

In reply to Ramon Fried

---

Changes in v2: None

 configs/dragonboard410c_defconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)
configs/dragonboard410c_defconfig +10 -0
index 0d9008deb7..a55abaf8df 100644
@@ -4,6 +4,7 @@ CONFIG_SYS_TEXT_BASE=0x80080000
 CONFIG_IDENT_STRING="\nQualcomm-DragonBoard 410C"
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_NR_DRAM_BANKS=1
+# CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_FIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_MISC_INIT_R=y
@@ -22,6 +23,10 @@ CONFIG_CMD_TIMER=y
 CONFIG_DEFAULT_DEVICE_TREE="dragonboard410c"
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_CLK=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x91000000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
 CONFIG_MSM_GPIO=y
 CONFIG_PM8916_GPIO=y
 CONFIG_LED=y
@@ -43,6 +48,11 @@ CONFIG_USB_EHCI_MSM=y
 CONFIG_USB_ULPI_VIEWPORT=y
 CONFIG_USB_ULPI=y
 CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_VENDOR_NUM=0x18d1
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd00d
+CONFIG_CI_UDC=y
+CONFIG_USB_GADGET_DUALSPEED=n
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_ASIX88179=y
Signature · 1 line
2.18.0
#25 lore raw

PATCH v2 12/14 DB410c: Enable fastboot support

Quoted 1 line · Ramon Fried

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/bf0fa72b/attachment.sig>
#26 lore raw

PATCH v2 13/14 db410c: automatically launch fastboot

In reply to Ramon Fried

If during boot the key-vol-down press is detected
we'll fall back to fastboot.

---

Changes in v2: None

 board/qualcomm/dragonboard410c/dragonboard410c.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
board/qualcomm/dragonboard410c/dragonboard410c.c +2 -1
index b2a72bce38..9ceed3ad9b 100644
@@ -140,7 +140,8 @@ int misc_init_r(void)
 
 	if (dm_gpio_get_value(&resin)) {
 		env_set("bootdelay", "-1");
-		printf("Power button pressed - dropping to console.\n");
+		env_set("bootcmd", "fastboot 0");
+		printf("key_vol_down pressed - Starting fastboot.\n");
 	}
 
 	return 0;
Signature · 1 line
2.18.0
#27 lore raw

PATCH v2 13/14 db410c: automatically launch fastboot

Quoted 4 lines · Ramon Fried

If during boot the key-vol-down press is detected
we'll fall back to fastboot.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/6e1e7c45/attachment.sig>
#28 lore raw

PATCH v2 14/14 usb:ci_udc: don't overwrite configuration on pullup

In reply to Ramon Fried

change writel to writebits32 in ci_pullup() in order to keep phy configuration in tact.

---

Changes in v2:
Patch introduced

 drivers/usb/gadget/ci_udc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/gadget/ci_udc.c +2 -1
index 8d23fab3b7..0a84f6850d 100644
@@ -906,7 +906,8 @@ static int ci_pullup(struct usb_gadget *gadget, int is_on)
 		writel(0xffffffff, &udc->epflush);
 
 		/* Turn on the USB connection by enabling the pullup resistor */
-		writel(USBCMD_ITC(MICRO_8FRAME) | USBCMD_RUN, &udc->usbcmd);
+		setbits_le32(&udc->usbcmd, USBCMD_ITC(MICRO_8FRAME) |
+			     USBCMD_RUN);
 	} else {
 		udc_disconnect();
 	}
Signature · 1 line
2.18.0
#29 lore raw

PATCH v2 14/14 usb:ci_udc: don't overwrite configuration on pullup

Quoted 4 lines · Ramon Fried

change writel to writebits32 in ci_pullup() in order to keep phy configuration in tact.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180930/7c120a1f/attachment.sig>
#30 lore raw

PATCH v2 14/14 usb:ci_udc: don't overwrite configuration on pullup

In reply to Ramon Fried

Hi Ramon,

Quoted 23 lines

change writel to writebits32 in ci_pullup() in order to keep phy configuration in tact.

---

Changes in v2:
Patch introduced

 drivers/usb/gadget/ci_udc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/gadget/ci_udc.c +0 -0
index 8d23fab3b7..0a84f6850d 100644
@@ -906,7 +906,8 @@ static int ci_pullup(struct usb_gadget *gadget,
 int is_on) writel(0xffffffff, &udc->epflush);
 
 		/* Turn on the USB connection by enabling the pullup

resistor */

drivers/usb/gadget/ci_udc.c +0 -1
-		writel(USBCMD_ITC(MICRO_8FRAME) | USBCMD_RUN,

&udc->usbcmd);

drivers/usb/gadget/ci_udc.c static int ci_pullup(struct usb_gadget *gadget, int is_on) · line 913

Quoted 5 lines
drivers/usb/gadget/ci_udc.c +2 -0
+		setbits_le32(&udc->usbcmd, USBCMD_ITC(MICRO_8FRAME) |
+			     USBCMD_RUN);
 	} else {
 		udc_disconnect();
 	}

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181001/415d4b89/attachment.sig>