UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
692 Views
Registered: ‎12-26-2016

U-Boot USB Host failed to recognize FAT drive (zynq 7020)

Hi there,

I've got some problems with mounting a FAT flash drive to my Zynq from the U-Boot environment. My toolchain is the 2018.2 version of Vivado, PetaLinuxTools.

I'm working on a custom Zynq board (.hdf file below) with a USB3318C chip attached to MIO 41 .. 50 at the Zynq PS/USB1 interface. Reset of the USB3318 is HIGH and therefore _not_ in reset mode. U-Boot, FSBL and FPGA bitfile are located in a QSPI flash on the board, boot mode is set to QSPI.

When I power the board the U-Boot loads. If I plug a FAT formatted flash storage plugged into my connector I've got the following:

U-Boot 2018.01-00073-g21812b5fd3 (Jul 02 2019 - 13:40:09 +0200)

Board: Xilinx Zynq
Silicon: v3.1
I2C:   ready
DRAM:  ECC disabled 1 GiB
MMC:   
SF: Detected n25q128 with page size 256 Bytes, erase size 64 KiB, total 16 MiB
In:    serial@e0000000
Out:   serial@e0000000
Err:   serial@e0000000
Board: Xilinx Zynq
Silicon: v3.1
Net:   ZYNQ GEM: e000b000, phyaddr ffffffff, interface rgmii-id
eth0: ethernet@e000b000ZYNQ GEM: e000c000, phyaddr ffffffff, interface rgmii-id
PHY is not detected
GEM PHY init failed

Hit any key to stop autoboot:  0 
** Bad device mmc 0 **
No MMC device available
Zynq> usb start
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
error in inquiry
2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Zynq> usb tree
USB device tree:
  1  Hub (480 Mb/s, 0mA)
  |  u-boot EHCI Host Controller 
  |
  +-2  Mass Storage (480 Mb/s, 500mA)
       TS-RDF5  Transcend 000000000037

Zynq> usb info
1: Hub,  USB Revision 2.0
 - u-boot EHCI Host Controller 
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

2: Mass Storage,  USB Revision 2.10
 - TS-RDF5  Transcend 000000000037
 - Class: (from Interface) Mass Storage
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x8564  Product 0x4000 Version 0.58
   Configuration: 1
   - Interfaces: 1 Bus Powered 500mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 2
     - Class Mass Storage, Transp. SCSI, Bulk only
     - Endpoint 1 In Bulk MaxPacket 512
     - Endpoint 2 Out Bulk MaxPacket 512
Zynq> usb storage
No storage devices, perhaps not 'usb start'ed..?
Zynq> dm tree Class Probed Driver Name ---------------------------------------- root [ + ] root_drive root_driver rsa_mod_ex [ ] mod_exp_sw |-- mod_exp_sw simple_bus [ + ] generic_si `-- amba gpio [ ] gpio_zynq |-- gpio@e000a000 serial [ + ] serial_zyn |-- serial@e0000000 spi [ + ] zynq_qspi |-- spi@e000d000 spi_flash [ ] spi_flash_ | `-- spi_flash@0:0 eth [ + ] zynq_gem |-- ethernet@e000b000 eth [ ] zynq_gem |-- ethernet@e000c000 simple_bus [ + ] generic_si |-- slcr@f8000000 clk [ + ] zynq_clk | `-- clkc@100 usb [ + ] ehci_zynq `-- usb@e0003000 usb_hub [ + ] usb_hub `-- usb_hub usb_mass_s [ + ] usb_mass_s `-- usb_mass_storage

Somehow the mass_storage driver is loaded correctly. But I can not mount any storage devices because the usb subsystem tells me, there are none.

I've attached my hdf file and the meta-user/recipes-bsp/u-boot files. The petalinux-build command runs w/o errors. The solution suggested in AR69378 didn't help me here.

How can I modify the PetaLinux Xlnx U-Boot to allow me mounting flash-devices?

If any other files are needed just let me know, I can see what is possible ;)

 

Cheers
Thomas

