From patchwork Fri Dec 7 14:14:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1009458 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="CjkHrgFd"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43BDzF192Hz9rxp for ; Sat, 8 Dec 2018 01:16:09 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id C3400C2273B; Fri, 7 Dec 2018 14:12:38 +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_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 7D5AFC2275A; Fri, 7 Dec 2018 14:10:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7C852C226FC; Fri, 7 Dec 2018 14:09:51 +0000 (UTC) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by lists.denx.de (Postfix) with ESMTPS id D0569C22711 for ; Fri, 7 Dec 2018 14:09:46 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id s198so1790645pgs.2 for ; Fri, 07 Dec 2018 06:09:46 -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=xQyi4YqTYBGKmSUILfZ4RJU2P57giz+s758t45ujVz4=; b=CjkHrgFdrEGs7pMn0bNGdAznPyy6QXlIlYZE51sS95kRNSLJ78+l8d6/bLJlb9MZ7q MfZTte7ckE/5LeNTJ2m0tZoHexNvwnBw/wbpioyo3fzTHSgmO2/yHkgGQXiiT3oCnI84 Oxo5JGQcRe2MOSZmQ5SvPDiz73FwrSGlyeWRwy/MG9ZW8SDrdLdGMoZsvnfA5T0mYy2b bm3GmKyM9+Vt5dSK3C3889FVr0XabFbp0/fefNFBwnAzJlg4AXVv9WDWBC0VtbY9WlHH MZe/vIIgCreZRR4FrgnB6kuT+TOsU7q5VseoQeqNPUBSAGRteF192XlXMBQ98+S5MiTq UNXw== 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=xQyi4YqTYBGKmSUILfZ4RJU2P57giz+s758t45ujVz4=; b=k1uZ3Kxbx6pNi/yC5DT9T8rQWlYjIZBIvfIdhf5Ern8tbkC1qbbon5tt6m8zaurQrY z16mSSQkVoXiofgurfuoVJpw47n4t9HJOmRV1DnwGTYSS+fSEgbShPhdrT48mqeS36XV 1Vyg7ISLUUAwNS+etdCDEidLG2s80jMMo9Eb5NHY+L00KqZmI5aEdvVrbiQSjSyMjm9K QCmmkdZgyH7legAjfct8+7jeu1eiILP6lyHMWQRUwh9tMoge9vLsSBsmmrFQdteiOvvk W2h/+yVG/fUJLtYHVMzM0zXst7gJUF5WyCrUOfZw4z/XfOxXHYmSftSJAPLthNSu8hWL XN4w== X-Gm-Message-State: AA+aEWYkBb0GCyur1w7vhFKViKGQ9Dx1hB9ZVTQNVIpqTLvsE2YrFnoM P6CCuUjzmerkBU92+uLZXIA= X-Google-Smtp-Source: AFSGD/VZeFLXdZzLKycTfqQws7B9qdPSwBN2XhvIvAc7SsxjEB3x8jIAlB9EUF1ZLUg2SGrUIy4uGA== X-Received: by 2002:a62:2082:: with SMTP id m2mr2308406pfj.163.1544191785567; Fri, 07 Dec 2018 06:09:45 -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 f6sm5206070pfg.188.2018.12.07.06.09.44 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Dec 2018 06:09:44 -0800 (PST) From: Bin Meng To: Rick Chen , Simon Glass , Lukas Auer , Anup Patel , U-Boot Mailing List Date: Fri, 7 Dec 2018 06:14:24 -0800 Message-Id: <1544192072-28764-13-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1544192072-28764-1-git-send-email-bmeng.cn@gmail.com> References: <1544192072-28764-1-git-send-email-bmeng.cn@gmail.com> Subject: [U-Boot] [PATCH v2 12/20] riscv: Probe cpus during boot 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" This calls cpu_probe_all() to probe all available cpus. Signed-off-by: Bin Meng Reviewed-by: Lukas Auer --- Changes in v2: - move to arch/riscv/cpu/cpu.c arch/riscv/cpu/cpu.c | 14 ++++++++++++++ arch/riscv/cpu/qemu/Kconfig | 1 + 2 files changed, 15 insertions(+) diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c index d9f820c..3858e51 100644 --- a/arch/riscv/cpu/cpu.c +++ b/arch/riscv/cpu/cpu.c @@ -4,6 +4,8 @@ */ #include +#include +#include #include /* @@ -53,3 +55,15 @@ int print_cpuinfo(void) return 0; } + +int arch_early_init_r(void) +{ + int ret; + + /* probe cpus so that RISC-V timer can be bound */ + ret = cpu_probe_all(); + if (ret) + return log_msg_ret("RISC-V cpus probe failed\n", ret); + + return 0; +} diff --git a/arch/riscv/cpu/qemu/Kconfig b/arch/riscv/cpu/qemu/Kconfig index 2e953e1..f48751e 100644 --- a/arch/riscv/cpu/qemu/Kconfig +++ b/arch/riscv/cpu/qemu/Kconfig @@ -4,6 +4,7 @@ config QEMU_RISCV bool + select ARCH_EARLY_INIT_R imply CPU imply CPU_RISCV imply RISCV_TIMER