How to enable USB Mass Storage
Hello,
I want to use the ums command to access the SD card of a A20-OlinuxIno-Lime board via usb-org cable. For that I start the CPU in FEL mode, download the u-boot-sunxi-with-spl.bin file by sunxi-fel tool. I do this FEL mode boot for preparation of an Einstein A20 board, which has only an internal MMC. I run on uboot serial console:
=> ums 0 mmc 0
UMS: LUN 0, dev 0, hwpart 0, sector 0x0, count 0x1dc000 Controller uninitializedg_dnl_register: failed!, error: -6 g_dnl_register failed
It seems that the drivers/usb/musb-new/sunxi.c is not initialized. The devicetree has a node that should match:
usb at 01c13000 {
compatible = "allwinner,sun4i-a10-musb";
reg = <0x1c13000 0x400>;
clocks = <0x2 0x0>;
interrupts = <0x0 0x26 0x4>;
interrupt-names = "mc";
phys = <0x2b 0x0>;
phy-names = "usb";
extcon = <0x2b 0x0>;
allwinner,sram = <0x2c 0x1>;
status = "okay";
dr_mode = "otg";
};My config is:
cat defconfigCONFIG_ARM=yCONFIG_ARCH_SUNXI=yCONFIG_MACH_SUN7I=yCONFIG_DRAM_CLK=384CONFIG_MMC0_CD_PIN="PH1"CONFIG_I2C1_ENABLE=yCONFIG_SATAPWR="PC3" CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime" CONFIG_AHCI=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=yCONFIG_SPL_I2C_SUPPORT=y
# CONFIG_FASTBOOT is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set CONFIG_CMD_USB_MASS_STORAGE=y
# CONFIG_SPL_DOS_PARTITION is not set
# CONFIG_SPL_ISO_PARTITION is not set
# CONFIG_SPL_EFI_PARTITION is not set CONFIG_ETH_DESIGNWARE=yCONFIG_SUN7I_GMAC=y CONFIG_AXP_ALDO3_VOLT=2800 CONFIG_AXP_ALDO4_VOLT=2800CONFIG_SCSI=yCONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y CONFIG_USB_GADGET_DOWNLOAD=y
# CONFIG_USB_ETHER is not set
Is the ums working for Allwinner CPUs, or is there some further configuration needed that I have not figured out?
Br,
Frank
Hi Frank,
Quoted 8 lines
Hello,
I want to use the ums command to access the SD card of a A20-OlinuxIno-Lime board via usb-org cable. For that I start the CPU in FEL mode, download the u-boot-sunxi-with-spl.bin file by sunxi-fel tool. I do this FEL mode boot for preparation of an Einstein A20 board, which has only an internal MMC. I run on uboot serial console:
First of all - I do not have any experience with Allwiner...
Quoted 5 lines
=> ums 0 mmc 0
UMS: LUN 0, dev 0, hwpart 0, sector0x0, count0x1dc000Controller uninitializedg_dnl_register: failed!, error: -6g_dnl_registerfailed
Could you paste output of the console after defining #define DEBUG on top of drivers/usb/gadget/g_dnl.c ?
It seems like your musb UDC is not initialized in your board (CONFIG_USB_MUSB_GADGET=y).
Please check if you call it at your board file.
Quoted 56 lines
It seems that the
drivers/usb/musb-new/sunxi.cis not initialized. The devicetree has a node that should match:usb at 01c13000 { compatible = "allwinner,sun4i-a10-musb"; reg = <0x1c13000 0x400>; clocks = <0x2 0x0>; interrupts = <0x0 0x26 0x4>; interrupt-names = "mc"; phys = <0x2b 0x0>; phy-names = "usb"; extcon = <0x2b 0x0>; allwinner,sram = <0x2c 0x1>; status = "okay"; dr_mode = "otg"; };My config is:
cat defconfig
CONFIG_ARM=yCONFIG_ARCH_SUNXI=yCONFIG_MACH_SUN7I=yCONFIG_DRAM_CLK=384CONFIG_MMC0_CD_PIN="PH1"CONFIG_I2C1_ENABLE=yCONFIG_SATAPWR="PC3"CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime"CONFIG_AHCI=y
#CONFIG_SYS_MALLOC_CLEAR_ON_INITis not setCONFIG_SPL=yCONFIG_SPL_I2C_SUPPORT=y
#CONFIG_FASTBOOTis not set
#CONFIG_CMD_FLASHis not set
#CONFIG_CMD_FPGAis not setCONFIG_CMD_USB_MASS_STORAGE=y
#CONFIG_SPL_DOS_PARTITIONis not set
#CONFIG_SPL_ISO_PARTITIONis not set
#CONFIG_SPL_EFI_PARTITIONis not setCONFIG_ETH_DESIGNWARE=yCONFIG_SUN7I_GMAC=yCONFIG_AXP_ALDO3_VOLT=2800CONFIG_AXP_ALDO4_VOLT=2800CONFIG_SCSI=yCONFIG_USB_EHCI_HCD=yCONFIG_USB_MUSB_GADGET=yCONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=yCONFIG_USB_GADGET_DOWNLOAD=y
#CONFIG_USB_ETHERis not setIs the ums working for Allwinner CPUs, or is there some further configuration needed that I have not figured out?
Quoted 6 lines
Br,
Frank
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
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