From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8327FC7EE23 for ; Sun, 21 May 2023 07:09:57 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 16483846A6; Sun, 21 May 2023 09:09:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="R1pwouX1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8D6DF846A5; Sun, 21 May 2023 09:09:53 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2C9B8846A6 for ; Sun, 21 May 2023 09:09:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eugen.hristev@collabora.com Received: from [192.168.18.121] (unknown [46.8.172.200]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madras.collabora.co.uk (Postfix) with ESMTPSA id 51F3B66056D2; Sun, 21 May 2023 08:09:49 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1684652989; bh=k8JvK+UMnXIRjh991y4UXgqM42zeZe+XQ5aRuvV2TQk=; h=Date:Subject:To:References:Cc:From:In-Reply-To:From; b=R1pwouX1UZbHZMqq9zZgbTsKQigVKsoUvGokUdac38DulLH1ttBHqPVzm9yQUcQlx skrztIfQK3+f1qvWNbJjCZkOs8m+aO80O3LX06/DHjDHFYTJEQ0/Fno1HGNy+Vw6kE XeBvX4VVzXjeZp2YDQcFGjAVcUUud3wGTjRCL8ad9Rq7fIXL2Cng0HqQBvdIgDy5k0 8lS/HYrYs2o4rgdydSHVGGpVGXA1qt/euMbf2b2fDZH/M3bHycWkE5Rx3xutVJUGIo f/Nvv7TPyvu7ygk2LbFlkZQyO/sV3SlZ3Aepr7zzLaF/VBxZXOCZxvNPYGhQRGw78K 019HawasuWJkw== Message-ID: <205b348b-e7fd-3b8f-e921-027add8fb9ba@collabora.com> Date: Sun, 21 May 2023 10:09:46 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: USB mass storage gadget on SAMA5D2 Content-Language: en-US To: admin LI , Lukasz Majewski , Marek Vasut , u-boot@lists.denx.de References: Cc: mihai Sain , cristian.birsan@microchip.com From: Eugen Hristev In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Hi, I believe someone from Microchip have tried this before Some people in CC added You can also open a case on support.microchip.com Eugen On 5/19/23 23:18, admin LI wrote: > Hi, > > I'm trying to use ums to access EMMC on our SAMA5D2 board without success. > > My board_init(), without adding usba_udc_probe() ums will cause data abort > error: > int board_init(void) > { > /* address of boot parameters */ > gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; > > #ifdef CONFIG_USB_GADGET_ATMEL_USBA > at91_udp_hw_init(); > usba_udc_probe(&pdata); > #endif > > return 0; > } > > USB related config: > CONFIG_USB=y > CONFIG_USB_EHCI_HCD=y > CONFIG_USB_STORAGE=y > CONFIG_USB_GADGET=y > CONFIG_USB_GADGET_VENDOR_NUM=0xdead > CONFIG_USB_GADGET_PRODUCT_NUM=0xbeef > CONFIG_USB_GADGET_ATMEL_USBA=y > CONFIG_USB_GADGET_VBUS_DRAW=500 > CONFIG_USB_GADGET_DOWNLOAD=y > CONFIG_USB_ETHER=y > > EMMC can be successfully accessed, Linux boot is ok: > => mmc list > sdio-host@a0000000: 0 (eMMC) > > => mmc info > Device: sdio-host@a0000000 > Manufacturer ID: 70 > OEM: 100 > Name: M6270 > Bus Speed: 52000000 > Mode: MMC High Speed (52MHz) > Rd Block Len: 512 > MMC version 5.1 > High Capacity: Yes > Capacity: 3.6 GiB > Bus Width: 4-bit > Erase Group Size: 512 KiB > HC WP Group Size: 4 MiB > User Capacity: 3.6 GiB > Boot Capacity: 2 MiB ENH > RPMB Capacity: 512 KiB ENH > Boot area 0 is not write protected > Boot area 1 is not write protected > > => mmc part > > Partition Map for MMC device 0 -- Partition Type: DOS > > Part Start Sector Num Sectors UUID Type > 1 2048 1044480 0508e2bf-01 83 > > However, when I use "ums 0 mmc 0", the USB device is partially enumerated > without a block device available, in the console the rotation cursor spins > about 20s then USB is disconnected. > > On u-boot: > => ums 0 mmc 0 > UMS: LUN 0, dev mmc 0, hwpart 0, sector 0x0, count 0x720000 > -=> (self-exit after 20s) > > On Linux: > [ 699.920316] usb 3-5: new high-speed USB device number 5 using xhci_hcd > [ 700.060766] usb 3-5: New USB device found, idVendor=dead, > idProduct=beef, bcdDevice= 2.17 > [ 700.060772] usb 3-5: New USB device strings: Mfr=1, Product=2, > SerialNumber=0 > [ 700.060774] usb 3-5: Product: USB download gadget > [ 700.060776] usb 3-5: Manufacturer: U-Boot > [ 700.081573] usb-storage 3-5:1.0: USB Mass Storage device detected > [ 700.081780] scsi host0: usb-storage 3-5:1.0 > [ 700.081874] usbcore: registered new interface driver usb-storage > [ 700.088339] usbcore: registered new interface driver uas > [ 722.407008] usb 3-5: USB disconnect, device number 5 > > > Thanks,