From patchwork Mon Aug 3 06:09:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1340137 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=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=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=X1ZC0qdv; 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 4BKnZ12Njpz9sRN for ; Mon, 3 Aug 2020 16:10:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3A85A81F3F; Mon, 3 Aug 2020 08:10:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="X1ZC0qdv"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4F9838219A; Mon, 3 Aug 2020 08:10:42 +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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (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 1F36281C3C for ; Mon, 3 Aug 2020 08:10:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-wm1-x344.google.com with SMTP id t14so9118995wmi.3 for ; Sun, 02 Aug 2020 23:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=d9lHAaZVMv/eTskqs+vzFXtDmmqrmUzzgcvWZuSYgIc=; b=X1ZC0qdvHPsVmAIkVnc7mNXsRj/MS/2DvF+9+wTpe/kyXlT9t/Qb1OZhqVvgiwfAAC Iine79meOBcJFJwHEyPd+Gb274+Q+ZBdkQ5G3a7uIonQ5D2tg8DSXvALB8swqfsfNxs1 sOd5wb4+rshNa5c0yh9XUHMRdAbLDEZcpsi2R4GkiCKRgi8Qj5jsY3S0OTjD/PVO79OJ qNo4Mm/nT6dNpEr077o4RSvFOEzS1mU4K4TcgjJy+hr8N5uO7Ay2FHwf5sGXfJUGwQBi s9nm9XHDq4XfmwyRJdShz1ygg5OwzdP7ZIv2KPbYfQjD/jh7Wo+0LIk+fSUzQjvIcKd/ y5+g== 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; bh=d9lHAaZVMv/eTskqs+vzFXtDmmqrmUzzgcvWZuSYgIc=; b=pAeB2hSfRLCA5BJubhAMLu2t6VyoQp7j1sdGfdq5eipMio42HROxn/fb9zDKs5dETW IL3b/uiTWhciAMYrrAO5IFnOMHEc/SPig1qIMzsvMMkvr56BxbJubFsGAoPJNryM3+KM RFDpKqoa2J7dkQnXAgjpXfvImr24YtGMYHWn5Ot9PYYEBzagj0/T8dEhe9WwymPB79I8 DEiBa3C+lFFr22IYS26fbjElbRseIuGk0UE0qxHNQYxezamDRHVi9NwpZpgaH114VTxS KQs+kGFUZN2LxmO5BjQbnvBE1E4ninbEE7yJxs8XlxefEepxi3PvMMPqS6xrJgaGAGwH brsQ== X-Gm-Message-State: AOAM531Mcu1F7nXMBXlLTdHhVaO3thmvwA8v4potnwVfwlIAQ2Wf37BN YwIIfJuM5ircPThY46ByMs02cxVi X-Google-Smtp-Source: ABdhPJwE97MxHRD9q11FEdNwEsAckzN/SszTV4UlR+/QxC9Hj7N+V0JGHW0gVX8pxkhLKK1blVVF1Q== X-Received: by 2002:a1c:2e07:: with SMTP id u7mr15224588wmu.52.1596435036728; Sun, 02 Aug 2020 23:10:36 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id 32sm23363811wrn.86.2020.08.02.23.10.35 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 02 Aug 2020 23:10:36 -0700 (PDT) From: Bin Meng To: Rick Chen , Pragnesh Patel , U-Boot Mailing List Cc: Bin Meng Subject: [PATCH 1/6] riscv: Call spl_board_init_f() in the generic SPL board_init_f() Date: Sun, 2 Aug 2020 23:09:01 -0700 Message-Id: <1596434946-12630-1-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.3 at phobos.denx.de X-Virus-Status: Clean From: Bin Meng The generic SPL version of board_init_f() should give a call to board specific codes to initialize board in the SPL phase. Signed-off-by: Bin Meng Reviewed-by: Rick Chen Reviewed-by: Pragnesh Patel Tested-by: Pragnesh Patel --- arch/riscv/include/asm/spl.h | 7 +++++++ arch/riscv/lib/spl.c | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/arch/riscv/include/asm/spl.h b/arch/riscv/include/asm/spl.h index 45c03fb..1487f2d 100644 --- a/arch/riscv/include/asm/spl.h +++ b/arch/riscv/include/asm/spl.h @@ -28,4 +28,11 @@ enum { BOOT_DEVICE_NONE }; +/** + * spl_board_init_f() - initialize board in the SPL phase + * + * @return 0 if succeeded, -ve on error + */ +int spl_board_init_f(void); + #endif diff --git a/arch/riscv/lib/spl.c b/arch/riscv/lib/spl.c index c47dcd4..e24ec5a 100644 --- a/arch/riscv/lib/spl.c +++ b/arch/riscv/lib/spl.c @@ -13,6 +13,11 @@ DECLARE_GLOBAL_DATA_PTR; +__weak int spl_board_init_f(void) +{ + return 0; +} + __weak void board_init_f(ulong dummy) { int ret; @@ -24,6 +29,10 @@ __weak void board_init_f(ulong dummy) arch_cpu_init_dm(); preloader_console_init(); + + ret = spl_board_init_f(); + if (ret) + panic("spl_board_init_f() failed: %d\n", ret); } void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) From patchwork Mon Aug 3 06:09:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1340138 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=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=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=tM092zwk; 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 4BKnZC6bzvz9sRN for ; Mon, 3 Aug 2020 16:10:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1EA0C821E0; Mon, 3 Aug 2020 08:10:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tM092zwk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3D400821B0; Mon, 3 Aug 2020 08:10:43 +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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (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 DE5DF81F3F for ; Mon, 3 Aug 2020 08:10:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-wm1-x341.google.com with SMTP id 3so14324238wmi.1 for ; Sun, 02 Aug 2020 23:10:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YXQHlR+b65qjVYUYIB3nESkgqyT9j9svxllJdvBR6vc=; b=tM092zwkah3SZeQLEfbM16Lnt6XKBIzeROUbjHqIPEWVVkpBofT8nvtTOBPDZN5wxz FG+3Lss2nEBX7T2ZVKek4wJMJxBVN5ORN/5TXeALHMu86dHEl2lcMhGfhx9+uOOKbVAB Lkr7BUgR18QtrMySYCo3cgLnTZJIxeg6CzDzd7sHVgnJNIFzH1PsPCCPfs4YL0pSz6tJ C3iGF3Qx6fBhlLllLFn/sQjx16otTD8lu+Tv1GQb1NkgLZ5QKbeaN7DFL/aPE+JEQewZ MJmycJc2QXVlRG0JRz/0SwRyXMmnGXiz6NC6abTpCXbgt0i8/rn8XqXVRmlwx6XrCgdw Ot0Q== 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=YXQHlR+b65qjVYUYIB3nESkgqyT9j9svxllJdvBR6vc=; b=bCq/ZNsYuxJAYtcpDx1HXXw8NOGl4mR57I2Hq547G9YFeFXlj+ndRQJtO2miYzRydv KcRed8qgaQGEK1Y8sanEUio0T9ajJbaXNnOigdD7SLClA9dH3Bs86zKPfjj9iDU8xTI6 5VeRQBmKXw6qIQrgIc6TDFDM9Z1mGr2UttN1QJbWP7YcWNuvSSwqSle17Vox9k7Hfjok aFZy2oVmtOFWo+ygeJ9QnEC/o9kn5lSRj1MfAvGT3z7ZYKrLFVamrxcJxUfIQQVD4Sal kUhIbU6YHjXkcK2bfbt9NWMIyBnxKHlTWRSl1XiHADGdK+tqa4H6fltbRC+17RJkcvOn Q9aQ== X-Gm-Message-State: AOAM531PouwNXyzXNtWItcogZQrbr3YzrOTbtpBeyDPxb3YknxwQg2M3 XQBqcFBhFjdW2S1fNE/FooA= X-Google-Smtp-Source: ABdhPJwlxnXbn3w3YdqBKNMirS72aeeDNlBxTht9G/U9YiXfTijg9KoEGa/kwgF+gJf35MMfAuoEMg== X-Received: by 2002:a1c:a7d1:: with SMTP id q200mr13991505wme.131.1596435038586; Sun, 02 Aug 2020 23:10:38 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id 32sm23363811wrn.86.2020.08.02.23.10.36 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 02 Aug 2020 23:10:38 -0700 (PDT) From: Bin Meng To: Rick Chen , Pragnesh Patel , U-Boot Mailing List Cc: Bin Meng Subject: [PATCH 2/6] riscv: sifive/fu540: spl: Drop our own version of board_init_f() Date: Sun, 2 Aug 2020 23:09:02 -0700 Message-Id: <1596434946-12630-2-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1596434946-12630-1-git-send-email-bmeng.cn@gmail.com> References: <1596434946-12630-1-git-send-email-bmeng.cn@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.3 at phobos.denx.de X-Virus-Status: Clean From: Bin Meng Use the generic board_init_f() provided by the RISC-V library codes. Signed-off-by: Bin Meng Reviewed-by: Rick Chen Reviewed-by: Pragnesh Patel Tested-by: Pragnesh Patel --- board/sifive/fu540/spl.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/board/sifive/fu540/spl.c b/board/sifive/fu540/spl.c index 55325cf..31d315d 100644 --- a/board/sifive/fu540/spl.c +++ b/board/sifive/fu540/spl.c @@ -17,7 +17,7 @@ #define GEM_PHY_RESET SIFIVE_GENERIC_GPIO_NR(0, 12) -int init_clk_and_ddr(void) +int spl_board_init_f(void) { int ret; @@ -55,20 +55,3 @@ int init_clk_and_ddr(void) return 0; } - -void board_init_f(ulong dummy) -{ - int ret; - - ret = spl_early_init(); - if (ret) - panic("spl_early_init() failed: %d\n", ret); - - arch_cpu_init_dm(); - - preloader_console_init(); - - ret = init_clk_and_ddr(); - if (ret) - panic("init_clk_and_ddr() failed: %d\n", ret); -} From patchwork Mon Aug 3 06:09:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1340139 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=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=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=nrC3N3wf; 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 4BKnZN6YvHz9sRN for ; Mon, 3 Aug 2020 16:11:08 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BF952821EE; Mon, 3 Aug 2020 08:10:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nrC3N3wf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 168DF82189; Mon, 3 Aug 2020 08:10:44 +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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) (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 AE09D81BD7 for ; Mon, 3 Aug 2020 08:10:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-wm1-x342.google.com with SMTP id k20so14299462wmi.5 for ; Sun, 02 Aug 2020 23:10:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hzc4CWvlWbSW1KdgyNserWykjQNzb1ggPKvr7uuAPQI=; b=nrC3N3wf0tNfMwGKz2hcKTchdiOASCkydUUSEWrWCSZzpSLmvi8Q9U3tZ1I5RNxO/6 33BDgaEOJ0sdZDS05A97QBb7ois0VT4jse/ut2mlVCwaTUu9GcqGYunIC+cgUuvxIRSc ktLNVVHQdwe4DKSNws+iCPQ52qZYv1M4knIE+IZ2JOtcyXqx9Wohxv7p33SGuY+XfdIn w1Z4QD5JWQYE8JKPPc/iUhxomPEIw7X8K2fNkx7FBfusMPIMONq+Dv1bj4CSzCavp89t /oPXaFpXbXv79d4KK9IQ2jqnfm46hcbR5GsAjrsOm8NkyRjdIzilm3ibO0l0q0Zmt15e Ip2A== 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=hzc4CWvlWbSW1KdgyNserWykjQNzb1ggPKvr7uuAPQI=; b=Y/XZprHGtgbGI8hJqmHHE0YC94dc2ASk+DBC4R2D9fZ3qVkfaEX4WRS/TUm+me/tyX 9J+OL7pS45mwcrRGtPRjqWwHukPaFunFm5OwUGHt5wYAOUXH76ZvBBrC6WC/kMgNVQ71 B2A4Tm5y0ah+AclKQVbw07AWSWGmdDwkERvTk/+Z3FE/Lwodj5mHMu+KloypRrtc/lx0 v7QofnrMz8ECD/JlVcmfh7fGnCUi0O0ZNVK7iYhJGLh08Y//8Y5RGihI74LOglxQ1tgt FR1bJLowtTo68SLV4vfRq98y6RxpAjw1lrWsTINl+KQyRPPG8jWEf9uws5iS7OyFo4p4 zMjQ== X-Gm-Message-State: AOAM530ll45YXILMBjNyo4pSgyi1PPo5T2z0OkRK96lIwvc0TegyLnZy a07g8Zw8w1ePwETWiCvxkp+5Q14X X-Google-Smtp-Source: ABdhPJx7KaISx9WnyFqXR1dpEFPbSrQaJNA9fXiIqYj6tmIESKHyKYIsMSKe+qam+vh3fAM6aSd4DQ== X-Received: by 2002:a05:600c:21c2:: with SMTP id x2mr14897926wmj.142.1596435040383; Sun, 02 Aug 2020 23:10:40 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id 32sm23363811wrn.86.2020.08.02.23.10.38 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 02 Aug 2020 23:10:39 -0700 (PDT) From: Bin Meng To: Rick Chen , Pragnesh Patel , U-Boot Mailing List Cc: Bin Meng Subject: [PATCH 3/6] riscv: sifive/fu540: spl: Rename soc_spl_init() Date: Sun, 2 Aug 2020 23:09:03 -0700 Message-Id: <1596434946-12630-3-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1596434946-12630-1-git-send-email-bmeng.cn@gmail.com> References: <1596434946-12630-1-git-send-email-bmeng.cn@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.3 at phobos.denx.de X-Virus-Status: Clean From: Bin Meng spl_soc_init() seems to be a better name, as all SPL functions names start from the spl_ prefix. Signed-off-by: Bin Meng Reviewed-by: Rick Chen Reviewed-by: Pragnesh Patel Tested-by: Pragnesh Patel --- arch/riscv/cpu/fu540/spl.c | 2 +- arch/riscv/include/asm/arch-fu540/spl.h | 2 +- board/sifive/fu540/spl.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/riscv/cpu/fu540/spl.c b/arch/riscv/cpu/fu540/spl.c index a2034e9..45657b7 100644 --- a/arch/riscv/cpu/fu540/spl.c +++ b/arch/riscv/cpu/fu540/spl.c @@ -7,7 +7,7 @@ #include #include -int soc_spl_init(void) +int spl_soc_init(void) { int ret; struct udevice *dev; diff --git a/arch/riscv/include/asm/arch-fu540/spl.h b/arch/riscv/include/asm/arch-fu540/spl.h index 0c188be..4697279 100644 --- a/arch/riscv/include/asm/arch-fu540/spl.h +++ b/arch/riscv/include/asm/arch-fu540/spl.h @@ -9,6 +9,6 @@ #ifndef _SPL_SIFIVE_H #define _SPL_SIFIVE_H -int soc_spl_init(void); +int spl_soc_init(void); #endif /* _SPL_SIFIVE_H */ diff --git a/board/sifive/fu540/spl.c b/board/sifive/fu540/spl.c index 31d315d..135e118 100644 --- a/board/sifive/fu540/spl.c +++ b/board/sifive/fu540/spl.c @@ -21,7 +21,7 @@ int spl_board_init_f(void) { int ret; - ret = soc_spl_init(); + ret = spl_soc_init(); if (ret) { debug("FU540 SPL init failed: %d\n", ret); return ret; From patchwork Mon Aug 3 06:09:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1340140 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=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=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=rgziW1NN; 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 4BKnZb1Clcz9sTX for ; Mon, 3 Aug 2020 16:11:19 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6D6868220F; Mon, 3 Aug 2020 08:10:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rgziW1NN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1C874821D3; Mon, 3 Aug 2020 08:10:46 +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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (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 7B48C81C3C for ; Mon, 3 Aug 2020 08:10:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-wm1-x344.google.com with SMTP id f18so10376755wmc.0 for ; Sun, 02 Aug 2020 23:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=67AKkTncPbD1DxiCdAEPqLcVByzvZnDEien3Pg8347c=; b=rgziW1NNxBHv+WL70rXzmTnOQADjcH63sqX+KVgZlImfj9xAFibCQ5qAsTX84a6JzP uzlKI2vtG3Yeai6tJlkekQqOW5ht4Zo7c878UgZd7LzKHA52cOeYIHcvNr/rzraQ1QF8 HFpYCP8GH4pHktLQ8s2oOb4ClTMbcE6ABgUFz3M+ZEpmU9U8ZAv5gNYDM17rS3ilGFbq l7d2OD+aBV8R6/dJPAwaBKA2sXIljRdK9rfmrKcBHp7voCdUxQWN5zZQVY4CJf+sGB07 9kncQiB5fM/CnHK64X9ZI/L6YBu05sglxxiwQNTgHOilPfs0zd3FNMWbPFQjGqDP2kuw wa/w== 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=67AKkTncPbD1DxiCdAEPqLcVByzvZnDEien3Pg8347c=; b=Frp3VeyFzURQ+4oNV98ATMuNjhSWHfrWJm+kTnglmopKWpZhYOcmV7szTstpckEMQF 5RrtAtV819fORk0F+eo4VDZE3Griue1xa20VPToWOZJhmPHdMPZ2NbCSjUW4R7+xMfGB xMT/uEWoE674gCHp0f2dQd2Bkl4jjjC8uZSsp4Sjrx0uCIC5+Unh6qwxbKWCKp2Evv9U 0cXpA8mR3kql1WYm06IQnAr2H3wUWck/6u5AYnQVq6nvOkU0wriz19zz71ANuYKJUOGJ 9kA65fmBxUN7m3eB1uka3LJdunM/8s0CJjH7xP14rE2azAU4DWt9sKktvhy8X9gViMXQ YygA== X-Gm-Message-State: AOAM530QASeoGu96eEwkJT1cEXXLyKrQGe5+OKKejc1hE0CLkgaH+246 7TjOG45L0B48CgWEK8rpeGg= X-Google-Smtp-Source: ABdhPJxFzYbjnYjnZJ78kX26WJnZ/6TxgUedb0awo6/p5vE2djx73grvfxVeYe+ttZ4gVsapFV7LAg== X-Received: by 2002:a1c:9dc4:: with SMTP id g187mr13944595wme.19.1596435042131; Sun, 02 Aug 2020 23:10:42 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id 32sm23363811wrn.86.2020.08.02.23.10.40 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 02 Aug 2020 23:10:41 -0700 (PDT) From: Bin Meng To: Rick Chen , Pragnesh Patel , U-Boot Mailing List Cc: Bin Meng Subject: [PATCH 4/6] riscv: sifive/fu540: kconfig: Move FU540 driver related options to the SoC level Date: Sun, 2 Aug 2020 23:09:04 -0700 Message-Id: <1596434946-12630-4-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1596434946-12630-1-git-send-email-bmeng.cn@gmail.com> References: <1596434946-12630-1-git-send-email-bmeng.cn@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.3 at phobos.denx.de X-Virus-Status: Clean From: Bin Meng All FU540 driver related options should be in the SoC level Kconfig. Signed-off-by: Bin Meng Reviewed-by: Rick Chen Reviewed-by: Pragnesh Patel Tested-by: Pragnesh Patel --- arch/riscv/cpu/fu540/Kconfig | 22 ++++++++++++++++++++++ board/sifive/fu540/Kconfig | 22 ---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/arch/riscv/cpu/fu540/Kconfig b/arch/riscv/cpu/fu540/Kconfig index 2dcad8e..53e1963 100644 --- a/arch/riscv/cpu/fu540/Kconfig +++ b/arch/riscv/cpu/fu540/Kconfig @@ -5,6 +5,9 @@ config SIFIVE_FU540 bool select ARCH_EARLY_INIT_R + select SUPPORT_SPL + select RAM + select SPL_RAM if SPL imply CPU imply CPU_RISCV imply RISCV_TIMER @@ -13,6 +16,25 @@ config SIFIVE_FU540 imply SPL_CPU_SUPPORT imply SPL_OPENSBI imply SPL_LOAD_FIT + imply SMP + imply CLK_SIFIVE + imply CLK_SIFIVE_FU540_PRCI + imply SIFIVE_SERIAL + imply MACB + imply MII + imply SPI + imply SPI_SIFIVE + imply MMC + imply MMC_SPI + imply MMC_BROKEN_CD + imply CMD_MMC + imply DM_GPIO + imply SIFIVE_GPIO + imply CMD_GPIO + imply MISC + imply SIFIVE_OTP + imply DM_PWM + imply PWM_SIFIVE if ENV_IS_IN_SPI_FLASH diff --git a/board/sifive/fu540/Kconfig b/board/sifive/fu540/Kconfig index f3217f6..fc28120 100644 --- a/board/sifive/fu540/Kconfig +++ b/board/sifive/fu540/Kconfig @@ -26,10 +26,7 @@ config SPL_OPENSBI_LOAD_ADDR config BOARD_SPECIFIC_OPTIONS # dummy def_bool y select SIFIVE_FU540 - select SUPPORT_SPL select ENV_IS_IN_SPI_FLASH - select RAM - select SPL_RAM if SPL imply CMD_DHCP imply CMD_EXT2 imply CMD_EXT4 @@ -40,34 +37,15 @@ config BOARD_SPECIFIC_OPTIONS # dummy imply CMD_NET imply CMD_PING imply CMD_SF - imply CLK_SIFIVE - imply CLK_SIFIVE_FU540_PRCI imply DOS_PARTITION imply EFI_PARTITION imply IP_DYN imply ISO_PARTITION - imply MACB - imply MII imply NET_RANDOM_ETHADDR imply PHY_LIB imply PHY_MSCC - imply SIFIVE_SERIAL - imply SPI - imply SPI_SIFIVE imply SPI_FLASH imply SPI_FLASH_ISSI - imply MMC - imply MMC_SPI - imply MMC_BROKEN_CD - imply CMD_MMC - imply DM_GPIO - imply SIFIVE_GPIO - imply CMD_GPIO - imply SMP - imply MISC - imply SIFIVE_OTP - imply DM_PWM - imply PWM_SIFIVE imply SYSRESET imply SYSRESET_GPIO From patchwork Mon Aug 3 06:09:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1340141 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=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=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=hoY/C8Z0; 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 4BKnZp07Zhz9sRN for ; Mon, 3 Aug 2020 16:11:29 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B0D828220A; Mon, 3 Aug 2020 08:10:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hoY/C8Z0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0DE81821D3; Mon, 3 Aug 2020 08:10:48 +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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (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 5F76B821AF for ; Mon, 3 Aug 2020 08:10:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-wm1-x341.google.com with SMTP id c19so3097090wmd.1 for ; Sun, 02 Aug 2020 23:10:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7hAruQVUa/KDXWgvHV+xlrQwn15US1ptvNufSUwhju4=; b=hoY/C8Z04x4qgqYbPEa6rhvS6dDxIuOHLcyWKk8hhg+0+57Vd7+QTq1RCCNpfaUyah wU1OUs1rlb+tKVoDt+42iUyNv2h0GS4u9nIW9QgWQzUiBzanLPWEqK7du8qSLqB2rkEE BTBr7J6mq1qhuwTVJvCySUyzekI9A6kkl3qgn2/9WyN0en7Wv+zTVr8oEiM16Yke9EZ3 /DJX1amASQadIQjf7bTTLvpsrKyx5R6FZlaq3pHHk8fcvxn6PPtg7vt76zsbdlIav18C QhAiMM+xwEFa+ylHfC3yxC/hYfwb5/WYUyu5TFG6LbFEWrZjPoAUKQHkgc/tM9HRoKIU i4WA== 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=7hAruQVUa/KDXWgvHV+xlrQwn15US1ptvNufSUwhju4=; b=TA9Z2/fc/ZLB3+2RtGvUvgm2Z+m2lkQYMuFsKpPGYv2tZ+uC9jxqURUItJmBEm8Xw3 cxz1HuVRLCi2/EtiBWXWdoQ+RbMuE1urxD+qgXnanxDpjBRLfNzym5GRP8Tu8OCW2GV1 Sx7NghGxWPuP90Mi6krKc8YQHmt5TFr99/y0YETewRJN0V39SKF4bYI6u9kNtyYekLTt HF+GNu483ROQpx6zEgiZr+ZiENXmtriNtzSWNm5XaLqMDpaQx+enUrOL+gQdQ3/uHSN5 BMGa7p0AbJLOHZ9CZL8oSOTMVJySG30jXevlIGKeqQdHQkmNCbGmghQSFnS12LT0kKYt O7Yg== X-Gm-Message-State: AOAM5328afA6rwhCsKeVkyoa1IYZcr9j4joe8zIY4KwwmQ7NwTBLs3c3 TM6Mig38gMspDMlkjA+bXoU= X-Google-Smtp-Source: ABdhPJw95kyt8FGIk0vk8qphq+/TW0Vpt7SFyuDjpPCI/Dh/DO8AzaAFXmdJSXc5ATS254q7/u71jA== X-Received: by 2002:a1c:6a18:: with SMTP id f24mr12267031wmc.94.1596435044028; Sun, 02 Aug 2020 23:10:44 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id 32sm23363811wrn.86.2020.08.02.23.10.42 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 02 Aug 2020 23:10:43 -0700 (PDT) From: Bin Meng To: Rick Chen , Pragnesh Patel , U-Boot Mailing List Cc: Bin Meng Subject: [PATCH 5/6] riscv: sifive/fu540: Drop NET_RANDOM_ETHADDR Date: Sun, 2 Aug 2020 23:09:05 -0700 Message-Id: <1596434946-12630-5-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1596434946-12630-1-git-send-email-bmeng.cn@gmail.com> References: <1596434946-12630-1-git-send-email-bmeng.cn@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.3 at phobos.denx.de X-Virus-Status: Clean From: Bin Meng This option was enabled during the earlier U-Boot porting time. Now we already have the OTP driver in place and the unique MAC address is read from the OTP, there is no need to turn on this option. Signed-off-by: Bin Meng Reviewed-by: Leo Liang Reviewed-by: Rick Chen Reviewed-by: Pragnesh Patel Tested-by: Pragnesh Patel --- board/sifive/fu540/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/board/sifive/fu540/Kconfig b/board/sifive/fu540/Kconfig index fc28120..e70d1e5 100644 --- a/board/sifive/fu540/Kconfig +++ b/board/sifive/fu540/Kconfig @@ -41,7 +41,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy imply EFI_PARTITION imply IP_DYN imply ISO_PARTITION - imply NET_RANDOM_ETHADDR imply PHY_LIB imply PHY_MSCC imply SPI_FLASH From patchwork Mon Aug 3 06:09:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 1340142 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=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=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=hmcQuAq+; 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 4BKnb00NrJz9sRN for ; Mon, 3 Aug 2020 16:11:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 816108221F; Mon, 3 Aug 2020 08:10:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hmcQuAq+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5A7FB821FD; Mon, 3 Aug 2020 08:10:50 +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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (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 3D3D7821D4 for ; Mon, 3 Aug 2020 08:10:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng.cn@gmail.com Received: by mail-wr1-x443.google.com with SMTP id b6so32993665wrs.11 for ; Sun, 02 Aug 2020 23:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uzqioufkwCgI4VFgtJqGlFcLfyNCGR7NeC6PQTndZIg=; b=hmcQuAq+DUUiFldADw7jG6TVuogGvvKGgqw6layOenYSXoL4JxNII0KZF2o4eRu5u/ zH8nt96mxB+hIxhyXnlBn6tBTfi0vHrIJgm1pUMMHTzbBPcyKTx/nSrVi2gEgrnB3S7u SXfRQJVtYkW8QNynuFbGhelFkmdRATUrA1c9jcZRD7jA0qoIP3qUwEQAkWD/hWFwnPxH jl1skUUwlkJpO3EGeg8ZhJOFX3da0eZ/QnrbRr7gbQU4zNGORIRht2nLglNUUXkrAVov QDEhQPQRHsVtmjihqMjzZiXFbOew6fQK3RZtU3Qis2AC+4ftCUNgXZssdOQihb7hbgAH cubg== 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=uzqioufkwCgI4VFgtJqGlFcLfyNCGR7NeC6PQTndZIg=; b=oQ26ptkZ87wYMPYwAK5prXVb447cAhqhEVbKafk94ssiknK82nWwiZeZPkou96nonS DinW0glkujBafsjpD1Of/m88Me/Jv59IlJ/1ggM0x3NS8BrFaMdEOGYg4OX4c+siRN9b vku7X/AcXwibtHF8a+GOYfs4i+w99ykQQmTTPet7BmuXvJanzYEjo6V8iGUGQlniyPiQ 3tolKtGvictzBzcq9n4AEYPFEswaO6O2O5I78HvB98aL4ycB9kchhck6Vc5WJ7YPOFaL yUA2UkMzd/TTYRoVDk2ht66HmHt2eemzXSA1h3EV3uXg8kdqQG28lQVrbPsj3lEUNn3W UZGA== X-Gm-Message-State: AOAM5319K3jGlTNLcusH1rn+NknMIf8zWnuaBANldzN8WvtIji2Pludd sDoFGEKEFANDdVNj8VtsfmM= X-Google-Smtp-Source: ABdhPJxQxLKlcUfgYt92b1CPJqQIvLjerUQWU+KxwR1t/f0b47Ry9gENref9lvfhh8YwncdIDUE1Cw== X-Received: by 2002:adf:94c5:: with SMTP id 63mr13480542wrr.34.1596435045908; Sun, 02 Aug 2020 23:10:45 -0700 (PDT) Received: from localhost.localdomain (unknown-224-80.windriver.com. [147.11.224.80]) by smtp.gmail.com with ESMTPSA id 32sm23363811wrn.86.2020.08.02.23.10.44 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 02 Aug 2020 23:10:45 -0700 (PDT) From: Bin Meng To: Rick Chen , Pragnesh Patel , U-Boot Mailing List Cc: Bin Meng Subject: [PATCH 6/6] riscv: sifive/fu540: Move SPL related functions to spl.c Date: Sun, 2 Aug 2020 23:09:06 -0700 Message-Id: <1596434946-12630-6-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1596434946-12630-1-git-send-email-bmeng.cn@gmail.com> References: <1596434946-12630-1-git-send-email-bmeng.cn@gmail.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.3 at phobos.denx.de X-Virus-Status: Clean From: Bin Meng It's better to keep all SPL related functions in the same spl.c. Signed-off-by: Bin Meng Reviewed-by: Leo Liang Reviewed-by: Rick Chen Reviewed-by: Pragnesh Patel Tested-by: Pragnesh Patel --- board/sifive/fu540/fu540.c | 33 --------------------------------- board/sifive/fu540/spl.c | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/board/sifive/fu540/fu540.c b/board/sifive/fu540/fu540.c index 57753ba..54e5a4c 100644 --- a/board/sifive/fu540/fu540.c +++ b/board/sifive/fu540/fu540.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -127,35 +126,3 @@ int board_init(void) return 0; } - -#ifdef CONFIG_SPL -#define MODE_SELECT_REG 0x1000 -#define MODE_SELECT_QSPI 0x6 -#define MODE_SELECT_SD 0xb -#define MODE_SELECT_MASK GENMASK(3, 0) - -u32 spl_boot_device(void) -{ - u32 mode_select = readl((void *)MODE_SELECT_REG); - u32 boot_device = mode_select & MODE_SELECT_MASK; - - switch (boot_device) { - case MODE_SELECT_QSPI: - return BOOT_DEVICE_SPI; - case MODE_SELECT_SD: - return BOOT_DEVICE_MMC1; - default: - debug("Unsupported boot device 0x%x but trying MMC1\n", - boot_device); - return BOOT_DEVICE_MMC1; - } -} -#endif - -#ifdef CONFIG_SPL_LOAD_FIT -int board_fit_config_name_match(const char *name) -{ - /* boot using first FIT config */ - return 0; -} -#endif diff --git a/board/sifive/fu540/spl.c b/board/sifive/fu540/spl.c index 135e118..fe27316 100644 --- a/board/sifive/fu540/spl.c +++ b/board/sifive/fu540/spl.c @@ -11,11 +11,17 @@ #include #include #include +#include #include #include #include -#define GEM_PHY_RESET SIFIVE_GENERIC_GPIO_NR(0, 12) +#define GEM_PHY_RESET SIFIVE_GENERIC_GPIO_NR(0, 12) + +#define MODE_SELECT_REG 0x1000 +#define MODE_SELECT_QSPI 0x6 +#define MODE_SELECT_SD 0xb +#define MODE_SELECT_MASK GENMASK(3, 0) int spl_board_init_f(void) { @@ -55,3 +61,28 @@ int spl_board_init_f(void) return 0; } + +u32 spl_boot_device(void) +{ + u32 mode_select = readl((void *)MODE_SELECT_REG); + u32 boot_device = mode_select & MODE_SELECT_MASK; + + switch (boot_device) { + case MODE_SELECT_QSPI: + return BOOT_DEVICE_SPI; + case MODE_SELECT_SD: + return BOOT_DEVICE_MMC1; + default: + debug("Unsupported boot device 0x%x but trying MMC1\n", + boot_device); + return BOOT_DEVICE_MMC1; + } +} + +#ifdef CONFIG_SPL_LOAD_FIT +int board_fit_config_name_match(const char *name) +{ + /* boot using first FIT config */ + return 0; +} +#endif