From patchwork Mon May 4 11:44:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rayagonda Kokatanur X-Patchwork-Id: 1282484 X-Patchwork-Delegate: trini@ti.com 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; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=eoGRW6a/; 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49G1K54G56z9sP7 for ; Mon, 4 May 2020 21:46:17 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4F5E481FAF; Mon, 4 May 2020 13:45:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=broadcom.com header.i=@broadcom.com header.b="eoGRW6a/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7026681FB5; Mon, 4 May 2020 13:45:25 +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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) (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 24D1981F7C for ; Mon, 4 May 2020 13:45:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rayagonda.kokatanur@broadcom.com Received: by mail-pj1-x1042.google.com with SMTP id h12so6501779pjz.1 for ; Mon, 04 May 2020 04:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c0uEeOYffTaNnaRycDM8nUsl7E2R7Jojfz6l90i+/X0=; b=eoGRW6a/KWSQ+ZTZ8Wfm2uj5vA0FvVuZgnkMFaovBAVZ80mTHtniit9uy33fayG1vh YwvatoHKyCPr8KDFlvPTmm7f0YziFtk5sJnrfsqBR1xRFhwmNtSCQ7HMQ/O1nMq8YNNA Pjo9ouWqDMp0+Gxx9rWqwQ/iBHtTPdQp80Fj0= 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; bh=c0uEeOYffTaNnaRycDM8nUsl7E2R7Jojfz6l90i+/X0=; b=p2o+zeHH1aEseIxXN/ycY9dRxQjTqw6oyndFTDPVUbA39rweIQQmXMA1BQ1k+K3GsC m8sGb63k6xR1+18o6R3XtFhssh+L2nS/UreK3Dn3dc+5xOiH60ruJJAex/MtHKBpXjbU F7muBlFCXKu3DJyyIlamn/+qCWPvNEdEaRlYCRh0CNVStiU4VsLvWPRzCXW4yPhykwlC ALf8vpNbWB4iK9VIy/N90HGLXi6DG+1tTxOqV5/qYz4iV+fNd5CCSJySGXDKt+icmce1 kuvUxABcQGlZKcrIJormeTnZUzjSaGcb6u62hLT5zm71yxw1yzGxELsAXD+PbQbZRbYX m5ZA== X-Gm-Message-State: AGi0PuZnHSVeHXchXVgXm1CoOXBB5ETFsWo/R/tjY9fuxQFgjTKIj1sS 1C0mclHqK856PQ1eryoeKnL5r1+m9NfI2paHUVyTtkMHzarJsu3O/5PIqtTtVIVGoO5xk0Xd3A2 GxNasJhQhHFjL4FfP/WZa8oPDszB1i6gY6ppPI33kAyT1OqLTR5VJO8n49+dS3pYzDpOAUVnvVw ntVO8PhQ== X-Google-Smtp-Source: APiQypJ1cIDrelHvocsCoDiX1pIrplOh2mCwHEgTvOR90pe5brkwpJ+/Zi9r37fov063NKd0axcH/A== X-Received: by 2002:a17:90a:71c2:: with SMTP id m2mr17142589pjs.21.1588592720096; Mon, 04 May 2020 04:45:20 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id t20sm6712962pjo.13.2020.05.04.04.45.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 May 2020 04:45:19 -0700 (PDT) From: Rayagonda Kokatanur To: u-boot@lists.denx.de, Simon Glass , Marek Vasut , Bharat Kumar Reddy Gooty Cc: Rayagonda Kokatanur , Rajesh Ravi Subject: [PATCH v2 07/16] board: ns3: default reset type to L3 Date: Mon, 4 May 2020 17:14:23 +0530 Message-Id: <20200504114432.10886-8-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200504114432.10886-1-rayagonda.kokatanur@broadcom.com> References: <20200504114432.10886-1-rayagonda.kokatanur@broadcom.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean Default "reset" from u-boot to L3 reset. "reset" command with argument will trigger L1 reset. Signed-off-by: Rajesh Ravi Signed-off-by: Bharat Kumar Reddy Gooty Signed-off-by: Rayagonda Kokatanur --- board/broadcom/bcmns3/ns3.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/board/broadcom/bcmns3/ns3.c b/board/broadcom/bcmns3/ns3.c index f28e34ccc3..6687028d19 100644 --- a/board/broadcom/bcmns3/ns3.c +++ b/board/broadcom/bcmns3/ns3.c @@ -69,7 +69,23 @@ int dram_init_banksize(void) return 0; } -void reset_cpu(ulong addr) +void reset_cpu(ulong level) { - psci_system_reset(); +#define L3_RESET 30 + u32 reset_level, strap_val; + + /* Default reset type is L3 reset */ + if (!level) { + /* + * Encoding: u-boot reset command expects decimal argument + * strap val = 1st decimal digit;reset level = 2nd decimal digit + */ + strap_val = L3_RESET % 10; + level = L3_RESET / 10; + reset_level = level % 10; + psci_system_reset2(reset_level, strap_val); + } else { + /* U-boot cmd "reset" with any arg will trigger L1 reset */ + psci_system_reset(); + } }