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 9A02DC433F5 for ; Mon, 28 Feb 2022 15:23:01 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A528D83C27; Mon, 28 Feb 2022 16:22:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1646061779; bh=mjnPNX1sUB5lJbkJy0WeWSOOoxWqapWjgMNQz/vMg8I=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=srVu5Xmj+qImKx/AL5QTnasrzK7eATttrCTq2PnRkMz5rb27lNupXzcC367Vk/wAn 0kEjJF92qLDZWeJLAAGxg1Th9RPiMO0sTS8QI6BklIedNiwyeammpSy+FEpjyNvW1w q5XHcJao0uBGa9D1K8rs6tMPyNHndsyAN7lEC7tFmxxJDUasehGKpzl/IbiW+EBbMP 20+9abvmrJOdxIaOBHNkuYDoUVpTH9DZZZO3ZMep7uEh5LJ0OISDcdT4tzsBUh5L8T qTlngGe0jYRIv5JZuD0CdIHimaitZOybz/4lWrcUgJVgo7jakLIvM3k0hF9L2JKCfV 5OtyTNSV4JzMg== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 8164583C6D; Mon, 28 Feb 2022 16:22:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1646061776; bh=mjnPNX1sUB5lJbkJy0WeWSOOoxWqapWjgMNQz/vMg8I=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=fNK+/yu7/vi8iDkMPnSsQTYEUqmRD1DyPk+c7iyyrdnajrkvbZDFxjgr+8SX/MaNU E9Ow55soEN99a9YjqpO2xJKJaAwTHLA79++rAAFxl/o0p9KYS40NyOe2ozyflv68OW OetIByhNhJ2Ymb5W3MKPJs88k/u+yzm1n+48VjfqtYaRiM649hJZnmEGSSDl/5sgCq xk28sfH7F34mG6DMCKM5g5YZWRBM+c7siZaHvLvZzmpPPR+5rhrXbJT/oZjvrronyM bCBX/I8lhM0wcqV4WtdoL4Qnh85ytjJH1whcJ9ZuT38DFaS//30avblzVBDbt5gtcu xhfakye4JIXqw== Message-ID: Date: Mon, 28 Feb 2022 16:22:55 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: ARM: socfpga: gen5: release reset before using USB as device with ums Content-Language: en-US To: Wolfgang Grandegger , U-Boot Mailing List Cc: Simon Goldschmidt , Tien Fong Chee References: <6c39a79f-16b8-957c-88a8-2fac90f737b3@denx.de> <49b106bd-e3f0-0251-7fb3-3804b41a4532@aries-embedded.de> From: Marek Vasut In-Reply-To: <49b106bd-e3f0-0251-7fb3-3804b41a4532@aries-embedded.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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.5 at phobos.denx.de X-Virus-Status: Clean On 2/28/22 16:18, Wolfgang Grandegger wrote: Hi, [...] >>> diff --git a/arch/arm/mach-socfpga/board.c >>> b/arch/arm/mach-socfpga/board.c >>> index 7267163222..a2eed73fe9 100644 >>> --- a/arch/arm/mach-socfpga/board.c >>> +++ b/arch/arm/mach-socfpga/board.c >>> @@ -83,6 +83,14 @@ int board_usb_init(int index, enum usb_init_type init) >>>       /* Patch the address from OF into the controller pdata. */ >>>       socfpga_otg_data.regs_otg = addr; >>>   +#ifdef CONFIG_TARGET_SOCFPGA_GEN5 >>> +    /* First release reset of the USB port */ >>> +    if (addr == SOCFPGA_USB0_ADDRESS) >>> +        socfpga_per_reset(SOCFPGA_RESET(USB0), 0); >>> +    else if (addr == SOCFPGA_USB1_ADDRESS) >>> +        socfpga_per_reset(SOCFPGA_RESET(USB1), 0); >>> +#endif >> >> Is this really needed at all ? > > Yes, it's needed, otherwise "ums 0 mmc 0" does not work. It was working > some time ago but commit 430b42f76a4e50ffef7cc2b3c195ff645a438433 did > remove the ad-hoc reset code. I realize the issue an on Aries MCVEVP > board, but I'm quite sure that it's present on all Cyclone5 boards. Can you investigate why the reset-socfpga.c does not release the USB from reset instead ? That would be the right approach.