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 73FE7CCA47F for ; Mon, 4 Jul 2022 09:42:34 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E8F9C82102; Mon, 4 Jul 2022 11:42:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.b="yVAuC8E5"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Pl9RA3Hu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 531A8839CC; Mon, 4 Jul 2022 11:42:30 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (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 E2A7E80A3F for ; Mon, 4 Jul 2022 11:42:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=msuchanek@suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 9499E22C54; Mon, 4 Jul 2022 09:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1656927747; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VKgHnNstSKHmGfUTDGN66fBaNLoim9tQQV49D9V/EJU=; b=yVAuC8E5P7UxLL0sxI3AMPetwQSsE8Cuw43PfINq/nxqhvNoZLoP4JLlCdNE6lBdyisqRs dkIsu4AFtOyI6GfG1dg2T+zvsTWih5+9DnVT3LqHh487QeB5kFVYKsf1kQaJ+fUwdf0wxJ B7XZU3eA861u76F/dshBpkqqIPmHrao= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1656927747; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VKgHnNstSKHmGfUTDGN66fBaNLoim9tQQV49D9V/EJU=; b=Pl9RA3HueJZcbPwpzSsJDzkXg3S7KbApJ1t6B/ZaEZFOrg/ZE7OvccRh/ZacHBCaNzet62 sH6QGPj4DFZWCMBQ== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 60C572C146; Mon, 4 Jul 2022 09:42:27 +0000 (UTC) Date: Mon, 4 Jul 2022 11:42:26 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Andre Przywara Cc: Samuel Holland , 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: <20220704094226.GI17705@kitsune.suse.cz> References: <20220703232251.12d4d251@slackpad.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220703232251.12d4d251@slackpad.lan> User-Agent: Mutt/1.10.1 (2018-07-13) 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, Jul 03, 2022 at 11:22:51PM +0100, Andre Przywara wrote: > 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? The reset implementation also does not share any actual code between platforms, has different implementation on each platform, and is cross-platform command that provides the same functionality on each paltform. Because the functionality can be provided on multiple platfroms the goal is to provide cross-platform user interface for it. Thanks Michal