How to enable USB 2.0 in U-Boot for imx8qxp_mek_android

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to enable USB 2.0 in U-Boot for imx8qxp_mek_android

3,844 Views
lswdneil
Contributor I

Hello Bro

we used android_o8.1.0_2.0.0-beta which is release from website, and want to use USB2.0 (otg_1) throuth UUU tools to down the image to the emmc, we follow the documentation named is "Android™ User's Guide, Rev. O8.1.0_2.0.0-beta, 01/2019 " mentioned with "8.4 How to enable USB 2.0 in U-Boot for i.MX 8QuadMax/ 8QuadXPlus ", i change the config as below:

===========================================================================================

diff --git a/configs/imx8qxp_mek_android_defconfig b/configs/imx8qxp_mek_android_defconfig
index e88c05a..ddf577b 100644
--- a/configs/imx8qxp_mek_android_defconfig
+++ b/configs/imx8qxp_mek_android_defconfig
@@ -20,8 +20,8 @@ CONFIG_CMD_I2C=y
 CONFIG_I2C_MUX=y
 CONFIG_I2C_MUX_PCA954x=y
-CONFIG_USB_XHCI_HCD=y
-CONFIG_USB_XHCI_IMX8=y
+# CONFIG_USB_XHCI_HCD is not set
+# CONFIG_USB_XHCI_IMX8 is not set
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
@@ -33,14 +33,14 @@ CONFIG_USB_TCPC=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_USB_GADGET=y
-# CONFIG_CI_UDC=y
+CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x18d1
 CONFIG_USB_GADGET_PRODUCT_NUM=0x0d02
-CONFIG_USB_CDNS3=y
-CONFIG_USB_CDNS3_GADGET=y
+# CONFIG_USB_CDNS3 is not set
+# CONFIG_USB_CDNS3_GADGET is not set
 CONFIG_USB_GADGET_DUALSPEED=y
 CONFIG_CMD_GPIO=y
===============================================================================================
and also include named is "uuu" config
===============================================================================================
diff --git a/configs/imx8qxp_mek_android_uuu_defconfig b/configs/imx8qxp_mek_android_uuu_defconfig
index 05089b0..e6b1310 100644
--- a/configs/imx8qxp_mek_android_uuu_defconfig
+++ b/configs/imx8qxp_mek_android_uuu_defconfig
@@ -20,8 +20,8 @@ CONFIG_CMD_I2C=y
 CONFIG_I2C_MUX=y
 CONFIG_I2C_MUX_PCA954x=y
-CONFIG_USB_XHCI_HCD=y
-CONFIG_USB_XHCI_IMX8=y
+# CONFIG_USB_XHCI_HCD is not set
+# CONFIG_USB_XHCI_IMX8 is not set
 CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
@@ -33,14 +33,14 @@ CONFIG_USB_TCPC=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_USB_GADGET=y
-# CONFIG_CI_UDC=y
+CONFIG_CI_UDC=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x18d1
 CONFIG_USB_GADGET_PRODUCT_NUM=0x0d02
-CONFIG_USB_CDNS3=y
-CONFIG_USB_CDNS3_GADGET=y
+# CONFIG_USB_CDNS3 is not set
+# CONFIG_USB_CDNS3_GADGET is not set
 CONFIG_USB_GADGET_DUALSPEED=y
 CONFIG_CMD_GPIO=y
================================================================================================
and also changed 
================================================================================================
diff --git a/include/configs/imx8qm_mek_android.h b/include/configs/imx8qm_mek_android.h
index bc8a5ec..5f5b00b 100644
--- a/include/configs/imx8qm_mek_android.h
+++ b/include/configs/imx8qm_mek_android.h
@@ -40,7 +40,7 @@
 #define CONFIG_FASTBOOT_FLASH
 #define CONFIG_FSL_FASTBOOT
-#define CONFIG_FASTBOOT_USB_DEV 1
+#define CONFIG_FASTBOOT_USB_DEV 0
 #define CONFIG_ANDROID_RECOVERY
 #if defined CONFIG_SYS_BOOT_SATA