Tags (4)
0 Kudos
6 Replies
Moderator
Moderator
665 Views
Registered: ‎02-07-2018

Re: U-Boot USB Host failed to recognize FAT drive (zynq 7020)

HI @tmaintz 

Can you please share the device tree once. hope you connected the USB flash drive while issuing the usb start command from u-boot. 

 

Thanks & regards

Aravind

0 Kudos
Adventurer
Adventurer
660 Views
Registered: ‎12-26-2016

Re: U-Boot USB Host failed to recognize FAT drive (zynq 7020)

I've attached my devicetree from the PetaLinux/image/linux directory after compiling the OS.

Hope that helps ;)

0 Kudos
Adventurer
Adventurer
603 Views
Registered: ‎12-26-2016

Re: U-Boot USB Host failed to recognize FAT drive (zynq 7020)

@aravindb do you see some faults in the provided files?
0 Kudos
Moderator
Moderator
585 Views
Registered: ‎02-07-2018

Re: U-Boot USB Host failed to recognize FAT drive (zynq 7020)

Hi @tmaintz 

 

Could you please add this usb node in system-user.dtsi & check .

&usb1 {
dr_mode = "host";

status="okay";
usb-phy = <&usb_phy>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usb0_default>;   -- --Make sure to check this pinctrl seetings are there are not in your dtsi file , you can get this in this

path:components/plnx_workspace/device-tree/device-tree/*
};

For your refernce i am adding the zc706 dtsi file, in zynq by default usb0 enabled, not usb1.

 

Thanks & regards

Araivnd

0 Kudos
Adventurer
Adventurer
577 Views
Registered: ‎12-26-2016

Re: U-Boot USB Host failed to recognize FAT drive (zynq 7020)

I'd extended the device tree in the meantime and it looks pretty similar to yours (reference is the Xilinx wiki). This is the USB part of my device tree (I now moved to USB0, my board MIO layout changed too...):

&usb0 {
	status = "okay";
	dr_mode = "host";
	usb-phy = <&usb_phy0>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_usb0_default>;
};

/ {
	usb_phy0: phy0@e0002000 {
		compatible = "ulpi-phy";
		#phy-cells = <0>;
		reg = <0xe0002000 0x1000>;
		view-port = <0x0170>;
		drv-vbus;
	};
	
	pinctrl_usb0_default: usb0-default {
		mux {
			groups = "usb0_0_grp";
			function = "usb0";
		};
		conf {
			groups = "usb0_0_grp";
			slew-rate = <0>;
			io-standard = <1>;
		};
	
		conf-rx {
			pins = "MIO29", "MIO31", "MIO36";
			bias-high-impedance;
		};
	
		conf-tx {
			pins = "MIO28", "MIO30", "MIO32", "MIO33", "MIO34", "MIO35", "MIO37", "MIO38", "MIO39";
			bias-disable;
		};
	};
};

Sadly there is no success on recognizing the FAT drive. The U-Boot gives me the same errors as in the opening post.

I have troubles to understand your comment on the pinctrl-0 part. Do I need to put the pinctrl_usb0_default into the dtsi file or not?

The plnx_workspace directory is created when I start the petalinux-config/build commands.

After all: does the device-tree affect the U-Boot compilation? If yes: how?

Cheers
Thomas

0 Kudos
Adventurer
Adventurer
567 Views
Registered: ‎12-26-2016

Re: U-Boot USB Host failed to recognize FAT drive (zynq 7020)

Furthermore: if I don't plug a FAT drive into the USB port the error in inquiry is not present.

For fun I plugged a keyboard into the USB port

Zynq> usb start
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Zynq> usb tree
USB device tree:
  1  Hub (480 Mb/s, 0mA)
  |  u-boot EHCI Host Controller 
  |
  +-2  Human Interface (1.5 Mb/s, 100mA)
       LiteOn Lenovo Calliope USB Keyboard 

That seems to be fine. The FAT drives are still having the above issue. These usb sticks have been formatted on various PCs (Linux, Windows, MacOSX) as FAT.

0 Kudos