From patchwork Wed Jun 10 10:41:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rayagonda Kokatanur X-Patchwork-Id: 1306747 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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; secure) header.d=broadcom.com header.i=@broadcom.com header.a=rsa-sha256 header.s=google header.b=bjAzngxV; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 49hk8w5M1Xz9sQx for ; Wed, 10 Jun 2020 20:42:56 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7C7D581CB9; Wed, 10 Jun 2020 12:42:08 +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; secure) header.d=broadcom.com header.i=@broadcom.com header.b="bjAzngxV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 600EB81C80; Wed, 10 Jun 2020 12:42:03 +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-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) (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 71ADD81C75 for ; Wed, 10 Jun 2020 12:41:59 +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-x1044.google.com with SMTP id m2so729659pjv.2 for ; Wed, 10 Jun 2020 03:41:59 -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=TY1rNwdeM2/c8TR2jXfchHk3fZZnu3Q4cXZPcmXj+c8=; b=bjAzngxVJly65Qzxg8w0Wt5GKlfuL0uZwBRKuRVAadDST2UUVqZFssWyxEYOI3+ipf p4uLon8fPx5pAJaiHT/6135BK7PlEbeN4dOZ8Dls/uQ1pAk6FQhp1ZX2EhijPu7vCP1h V2/8xTUr5B+AzTahmqlp2sof8dLSGIhjH/uBs= 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=TY1rNwdeM2/c8TR2jXfchHk3fZZnu3Q4cXZPcmXj+c8=; b=Vg/+7IZopcySWqP/K+F/ainn5TlbgQOGcTY2bEb2Jyg17J+csCMg/xf6ckE/yC53UP 7sqvhk6rJI6Gn5Ie9+aBN9ENcqocOQcip5jiUUu/X1DwHTYElaD+zUh8hAAXGrk6wYor OwBjMWFmCzM6cGJxWhttjfzxiGGfwi23OfBuCrncBSztW4F7nwP/hQZR+556O081ruxi kn86gs0uRsD6m5LBk9i/mizVCFLJ9NlAtL8gBx4zZ8boMQs6v8PiWfVb9PSg5KBB2+5U xYMblUPg5vp6+kGgjUKB+IeojrkI0gVX2Tn2BVuJ7sC8lLOotej0Fo5/eFUEdn85tTYL h9mQ== X-Gm-Message-State: AOAM532g9yBYJz/SQFboYrEwZdSVUQBYKv3H3UV7WaWZxfieyaQnH6pK d2ibB22QzZhGl/D852W4fOISHz5Agu4TiUw2vQQYWv58gj4ZXIHHIVqRUuwu46rQF6CY6QCT5pF uBvb5Kgn6xv4qj8VxDOCPktgDGh9jVgUmY49386Js4TsHe9c1LpJEfkqwRnxso0TpeBXFGXtXXB 6qlFs= X-Google-Smtp-Source: ABdhPJycB4rRL01zgucK/hOm0hUDkimj4W/dUk/25/xBmLTBoNFRcNWbqrYaKkVxuWqxDIda2gwOrQ== X-Received: by 2002:a17:90b:3809:: with SMTP id mq9mr2378024pjb.156.1591785717294; Wed, 10 Jun 2020 03:41:57 -0700 (PDT) Received: from rayagonda.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id d22sm10760050pgh.64.2020.06.10.03.41.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 03:41:56 -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 v3 06/15] board: ns3: default reset type to L3 Date: Wed, 10 Jun 2020 16:11:11 +0530 Message-Id: <20200610104120.30668-7-rayagonda.kokatanur@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200610104120.30668-1-rayagonda.kokatanur@broadcom.com> References: <20200610104120.30668-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 5e644bd466..1221f26ddc 100644 --- a/board/broadcom/bcmns3/ns3.c +++ b/board/broadcom/bcmns3/ns3.c @@ -68,7 +68,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(); + } }