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 414A6C77B61 for ; Thu, 13 Apr 2023 20:35:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0989885B34; Thu, 13 Apr 2023 22:35:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="fpbwFsbD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3797585BB5; Thu, 13 Apr 2023 22:34:59 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BEE2485A83 for ; Thu, 13 Apr 2023 22:34:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0771B638D6; Thu, 13 Apr 2023 20:34:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 235C5C433EF; Thu, 13 Apr 2023 20:34:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681418094; bh=flRjdEaZ6VD8+EC4g+a0M9filp73zbSv8jzpOXNXvro=; h=From:To:Cc:Subject:Date:From; b=fpbwFsbD+1iuYTQHT51lT4wmXom324eRwkyoETB/lwdG4rI1xHh+ECpiWYWGkzGpa xTtE+wyYXQvI1TBc5e367cgQNgW2ZWR3lF09K9FLTZk3paiEkPsLBbgtoGyccs6sgQ hPCaX17vFiDFdp6juO5AWezW56a08x81duC86GILmpPcNDPcim8MRLgk7XjLAvi+/j U22kUX83kh9dGf9koMxUsTqDVvsUgmh5l/KtfemAktFeYe8mF7Ty/ud2ZS/LUH5BT6 KTIbRf05q22q85/Dm5Sw0ZLEsRXFpZpqYPjLm3DFcJGQXS224qEkeG7rt1CrzcT3py mbevuYwHioJEQ== Received: by pali.im (Postfix) id 54A7C788; Thu, 13 Apr 2023 22:34:51 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: u-boot@lists.denx.de Cc: Adam Ford Subject: [PATCH u-boot] arm: omap3: Directly use SMC #1 in lowlevel_init.S Date: Thu, 13 Apr 2023 22:34:43 +0200 Message-Id: <20230413203443.8529-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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 Since commit de39dc71625d ("arm: armv7-a: Compile and tune for armv7-a instead of armv5") is used -march=armv7-a option for Omap3 platforms. With directive ".arch_extension sec" it is possible for -march=armv7-a to directly use ARM SMC instruction. So enable ".arch_extension sec" in Omap3 lowlevel_init.S and replace hand assembled ".word 0xe1600071" by "SMC #1". Since commit 51d063865064 ("arm: omap-common: add secure smc entry") same pattern is already used in arch/arm/cpu/armv7/omap-common/lowlevel_init.S. Signed-off-by: Pali Rohár --- arch/arm/mach-omap2/omap3/lowlevel_init.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/omap3/lowlevel_init.S b/arch/arm/mach-omap2/omap3/lowlevel_init.S index ab7cdcf3d42e..1ab9472e1987 100644 --- a/arch/arm/mach-omap2/omap3/lowlevel_init.S +++ b/arch/arm/mach-omap2/omap3/lowlevel_init.S @@ -15,13 +15,14 @@ #include #include +.arch_extension sec + /* * Funtion for making PPA HAL API calls in secure devices * Input: * R0 - Service ID * R1 - paramer list */ -/* TODO: Re-evaluate the comment at the end regarding armv5 vs armv7 */ ENTRY(do_omap3_emu_romcode_call) PUSH {r4-r12, lr} @ Save all registers from ROM code! MOV r12, r0 @ Copy the Secure Service ID in R12 @@ -32,8 +33,7 @@ ENTRY(do_omap3_emu_romcode_call) MOV r6, #0xFF @ Indicate new Task call mcr p15, 0, r0, c7, c10, 4 @ DSB mcr p15, 0, r0, c7, c10, 5 @ DMB - .word 0xe1600071 @ SMC #1 to call PPA service - hand assembled - @ because we use -march=armv5 + SMC #1 @ Call PPA service POP {r4-r12, pc} ENDPROC(do_omap3_emu_romcode_call) -- 2.20.1