From patchwork Fri Apr 14 02:10:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 97419 Delivered-To: patch@linaro.org Received: by 10.140.109.52 with SMTP id k49csp101233qgf; Thu, 13 Apr 2017 19:12:57 -0700 (PDT) X-Received: by 10.223.139.91 with SMTP id v27mr522160wra.9.1492135977255; Thu, 13 Apr 2017 19:12:57 -0700 (PDT) Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id g142si15736808wmd.60.2017.04.13.19.12.56; Thu, 13 Apr 2017 19:12:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id A6FD9C21CC6; Fri, 14 Apr 2017 02:12:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id CB362C21CC5; Fri, 14 Apr 2017 02:11:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id F38A1C21CC8; Fri, 14 Apr 2017 02:11:15 +0000 (UTC) Received: from conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by lists.denx.de (Postfix) with ESMTPS id 11A1EC21CC9 for ; Fri, 14 Apr 2017 02:11:09 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id v3E2ARiX004239; Fri, 14 Apr 2017 11:10:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v3E2ARiX004239 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1492135827; bh=qyU7nqHH3SrT+RRMGjQt1nMez/5ub/TwSVTVNzf5XCI=; h=From:To:Cc:Subject:Date:From; b=XRdZzLDcGhEWrRNml15E4K4JPGmW0d1Fqk1g9jyqr8cgGDZskIsTm/4iadb6k6Ju9 8TBgSYui71Iv9OT5/uMw4ifgKNdl0lm5tDE0FLfiM6jTTZMKxv4okOF6Xv0EOTjsQ2 56HfsyVpdaqCFcReqZOwQmDJeXD9RmU6iIxhLbB296faYxQH4HRNc2l4TNXCnbJTGs iGffho93RIMaQg0OH1NBbtdFhcOK4qx03Zu7jal7iBGVM/COP7RsvGfLgCqgyXf/Gq N+F3c1AQlLyfrkvBMJL/6Zu9QBq4ZGGZMF/HugOrAr4iCPfrxzYFxFQlAOrIJ6efbU B0fQaLtGJ2Esg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Fri, 14 Apr 2017 11:10:21 +0900 Message-Id: <1492135824-15674-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Cc: Tom Rini Subject: [U-Boot] [PATCH v3 0/3] ARM: support System Reset via PSCI X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" For ARMv8, the secure firmware (ex. ARM Trusted Firmware BL31) is often implemented, making U-Boot a non-secure world boot loader. The secure firmware generally includes PSCI. The power management operations, including System Reset, are supposed to be handled by PSCI. In this case, U-Boot should not touch the system reset directly. Instead, U-Boot should call PSCI service to reset the system. In order to implement this, arm-smccc code is needed. The code has been copied from Linux. (1/3) They have been adjusted for use in U-Boot (2/3). 3/3 implements a generic sysreset driver based on the PSCI specification. Changes in v3: - opcodes-virt.h is GPL-2.0+ Changes in v2: - split into separate patches "import" and "adjust" - split into separate patches "import" and "adjust" Masahiro Yamada (3): ARM: import arm-smccc code from Linux 4.11-rc6 ARM: adjust arm-smccc code for use in U-Boot sysreset: psci: support system reset in a generic way with PSCI arch/arm/Kconfig | 9 ++ arch/arm/cpu/armv7/Makefile | 1 + arch/arm/cpu/armv7/smccc-call.S | 56 +++++++++ arch/arm/cpu/armv8/Makefile | 2 + arch/arm/cpu/armv8/smccc-call.S | 44 +++++++ arch/arm/include/asm/opcodes-sec.h | 17 +++ arch/arm/include/asm/opcodes-virt.h | 27 +++++ arch/arm/include/asm/opcodes.h | 229 ++++++++++++++++++++++++++++++++++++ arch/arm/lib/asm-offsets.c | 8 ++ drivers/Kconfig | 2 + drivers/Makefile | 5 +- drivers/firmware/Kconfig | 6 + drivers/firmware/Makefile | 2 + drivers/firmware/firmware-uclass.c | 11 ++ drivers/firmware/psci.c | 94 +++++++++++++++ drivers/sysreset/Kconfig | 10 ++ drivers/sysreset/Makefile | 1 + drivers/sysreset/sysreset_psci.c | 41 +++++++ include/dm/uclass-id.h | 1 + include/linux/arm-smccc.h | 126 ++++++++++++++++++++ include/linux/psci.h | 13 ++ 21 files changed, 703 insertions(+), 2 deletions(-) create mode 100644 arch/arm/cpu/armv7/smccc-call.S create mode 100644 arch/arm/cpu/armv8/smccc-call.S create mode 100644 arch/arm/include/asm/opcodes-sec.h create mode 100644 arch/arm/include/asm/opcodes-virt.h create mode 100644 arch/arm/include/asm/opcodes.h create mode 100644 drivers/firmware/Kconfig create mode 100644 drivers/firmware/Makefile create mode 100644 drivers/firmware/firmware-uclass.c create mode 100644 drivers/firmware/psci.c create mode 100644 drivers/sysreset/sysreset_psci.c create mode 100644 include/linux/arm-smccc.h