From patchwork Wed Jul 15 10:08:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1501 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 616FF3F1DD for ; Wed, 15 Jul 2020 12:09:48 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id z187sf2414139pgd.11 for ; Wed, 15 Jul 2020 03:09:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1594807787; cv=pass; d=google.com; s=arc-20160816; b=hBym535S3OfA3LBgbptNSllBNX0TzNGhfqpT2TB9QHnRj+rarzPsZtduMiBcRXIwED OkQ+qGiUto44/mFavO9o8uW9HUOBmWZBEmU6QrQwoDXuElVXUqdlWS7w+b19Cwdp+ghb PXiI/KNzuXNDfnLNDN3t1/IpdoQfQN9DEXSqwdhUxqcEEBnqhu2uFI4PGCs9LTx15Bb4 Gk39I5LqKzuHIU+9JKzH6cUON1/nhP/mmXz1/DlOyVF+2kkeZUfNbg/DDjcV/709EnGD CfcCnAFECDHTxm0Nr2GkDm45MQBz/pIeToLRLj3iFyF8W1kDzqluGqpc0KBaKlr4EYGL 4ewg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=7TL/jK+eYvc0ZWUSvzk7D2UdAYbPOmJ4VJWZDU17XB4=; b=Jzdhil8My3S3K/2bx4bWvOHjIIcKIw6Tyz4A2WWNtIQmjad5JnNz/VuTrpQvYSm6BG u/SaD5JLGWQ3YOhukFD1gT6U1h9wFXWbs5SI4SjA6AeZs5m/iBYmI6zNtYnltUSggRlH /t3EKSgll471Emzh8G77trjL2vv38pS6uyWA1k8Ry6X48LLLLpVHsHSR4aRU2XiAAbWw NnBDoTAqFFhBil8QL6DQpeGU8C91NovjMofj8QN1EwCDM4ysZO7tKFnCg3W0wSBuBIgF yePdwQNI2/5Jvg2CbgEc7yRLPjgz8OfBQz4Ja6Y2MwT+CpSU22O7N4B2oM1B0i45ML34 IJxQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=K6uSPf+G; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=7TL/jK+eYvc0ZWUSvzk7D2UdAYbPOmJ4VJWZDU17XB4=; b=fexzoDo/gF88vwg97d0BPvQNUyVRjrvt3QCXC1yKUoAkJ2JjyR6OA0MPJWCElZy4W+ kxdp30CoILy/wnr2yIzrh4KNVIEr9jx3uTqItViOxUsdo5DH6+eLDBd0AM5w/pg1sBPw NqWZjmwK2vX0ATlmux81bsDoJeAoPNww/6oJo= 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:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=7TL/jK+eYvc0ZWUSvzk7D2UdAYbPOmJ4VJWZDU17XB4=; b=Ev581nQ7xLeWvR2ddQkKruIGBjV0AINvYDFBNLQeNAlva6EvZylqpfHFNrgAn+ioVQ hKi0+1yy/DQnt3lJxyR/WiKYDcwmtJTqXKKmTtvkA3KQ6T6FChnvysmGMlrltDJhQcQv 786vrnyTHwPzInS/CDoV7bC6JK0AZetTtArh9oYHRpbUa79xhYP/jZFHWu4NXV1FBKwo ud/K1hSOyahh7VV0TZ1J+COTE6HhQ4NSODYoJje9MZ2xHDlJI0zkCguj33WxrIbNvbtJ kzCOmPV24M1uUR6BV4DPrOK2aVFgRHH0q35nVs5BBwjTUiAnhNzpBA4Mtrsn59nmVzwo UqLA== X-Gm-Message-State: AOAM531s028YHX702qrvFqxUMtsqp59sra2mgu6C2/UO6aV/3ismqh2J sMN8yR3Fsc3ppdIsU6LOtghOFJ8g X-Google-Smtp-Source: ABdhPJxjxmqMXMQDiMUiWzxXTy0QpD688x7q1tjkuNdmAPWKVSpProuzd0o/dQ17vDaBjEkorXDKZA== X-Received: by 2002:a17:90a:71c1:: with SMTP id m1mr9488568pjs.22.1594807787237; Wed, 15 Jul 2020 03:09:47 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:52ca:: with SMTP id z10ls710046pgp.10.gmail; Wed, 15 Jul 2020 03:09:46 -0700 (PDT) X-Received: by 2002:a63:5b05:: with SMTP id p5mr7273292pgb.143.1594807786727; Wed, 15 Jul 2020 03:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594807786; cv=none; d=google.com; s=arc-20160816; b=piBYNCiRtpMVVbR0p9SyrZQtj0PvOi7Wqmh55x+cduAK+MAzr/zcAEvy6+gothuWS8 pjBstkSbf5dMAg/Y/JB7Tq85be4n+MQ+YSZWyMfo0raa338kTAu8I7WBdGsj4i9Ji2JE +tstwHNOmaNrBdyZQLqI3J+90TCd8f60TctZeH6h0kV+nj6HXzdBGeZYsCuJWRukTjfh wrc6jem6p8cXUMyY9/qIotfj5BWx1ol/6oC/Vg+KwbI0IEClKKDR4DUNqP0Wm4FX6pM8 0uJ27GH3Hpsg/bEwKhdbdB9ymFRSF3IiRbHVjOZpgTmw2WwVurCD0UrtGYdjR4sN9vIK BcDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=+vT6tXg3RzsaVu0o6uM5H17ZBy115+jPvGnVuu9Rp7M=; b=KMz7JYppUfwyNEhnZa/fziozFuWryuhuzJI9H1OAS8sITIAXOVZaKNLQF166fxuO63 k+01DgDCAq+gM4ii+UX3qTfy5c7mhNFE1y/qR3Z5LB+1z/PPT3840HHjN6IVqphJp+G8 CcxE9Dsl+ukApoTfyxuwoy9tTDYADfo8Se1zkFlVkATb+GxBUF4vDnqu3J0F2QqipyCZ SFSRf+uSR7utmWIA9n9itSD+LDN9gLFLVCimYrzyYuJg3yYxEgBn61lYRwoH4wj7DD/d fIzfeEO/pair6ziqYKShSF+XDYfwXZVaHu/5Fcvo9MegrQhu2TJgFE5xYcWxVM6NXJyG JUzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=K6uSPf+G; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id o3sor2006648pfu.54.2020.07.15.03.09.46 for (Google Transport Security); Wed, 15 Jul 2020 03:09:46 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a62:1610:: with SMTP id 16mr8144865pfw.113.1594807786440; Wed, 15 Jul 2020 03:09:46 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:9887:56a8:c916:cfdb]) by smtp.gmail.com with ESMTPSA id p127sm1658577pfb.17.2020.07.15.03.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 03:09:45 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Bin Meng Subject: [PATCH v5 1/6] sifive: fu540: Add runtime boot mode detection Date: Wed, 15 Jul 2020 15:38:58 +0530 Message-Id: <20200715100903.161363-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200715100903.161363-1-jagan@amarulasolutions.com> References: <20200715100903.161363-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=K6uSPf+G; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add support to detect boot mode at runtime for SiFive FU540 boards. Signed-off-by: Jagan Teki Reviewed-by: Bin Meng Tested-by: Bin Meng --- Changes for v5: - rebase on master board/sifive/fu540/fu540.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/board/sifive/fu540/fu540.c b/board/sifive/fu540/fu540.c index 27ff52f903..57753ba50b 100644 --- a/board/sifive/fu540/fu540.c +++ b/board/sifive/fu540/fu540.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -128,14 +129,26 @@ int board_init(void) } #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) { -#ifdef CONFIG_SPL_MMC_SUPPORT - return BOOT_DEVICE_MMC1; -#else - puts("Unknown boot device\n"); - hang(); -#endif + 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 From patchwork Wed Jul 15 10:08:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1502 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id C1D6E3F1DD for ; Wed, 15 Jul 2020 12:09:57 +0200 (CEST) Received: by mail-pj1-f72.google.com with SMTP id q71sf2398841pjc.7 for ; Wed, 15 Jul 2020 03:09:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1594807796; cv=pass; d=google.com; s=arc-20160816; b=EqVtLkwXHNsaE6a7EJWQ3l5l0Qbwy1J0FOV3XvHE1480UjnQQyXzhEJVRz3h4rtfoT XltrFhtHpyg1JgUTAAOslwhWnBqJG5AxT1nYnMrWjWpMqBK00EPglHici/KzkoHoAGXK rE9oidSscZnpRZCXoa2yuPihI9sEESa1WbLSraTq3BLYWIYZ9LdYEioR+cg1klD3nKbe jjRMMMWaNdh8/mtx6D7H2jLx5kvXduAmEpz2vD8Yd20lHTJcS9rIyicgyXUJCWg7SXew m2y+3VED+0eXTjY+aIEhOpGfyW57mlNzUL7/BR2/oTLx0kohDhJROpQXeEcZvD+RjFEN 2DXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=v8kGj80mJe/qvzSo7iHvfFGIWsPD/KRG8oxKEANoMOE=; b=DnuGbEoXg0qI8+2gxK3Nag3sRw2szI1RtxOqf8t40GKeHUTObTXsOIZE5qHNbRvC9l 7z24719odsBV4/n41fTO21+Ba3jkxDldwgkbKur1EopohbgnOyRnzdklZQ6SH1xLZD37 uAobs7mrsnmKLKPtOUgU0ns6WtMXd+BQdmAapi+PC3DKLSg74WMUKQ5CBbibZ3nAmojn 6r5etpNc1TIdUCcuyzZcOY86xrHBw+4oEBZDIlBuAR5UQkU75hsBha0/s4AFt+9kpiWh hGx0OhMV15Z5j68FmxdI12kmc7rBMCeMa1wpSIpZlOhngYNGknvXY3gHdzBz+Z/kUoba St6g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=r4rCpK19; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=v8kGj80mJe/qvzSo7iHvfFGIWsPD/KRG8oxKEANoMOE=; b=PgjgEeVz3NqRiJLhetuc2/ufw/dGHe2D1/kT2Z4ZUQiCdA29tQPyL2bjig5EKGvW+7 oRSxO4RWCFeOhAdKaOCEotR6pNjwvf7HYIjLiJIvKRKcOVaprfSTLpySRpvs7d4nA93S LOiodK+qGgOrpbHwIIigOl5ItUT2vaTOOWnSY= 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:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=v8kGj80mJe/qvzSo7iHvfFGIWsPD/KRG8oxKEANoMOE=; b=SLIyKFwO4hH8bgAA7qE6K0gf0vL0RzMYRwVXl4l7ZwpHEsUk6p+unS1kY/y2+x3HoM bBktYyYZP1Da8SrC0CsCjMDdXVz5MceUYCth8Fx+yxmY8TjS44llMRKUY1b0B1A+hK2i qNJJDU7oT76Taueqld2ZdixJsRXO85BPeynIrn1eR9DbzztprDg7L4rnE27d8PBGtHad vlm3GOx119N4EXgG8mmSCluTt+bRu+wDWRdW+f9XLOTYZVI7MjNQOfVwx4XOjxLeT94U Os9PG65Zbb0AvrNrB/NSgghirpBCTKFoqnCaaQ0OrNaBzkE9MeS3B2VoDBHmZAWQuy10 z0CA== X-Gm-Message-State: AOAM532Nft8TAAfnkGvOpIcSCr7B+0xGMiMQvNcjbmDA9eQIoBYMaMpD 3ewt1VFD+gs15tbKBGYJOEXvh1wQ X-Google-Smtp-Source: ABdhPJxJURZRelWf1CQIOsnjGx2bFCSyvNuwV8M8uOqQeOQIgx8pFWYt3mG2bk+4L79MrQICn4E1Yw== X-Received: by 2002:a63:5623:: with SMTP id k35mr7826887pgb.325.1594807796100; Wed, 15 Jul 2020 03:09:56 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:730d:: with SMTP id o13ls722293pgc.1.gmail; Wed, 15 Jul 2020 03:09:55 -0700 (PDT) X-Received: by 2002:a05:6a00:15c7:: with SMTP id o7mr7911107pfu.51.1594807795497; Wed, 15 Jul 2020 03:09:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594807795; cv=none; d=google.com; s=arc-20160816; b=udORAyIFwIvwINv1r1SyaBC3N/sVTg2O3lDyh1rXaNqr5oQjEwJ0ByqQEJ53d+xSjM nbPEeM9+c6Wj46fRE0tgUR+iR0RusuZY2UkvxKWv0FEtfDBh2ST3Qsd2XFUZRHcfiZUm wcreqyFks92T/wPMQ718O5TavgN8q+T+3CENuQEM3WRl0kTSnZ0dTuf5Cp3W9Xh65DsJ fXf1etuMLS5DHJtVYUbjDDfrZF3ofxGPKUt1s8MdxPjPn2pKbGloQ3UZ+Dmuhq/j4HLD TxbPyxq7jTdcI5QbpmKAwaquqoMjmh0FOxmau4Fw7DdvNRWK48RBy/SSA6Zw2q9X//p/ k5og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Ysdit2OgVsRcFAop2cRPXYvJt6B+pLgu58WnYXV3fZU=; b=nQyslDBVCegp6N6xafjNFDdKagdzA7jBKargu49R+dXX3TR/0EL+0cCJNkqnzEP24C 1MxjjZj8snnez6vA0ytVNPzvLPEIlYC/7m3S+tndlATfT+mAiLsl1rmQJ1HIEU18TdYK vntaJYlKstaa19cS3/f5s+XPKb/Uh2dCx2/WJYkh3EHPi62jh5bR3Gb6N9eNVKQJb//O /g+opX4zNei6p4Iz6pGPMJd4es9aMKcK6V5PizwzOghOQpNI46mC2CqLAP6iKjR4K6Uq RiV13b6hjKGaab7r47Y7lenqyRX6yCCzGfGuWTkI7tmZgg00RpWZSHer8bLsMSvay6Y5 ZKVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=r4rCpK19; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id ay8sor1662374pjb.36.2020.07.15.03.09.55 for (Google Transport Security); Wed, 15 Jul 2020 03:09:55 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:90b:4c8b:: with SMTP id my11mr9405086pjb.153.1594807795203; Wed, 15 Jul 2020 03:09:55 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:9887:56a8:c916:cfdb]) by smtp.gmail.com with ESMTPSA id p127sm1658577pfb.17.2020.07.15.03.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 03:09:54 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Bin Meng Subject: [PATCH v5 2/6] sifive: fu540: Add Booting from SPI Date: Wed, 15 Jul 2020 15:38:59 +0530 Message-Id: <20200715100903.161363-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200715100903.161363-1-jagan@amarulasolutions.com> References: <20200715100903.161363-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=r4rCpK19; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add booting from SPI for SiFive Unleashed board. Signed-off-by: Jagan Teki Reviewed-by: Bin Meng Tested-by: Bin Meng --- Changes for v5: - rebase on master .../dts/hifive-unleashed-a00-u-boot.dtsi | 12 ++++++ configs/sifive_fu540_defconfig | 4 ++ doc/board/sifive/fu540.rst | 41 +++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi index e037150520..7d838bf9de 100644 --- a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi +++ b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi @@ -16,6 +16,10 @@ spi2 = &qspi2; }; + config { + u-boot,spl-payload-offset = <0x105000>; /* loader2 @1044KB */ + }; + hfclk { u-boot,dm-spl; }; @@ -26,6 +30,14 @@ }; +&qspi0 { + u-boot,dm-spl; + + flash@0 { + u-boot,dm-spl; + }; +}; + &qspi2 { mmc@0 { u-boot,dm-spl; diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig index 9e00a56ce6..06e17860c6 100644 --- a/configs/sifive_fu540_defconfig +++ b/configs/sifive_fu540_defconfig @@ -6,6 +6,7 @@ CONFIG_SPL_DM_SPI=y CONFIG_SPL_MMC_SUPPORT=y CONFIG_NR_DRAM_BANKS=1 CONFIG_SPL=y +CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI_SUPPORT=y CONFIG_TARGET_SIFIVE_FU540=y CONFIG_ARCH_RV64I=y @@ -16,8 +17,11 @@ CONFIG_MISC_INIT_R=y CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y CONFIG_SPL_SEPARATE_BSS=y +CONFIG_SPL_DM_SPI_FLASH=y +CONFIG_SPL_SPI_LOAD=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00" CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SPL_CLK=y CONFIG_DM_MTD=y diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst index 739eefa669..1ce9ab14f5 100644 --- a/doc/board/sifive/fu540.rst +++ b/doc/board/sifive/fu540.rst @@ -533,3 +533,44 @@ Sample boot log from HiFive Unleashed board type: 0fc63daf-8483-4772-8e79-3d69d8477de4 type: linux guid: 9faa81b6-39b1-4418-af5e-89c48f29c20d + +Booting from SPI +---------------- + +Use Building steps from "Booting from MMC using U-Boot SPL" section. + +Partition the SPI in Linux via mtdblock. (Require to boot the board in +SD boot mode by enabling MTD block in Linux) + +Use prebuilt image from here [1], which support to partition the SPI flash. + +.. code-block:: none + + # sgdisk --clear \ + > --set-alignment=2 \ + > --new=1:40:2087 --change-name=1:loader1 --typecode=1:5B193300-FC78-40CD-8002-E86C45580B47 \ + > --new=2:2088:10279 --change-name=2:loader2 --typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \ + > --new=3:10536:65494 --change-name=3:rootfs --typecode=3:0FC63DAF-8483-4772-8E79-3D69D8477DE4 \ + > /dev/mtdblock0 + +Program the SPI (Require to boot the board in SD boot mode) + +Execute below steps on U-Boot proper, + +.. code-block:: none + + tftpboot $kernel_addr_r u-boot-spl.bin + sf erase 0x5000 $filesize + sf write $kernel_addr_r 0x5000 $filesize + + tftpboot $kernel_addr_r u-boot.itb + sf erase 0x105000 $filesize + sf write $kernel_addr_r 0x105000 $filesize + +Power off the board + +Change DIP switches MSEL[3:0] are set to 0110 + +Power up the board. + +[1] https://github.com/amarula/bsp-sifive From patchwork Wed Jul 15 10:09:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1503 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4F7223F1DD for ; Wed, 15 Jul 2020 12:10:14 +0200 (CEST) Received: by mail-il1-f199.google.com with SMTP id z16sf1048353ill.7 for ; Wed, 15 Jul 2020 03:10:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1594807812; cv=pass; d=google.com; s=arc-20160816; b=T9c1G3rufQxDmFaRth5bNsFkJhisIqa8jPMSJIk/a8idIsFk6rV9Nw2sZoO0wa5sZK PiFWRjAA1kt6kXC4zN2ohJ9vtTCqbiz583xcJIpBID1gopm2QG68/1lAFHrrYwDu7bbp 7mrUGpXNACcyttNBmp5LtwrwS/+On4XIctzv9S0Y1P5a5GtdnbghSKgX7Ugc/LG7PUZh YD34YbtsJkcUoYPJ6AbN4DNRDpnH5IqMh5g0dy8BaUgoe73emheCnD9gTe7aBzc4tLPZ qy/oUMONCnlCLzubSHIU35wbHZOclcORDCs0IAfwlzqIRTAnXFcIgSXhwOlfvbsJ2Lr4 Q7NA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pSznNLk6aFGQwuoIQbNnffFVK9Z7EghKCjt9SKk7SPk=; b=IYvPe7a93WzVbmXXh/9ZPjTP7+9uqOIwNOuYpeSTdR0ykTjCI09a1PZDDDWsMd5umP TvXYKGQBR7/YRb98Sz8SzWncSLw+nwien4Eihhzo9cCr3ayNfr+Qv9rjySHrudlLyW4C /i39KOEwI0N6gjbyd0QB0rYDt6KRksEZt53kLxHeDPuTMpCCwFVnkCoUiAto5UI0dAHI B97v4ljSFJWvn5HDH0/g2ny3gLRaskohvVLCVpsLul1dR2RQump6EjtYlyuoBY58zpPi jQeNKexzOVYtnxrlSx28TBWAC/3gP9NJ/vqTsTiWIaKOWWy/AtLuLdrI0BhpeIsP/mHJ St5Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BSPU6GS2; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=pSznNLk6aFGQwuoIQbNnffFVK9Z7EghKCjt9SKk7SPk=; b=Tjth0gkeVJbC8hTEr/y/342gcY4MQYxO9OhzUzffvobnZaILwUYwBLD1BrC03zHbRQ oh+eA8EHwm6FaD7AsMsDaTrDeUayILCVvLIdM41hMN6rD30hrQJxxg+rnvYLyRoLHWPz BMptqx7FhmdoTXYk2N7oCnthwWr2GqMeAxDbE= 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:mime-version:content-transfer-encoding:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=pSznNLk6aFGQwuoIQbNnffFVK9Z7EghKCjt9SKk7SPk=; b=uQCEH0t5NPWpRGnyVEe9YV/HPO9l3nUFmo3tOJwa/vVY1ZEbjOXkULcnCjQjEztkOG tixvINnl4fk9f6q/lr0OmbZ2T6Wj3L08OkzRyRP45pobMKs6b0jdNPVjenakmu3J2scr XEOlsoVJkjsq3M4cyhJ7300xl8+wXPERu5d+jd3VG0V+y8/r5VQuZA0Is8IiWbgfgpaK uxxw7Co19ZYWP8qO7Hy9gdDQM3Yj+XK5kwueE4sI77pspep/on5TLFieIg9lcZjvvEUI QLBTRluqaAG0pn2QGPA+wf1Nl5woMOiVjDQCM8Dlab6bcpUhPZ2xNO88yFu1/Y/vNpSN Cq1A== X-Gm-Message-State: AOAM531ERquA11dUYpcCxAOEgZTWT5A8+W0TOHW4nfw6v1qRWCfSnd1q Q1k3Uys+XW/ynDJ4Ip2fOGIFyqbY X-Google-Smtp-Source: ABdhPJyDYnOjmUa6AgtKDLgdW8kJeYCsG7i+BwaqCKfljYAABdCw0VZKY4hpNP4LfcFuR5e5wKJ0gQ== X-Received: by 2002:a6b:e20b:: with SMTP id z11mr9156159ioc.2.1594807812597; Wed, 15 Jul 2020 03:10:12 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a92:bb4d:: with SMTP id w74ls459131ili.6.gmail; Wed, 15 Jul 2020 03:10:12 -0700 (PDT) X-Received: by 2002:a92:10a:: with SMTP id 10mr8807882ilb.172.1594807812192; Wed, 15 Jul 2020 03:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594807812; cv=none; d=google.com; s=arc-20160816; b=CpegVn4ltT7fpB/x0HpK2H4+yxwZCxDq58L8aZs7QDaRhrVfK3vDg6vYZ0KM2VGSsU WpS+9kfRcaeSRNC2BMZ+ZtqCjLi0VgfBIIRRlmIYibcmmEcSJy7cEGaFlEeAHFMTbzse nnvfPpM9WfCDczXmdTeg3eCQ1hc60MAM6SSHwbu4bPfmR3ZfVuLQeC8pcPpBI0lrbSg7 FLGCyKrp32qAmVxadS0hCFKOPXMh2k+N4Cht8p/L2HUEOnzKHY4OKBGiNT9EuXjOkaLP dEI55JQMZ71T+DcdmmyX0cRYE6eR1Cip8+m/wqlA+H5Pzdk9IqY2Ug/SNzAUH3szPKio DMaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=5eok8F2gRmJRoDkqTrKQg1taynuH1PJnLgNCZ5WnPOw=; b=vUNmllZqSpgIPwQnxB+n0dFtTs/LBiz/gjhn1MzqJkfT2uDTJaO3bkVjfj6IKAaF5j iW6N2sm2qKQ45nHxoSZvq1hzNjukD9vBJFea8dd0h6OEX3VNR3ekRruhBNSMvWL9U/Bt VXODslScyHjz2dTgYz3AOxK1enHw5kCkqIyPHgx/D4dbby+LANRXUVRUk7QH7FKSsnHo RzbEWtSotXOWSP9TDCiVpwQHmviJmOAZEWCs8EpkGkldQERrNF7fIB17KyzlkhHgH9i4 XI6NKhdEkiNaXzNOO3TuIv682YpfwRCS/LHI5VBQNkHCoLikR0LJUlfmMw/btFa+nHop 79rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BSPU6GS2; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id m188sor1497372iof.86.2020.07.15.03.10.12 for (Google Transport Security); Wed, 15 Jul 2020 03:10:12 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:90a:8c01:: with SMTP id a1mr8976369pjo.97.1594807811820; Wed, 15 Jul 2020 03:10:11 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:9887:56a8:c916:cfdb]) by smtp.gmail.com with ESMTPSA id p127sm1658577pfb.17.2020.07.15.03.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 03:10:11 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Bin Meng Subject: [PATCH v5 3/6] env: Enable SPI flash env for SiFive FU540 Date: Wed, 15 Jul 2020 15:39:00 +0530 Message-Id: <20200715100903.161363-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200715100903.161363-1-jagan@amarulasolutions.com> References: <20200715100903.161363-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BSPU6GS2; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , SPI flash device on HiFive Unleashed has 32MiB Size. This patch adds SPI flash environment after U-Boot proper partition with a size of 128KiB. SPI flash partition layout(32MiB): 0 - 34 : reserved for GPT header 35 - 39 : unused 40 - 2087 : loader1 (SPL, FSBL) 2088 - 10279 : loader2 (U-Boot proper, U-Boot) 10280 - 10535 : environment 10536 - 65494 : rootfs 65528 - 65536 : distro script Note: the loader1 must start from 40th sector even though there are 6 free sectors prior since 40th sector is nearest flash sector boundary.  Signed-off-by: Jagan Teki Reviewed-by: Bin Meng Tested-by: Bin Meng --- Changes for v5: - rebase on master arch/riscv/cpu/fu540/Kconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/riscv/cpu/fu540/Kconfig b/arch/riscv/cpu/fu540/Kconfig index e9302e87c0..2dcad8e27f 100644 --- a/arch/riscv/cpu/fu540/Kconfig +++ b/arch/riscv/cpu/fu540/Kconfig @@ -13,3 +13,16 @@ config SIFIVE_FU540 imply SPL_CPU_SUPPORT imply SPL_OPENSBI imply SPL_LOAD_FIT + +if ENV_IS_IN_SPI_FLASH + +config ENV_OFFSET + default 0x505000 + +config ENV_SIZE + default 0x20000 + +config ENV_SECT_SIZE + default 0x10000 + +endif # ENV_IS_IN_SPI_FLASH From patchwork Wed Jul 15 10:09:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1504 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id B875B3F1DD for ; Wed, 15 Jul 2020 12:10:26 +0200 (CEST) Received: by mail-pj1-f72.google.com with SMTP id a19sf2332253pjq.9 for ; Wed, 15 Jul 2020 03:10:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1594807825; cv=pass; d=google.com; s=arc-20160816; b=rXDM1suUex2JTpaxv9dvcCx8D20kxBt+gsS0sO5AtLERCIMjJ5NqwEiXsLJ96/+dDt ZmkK+62AwO0w2Vep4mkBszg4DEc5HYNv5eruKVijlfs/q47nXqU4SDgikYWr+9rnjt0b I4EtS8PcKDQ8AB0Ya1S6P7xUBdB3L4eZZ0Oz8m5AspyyjReW3eQ87vKLIGiM3fiJVX/v iOLa0Bh4Nhxe/cjgZEdDJVlvnctIlTIqpUwE20xMyi63UF6HWgVEu49VAV3IF1sRVCys NzRnNHJpldpwFACuHWJkHEr0xi/DCVsLYUhEbOpVi7lKaxlM+wTtZyj5EcyurEmlC3aV g1MQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Mi+clBAoZga06oyWVsdo6ohNrvHwidNpDWVfZOcD1nA=; b=hPh9MnMGo6FiHHRGUqEni2Oe7zZ2qTRs0Z8x2xoD4XmMIPQs5UpySoTIiDzJsITbOR dHS0n4s6FDm443VBQhysQEqKtRT5KN0xdHs26WsJzd3wq8KJOSFJhgOiS4mk7RSqm1EK oubvWjbldiTypFOlmJBwTBIq2SrpyfkOZg3ppj+AQTMtB4wIgidNvuKhIrj5glWD39Un ELg+MSi0Tg9buPKHUPOtIxOSfMa8dTl3xvu1MNQHEyOG364e5dA5RfePkQ3aLOZFeeuH 9c08N/iBB0THG67AJSIJn5aZT13w9V2ciAwZ/24YQ8CY9g2WQbOV7zavGpv3dGENNa0y REnw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=YyKsD6Ne; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Mi+clBAoZga06oyWVsdo6ohNrvHwidNpDWVfZOcD1nA=; b=AeH86clYwmkldNlUDCe9ufHAJnL2mMDO7WBSPtBu0+PvgPIYwW/QFaFkbUVVtLuWl7 HVfIgWk3c5nvfstnaENjDnIayZVXr5rQTYUsKpUKkpSVaTVAtmEJ54QQavnE5AVbDmRK mvibaAY3nrtgL01xWQhCYJTzR+38/UTWwq7i0= 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:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=Mi+clBAoZga06oyWVsdo6ohNrvHwidNpDWVfZOcD1nA=; b=WRN9RmQRrBGPfnoEaW4R2ykZin0egsOEfk6il8qPo9m+eVcoZSwtl0n9aWEapU/NkX 7eGajrEAkueCWxheJpK3pwDk6IWTSr/6O6pKgjHwkIZ1dJW2sRgPbYsy+LdemJRw7WCZ 5Zpc4ULRghBUp9GoN7Nua0w4bD3/1Y0OB4JXr+znbKEW7wBMa8OIpDmdRciJ0Of/ds0S 3ryXacHXOpfOjgZfSseg0NmCBSulbruuuqE+vj1EpY6NSgeZz9byglPsOwN0g7wfxxMP AbX6sMkQrujS/9ZkTrI4VZRo7tS56wp+u8h2mKRSIpkvMWgLdal2NimbAYGOh+ZeFVWP MGwA== X-Gm-Message-State: AOAM533gTKciXOTRfKFizuSZ6LMrLNdut/UGh2VRCX+7HFIk7q86dt9x ByV8GY5S+tIw7zwhoNBZWJMTkrbf X-Google-Smtp-Source: ABdhPJwAmb9CyJGM+e9IDjt/R48gc2sRZI450OehyxRKu7FvVEtBuugjIOyrcrg2q4SlI/sJyfPi4Q== X-Received: by 2002:a17:90b:3750:: with SMTP id ne16mr9316135pjb.6.1594807825604; Wed, 15 Jul 2020 03:10:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:52ca:: with SMTP id z10ls710729pgp.10.gmail; Wed, 15 Jul 2020 03:10:25 -0700 (PDT) X-Received: by 2002:a65:6846:: with SMTP id q6mr6955270pgt.397.1594807825153; Wed, 15 Jul 2020 03:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594807825; cv=none; d=google.com; s=arc-20160816; b=vCvbOXtTtOxClyerAnkyVpEKO9NWEUwOqezoyJLmwKcIp9FISipgKnK7t0knDwZIY7 YEkVLg4h2p7OVfF9OHLbelB6+OKUWCBpc3KQpf6VswzT1UvMnCks8AOXG/bhkyRNGdhk HToGxD2u8KaqI/XCUMX6HvEzclNVGz2ERioX17iFpFPI/V1Gxo+eyaMuRo8Yr6rpsoFF 7Ht2BqYj443WIieJxA8D9bwKnYa5eHpx2O4wBD9IofW7Jh7ZTqw568qdf+AaZZ585sUb Kxyl0PB/DRqJYn79miYLA9jnCx0AFVym0pUVt/K8roOMkyKwC3Grbf67Y5L8iRe9Cg75 RCMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=fax5Sj6JL/vLwQRqAE9060jxWRK1c17Ef48egUf6kCc=; b=XQS0rIVkKGFLWEv5G2XysXZ0yhnirZcCELn/WQ0+EPA0xk/S9WoI5z6pN9skbnnJWb fU/IbNXITCp+GC8pY7v+LX5jYDGOKYkVjT92Soc0JjfieqXJ8z8krLA5HhMd3TfWD/vY w63S8bZgkdtklV95ikpY6aLypd18fW1skqk0oljIVR95pdnQkrjinA/g0JanrNp/73hd jNHOmDppNRKMgAmOsSWSXGH/bNZ3Orm7u1v2TYrGIzMQZxSP2m7MQ0MHELWhMCBI52+I j2Sn1eyU0DNfn6z4iE59vgbqkyjAMyBb+k7qu8pUyESs40iq5Qe+89lnOP5dUFbJtI2H Rfyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=YyKsD6Ne; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id gk8sor1708729pjb.8.2020.07.15.03.10.25 for (Google Transport Security); Wed, 15 Jul 2020 03:10:25 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:90a:6acb:: with SMTP id b11mr9315482pjm.71.1594807824913; Wed, 15 Jul 2020 03:10:24 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:9887:56a8:c916:cfdb]) by smtp.gmail.com with ESMTPSA id p127sm1658577pfb.17.2020.07.15.03.10.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 03:10:23 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Bin Meng Subject: [PATCH v5 4/6] sifive: fu540: Mark the default env as SPI flash Date: Wed, 15 Jul 2020 15:39:01 +0530 Message-Id: <20200715100903.161363-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200715100903.161363-1-jagan@amarulasolutions.com> References: <20200715100903.161363-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=YyKsD6Ne; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Mark the default U-Boot environment as SPI flash since this is an on board flash device. Reviewed-by: Bin Meng Signed-off-by: Jagan Teki Reviewed-by: Bin Meng Tested-by: Bin Meng --- Changes for v5: - rebase on master board/sifive/fu540/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/board/sifive/fu540/Kconfig b/board/sifive/fu540/Kconfig index 86193d7668..e1ba629e37 100644 --- a/board/sifive/fu540/Kconfig +++ b/board/sifive/fu540/Kconfig @@ -27,6 +27,7 @@ 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 From patchwork Wed Jul 15 10:09:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1505 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AEAB43F1DD for ; Wed, 15 Jul 2020 12:10:36 +0200 (CEST) Received: by mail-io1-f72.google.com with SMTP id l1sf1078272ioh.18 for ; Wed, 15 Jul 2020 03:10:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1594807835; cv=pass; d=google.com; s=arc-20160816; b=U8IKw1GSL5hhFODwJv9gbi2RZaOQaDdyrMbZfCoS/unP2LYVN3fjSyi5D9skWyiYqH zOUabf1k7dqzW1ZBHGRJ0JUwk3bjTawtk4lHFU4PA3So9wcG0OPCnGvxZ2jUWysd4rJH TNWf5RF0U5nk5ssAHo4gxf/agYfa6/7gDAoiTwaMSTGetB0GwogqQmjBg2cN1zf9BttX 5H22Oku8WjPsVPNEbvEBIgLZVBU18YECs+ZT8XbvPO1J/RsvblsQf2mwLbwrCHo30Qby GLHekxYfqdIfqzmqJEWRP6VYY1jGfbbXqrMz/PiNulD7RMjVYhhCSEi85yKQb7mjS69g tdJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=D6UH1anE8PzvP4Ko65Up5WF0AJ35ADFpKlkXPVRvUBM=; b=uDXAm+nvlrVGbh8fx3C6aXCJjjG3A/n7Ysys1Zvtl9dlip3fIUjVO7DwqW+9dV8L41 1Nh0A7noex7PhXKfDJy9s1vYQZSxTQby0WEAtQGvG2EvEdvTKJaWagF4t3YanTVtES4y A0ZHUtC872CGklKHGDxl1Z+ahHk7jCcdLCIoGGwAz4Fy2ChQxCp/VVjiXeNOZgoR3SY+ nemT20B4QA4kjCB8e2HQ01AOUBWZcq5ZDzQ6ewnihBTs7dPmcITCUgFX1LT3ODR2IGVZ RUu0bUnebAj2CffPUpx2lbf+P7EUY4K5U97sDSCwrmB4KH9UbpjYL0Zvl1jYKa44nhE3 HL5w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Dp4Uog4I; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=D6UH1anE8PzvP4Ko65Up5WF0AJ35ADFpKlkXPVRvUBM=; b=Qz/ynlmAsjhuQUR4lKXmVnrh/W2j0vm+O3ZTpaGXv0wSusOuCuWFrgcQ+5Q+iJiwHf PHOkq8MZrgeJbmzM9unBCSdtVsHJBiTjXY3MOzOeHR3H2V/GuvChyQUv8iuciYzIHzy+ LI6zhSC2Y1j97Mj+KzHuYHKCJaP/ENucb7OKk= 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:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=D6UH1anE8PzvP4Ko65Up5WF0AJ35ADFpKlkXPVRvUBM=; b=MzCwTsv/hLiqnHbE32EqkyHMig/+HqgKj1wJhgc2dfStOgaBVzNuDVtBA7aZRPydpC 9XNRzQuEaykL84fIXwIj6maBVTIgcnYoc7PsjylNt63qrQcD5CzQK1m9Hh+K3wSvEtuT GyuHMpkb3NZxLxIepxTrqMz7CiMSV677FjoAH71WD/1Smz/I6cjj4xuyyqB2C7h+eC/U ZB0LIXY+C95Vmv4Qby1t+m/3zRq2HhsMfSxHF5pA9PeFG3mX6a/oidY+O10v5NxsJ2mP Vluhvy98jw/seh6VUiTa4Q/aS/id23fsc6Nw4ann6nCIsmCMIA37XH5htnPWp+MQ7lbO V6Dg== X-Gm-Message-State: AOAM530fr5PULLj2vGEyXZBABr+S3/ytUvlGy5oewP3KIoytCpDcsE1P R6ijQTXWte4NJSfrTIj9/s9Yl+A2 X-Google-Smtp-Source: ABdhPJyTQDDGgOONGOBu8Ilhwj+QpXSCQyYtTPYljePMhPTOCpcuDYsH1ahJ47GvA0VoaMx6kRXPlg== X-Received: by 2002:a02:c785:: with SMTP id n5mr10981861jao.75.1594807835391; Wed, 15 Jul 2020 03:10:35 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a5e:da02:: with SMTP id x2ls314715ioj.3.gmail; Wed, 15 Jul 2020 03:10:35 -0700 (PDT) X-Received: by 2002:a6b:ba03:: with SMTP id k3mr9267351iof.72.1594807834955; Wed, 15 Jul 2020 03:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594807834; cv=none; d=google.com; s=arc-20160816; b=UTzi52K8itqBHj72GbGHubHOh20x8KAj2Z1j/upu+RMnuKZ0hESwz6OHxW65yfpYe1 XHBaYvNqdCxbBDIPmKYeROIXkNBaoQyvvypb0sl6/xmY7qhDZEDKLUt7r7+OvQLq0wm+ 5oKmVH3ywFlPtUu74XmsA40NAsmTCC7LFDojCN9EWXpApspCtKl69i8b9zMUTC8boQ5d RIoYeOJPvvSvGaSQhndLEzrqTkJO7jp4AaOED9eaBZgUw3U9yqDa2KZmEROssRu4P10D xVfUc+3ItiIDESx71YdvEiI+kfMnwmueYuzHziCDRjXjZp/WhHSbtSeLlRZDUvoU504y AU1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=i47e+VswuZEiFW+hgamjwuJI7N9t6GVaZGVi7Z9gDk4=; b=ixABrYiml8+gtGO1esSuXs/OivSuZA2rzYxhEUpUQIwfxzdqcPOvAFAe/wVOgDsig6 oEOBhnyxjQyW2Zy8W4VvRIuZUCB/OpUDEHee541c7G7pjPpf9L6Lm6cnHgemwUD0EYBJ nF2412pJrSmU7QRwYJN+jf8Bp25q7CPevHHNiN7sVn33xvj1GAkUWdNUnZbsxreVZ0oT mHUlhRPhfhHVt8DiSUREs1QHDYrfGYdyNvGsuP+YDbhdSLmoGFDDYFRPR/j9rmhEkWGQ sPjSelSYVR0wY2iCVBoIgyNj2B+H9fNmUFBj8YNuOIB1VyAdVpWnVJuWemhvR5XM11aB Nssg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Dp4Uog4I; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id k12sor1006840ilg.141.2020.07.15.03.10.34 for (Google Transport Security); Wed, 15 Jul 2020 03:10:34 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:8d86:: with SMTP id v6mr7883943plo.200.1594807834622; Wed, 15 Jul 2020 03:10:34 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:9887:56a8:c916:cfdb]) by smtp.gmail.com with ESMTPSA id p127sm1658577pfb.17.2020.07.15.03.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 03:10:33 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Bin Meng Subject: [PATCH v5 5/6] sifive: fu540: Add boot flash script offset, size Date: Wed, 15 Jul 2020 15:39:02 +0530 Message-Id: <20200715100903.161363-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200715100903.161363-1-jagan@amarulasolutions.com> References: <20200715100903.161363-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Dp4Uog4I; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , HiFive-Unleashed-A00 has SPI flash with 32MiB size. So, let's use the script offset at the end of 4K. This way it cannot overlap any offsets being used by software components in flash layout. So, SF distrocmd will pick the script at desired script address and run. Signed-off-by: Jagan Teki Reviewed-by: Bin Meng --- Changes for v5: - rebase on master include/configs/sifive-fu540.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/configs/sifive-fu540.h b/include/configs/sifive-fu540.h index 72c841eb9b..68fda14d76 100644 --- a/include/configs/sifive-fu540.h +++ b/include/configs/sifive-fu540.h @@ -62,6 +62,8 @@ "kernel_addr_r=0x84000000\0" \ "fdt_addr_r=0x88000000\0" \ "scriptaddr=0x88100000\0" \ + "script_offset_f=0x1fff000\0" \ + "script_size_f=0x1000\0" \ "pxefile_addr_r=0x88200000\0" \ "ramdisk_addr_r=0x88300000\0" \ "type_guid_gpt_loader1=" TYPE_GUID_LOADER1 "\0" \ From patchwork Wed Jul 15 10:09:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1506 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5B8133F1DD for ; Wed, 15 Jul 2020 12:10:49 +0200 (CEST) Received: by mail-pl1-f197.google.com with SMTP id u16sf2069946plq.21 for ; Wed, 15 Jul 2020 03:10:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1594807848; cv=pass; d=google.com; s=arc-20160816; b=s4Isc3O5BuV6rFJioIvHKYk5fq9x75SwZVgWVgZOW3lbHfkgAtJ3ZP6ctubP8WTORN 4gIjX3xvh4OTI1agcN8NqcINsXTXTe/jlyEDFWMSPBECpECSEMxoCWGPI3LfA9aRZ2ij brRCz8alxJkMmJf4ElTMzoX2Ifuka62WmSEX5HMEgjldCWvbdyEpnPzYFm/lEJA/0dDJ fG9700l9j2Xr0l+FHEY99zgsWVK/QWyeglxfU87SxIqfaFZ5h/IQUys+D8G7BLY/DIcz Nb+/TgvIJGaBtU1feAHlms6YDCKBAa11ZON0KUQ7JBodDoltu/qzGw7TTbqlZWhW1tiC kNKg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=HiaA4n/ZNj0FtkSP/THrPgCoAOagLRL3KFKZ5U+0vak=; b=GwDBvilrN48t+/V4Sh492B5TsKssByyE3WV/AdDRB+BkL+nLlD+ZyyXQCH7CUQvtxK 3g5548pwQ7HCj3sIMPDsRyEe1BtMvWMYhRIUPDGmzv1Seln7O32hWm0iTUA9CpFN+Y00 gx60bpVkKciZOCZiDqyxo60LlWJ1qyCcQEmpgnJFJ3+J5B+XDh+HKi70spRjoXLNLoFT BGOIgz6cnRZOKluK3QJJdhgo6UIe58SyRJ5kS3LG7H2LPfpKhbF0xSiigmRcLqzTF6x8 G8itn3HRYwpWrUFH8YbNzXESdJBILP5kgpGhEFAl2Up/iIhtGTiG9jzmK9f/aA1wZmy9 7vDQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ndioc2jR; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=HiaA4n/ZNj0FtkSP/THrPgCoAOagLRL3KFKZ5U+0vak=; b=OynzkPK9whqbWe8f6ygia2uTYo7PdUrHYF5lasJ+oYMgJB09WMO/KwADIIxiMnrx1O 1LIL5qm5zkH4cXFJBskV8ZSfNTqzUDVi+HeZ+Iv0ybeixT4oZdRPVU//Cr12jMyQD5d/ cPvTiQsJNzQFCqtC/BwkoJ8Bm2UzfuDzAHaOY= 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:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=HiaA4n/ZNj0FtkSP/THrPgCoAOagLRL3KFKZ5U+0vak=; b=a4PWLM+mw0MYpP1K7pTmo6libB/ZsuDUYN5mR3PzXJy4AxQvHZhJvi4v/MtSX1Ya7j y7bG/7afxd5y9x9dKKQ7FoiZiw7bnuNACNx4oSqdSkDWowHBQfQR5JJPzOZXuWFkWUre Qui6NNm6LH3BNyfIJJkVYrMXWTr3P+Dk9GHuc4ZC5rv5oQ0huzEn4oA3qxfeCw6VQ5Ex 7CYWCgmOHPDYzAHj2TSyiAkHi6LCwf2kQLiuqMbBqYN6G9aItxbWU2nDu/85pzNokkDM Bo28+pfi81HDqjGaw9ZCU36MJRJz1PJRVYsUk5VVk3K82AW21fBpzdT2k9rGzqqBNPdl l/Zg== X-Gm-Message-State: AOAM531KqvZXOvdJIyFjRZXrgIUbuoZYwebwJcV0ktZ+gUvp8dnDJXNo mnd2O+Y/tUEy9ca7FMQCPhbVhy6C X-Google-Smtp-Source: ABdhPJzifm8y56UoU8s5rA9iY8jAIwcjnR6Mc4xqiJ2r+FrtInVfHb3PcFQSYAQDrDyH8SHzO59b9Q== X-Received: by 2002:a65:6706:: with SMTP id u6mr7434527pgf.69.1594807847826; Wed, 15 Jul 2020 03:10:47 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:6891:: with SMTP id e17ls721313pgt.3.gmail; Wed, 15 Jul 2020 03:10:47 -0700 (PDT) X-Received: by 2002:a63:8f08:: with SMTP id n8mr7154640pgd.9.1594807847299; Wed, 15 Jul 2020 03:10:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594807847; cv=none; d=google.com; s=arc-20160816; b=rdMaEUMWcD7OGpyRn0WHDN8sPrxJ2ne6Ah5CAWdXDoCtWIg77iJWM6Qp4ALqaWTq/G FuBK7RS5BdUh2PaJ7M+rrMFLmytgcyYI9D2WE8iWLCy5YGqQxsUoDwdDTgbJ8TV5tGUW qV0tcZ5DuMcqeOfylPfhKy5w1qPMq4Nm2x93lXB7coEFMKhzv7eqyb5DliYLXq9qkvbr GXdGqhoC3DLgm9d3SeUD2nTcfYqVGEh2WpcvVDX5eDsKzvk/2lGyKj2jKz4qo1Fs0X8O tPj1iSFPg0yV0Iq1uMbBygq87ZqOsVN+l7KP0yz4Iw5IhKN2heRCk+qgkdrxHYy1qgi/ vx/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=FgNdabMkvemqpyH+/OeXBbZvLL/r0x+J6aGJf5F0f3M=; b=o3qU1uaxx766+vBGEvy5Qv0Zw/+OOF+QlN0j0hnYO87o0cIMVE7DSWbWAYGW4Ul9ZR Rsv5dG8VtAFWpPP2xreuv5HlYp+V/fOTIDW6NlaCwduIZka1SFQDTGXYm5QNwNbRVoK5 TJN6kGOCvC3ctEkgcc9wHDfhti3uAlA66t/gjeiE4RPL+HFxYF6kDpoPhuTJoUMIQmvD gi76GRK5ZieuCAPxvF+DmlBI3sH071NqINwyPfyu6QHMcPP//pc2ZITmSETvv/Qbih9l T5UDjkql5Eb40WK7e+++aFizXRP4EEdXj6XDfHYw5mpUXgJ3g3ks5wRYU5EkCo0XFvEj ADOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ndioc2jR; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id l187sor1986623pge.81.2020.07.15.03.10.47 for (Google Transport Security); Wed, 15 Jul 2020 03:10:47 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:5509:: with SMTP id j9mr7323111pgb.195.1594807846982; Wed, 15 Jul 2020 03:10:46 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:9887:56a8:c916:cfdb]) by smtp.gmail.com with ESMTPSA id p127sm1658577pfb.17.2020.07.15.03.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 03:10:46 -0700 (PDT) From: Jagan Teki To: Rick Chen , Atish Patra , Palmer Dabbelt , Bin Meng , Paul Walmsley , Anup Patel , Sagar Kadam Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki , Bin Meng Subject: [PATCH v5 6/6] sifive: fu540: Enable SF distro bootcmd Date: Wed, 15 Jul 2020 15:39:03 +0530 Message-Id: <20200715100903.161363-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200715100903.161363-1-jagan@amarulasolutions.com> References: <20200715100903.161363-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ndioc2jR; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Enable SPI flash(SF) distro boot command in Sifive FU540. This distro boot will read the boot script at specific location at the flash and start sourcing the same. Included the SF device at the last of the target devices list since all the rest of the devices on the list have more possibility to boot the distribution due to the size of the SPI flash is concern. Signed-off-by: Jagan Teki Reviewed-by: Bin Meng --- Changes for v5: - rebase on master include/configs/sifive-fu540.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/configs/sifive-fu540.h b/include/configs/sifive-fu540.h index 68fda14d76..f21411a701 100644 --- a/include/configs/sifive-fu540.h +++ b/include/configs/sifive-fu540.h @@ -43,9 +43,11 @@ #ifndef CONFIG_SPL_BUILD #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 0) \ + func(SF, sf, 0) \ func(DHCP, dhcp, na) #include +#include #define TYPE_GUID_LOADER1 "5B193300-FC78-40CD-8002-E86C45580B47" #define TYPE_GUID_LOADER2 "2E54B353-1271-4842-806F-E436D6AF6985" @@ -70,7 +72,8 @@ "type_guid_gpt_loader2=" TYPE_GUID_LOADER2 "\0" \ "type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \ "partitions=" PARTS_DEFAULT "\0" \ - BOOTENV + BOOTENV \ + BOOTENV_SF #define CONFIG_PREBOOT \ "setenv fdt_addr ${fdtcontroladdr};" \