From patchwork Wed Jan 20 09:27:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 12031773 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13538C433E0 for ; Wed, 20 Jan 2021 09:29:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6EA8F22D08 for ; Wed, 20 Jan 2021 09:29:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6EA8F22D08 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l29o2-0002AR-9k for qemu-devel@archiver.kernel.org; Wed, 20 Jan 2021 04:29:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l29mQ-0000rm-MW for qemu-devel@nongnu.org; Wed, 20 Jan 2021 04:27:58 -0500 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:39326) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l29mO-00055L-R8 for qemu-devel@nongnu.org; Wed, 20 Jan 2021 04:27:58 -0500 Received: by mail-lf1-x134.google.com with SMTP id h7so3958049lfc.6 for ; Wed, 20 Jan 2021 01:27:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EBGOBlbBtO/dbxctd0HuQeQZa7qOrzfcGEX+G2MkXNo=; b=JN46kY24Ces71pTPLAp1wdyWGh9w4KVU6hBL2wZKDb2rcSyYMP97Psd9SZW22gHsok zlz2bLf174D4EoeNg/61lAVTTf0I6f/bj+r3pevvWLS9pBguyy52BJOVq6MBqVltapUL Qe4H3z8UJ38ZfT6m2KQZKZOr6uWsJGXRSh4HRB/H1K8BmEUCZKxVXRkyrsRj3cO/Pynb tgVSWjoFYJST2/adXJeNMdbzUtKGtT8xdlHtQ2IP2Hzul0ljnpW2PihqLJU7182yOvik 7sQapikhfmBQtAs77FcztcElaLRu7QdzCQAf4m6K+yTX6bNX9Ouy7+L5fDIdlLFcyoB/ j8SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EBGOBlbBtO/dbxctd0HuQeQZa7qOrzfcGEX+G2MkXNo=; b=G/eak9JbuTaI+IYRbQ7YHC22ss16eogTH4ZDZrm/cUPkDAN4XbAlDghGr/0aLycbkr dxrH9D0rLpf7hy9AOenvy3hxiIPX5JjaGGD8lZVoOAgq25r1xJj8xGKlXrphwJdJUMzZ HGaMprS5Bi2fRc5bcTCQECmA337iFL1a5OsrovDzW4itNP5QypTUhejJRp2RdGHwIu6d P/52q+UcnT+P04ocndZPajsErp5CFgLVbWa9D4E0S3iTt5j+a7a3tMU22GCz9nIxFtgI EoVIIhUotUvVq5CDG/yojqf0eVLfj6JpV6xOSirvIOwry2wsA07aEio7NlTdBbIxA3ix 8IYw== X-Gm-Message-State: AOAM533K5r92hWx9DSfBqICRW4r8/eVLMWi8rx+RLz4IY6ESRJ7GT3cL 8cjf3J03JPzGbMJPWsBtQcP3rQ== X-Google-Smtp-Source: ABdhPJxITQ5uYk8k/iEyMvSMpntVxAv73JkCmYIpw6v8gVqeFrGWW27qViMvnncC6F4Nlesh0v8wvA== X-Received: by 2002:ac2:5145:: with SMTP id q5mr3510903lfd.626.1611134872351; Wed, 20 Jan 2021 01:27:52 -0800 (PST) Received: from localhost.localdomain ([2.92.195.184]) by smtp.gmail.com with ESMTPSA id r81sm147479lff.215.2021.01.20.01.27.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 01:27:51 -0800 (PST) From: Maxim Uvarov To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCHv8 0/3] arm-virt: add secure pl061 for reset/power down Date: Wed, 20 Jan 2021 12:27:45 +0300 Message-Id: <20210120092748.14789-1-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=maxim.uvarov@linaro.org; helo=mail-lf1-x134.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, drjones@redhat.com, Maxim Uvarov , Jose.Marinho@arm.com, f4bug@amsat.org, tf-a@lists.trustedfirmware.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" v8: - use gpio 0 and 1, align dtb with kernel gpio-restart, gpio-poweroff, change define names, trigger on upper front. (Peter Maydell). v7: - same as v6, but resplit patches: patch 2 no function changes and refactor gpio setup for virt platfrom and patch 3 adds secure gpio. v6: - 64k align gpio memory region (Andrew Jones) - adjusted memory region to map this address in the corresponding atf patch v5: - removed vms flag, added fdt (Andrew Jones) - added patch3 to combine secure and non secure pl061. It has to be more easy to review if this changes are in the separate patch. v4: rework patches accodring to Peter Maydells comments: - split patches on gpio-pwr driver and arm-virt integration. - start secure gpio only from virt-6.0. - rework qemu interface for gpio-pwr to use 2 named gpio. - put secure gpio to secure name space. v3: added missed include qemu/log.h for qemu_log(.. v2: replace printf with qemu_log (Philippe Mathieu-Daudé) This patch works together with ATF patch: https://github.com/muvarov/arm-trusted-firmware/commit/886965bddb0624bdf85103efb2b39fd4eb73d89b Maxim Uvarov (3): hw: gpio: implement gpio-pwr driver for qemu reset/poweroff arm-virt: refactor gpios creation arm-virt: add secure pl061 for reset/power down hw/arm/Kconfig | 1 + hw/arm/virt.c | 111 ++++++++++++++++++++++++++++++++++-------- hw/gpio/Kconfig | 3 ++ hw/gpio/gpio_pwr.c | 70 ++++++++++++++++++++++++++ hw/gpio/meson.build | 1 + include/hw/arm/virt.h | 2 + 6 files changed, 167 insertions(+), 21 deletions(-) create mode 100644 hw/gpio/gpio_pwr.c