All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] How to enable USB Mass Storage
@ 2017-10-22 14:37 Frank Kunz
  2017-10-26 11:49 ` Lukasz Majewski
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Kunz @ 2017-10-22 14:37 UTC (permalink / raw)
  To: u-boot

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 uninitialized         
g_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 defconfig 
CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
CONFIG_MACH_SUN7I=y
CONFIG_DRAM_CLK=384
CONFIG_MMC0_CD_PIN="PH1"
CONFIG_I2C1_ENABLE=y
CONFIG_SATAPWR="PC3"
CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime"
CONFIG_AHCI=y
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
CONFIG_SPL=y
CONFIG_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=y
CONFIG_SUN7I_GMAC=y
CONFIG_AXP_ALDO3_VOLT=2800
CONFIG_AXP_ALDO4_VOLT=2800
CONFIG_SCSI=y
CONFIG_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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] How to enable USB Mass Storage
  2017-10-22 14:37 [U-Boot] How to enable USB Mass Storage Frank Kunz
@ 2017-10-26 11:49 ` Lukasz Majewski
  0 siblings, 0 replies; 3+ messages in thread
From: Lukasz Majewski @ 2017-10-26 11:49 UTC (permalink / raw)
  To: u-boot

Hi Frank,

> 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...

> => ums 0 mmc 0                   
> UMS: LUN 0, dev 0, hwpart 0, sector 0x0, count 0x1dc000            
> Controller uninitialized         
> g_dnl_register: failed!, error: -6                                 
> g_dnl_register failed

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.

> 
> 
> 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 defconfig 
> CONFIG_ARM=y
> CONFIG_ARCH_SUNXI=y
> CONFIG_MACH_SUN7I=y
> CONFIG_DRAM_CLK=384
> CONFIG_MMC0_CD_PIN="PH1"
> CONFIG_I2C1_ENABLE=y
> CONFIG_SATAPWR="PC3"
> CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime"
> CONFIG_AHCI=y
> # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
> CONFIG_SPL=y
> CONFIG_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=y
> CONFIG_SUN7I_GMAC=y
> CONFIG_AXP_ALDO3_VOLT=2800
> CONFIG_AXP_ALDO4_VOLT=2800
> CONFIG_SCSI=y
> CONFIG_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
> _______________________________________________
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] How to enable USB Mass Storage
@ 2020-05-22 12:16 Diego Rondini
  0 siblings, 0 replies; 3+ messages in thread
From: Diego Rondini @ 2020-05-22 12:16 UTC (permalink / raw)
  To: u-boot

Hi list,


> 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 uninitialized
> g_dnl_register: failed!, error: -6
> g_dnl_register failed
>

Sorry to jump in such an old thread, but as this is still an issue in
current master (~ 2020.07-rc2) I don't think it hurts.

This error is typically encountered with Allwinner SOCs when:
CONFIG_CMD_USB_MASS_STORAGE=y
but CONFIG_USB_ETHER is not set.

Enabling CONFIG_USB_ETHER=y workarounded the issue for me, as reported also
elsewhere:
http://patchwork.ozlabs.org/project/uboot/patch/CAEXMXLTm9bhX7aAub+MaZGBdw2cCsoO3nE6ep7dbm8mMryaQeg at mail.gmail.com/#1976362
http://linux-sunxi.org/U-Boot/USB_Mass_Storage#Prerequisites

Regards,
Diego Rondini

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-22 12:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-22 14:37 [U-Boot] How to enable USB Mass Storage Frank Kunz
2017-10-26 11:49 ` Lukasz Majewski
2020-05-22 12:16 Diego Rondini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.