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 804B4C433EF for ; Sun, 3 Jul 2022 22:23:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EE71783F2F; Mon, 4 Jul 2022 00:23:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id AF8F3844D4; Mon, 4 Jul 2022 00:23:54 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 6955183C28 for ; Mon, 4 Jul 2022 00:23:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8A89123A; Sun, 3 Jul 2022 15:23:51 -0700 (PDT) Received: from slackpad.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 36FD23F70D; Sun, 3 Jul 2022 15:23:49 -0700 (PDT) Date: Sun, 3 Jul 2022 23:22:51 +0100 From: Andre Przywara To: Michal Suchanek , Samuel Holland Cc: u-boot@lists.denx.de, Simon Glass , Philipp Tomsich , Kever Yang , Jagan Teki , Andy Yan , Michal Simek , Igor Opaniuk Subject: Re: [PATCH 0/2] Command for entering mask rom USB download mode Message-ID: <20220703232251.12d4d251@slackpad.lan> In-Reply-To: References: Organization: Arm Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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.6 at phobos.denx.de X-Virus-Status: Clean On Sun, 3 Jul 2022 21:20:20 +0200 Michal Suchanek wrote: Hi, > many ARM SoCs have a mask rom feature that provides interface for > downloading firmware over USB. > > Downstream rockchip u-boot has 'brom' or 'rbrom' command for this > purpose, and downstream sunxi u-boot provides 'efex' command. p-boot has > code for entering FEL on A64 SoC. Thanks for bringing this up. We have discussed several options before, including some true FEL reset commands, which do not depend on the SPL doing the branch. But I guess we can just start with this one and expand it from there. > With this patch I am able to activate the USB downloader on a rk3399 but > the rkflashtool fails to communicate with the device. On a H2+ I can get > into the FEL mode and get flash parameters. YMMV > > I don't have any great idea how to structure this so that the command > does not need platform-specific code. Is there an example of a command > that has platform-specific implementations? I don't think that's a problem: there are already platform specific commands, you just put them in a separate file and mark them as "depends on ARCH_SUNXI" (or whatever) in cmd/Kconfig and be done. No need to boil the ocean here in trying to be generic. That's why I wouldn't put them in cmd/boot.c, especially since you don't seem to share any code? For more details see the reply to the actual (sunxi) patch. Cheers, Andre > > Thanks > > Michal > > Andy Yan (1): > cmd: boot: add brom cmd to reboot to brom dnl mode > > Michal Suchanek (1): > cmd: boot: add brom cmd to reboot to FEL mode > > .../arm/include/asm/arch-rockchip/boot_mode.h | 1 + > arch/arm/include/asm/arch-sunxi/cpu.h | 11 ++++++ > arch/arm/mach-sunxi/Kconfig | 18 ++++++++++ > arch/arm/mach-sunxi/board.c | 24 +++++++++++++ > cmd/boot.c | 35 +++++++++++++++++++ > 5 files changed, 89 insertions(+) >