From patchwork Mon Apr 27 10:51:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rayagonda Kokatanur X-Patchwork-Id: 1277597 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=h6I4Kvrq; 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 499kTv6zX0z9sSK for ; Mon, 27 Apr 2020 22:24:03 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 97AB281EA9; Mon, 27 Apr 2020 14:19:40 +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="h6I4Kvrq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1549A81E1A; Mon, 27 Apr 2020 12:59:39 +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 4E21781E0A for ; Mon, 27 Apr 2020 12:59:32 +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 hi11so7375955pjb.3 for ; Mon, 27 Apr 2020 03:59:32 -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=0KQSkXZtG13PrEuU1OK0BqpF+uvIC04FDDwysKBwpkc=; b=h6I4KvrqSAbod9zf/zQCisgksCznDPfAjVnADokYczQVEeX9o20fHvZ7sD059nCzcs dqOPOu+wtwB4zR1dYPxsPbLC9TE/SYbKUW9Uu5HQOxpXVjYV3s+GcQ6UAXj/nN4N1DEq LKuM2Y92x1YWW7RzxT4MSnoVMo+1uzJYYP670= 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=0KQSkXZtG13PrEuU1OK0BqpF+uvIC04FDDwysKBwpkc=; b=rFljC/RPNdZ0pmTpCkeFuLjVdGiGjZtltnB2jEtVLQoJ2oPDyJrH4eZ+ZbqXZfiWA2 URa5dN6uNGo3/UUiq6Z4P1Ujqrep9YKB0Bs4nb6e7uVPgh0om0fDLF0MYjW7O6DBxQD0 B93hYhYNlGYloS+M7V2aiUmw0CBXP/6l85DgoRh1ZjHdKIty02zuO0j6jporU5jjp2So /v7SdctOGMsfJGqYT331xGGXOFAk9+0q0p2rZjtIdrY3qMwfnV44c4MS7u8PpPtNo9s3 9D0FLdQfWwrYrYgMleWgtFFgFw+vIIJE2Tzq7YyxDR3H2xNf6IQmHEIlnDD5CN5khgi/ MqxA== X-Gm-Message-State: AGi0PuaswcPx0YbljJeu5QDjSuTcRIanltIjfdFlRx7QTYqj6xnxOffZ 76l7P+fXRHZHLphYA5KHZ6FpbN5B7WNm+CNTJqsjbQr7PtCSuhWhd2ynzhmunxFAFVTAAK5xn8J BhlHgiaoNa8b/D+qE0gYcpYkilplR6r/dZKWjMGNhNXWgICEQw+a4dBXUmkNubJNvgJr4noNajw BTmZzqdWwr X-Google-Smtp-Source: APiQypIOfdicvbDQKHYqIPbSu5nE8Bim1fxOdmSzsi04Awgfa62+Ikqlb4irLOr1rJmwFaHQjbX2ug== X-Received: by 2002:a17:90a:fd16:: with SMTP id cv22mr22768939pjb.169.1587985170258; Mon, 27 Apr 2020 03:59:30 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id u3sm11996430pfn.217.2020.04.27.03.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 03:59:29 -0700 (PDT) From: Rayagonda Kokatanur To: u-boot@lists.denx.de, Simon Glass , Kever Yang , Michal Simek , Jagan Teki , Marek Vasut , Fabio Estevam , Baruch Siach , Troy Kisky , Josip Kelecic , Priyanka Jain , Biwen Li , Jason Li , Philippe Reynes , Eddie James , Heinrich Schuchardt , Sam Protsenko , Lukasz Majewski , Miquel Raynal , Ramon Fried , Anup Patel , AKASHI Takahiro , Patrice Chotard , Eugeniu Rosca , Joe Hershberger , Simon Goldschmidt , Boris Brezillon , Simon South , Andy Shevchenko , Marek Bykowski , Lokesh Vutla , Patrick Delaunay , Rajesh Ravi , Abhishek Shah , Vladimir Olovyannikov , Bharat Kumar Reddy Gooty , Srinath Mannam , Pramod Kumar , Ray Jui , Vikas Gupta , Trac Hoang , Corneliu Doban , Sheetal Tigadoli Cc: Rayagonda Kokatanur Subject: [PATCH v1 23/49] board: ns3: default reset type to L3 Date: Mon, 27 Apr 2020 16:21:41 +0530 Message-Id: <20200427105207.5659-24-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200427105207.5659-1-rayagonda.kokatanur@broadcom.com> References: <20200427105207.5659-1-rayagonda.kokatanur@broadcom.com> X-Mailman-Approved-At: Mon, 27 Apr 2020 14:18:25 +0200 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 From: Rajesh Ravi 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 fa98ed18cd..ae4da977b6 100644 --- a/board/broadcom/bcmns3/ns3.c +++ b/board/broadcom/bcmns3/ns3.c @@ -79,9 +79,25 @@ 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(); + } } #ifdef CONFIG_OF_BOARD_SETUP