==============================================================================================
after complie uboot , and use UUU toools to download, looks the PC still can not found the USB 2.0 and the uuu-boot boot log is :
==============================================================================================
U-Boot 2018.03-dirty (Mar 13 2019 - 03:59:46 +0800)
CPU:   Freescale i.MX8QXP revB A35 at 1200 MHz at 36C
Model: Freescale i.MX8QXP MEK
Board: iMX8QXP MEK
Boot:  USB
DRAM:  3 GiB
setup_typec lookup gpio@1a_7 failed ret = 3
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... MMC: no card present
*** Warning - No block device, using default environment
Failed (-5)
TX PLL is not locked.
No panel detected: default to IT6263
Display: IT6263 (1280x720)
In:    serial
Out:   serial
Err:   serial
 BuildInfo:
  - SCFW 65afe5f6, SECO-FW 9d71fd5b, IMX-MKIMAGE 19b9d9b6, ATF d6451cc
  - U-Boot 2018.03-dirty
Detect USB boot. Will enter fastboot mode!
Net:   No ethernet found.
MMC: no card present
Block device mmc 1 not supported
bcb_rw_block, get_block_size return 0
read_bootctl, bcb_rw_block read failed
read command failed
Fastboot: Normal
Boot from USB for uuu
Hit any key to stop autoboot:  0
g_dnl_register: failed!, error: -19
=>
can you give us more advice and how can use uuu tools to down load the image through USB 2.0 otg_1 port?
thanks a lot
neil.wang
2019-3-13
Tags (2)
0 Kudos
2 Replies

2,410 Views
tiebing_guo
Contributor I

Hi Carlos

In our company, we are using Android P9.0.0.2.1_GA release.

Mr' Wang would missed the dts change which to enable the usbotg1.

--- a/arch/arm/dts/fsl-imx8qxp-mek-auto.dts
+++ b/arch/arm/dts/fsl-imx8qxp-mek-auto.dts
@@ -44,7 +44,7 @@
};

&usbotg1 {
- status = "disabled";
+ status = "okay";
};

=====

in our side, we tried as below:

after changed, 

   make bootloader -j8  

used fastboot to reflash the bootloader0 and bootload_a partitions with new bootloader images.

after that, when board rebooting, type enter in uart console, then input 

==> fastboot flash

g_dnl_register: failed!, error: -19

 

I think the error is from:

static int do_fastboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) {  int controller_index;  char *usb_controller;  int ret;   if (argc < 2)   return CMD_RET_USAGE;   usb_controller = argv[1];  controller_index = simple_strtoul(usb_controller, NULL, 0); #ifdef CONFIG_FASTBOOT_USB_DEV controller_index = CONFIG_FASTBOOT_USB_DEV; #endif ret = board_usb_init(controller_index, USB_INIT_DEVICE);  if (ret) {   pr_err("USB init failed: %d", ret);   return CMD_RET_FAILURE;  }  g_dnl_clear_detach();  ret = g_dnl_register("usb_dnl_fastboot");  if (ret)   return ret;

the CONFIG_FASTBOOT_USB_DEV is 0;

when goes into the board_usb_init() function, in imx8qxpmek case, the function would be defined in 

/vendor/nxp-opensource/uboot-imx/board/freescale/imx8qxp_mek/imx8qxp_mek.c

we can see there is no code for index == 0 case,

Looks like current NXP's release doesn't support USB2.0 download in fastboot.

Is there any patch to fix this?


					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
0 Kudos

2,410 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Wang,

You could take a look to steps from Android User Guide document from P9.0.0_1.0.0_GA release, in case of have missed something considering the beta status of the previous version.

Additionally, you need to ensure that U-Boot is really recompiled considering the applied changes, as it usually discard the compilation of already-compiled modules.

For more details about this, please take a look to the following thread:

YOCTO project clean 


Hope this will be useful for you.
Best regards!
/Carlos
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

-------------------------------------------------------------------------------

0 Kudos