From patchwork Tue Mar 30 21:16:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Opaniuk X-Patchwork-Id: 1460254 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=foundries.io header.i=@foundries.io header.a=rsa-sha256 header.s=google header.b=IBssHnsz; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F92N52567z9sW0 for ; Wed, 31 Mar 2021 08:17:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9EEA982998; Tue, 30 Mar 2021 23:17:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io 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=foundries.io header.i=@foundries.io header.b="IBssHnsz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CC7058297F; Tue, 30 Mar 2021 23:17:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (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 D968E82976 for ; Tue, 30 Mar 2021 23:17:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=igor.opaniuk@foundries.io Received: by mail-lf1-x132.google.com with SMTP id o126so25956782lfa.0 for ; Tue, 30 Mar 2021 14:17:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=S3Ld297ola2me+ioqgwsoEvktZpoYXMQrnLZtLQFS6o=; b=IBssHnszFQ+ZqXmKIVvxqRIV1l5lfbUdfO9lGEtEmamm/jqH1qSUiF2gQwW33Oz1OA h4V4/aqoIPHYIKT55JaHr+W/uqOso2Rxh/bUtBmMHC+1ABXCHtnsW7FLMa/v+ohJdokb ks+HQ2DCkL6qhPoS9O324vGaQlOQ1L0g3iZhBCayQjI9focxz3565GV8XfBBWUOWFQzJ +mvtzs1gp9f+GTUgyCNwEoyNPXbqhlkqF9V0Su64crf8fzJEnmzpnwKfxynZWKQkHjBn JUWZDONOqusuigYOKEAEYYrOg9tnEGAPkNZ9u2IS8bbujLhzEYj/aQCfMPSLZouHpRQv vATg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=S3Ld297ola2me+ioqgwsoEvktZpoYXMQrnLZtLQFS6o=; b=REx6HtVOABDNWh4uILuQ0xpPoBLIOqusXwaDRiFTWzBjznTJdbQUmQ9Gal+JiCQiIW Yej/ZM+U0KsGFYorvmBQ2aeLRlIW5yK7znl3uq4nFI0CG8ckNoX71T/TKs1i8qlYWoS7 i/idOdpAEhjodFtgA4IJRykLwpPytOd4MF2yr1pUCOJ0OEmRRU3Qi3PSVgE+0VzDTtr3 X48bOv1+xdsBJTjPPrnTxBbECmab3wp1PEb1KD4AZh94GpkL8CJyvb7Ry8hphIBjyZP/ acrDtWJIq6EBQ2gbZBKQd6PbiAGdVXC6BP5FXQmbCYMwrB5XFcYXQ3juhkDG4xeNkBUq dTyQ== X-Gm-Message-State: AOAM5334xe8p3RICFLeS1dQ0CFqd6uhUvvylbe5u24HQTmhDOevwthaq xj2B5UF9U5kKeTn7F5og8GNYqY4But09pHpU X-Google-Smtp-Source: ABdhPJw3jFpnZZSdoSExU+gNsnRuWsuK/+B/WkfsKv/xALftruejHsKVAWGIKGQ7UmliQTAx7x0/3Q== X-Received: by 2002:a19:2402:: with SMTP id k2mr77493lfk.138.1617139029030; Tue, 30 Mar 2021 14:17:09 -0700 (PDT) Received: from localhost ([109.108.76.111]) by smtp.gmail.com with ESMTPSA id t26sm2908864ljg.12.2021.03.30.14.17.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 14:17:08 -0700 (PDT) From: Igor Opaniuk X-Google-Original-From: Igor Opaniuk To: u-boot@lists.denx.de Cc: jorge@foundries.io, mike@foundries.io, ricardo@foundries.io, vanessa.maegima@foundries.io, tim.anderson@foundries.io, daiane.angolini@foundries.io, Igor Opaniuk Subject: [RFC PATCH v2 3/4] sysreset: psci: use psci driver exported functions Date: Wed, 31 Mar 2021 00:16:58 +0300 Message-Id: <20210330211659.1260518-4-igor.opaniuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210330211659.1260518-1-igor.opaniuk@gmail.com> References: <20210330211659.1260518-1-igor.opaniuk@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean From: Igor Opaniuk Use psci driver exported functions for reset/poweroff, instead of invoking directly invoke_psci_fn. Signed-off-by: Igor Opaniuk --- (no changes since v1) drivers/sysreset/sysreset_psci.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/sysreset/sysreset_psci.c b/drivers/sysreset/sysreset_psci.c index c7907b3226..83ecbcb9d2 100644 --- a/drivers/sysreset/sysreset_psci.c +++ b/drivers/sysreset/sysreset_psci.c @@ -11,22 +11,18 @@ static int psci_sysreset_request(struct udevice *dev, enum sysreset_t type) { - unsigned long function_id; - switch (type) { case SYSRESET_WARM: case SYSRESET_COLD: - function_id = PSCI_0_2_FN_SYSTEM_RESET; + psci_sys_reset(type); break; case SYSRESET_POWER_OFF: - function_id = PSCI_0_2_FN_SYSTEM_OFF; + psci_sys_poweroff(); break; default: return -ENOSYS; } - invoke_psci_fn(function_id, 0, 0, 0); - return -EINPROGRESS; }