From patchwork Tue Dec 11 09:35:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1010936 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Um47Ua58"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43DZlH08lGz9s3l for ; Tue, 11 Dec 2018 20:43:54 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 91CBFC226D4; Tue, 11 Dec 2018 09:33:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id F20A9C22172; Tue, 11 Dec 2018 09:30:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9FA53C2264B; Tue, 11 Dec 2018 09:30:37 +0000 (UTC) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by lists.denx.de (Postfix) with ESMTPS id CEAA8C2251C for ; Tue, 11 Dec 2018 09:30:31 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id c73so6830353pfe.13 for ; Tue, 11 Dec 2018 01:30:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=FX++n7wsckdh6Yw1gsdwCMBchuqvdDrwf8f2fzhfMac=; b=Um47Ua58RcMpw+aKKS48kgNG7/OlkB97nngjhciJ5Kft1egDik4ceBEA+JStriVK5m IIdFVq+I0T+3OecsMJfhRs2vCrq60EPxawj1NEsqduga7w/m4nwUtMAIkSS1F/FscT4T ZU8saS+BvX+WT+ThbU9xJ9JhemeBLg6d/0RDI9v8Cs5XPnJC9v0PU9UlMRvb6Bej396X v3L9oRpTNVyQFZo+eRwtwQ3cllZ/tEQvuFoAe28uKv6fqM2kSWhO4FrBnZg8oZq8UDQV qMwQtr+2vRmQCF6jIxdS9qoi900+dnpn/cP8ceCqxvHiyhXf8N4lCQo9B8vT2tw7PlA1 KtiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=FX++n7wsckdh6Yw1gsdwCMBchuqvdDrwf8f2fzhfMac=; b=Wsim1Yg4wzahn6Zi2bkl28HxMJgi8r8UcxJ2MUce42/9LYZOQ1mPv9phrh5zF6nnQW 9mog51hbcXsoCjA3ItBwBcxPG3AWaFM4VXW1YiJZeQfkg/6mcoteEr4XYPbGjepKug+q 1w0ebjEbLo3/7F/cr9puEKCIXIxCgA97pjBRzsUzJ2fIDs2Kd0T+JWyQIW6yFscCcye3 QamGXIYY3pTl3q8To/pHjGNjkYnU6mhCwFYUSJn7Fhl5EB5/Dl+OaBm55ude4QEg5/ba /uhPHSRXhPl+godXja+u7uNpR6THnRuBfeb5YeIlGqL0fuCXs3oAYF1qtrPrc9/C91cF 6oXA== X-Gm-Message-State: AA+aEWaKRCvUDtTljpYQgwTjRpZFJoH/WJoxhZNnl7Unlb9J7z8Ee4Qx B+n2g71/GXNfStx6ZOqh2m6ZYRoj X-Google-Smtp-Source: AFSGD/WFX9yBQ2SB0ZoFq/Vi4H4RDiHEnAtYZxtXfv5T7SVmE8pdtPAt5x1XW8Cj4IjG8+wRhgNYVw== X-Received: by 2002:a63:fa02:: with SMTP id y2mr14030080pgh.177.1544520630583; Tue, 11 Dec 2018 01:30:30 -0800 (PST) Received: from ala-d2121-lx1.wrs.com (unknown-156-139.windriver.com. [147.11.156.139]) by smtp.gmail.com with ESMTPSA id n66sm21916129pfk.19.2018.12.11.01.30.29 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Dec 2018 01:30:30 -0800 (PST) From: Bin Meng To: Rick Chen , Simon Glass , Lukas Auer , Anup Patel , U-Boot Mailing List Date: Tue, 11 Dec 2018 01:35:00 -0800 Message-Id: <1544520901-31558-25-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1544520901-31558-1-git-send-email-bmeng.cn@gmail.com> References: <1544520901-31558-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH v3 24/25] riscv: bootm: Change to use boot_hart from global data X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Avoid reading mhartid CSR directly, instead use the one we saved in the global data structure before. With this patch, BBL no longer needs to be hacked to provide the mhartid CSR emulation for S-mode U-Boot. Signed-off-by: Bin Meng Reviewed-by: Lukas Auer --- Changes in v3: - new patch to change to use boot_hart from global data Changes in v2: None arch/riscv/lib/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c index 124aeef..60b32cc 100644 --- a/arch/riscv/lib/bootm.c +++ b/arch/riscv/lib/bootm.c @@ -93,7 +93,7 @@ static void boot_jump_linux(bootm_headers_t *images, int flag) if (!fake) { if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len) - kernel(csr_read(mhartid), images->ft_addr); + kernel(gd->arch.boot_hart, images->ft_addr); } }