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 2B281EB64D9 for ; Sun, 2 Jul 2023 11:52:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9799A8613D; Sun, 2 Jul 2023 13:52:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se 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=kwiboo.se header.i=@kwiboo.se header.b="rNc4J/rH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6920F861E4; Sun, 2 Jul 2023 13:52:41 +0200 (CEST) Received: from s.wrqvtzvf.outbound-mail.sendgrid.net (s.wrqvtzvf.outbound-mail.sendgrid.net [149.72.126.143]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EB6D8860A9 for ; Sun, 2 Jul 2023 13:52:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=mime-version:subject:references:from:in-reply-to:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=+HAsxZZegF7q3pJSMJ8j5kFz+VNk7MaqycFxQRU2tzI=; b=rNc4J/rHWMrN/R8+NT2E/RA5dFQKXLTBMEEbrs89B5m7iqZEea9xq+VWbBjHhNmqhcqT acJOMIqiVERba6/1UM4jvQa5IWuhwmPFoGrziWK0OqF6RdCtXP2rjz2zeCTRZPR3d7FDNX IUHFLltso1lUHVCeuoQFcBSrFuJsKX/un1DFK1H7nGsTwvPlXI/VvmpGhP+WuCKN8nsfSb YduxuYwuoKdjewf2YgWUys4m1/ZV0yCeIm0KcExXezwVUMd+Md/DZmGk4mAttl+VgJ0uhJ 1XRrfDqSOTC4VZafIKY4nIMPzVXH4IuiJx188T2yhlHzTThG/MFxwUBwyO/mCDbg== Received: by filterdrecv-66949dbc98-gwbzx with SMTP id filterdrecv-66949dbc98-gwbzx-1-64A16504-B 2023-07-02 11:52:36.481867374 +0000 UTC m=+4536768.264684347 Received: from [192.168.1.50] (unknown) by geopod-ismtpd-8 (SG) with ESMTP id 2JyzK1QTRsW_umtgRSTucQ Sun, 02 Jul 2023 11:52:35.895 +0000 (UTC) Message-ID: Date: Sun, 02 Jul 2023 11:52:36 +0000 (UTC) MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [RFC] rockchip: spl: Enable caches to speed up checksum validation References: <20230702110055.3686457-1-jonas@kwiboo.se> Content-Language: en-US From: Jonas Karlman In-Reply-To: X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h83KhQifmZ6DBGDPI?= =?us-ascii?Q?sqtaJxNK6nj67uvTOKSWqUaS4Dw4NfeAGhZ83sJ?= =?us-ascii?Q?3Usf697SgCtsI8J4Twl5quI0gIaCGuwdbxV0a6o?= =?us-ascii?Q?AAOfccI70LpVBiR5xo9+LA2MNzEsLHHOy75qQzM?= =?us-ascii?Q?6yWRChFRGcis6c1jov8vIseGhUQ69O+mJHxavF?= To: Jagan Teki Cc: Kever Yang , Simon Glass , Philipp Tomsich , u-boot@lists.denx.de X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Type: text/plain; charset=utf-8 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.8 at phobos.denx.de X-Virus-Status: Clean On 2023-07-02 13:07, Jagan Teki wrote: > On Sun, Jul 2, 2023 at 4:31 PM Jonas Karlman wrote: >> >> FIT checksum validation is very slow in SPL due to D-cache not being >> enabled. >> >> Enable caches in SPL to speed up FIT checksum validation, from seconds >> to milliseconds. >> >> Signed-off-by: Jonas Karlman >> --- >> I am not sure if it is even a good idea to enable caches in SPL, if this >> is the best way to enable caches and maybe this should be behind a >> Kconfig option? > > It would. I would suggest giving board options instead of marking them for SoC. There is already SPL_SYS_ICACHE_OFF and SPL_SYS_DCACHE_OFF that can be used by board/SoC to disable I/D-cache in SPL/U-Boot proper, those are however opt-out instead of opt-in Kconfig options. And they protect the lower level functions called from enable_caches(). Maybe an opt-in wrapper Kconfig could still be needed? One that has e.g. "default y if SPL_FIT_SIGNATURE". Vendor u-boot also enable caches early in SPL instead of just in U-Boot proper. There caches are enabled slightly different and even earlier. > > Be careful to proceed with this to make it default, as it affects > other drivers as well. Any particular driver in mind that is in use by SPL that could be affected? Based on limited testing at least SD/eMMC/SPI flash and pinctrl seemed to work okay on RK3328, RK3399 and RK356x. FIT checksum validated and boards could load and run TF-A and U-Boot proper. Regards, Jonas > > Jagan.