From patchwork Thu Jun 4 20:39:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1333 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 0E6D83F086 for ; Thu, 4 Jun 2020 22:40:41 +0200 (CEST) Received: by mail-pl1-f199.google.com with SMTP id m4sf5468937pll.11 for ; Thu, 04 Jun 2020 13:40:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1591303240; cv=pass; d=google.com; s=arc-20160816; b=eG3Qb9VPPQkaHy4uagOljVt9n6MIw7B57xa4dipMuhvDKUnEz51wyeYee0TdB3kQOx jchpPTxX8e20PSbv1T8ZvkJqfp748lqxiTBLleLkg+g2V8j25/JtaETVbz0sIeK2SfYZ nm1zpkEioQhE8gqtJXoiqk+hUcnFIWsxOZYxYcIsCz/wI53LX8Oa+vy8r7FLmShKMe5E uQ5EsDARTFgGYS1TmSjIpH3fe8d6bVZt+TcNK+NCH509doYt3zryseI36Gp5aS5U5W4y 5edTdhvbSu6ToCjRKwqNIqIcDxiigCoaAyroGukTs547JkBUM4jOnNuwW5GrW4s6OFG1 KZsg== 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=as+UUu8xPRmBQ1pS07EmAzsJh7kBBdU3iMaLyjs/FdA=; b=TMWKjD7gKi/X2QSszEufqvyPwnc5Hh7s9XEhIPvvTmeg46Q/2Fed2mF394HTMm6QUC 3Gbeibb2wyG95APgi96r5dHULu/WJA0yPLDhWv+Q85casM4a3lqqh6hTbBG6KWugN3FC asQHxt/DCHccMhV9IC8yElY3zqRVcLcAFcgSOk1JZ5ZyFIv4hTi6W12I0wwxpOyR2Jbc bUJOlnW8aZGNC6mItwA7tb0dltBIgV7mLuLF0R9V9atg2kojgURjyafe1I+0GYXzAl1L uhNPK6pJL40YkOpxgtzlz4v4ZVSQ7jj/Q2qxJyIGdlpzKJEqK7JXS0vNK7HNe6vWrsXC YQNA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=go4ikuMi; 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=as+UUu8xPRmBQ1pS07EmAzsJh7kBBdU3iMaLyjs/FdA=; b=KZLf/SJnWosdZzZWbj3MBKGK8uLuwkCl2XdyGbMoYIIe3eVtRZ6gR1M48H3AG4JDF2 K+t726l90WlHJ4nzhl8JD5SeHj08YNDm9iXeUummg8cQTD20ccI0KiPIG4VSaId7ZUnI MU39tqLh09g8P1BD95b9pJzuA1QphU9emZsyQ= 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=as+UUu8xPRmBQ1pS07EmAzsJh7kBBdU3iMaLyjs/FdA=; b=HPIKsl1GJ2QVNCboCjlcylmDvXlzS2R7XRBj2lPaE3BG+psRSelJZDCWW/0+Mcal6/ +FdPl1TmgLCki6MIKieXt6QNe1GKx2qEbjOoxuh123w9BIj4vpSnjwUanfyzJiQHGBHh nouxKQqqGZpCoQX41AKXppr278Xv2G3D5qJR0b8rr4RaUHW/GUl+ltiU98H7hXxUc+2v d1kqbIccEhnsEuWWPVxvRJkPrsgMa86UtYfSdOm8tudzrLg3/GF3XUgxN3aG7xApOvYz i/9FXPCScVn9RSWof2aT3XcIEt0C1yuwfpP9VmWeQ7UCeRQ+M9DYJHSiOEBD8V+OWSII Z88A== X-Gm-Message-State: AOAM532xZEdV7GUNlEoqa3FzALZFZRj1JpGplC2/JqOVJ5HsvPGpmpWe BcRB+R6+PczAstPIT1p7A56ifSg1 X-Google-Smtp-Source: ABdhPJwl5opl0/j6iZ4yBeAtHdeG5+TzSImBCitFTVINdy0Rm4+wsDFQX1EaAuUjmRswMaRB5Kh0vw== X-Received: by 2002:a17:90a:df98:: with SMTP id p24mr8039272pjv.135.1591303239839; Thu, 04 Jun 2020 13:40:39 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:668c:: with SMTP id b12ls1909317pgw.10.gmail; Thu, 04 Jun 2020 13:40:39 -0700 (PDT) X-Received: by 2002:a63:f14a:: with SMTP id o10mr6359772pgk.216.1591303239385; Thu, 04 Jun 2020 13:40:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591303239; cv=none; d=google.com; s=arc-20160816; b=PIaWpuSvMUC0FaK1rUaQSVkNaUOPeJ618786wWglPSdoaprKaNjowCAYhd8OKWllp5 5Oy36cfgMglWYiszl+pLPmf+86kXGDPaUZWNIWHOC8hXp5A7AEYREmO850qjzXxFie4n gRSFaGEgYP3HZSNwoXwFb7lJj8c+7bD17Fcunu7ijjUS9UAIWFcG9xmwjFG39Q2CBHxx APFdBrUJA1iauPC4KLNyfdgpzTSCMFndBuAOtn8KQBJft1litguuEgZyIKrS3ntOACZX iTQs+syD6z9d48goSojb8n3igEZPGuSpJoU2DjPcsqaqwgTceUGXqXcxtfhhgg3e3TIU irWw== 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=qBs9NXhmKyxWNitQSUfRNDBZ0b9I2KYjGOHdfUHu5/c=; b=n7Yr0SvWBf14uB0Ebi0RqBT+uQZTPA62lKRL0S1vQhc3uUKpGSiTLgRGVKKy+MTgYX D4DU5UWrC+/FJI37tyApOZ+Cp2T9wdUPMKPI/Cv/LjFRq6pVNAciWncvayqq4uahjHqp G6hXUeas405/eMxV4sL+MSJSJiMH+FuyEV7tpKVpp2TSpAH1gNLXzf2sDs0kHcAKFM3J 5RzfC37846EhLrHROWgvQ2wdsAnK9WYFm7hI0JLPfefnZ7y12NtVRfZDk/AEUcgrZG+c 6u9d/KMoGyBMxBzhdzWOrsPzGvohA/7yCstpPPXoNf6kuJN9MDIvh0D4YGNDYTRi9GOJ 9LWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=go4ikuMi; 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 s19sor4143532plq.37.2020.06.04.13.40.39 for (Google Transport Security); Thu, 04 Jun 2020 13:40:39 -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:bd95:: with SMTP id q21mr6777176pls.238.1591303238954; Thu, 04 Jun 2020 13:40:38 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:41f4:94a8:1af3:a574]) by smtp.gmail.com with ESMTPSA id cm13sm6463775pjb.5.2020.06.04.13.40.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 13:40:38 -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 Subject: [PATCH v3 1/6] sifive: fu540: Add runtime boot mode detection Date: Fri, 5 Jun 2020 02:09:44 +0530 Message-Id: <20200604203949.550290-2-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604203949.550290-1-jagan@amarulasolutions.com> References: <20200604203949.550290-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=go4ikuMi; 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 v3: - new patch 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 fa705dea71..a35b79ace3 100644 --- a/board/sifive/fu540/fu540.c +++ b/board/sifive/fu540/fu540.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -120,14 +121,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 Thu Jun 4 20:39:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1334 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 1C4D53F086 for ; Thu, 4 Jun 2020 22:40:53 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id h137sf5654458pfe.18 for ; Thu, 04 Jun 2020 13:40:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1591303251; cv=pass; d=google.com; s=arc-20160816; b=Bln+zJsnNMaNBYf8QlpfQNgzA5lft+d41I8yFQJOrqBEMboQKRDfjMONH2fh1PEAMN kHIhN/rizDBIa/CgGggvcHdkVy3caUIPMuMBrbLgTsTAVSwYAO8OlJKwd6rjcCW01RXX 6Se5d9N4VKHDj6q1ofkPAfd04NgiZRFCWjjp70EkfAEsLXSvZZlkGdoqpZvW8/rKVKoy EuLQkDxj/x+1qCHale2L4bFQ2hryNcQOnUkAfn0wqFTOBXo3Rh/eM4IIIxKkpUgp7gXe ZUzcgahOZADM1Mk17s3lgurjMR8cmqRqmNez7q8bh14bAIx/uPXDvT13my/6ta+aPOs7 FfYQ== 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=eDjlUaM5J6ln60lXH7VEF/2awo5Ru5xATon20y8vgYc=; b=XcCDYDT4thy2cTW6aPaCzJRzfU9/sGG54aV6Pyou7OI2y4CpaiJHsuLJKpxIlSln7H 3prj1ATIUj2IC/BxtwuqvYbkpX7PEG3ZZZ41xh3LLYXl5Zqd1VQhZCDfkAhiucPS+c8j X0xDRx5Nl2xKKEh6OsyLg6/woHTQ0x8MFD6YqXDBEiU9xt0MXvd0kCFgNdYg3a4+V5g+ TJezKEUK6SGvbYfXwguElXOBcpgSOTRwFMnFEq6SA08iVRakYJ5LoxoK4OHGKJ+oD+QL +iT1NcWShV2xWdhVhGg+71VVhc3pxQCpUj749XhDC2CdI0/5qJNzH5AjRNMbJeE2bryf BghA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=LMpUhMpN; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 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=eDjlUaM5J6ln60lXH7VEF/2awo5Ru5xATon20y8vgYc=; b=WeHeNRFpRG+QRBPCaRbZxBDN6ksI7aApdtNIcA8f9//gQI/BaFLCpCG+IBctBOWNJg m3tOOAfwXrKtYB6uJKXnP4r75CtwVbv5Z0J4BgPRrjqkOqha9qPhOgtstAE5kQmMFQwQ t8SLGDjPZ8PoUbKAsupDgYLtwwVAj+jbaoCYg= 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=eDjlUaM5J6ln60lXH7VEF/2awo5Ru5xATon20y8vgYc=; b=XDhl1tXdR+EDBiV5hmXmpTIMCaWjK9tJkI/ZqgOUNW9X4NExesWH9QdE79m9oI11h2 QfolByrGyCnP7qlA+nMJUOYBOn1ZdcVqn3tIFzhnZi0yqnzflXDtzdmB5WVy0m5o0q9R wiDwMDQLyoJWAzq63R+F4ceuen2JVdrbON9Epc0JEheL8rDDXbRA24kZjMF9q9DEpq/6 4kH8QeoJL+U2mt4YdomVxIiVeaxhJsnMENhoui6NXzRnl/NHIWPuJ8z636+v7WYewErc MZdpSFb//9cAQPWNRSlxL5HeH/tWic0/YdG33U8u2Iuqd5BW80lXEBYBOXFLh/qpq7Jy YwEw== X-Gm-Message-State: AOAM530reKb51VzlVOXoGIkHRHKuXoLtfQTe/B2Cp8JkcMNloYClDYuL cAGpJYyscv+fmt7lxK3JMWuwlpl/ X-Google-Smtp-Source: ABdhPJxVCjvkojksNHP/s54JlXyD8wagkpo65R25Smt65ax+K28NfBRTtVdKXsOJJBe3aGHhwITw4A== X-Received: by 2002:a17:902:b682:: with SMTP id c2mr6440928pls.313.1591303251348; Thu, 04 Jun 2020 13:40:51 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:b702:: with SMTP id d2ls2536687pls.6.gmail; Thu, 04 Jun 2020 13:40:51 -0700 (PDT) X-Received: by 2002:a17:902:7c96:: with SMTP id y22mr6199428pll.293.1591303250835; Thu, 04 Jun 2020 13:40:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591303250; cv=none; d=google.com; s=arc-20160816; b=FUWkuZbOarPoReYGB2qHMdE8CgJTdZomvMdR4fDqt51JNAb6a3ogB7xM6ZQCHbOD0i 8901plGvW90GtCUjzeY/l92R7iVP225GXPG7OkW8vvmBYRQmHo9azLOjl+IgRwWGZdp9 OBVhh9UYkQin0E4PECS4lzmCf1w4Jn/6LcjQntkbzd7ZzygIxYF/W1gSP/MsuqnY/GVc u4SdAWdDpGo/SZJLr3FbQrwPdDdWyb5G69XwI+P5har/HvqBq0bgFo0nVz6Ywrn0zZAZ keF73seDlEuYB4pbLC9nm1W0RvZo6K3Y5dijsHNZOike8LpqErikblbv556eigIZKmxE Optg== 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=i1WUqe4LCCLsnKRCsVFitSemnpVj2WAMcsw8SmwLXzM=; b=NL+kbPQTQ0S/qe3vAtpak28ry1GCG2asD40ske3obp99fq6RCh9pA37FOqbL2xT9wq GZB82Vf0n3xGQab+8FivmIscAWSnJdYAXdFtrn0yUF4BIKlXsW90fnRWA9l1dXFSw4HT MFLaQWzwlrGIMtxhHIAAMJXHoigxWjw2ixNT7oaHdQAnU6i5KLVCLuQn1B5l9/soQzpU nblZfFmc7ESfHuZJcXFtIdNkMY84uQZ748ewpNFkOpuVvD/cp5SCUfVNLGwvfaAy3GKP VzjegF82GmELyhx1VhQumSlGceJkl2oqtL73z4+8cGEPKywP6sInE0fxBxlQ6Y6nPhEJ oUEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=LMpUhMpN; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id j16sor7549372pff.13.2020.06.04.13.40.50 for (Google Transport Security); Thu, 04 Jun 2020 13:40:50 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:6a00:801:: with SMTP id m1mr6151883pfk.200.1591303250517; Thu, 04 Jun 2020 13:40:50 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:41f4:94a8:1af3:a574]) by smtp.gmail.com with ESMTPSA id cm13sm6463775pjb.5.2020.06.04.13.40.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 13:40:49 -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 Subject: [PATCH v3 2/6] sifive: fu540: Add Booting from SPI Date: Fri, 5 Jun 2020 02:09:45 +0530 Message-Id: <20200604203949.550290-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604203949.550290-1-jagan@amarulasolutions.com> References: <20200604203949.550290-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=LMpUhMpN; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.41 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 v3: - updated based on master arch/riscv/cpu/fu540/Kconfig | 2 + .../dts/hifive-unleashed-a00-u-boot.dtsi | 12 ++++++ configs/sifive_fu540_defconfig | 4 ++ doc/board/sifive/fu540.rst | 41 +++++++++++++++++++ 4 files changed, 59 insertions(+) diff --git a/arch/riscv/cpu/fu540/Kconfig b/arch/riscv/cpu/fu540/Kconfig index e9302e87c0..7a813a9ac8 100644 --- a/arch/riscv/cpu/fu540/Kconfig +++ b/arch/riscv/cpu/fu540/Kconfig @@ -5,6 +5,8 @@ config SIFIVE_FU540 bool select ARCH_EARLY_INIT_R + imply BOARD + imply BOARD_FU540 imply CPU imply CPU_RISCV imply RISCV_TIMER diff --git a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi index 303806454b..4b2b242deb 100644 --- a/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi +++ b/arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi @@ -12,6 +12,10 @@ spi2 = &qspi2; }; + config { + u-boot,spl-payload-offset = <0x105000>; /* loader2 @1044KB */ + }; + hfclk { u-boot,dm-spl; }; @@ -22,6 +26,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 8d412f8d6a..551d4b04a5 100644 --- a/configs/sifive_fu540_defconfig +++ b/configs/sifive_fu540_defconfig @@ -2,9 +2,11 @@ CONFIG_RISCV=y CONFIG_SPL_GPIO_SUPPORT=y CONFIG_SYS_MALLOC_F_LEN=0x3000 CONFIG_ENV_SIZE=0x20000 +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 @@ -15,9 +17,11 @@ CONFIG_MISC_INIT_R=y CONFIG_DISPLAY_CPUINFO=y CONFIG_DISPLAY_BOARDINFO=y CONFIG_SPL_SEPARATE_BSS=y +CONFIG_SPL_SPI_LOAD=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_OF_BOARD_FIXUP=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 f7c2c9f5bd..7a4b208288 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 Thu Jun 4 20:39:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1335 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 39F663F086 for ; Thu, 4 Jun 2020 22:41:07 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id y16sf5670168pfp.11 for ; Thu, 04 Jun 2020 13:41:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1591303266; cv=pass; d=google.com; s=arc-20160816; b=ByaMHQto/XGf7kuby5uU9n1cg86TPpte6E5ZgCXgxW/pkUh2IRmT6iMVJ/S6DPffIG 7Pg4F0+dyFjiWpOzvXb32t3xrVA5/wsZhCbhmsZ2DN3Lq9CPkxitcy85itwbJfTGOhkO eQDuyldxdiCSYLNCQsWZ0pas1qeBXzaWpPWd9pNHeIG6kYmgLUBHRy9AQgDwYGy1tYbV hPHMPp+g2y3/jApvc6EmDiq6DHocEhaEhm6ZMjsDol/ljYeeWA5Fajs7bvmxCXlzwZ4o 8EwoBcydlvJctFFXYp4pptPw36QMuKDHPsdod2lyl5cWhJwi8Fd/6BC1ImG2/ytvSzgR 2NzA== 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=0tlILXoE7VX6W8aohFVeq7/AJ8Vh8D33eun2PW80VJk=; b=rspew44rGtMmNWEY4jobH6+QKnmUtWVKKyGpoUrFeWTXv9lsj/cZlpKKYeVnUeFG39 sOMgY9RD0jFjuAOE9lzhgi20FvuRA/3PBDLl1/90KnZMiak0QdZNYjTh+8hkNE3TvMBU 1Cf1JPVNxDkXSZKIL1KfKsWRdMUNlghXTTRGUuEHYOLZYRQ6GVKcHiQ3Tu9WtCVT2Vzs PVkoWOu+Jq28LHg1Xwv3JTY4Yv3kctRVKxxLLK/0OFKOW+Sgk3EDVwFtAr+piGJ0KGuq DsTHFNwE5l0ieWSKgOOZagXPKdL2vtelXOs4VRsYSBimdbl5KAsls0IkS3bcq/vXjnxh NRvg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ysr0Pcch; 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=0tlILXoE7VX6W8aohFVeq7/AJ8Vh8D33eun2PW80VJk=; b=S1QUx8nNcafHS/ICMzWVpZEz7DbQiAHUl8X41OAJumBHG0uXS+F53lGOcYlKYRgrF6 Usjg2NtQpsQwkktVj5w5MXjKcyyBS1mrE+3IjSSUpyIjSqMm4R/3YdBiGGKVLKbJRpHh hLkGbEoI1lcLxHBvYRbaHj46DCB4Hcob/+TGA= 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=0tlILXoE7VX6W8aohFVeq7/AJ8Vh8D33eun2PW80VJk=; b=Wh4EGQZpzXyPWlAEMckWiI0w/auFtZ2jhSJF54KbjWF2W615VrSQjfEAVDJGUTO7TK 68mz5QJ+NuCT1qN2kXbo8eedSYl39pZSntSTdHBVBsudHo3yTpxAunw/lBtlSugBfc/L 89FLfMQMRjBaY5sdAb405vAzDq1otJYrtmNLZEHvmV+5e0uVxx2Cx28Os231VfYU4ACh lu4Bo/zvY+PdNUbU9JgVJxoHTfbdz3XuNyksXKfBcanEVNyZ3ZimhkJTD3U1cb8S6CKc B6Id7hXKsFufaJsu45Hdzhsu+hjR16uvct3gk+4V7wsMrCTWlk+PIloD5JTQPb+hjHuZ efVw== X-Gm-Message-State: AOAM5333OTVG0jEx3bYwMfO1pgXFE8yQk/oJUBaElibB8UjJaLEeJD5L zmxvpnNS4Su2Z+lVtyIwaM9urFWR X-Google-Smtp-Source: ABdhPJxnCnYxRbN3CKa+xTHNN+HnH1Y6au80OgyehqodNh4c5Bw6hzGMNATyKjGLu7m8mIbbYJwdXg== X-Received: by 2002:a17:902:7602:: with SMTP id k2mr6043403pll.296.1591303265990; Thu, 04 Jun 2020 13:41:05 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:b598:: with SMTP id a24ls1882879pls.9.gmail; Thu, 04 Jun 2020 13:41:05 -0700 (PDT) X-Received: by 2002:a17:90a:dc16:: with SMTP id i22mr8058390pjv.84.1591303265476; Thu, 04 Jun 2020 13:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591303265; cv=none; d=google.com; s=arc-20160816; b=HoJi4yCopORw/abw9KO3VfAR2mmMTP8D/3raAHr/FB6iDGzptRqX+D55+9GJromMOK Ppd6W4rKZCNC8J3sF8i88WWzDNiZU+YvzwuHUdBWnkuhFivpp8AOPytgYS4GJmMpsy5I 2KxC6wciBFFIpSXDK/EPHbs4hJ6XJmTsYKf0hm7YXwjK2KWw5nWpvhxNzkZKmZx6KHns ECqUbDMDZHCI5Ce14Uj0CoXgZg/nyjx7+pnzyP6cpB0QhKtbEmOA5FdJ7kViTjIpEgDJ cbnoTcJ0KDXLt5vWGBQacFkVmN+Imbjp1D0gLMvDadA0L/noDW0N7vUQ12TC28gn9fpn u40w== 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=a9o5ZaLm/LQ/+QUX2rsR9AKYn8V2YuIP7u2jTnhqps0=; b=DoGUbW4MtwVXnKPQXIOqTV3tQffqDRh2JEVoVNTKmWSDMHgUwMrQ1WfBzs5xAiF5qV eWEjz3GJ36l/KoBhQemqMiXPLsI6itHLCi40jsPyhccT4ULegcVIIl6Ddf2DU8s+6HYn OeZwiVIKEN0lns1qQs8jy1CE7/02KqrmbGPzL0bDxb4YkOSjKgz6B6zmZZpQYhBg0Asn j0gMcLtE/fOXCqA9Rk3Lnj2eDV3oGkMJokMU7A8Jn87HwwlXTYH6Jc0R4rwusIs11POa a1Ov5ZBHhykLxZYwS6wZVMEb+Gxwecft+Mtx2NtH+BaAHkOHEBOrTgaYqEfisdjB36dj ER+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ysr0Pcch; 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 62sor5456822pfd.99.2020.06.04.13.41.05 for (Google Transport Security); Thu, 04 Jun 2020 13:41:05 -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:a65:67d0:: with SMTP id b16mr5940625pgs.91.1591303265134; Thu, 04 Jun 2020 13:41:05 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:41f4:94a8:1af3:a574]) by smtp.gmail.com with ESMTPSA id cm13sm6463775pjb.5.2020.06.04.13.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 13:41:04 -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 Subject: [PATCH v3 3/6] env: Enable SPI flash env for SiFive FU540 Date: Fri, 5 Jun 2020 02:09:46 +0530 Message-Id: <20200604203949.550290-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604203949.550290-1-jagan@amarulasolutions.com> References: <20200604203949.550290-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=Ysr0Pcch; 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 add 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 v3: - fixed build issues 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 7a813a9ac8..15698eaf65 100644 --- a/arch/riscv/cpu/fu540/Kconfig +++ b/arch/riscv/cpu/fu540/Kconfig @@ -15,3 +15,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 Thu Jun 4 20:39:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1336 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 54EAF3F086 for ; Thu, 4 Jun 2020 22:41:16 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id n22sf5907204pgd.18 for ; Thu, 04 Jun 2020 13:41:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1591303275; cv=pass; d=google.com; s=arc-20160816; b=ewrjHBGdwsXfiCVhsSAvLc+7IH8LUpKoVjp1/UPJGfitLOplRzkchC/qzfWX+eU/gI akYHan8kFgexvuDcjE1cfD69NEzYzb9GkG/SY7ra9J23/M8BfStdBkfXP24BFTu+tMZ7 p8YJNcSaiemoM87jGwrPPi8nkrdMNOS9yVhFfgd9ec5dTBMenLTTcgEj9ghLlPFzU1Wq nzuwF5tpPUKJmJS4m9U+dZPtiwGzewfIh6gJsH2jFVwm79uSbKtN8J6NkjsrgtVFfpce xfp0kf6U7hm1BQ2LApuThgeMtoASLhND2w8VdcahWXg5uvb/rRnq0pQmLWJXss9bSLLL RD+g== 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=qiLdWWq8rQgKPrZmIJx4Pls4RyxJ5DRtfLBH/vMVXCY=; b=V08SSO21i5uAKL7pioot3RZXud2SHnmQqhoU4fivpe8Mt4fhfRcRXQyUV0B+TmZT2w 1xYEHiNfcWePrUlXWQMIBTu9bTNgW7F9OxsUaklOcK8Obww/BCfRxdubpsq3IFwMNIN/ qYHb0RKdpUbUvplDot8JjBvlynV3BQp6BfeTCNY2nrzI6ThrIGPpLAj9kBlHQ/jXx686 niXr7swWWLxZ6fZu4+7tuHlVbe20jNKnIumEZDOTgVRVhXdXf1MpQbxtvOF4vBR7fikk msB2yLXGwdM893wd34CKK5sK9lmLun7IiXWwB7mAWlCEyoaoBTb40qiK4jLLaiYbo0UI ng+w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=OOJUhjGS; 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=qiLdWWq8rQgKPrZmIJx4Pls4RyxJ5DRtfLBH/vMVXCY=; b=Kje7Im1AZeKqEx55dKJKFLp+IZ9wmaBzJMALpP09rCH/OwpxvF3g3OI6oLyvs9KjpJ +Q9/hwlNi3AS0paXZPeifS9SugHg59iwuqCetHoQGvMuobxwgXmxVyHgIAl0W/ZnD4Aw YTiIOjEryrJzRn6/oTxnH1HIA9ZbEJbOpLFPs= 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=qiLdWWq8rQgKPrZmIJx4Pls4RyxJ5DRtfLBH/vMVXCY=; b=rx1X4rquQFdldBcQByCpXtuNBe4pbadpQNuPCxRnFHlIHUOXt+OYsy2cndv8adDq3V /JmS/167o4mVTTRtGo3InEWCaWUJ73JnDWeUveRj/aoOEfzwLuA7qOsbGqV7hZu8/0NO UsS9SUwS9cnSEvhHWCGvMTDM8JNcQFKYxLpYO//FaoqqRfGdspgm9SbzhnRlwwU7fRYI yyeKQVsA+kEBaNPg3zxEGfItIAQdDRpgCyTCghEtoKHveDwSOgaeh1PT+9I4nvVoBb/R vGHcZ6V/Yz+h+C8ftfmut3CzXYnMUMFw7B7LQpYVT4hm15giWPX6W7Bri1Va99ber2+k o78Q== X-Gm-Message-State: AOAM530du54Ni7kcLtUWK1lrZTV56Vx70QM+HILkRaAcj/aIaGp+4+fF nY65wuMGj14Pv55JVGrXKRKFaGxP X-Google-Smtp-Source: ABdhPJyiByA4r4EvB0akz7SaSNN5hxRPDDKD5ZgaUlD7HYKKKe79mtwLol8ZxBm6WkPzXRrBK4mQBQ== X-Received: by 2002:a17:90b:3006:: with SMTP id hg6mr8477793pjb.159.1591303275051; Thu, 04 Jun 2020 13:41:15 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:7a0c:: with SMTP id v12ls1703072pfc.1.gmail; Thu, 04 Jun 2020 13:41:14 -0700 (PDT) X-Received: by 2002:a63:3e46:: with SMTP id l67mr6061832pga.430.1591303274583; Thu, 04 Jun 2020 13:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591303274; cv=none; d=google.com; s=arc-20160816; b=VGTUqgmzLlJ2NlhmkLHu6MENxTDDxy82WKlL/sSzPoI7MU+QVKtGjtfnehdg19V5Uh 0f81cSjpc+l2ylvFEaZkeCOZMINJXVumVIuABmke6yyJ8Lozt0K/Knc4kg+XmOvS7arz QfmyceVzPKqnWRCSvAncCIEW9edIlw+YvIzKwWPjDj1QCjIyQf31Kkj/Xj/NudVTbkeP uVXZN002E6SoqWuRthLaCPrghZf7FISC4+JgVMbHJSB5ila3qnIumOhARmx6bZfubhVl t4YfgPH/ZZZ2nwKm07sq7lj6EXd1QWkAto92ZJO42jl5RcpVRuIGtR0rwl2SamXfKh7A ce/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=vslK4XfxdS/prsUh4BYYVfJw1vqcyXbtIgTQnnxUNXU=; b=Vc7zGxBvdwZcyzUOK4MYloKf6l50UzsOwgI/fxxs3i34Xw95nCfM4LveCZ6I8xfMY+ SFVwibWcOyi64OGhGtGUIB4EOPpC7AS5s/nyGrdLy4/FoyCPnXC/aRoj5Ll3383IunSX l6O9LR9VLCVGUTt50/5Wt7cxntXBGKHCaU8MmWQA91qUpLxJxc/go7LslRJbjgHAe6fl 5XxVTimGvHeHOrfSMIPLjsHgGl04Iq9Eazejd3gE27h4wlKF67CxCQ3zzEBUdpkJipjO nPFINZ+EIQH4nhI2i0HrrETkVYQJsHv405myJYdWCGsmT1R8F+JmNUmqr/YcIfUgp4mt V0Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=OOJUhjGS; 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 p8sor7445987pff.75.2020.06.04.13.41.14 for (Google Transport Security); Thu, 04 Jun 2020 13:41:14 -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:aa7:9541:: with SMTP id w1mr6237130pfq.69.1591303274279; Thu, 04 Jun 2020 13:41:14 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:41f4:94a8:1af3:a574]) by smtp.gmail.com with ESMTPSA id cm13sm6463775pjb.5.2020.06.04.13.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 13:41:13 -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 Subject: [PATCH v3 4/6] sifive: fu540: Mark the default env as SPI flash Date: Fri, 5 Jun 2020 02:09:47 +0530 Message-Id: <20200604203949.550290-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604203949.550290-1-jagan@amarulasolutions.com> References: <20200604203949.550290-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=OOJUhjGS; 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 v3: - none 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 Thu Jun 4 20:39:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1337 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 587A43F086 for ; Thu, 4 Jun 2020 22:41:26 +0200 (CEST) Received: by mail-pf1-f199.google.com with SMTP id l144sf5677212pfd.8 for ; Thu, 04 Jun 2020 13:41:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1591303285; cv=pass; d=google.com; s=arc-20160816; b=jKZHfOVAzIsDqP+12awpMHBuYaLQtijw0BG/hXGs2rs6m11HrjXgsf7/pBQMHhIeXI X4M4zpFKq6L/Q3o7bc7lAPZNsvdElo3+P7RXmgAAi18F6kgmGqjPy66jRX2bNUpHBH/T x+k2aZ5uxfXmC1/NP7mA906dnQTW6t312+UtTrPac74IKsjGENdboxqgrhoanxIXi4Em AopfqzQyBdXzkItb1Ldy/9aazdAA5zCK8Ub3nxdrmvUGsdcdckJuHIqMAi6vXRWZAu6/ QITxp0hsPy60/wwENJujENPdFL75Vmn883quX3B9Ql2i7kl6taKlTOuCX/9jdMsgFc3j fc9Q== 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=RSdGCtZct8NpsnmXdNOyBJwIWq2WwzVE4G0Qv7nCmNA=; b=EMMFfFHpwO7x1yGE5AjD79JLowBl7rHOWOBlxj5qade49Y9Pv9PWJON3qvjkl5kYFC 55mcIU0XnWLYpN2KiD6SmbiSGOmWz85hPsOCbwp9zVy1G/v/0O2V1Edowkkr+wQ4dwCm Sttj6MPR/LzVT7/6CTwTj9yx1rl7vdu+ekOPUzRIMoyprxBDIeNOHqjr7nE9sjH8JERz tF/9XfuJvnWKjxx2lCEyuLgYrXJsqOrOygaBA3JtJKS4CR2HMjQmZAunmq+b5Z01jLTQ oYwVXuq6+60ZtENsqiteMR6SCuEBcZyVyUPSX0xKWkAlCXLkvCK8qgH7qKF4CF+moL/q 6kPg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VxiKlafu; 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=RSdGCtZct8NpsnmXdNOyBJwIWq2WwzVE4G0Qv7nCmNA=; b=RyfwmBCnc1oX8Jg8uPDcpsfGimeP/8/5DVEqlAJ8WMOK38OW9crcFyInyXHoPeoArX chfwZKSBPzI9T+RbuB43clkJaNTga2dSwaCmNLkV8FRqDJZmpHewcen04Ram5FmoDnUq pKiY6yJzGTNiW6jEbHd8SFlHi0sd8Lc5hlAHY= 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=RSdGCtZct8NpsnmXdNOyBJwIWq2WwzVE4G0Qv7nCmNA=; b=skOJzfcldBBv5OCmgmIHy5Ln/VAWp0cOxYHKF/YO8Gzi4pAta4xK3HvOo5wDHZhb75 G/j78sztm7lBWXx3X4caILLckH5Ko7smJ7isfWuS/wIi1mDKgGEAao1otXRGD9PS7quA 9+5Whdqj967bJqeGGKakzXCpNLVg5b7UiCKNg/9/GC+YTZbFRrSUJzEh2LV5qdqG+shS edG1cX1aBerIr2ttWDP9AqccReKvucj/CtMtICeJZ9YNoFMdJ2DnvZADSStPQaL0ThyI PE6D5ITEvq4GwBHL/9K8hIJ0TSnJkP2Mt/go5HKx6DG+/fCpAIDSUBQoCT5lEnh0+RnL w3mQ== X-Gm-Message-State: AOAM532/Y8xmMygUcGb44ZkJRrP4llGCQpvnZ9JSd7cPCFj1QGEG6Ugc 683foGqxr6B1QJ80zdtIhScEY5hj X-Google-Smtp-Source: ABdhPJxGbGp5BYCucYHJ9yGI7HpR0nmaJW7lLn46hamxbPNUXeBZramk7ICVQPTkjOPohmu0GtPiEA== X-Received: by 2002:aa7:9494:: with SMTP id z20mr5955418pfk.314.1591303285078; Thu, 04 Jun 2020 13:41:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:2c94:: with SMTP id s142ls1051593pfs.4.gmail; Thu, 04 Jun 2020 13:41:24 -0700 (PDT) X-Received: by 2002:aa7:9f11:: with SMTP id g17mr6059421pfr.278.1591303284605; Thu, 04 Jun 2020 13:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591303284; cv=none; d=google.com; s=arc-20160816; b=nATqkhMI1r7XWhcGLXQutas/eIGDOUcdg/XxvpOYffZnke/nGAz4xqCHwea9h6IxzS sVlxnnnTVe5mQKAYPgQm9QQFyDzz+TuLP7zkq6uSfPC+wTHBhPbu05iHJnjyrbWSRROg pyr1PEFlnhX2u24xHaCJ8vGMW+QQuPLFXa9emfMJBYI1jo5VhqpZsKwPi6qY8zTr0a7D eWY5afgiwQgo8aWQ3SfX0w/+rxcB+WYBTU2I1GWs+F/jrL9SSbLSepWXLCFlDKK9AuoH jNnfVkiqMUrFEtJOpP5tU2c4Rg2XfTPoyV8Ja+Y+VxjCdaCSxH2+nM8SfuF2mT1tVQSh i6/g== 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=r5kMS41zXYlBEHWhY5QbZCxmO48PkAoZe0uyrMIIX4o=; b=RfGcUv1WPRKHhJXhRSEnOAkI0piaNSMiYFVMcXSS4rmlddZLDMJbr5g0lPLa1k+zsI EEp3sVtzf+rQKPk1QUxfGyhQsdvdIk5sJ9gCfN/cqpI69tnQsgqlNjmt2/hSNRYnwxIQ V1sCUA4lHogDVpu9r0YIWIHC0RMXajXxDY+aqH/5puojJDgmJIa5RXKoDnDm9tI7/M84 nuRyePrA0oGIPWL0PANb9TFC5GCLkShixR+5czBua0tb34ofWb90y++G01J29OZS7VnU DWCNre9jYRQBVvy8ks34fBoNadtBFy78J8D5ZiPhSuPlfhVuolHuQ9LdDUWeqW1CuxdF krmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VxiKlafu; 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 f18sor7626067plb.10.2020.06.04.13.41.24 for (Google Transport Security); Thu, 04 Jun 2020 13:41:24 -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:714e:: with SMTP id u14mr6470123plm.175.1591303284307; Thu, 04 Jun 2020 13:41:24 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:41f4:94a8:1af3:a574]) by smtp.gmail.com with ESMTPSA id cm13sm6463775pjb.5.2020.06.04.13.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 13:41: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 Subject: [PATCH v3 5/6] sifive: fu540: Add boot flash script offset, size Date: Fri, 5 Jun 2020 02:09:48 +0530 Message-Id: <20200604203949.550290-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604203949.550290-1-jagan@amarulasolutions.com> References: <20200604203949.550290-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=VxiKlafu; 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 v3: - none 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 Thu Jun 4 20:39:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1338 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id A0DE63F086 for ; Thu, 4 Jun 2020 22:41:39 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id l25sf5916354pgn.8 for ; Thu, 04 Jun 2020 13:41:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1591303298; cv=pass; d=google.com; s=arc-20160816; b=ez24tomFEXuoFFDi7jIR6hAGx8AygelWzUgC6TZdnyHJfIx+WkSEI6lUbwUfjqtNTl lt7m/gBFLrdPt4YBk2Cnc4jMEO41yVBGMwlLDZEO7Vd4Skxn5m+NEBrjc2jydqilgJ7Y 5LG1cT1QIv9FR+qalXktYMhcS1MY/zn0n9RtjxncqOgeQOjfjs+qf3j3T9TdHcLBGFLi O6hY+PpUMZyi6jMTbmpSMtuzVcoPuXiElf5gWqUfrmnAcXxJR/ZAmfq2OqSqaLHBo97q ubkP4jl46mynhYATakPUDRSakdzji8HaLzTktJpCuWfD+vSBdxPeJgcCXuQ4Iq01rURm aRRw== 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=TlvNYgLJH6kaFiVwa3jdjNkMGsaZHJKD+PV1YK+pi6o=; b=e8tSkoPT+hCkdnUMNCqiLl/zl0T8b8ySaL+f/2ophCiQyDB50NvtG4xc55a79xhzOX cwazT8aJ44FY/NYKg2lN17wYcgz3cSSMUO2HAB2OpRAjZPk/XiwN/FqRR/Y4zShUteQH yIa7xBJgQHQCNDBIDqqxElT12bp+HgUxd+L1Q++5Lc8xC7AKs658TsqXXMCI2Cs3ESpk xy6lPUeE+B1YoW54qtzRr8Lwbx+PXC3T3Zq5MW32xh1US6vCYEPIHi8g7b0Uis3zjsye a8/dDmAFiWnKaNbqaN/fjHQ3ExtwmS/n0RqS4ZiCBu3TahdrjMyXQqWUsmv8zQ+WuT2d a88w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PfJbGZud; 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=TlvNYgLJH6kaFiVwa3jdjNkMGsaZHJKD+PV1YK+pi6o=; b=l2a8W5X2+9e/wGPNzZ7kI70viz196thTl7N9UKh2OZn3bGD16KMjG7QAzussHRZqhU 3bk2ZseOB/sAV4bz6KGGan2d0K38yj72yemfB5oMKuSteu8vlEIaCFRiHnwIkFzD8q+a S6sQr5vjFi2bm2+KDREVVu9rU4hrTae14UVQg= 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=TlvNYgLJH6kaFiVwa3jdjNkMGsaZHJKD+PV1YK+pi6o=; b=T9m5OljzPdYcM9oos/tTm1GIh3RmNyT8oX/xxcepfZvqOOkx5Bh+dyO1rKSCRpXeeL UHqsbqk5MIUHyTefcQ+l4/EBgOsFGMAJ6+PfnA26UHpznl0Ggt3OelczcDrUQVokXGwg vfoomZ/rnmMcFjx2D8BcS55l+zGvzaMpROzQdRuxOcK+BPEOQEwv4aCGknGG3IEivhqq OEhRwlPnT+JgCviwc/MCuUjum8zE0p7pB4fU2F+CkwnbV3Qe9n6e5dgAbI9+wpL15vVh j6FWBUSTPO1vA11lpmjo7QovyycVL8ImzjHMtqQPsgtAM4WxH6eyIkG0BH+Vn5lDB2NR 75Tg== X-Gm-Message-State: AOAM530k4gzRDTGYI+EuY7ufd+noD6kuiw3K/Df414EJtjptSNZ7Li3y ryvzOmcLavk2cFXSfhE05sOsVO9g X-Google-Smtp-Source: ABdhPJyutoyLxWorHfJUm+UPP0pccMrS6h/WVY6PvD4cKSxQ0Q9eHTwHcngcdPK4bipxMx2YX/HdVQ== X-Received: by 2002:a17:902:c40c:: with SMTP id k12mr6306962plk.11.1591303298394; Thu, 04 Jun 2020 13:41:38 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:104a:: with SMTP id gq10ls3645201pjb.0.canary-gmail; Thu, 04 Jun 2020 13:41:38 -0700 (PDT) X-Received: by 2002:a17:902:502:: with SMTP id 2mr6392562plf.134.1591303297908; Thu, 04 Jun 2020 13:41:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591303297; cv=none; d=google.com; s=arc-20160816; b=k0i+3ZrUVT3AhU2oOX9PifNhsHbeJlP8TjEv28lL2Y6QSxzqZjVq2CBEVuUdtliZ8D /MmV5C0HxHSo3Vk4jMc+lYdvYYseXfL1qdOKcHhH+g2jT160qjnNeF0SdTH1ed0aCHyu ma8Mlo5cy3RV5WCngYk43Ha31D0IhyetN4DNbISZYFId15ByqlDohyksHgwW2+PtAN0r FJZNxKW64llGIkaBjmDoo32Hzk8qPIBMbHpvvVZz2I7SehfhFfkk7WTZJdcgTOyp5rPK t+BCdvT57SGhKlUui1ANbWMevlzSqjMnywZABU4oZf7DPOgDZ3YB0gGZjHyvzV1Tk/tq Bn0Q== 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=QK1SOCfhakIL/ZiUOpcKO6i0aiV+H7rneHdMgG7Ap5w=; b=xLWcgt1hxh4GntMSyeOh3G+agAImrMhX1Dk1cWnf8jbSImIdUG3W6JdZ+cN96hMztq K3gu/CJssfHhTGUyZj3wcFXIkw+wMpeaJDiKU1opUEOhqZUwWUewJ6Oh4F8ivEhbKOBa Gnkp9WMqF4mnoa7If+3OaQBv50ln+8azodfKGgTjpcnvOW8sdPRx2hnY5dHZlPL7rlwb OL0vPour29xrafFGeeNJk+aSricpDCymz2YLwPKB/gkITzCcuJMzwSwegmYnEf3cHPY9 vvWntVvMicweeGNg2VfiRvb9TFCB133Eqb1biP7cb3VXf24bCaJowRe98JqWBKemzCZ1 7ygA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=PfJbGZud; 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 35sor8054919ple.22.2020.06.04.13.41.37 for (Google Transport Security); Thu, 04 Jun 2020 13:41:37 -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:c40c:: with SMTP id k12mr6617942plk.105.1591303297581; Thu, 04 Jun 2020 13:41:37 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:41f4:94a8:1af3:a574]) by smtp.gmail.com with ESMTPSA id cm13sm6463775pjb.5.2020.06.04.13.41.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 13:41:36 -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 Subject: [PATCH v3 6/6] sifive: fu540: Enable SF distro bootcmd Date: Fri, 5 Jun 2020 02:09:49 +0530 Message-Id: <20200604203949.550290-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200604203949.550290-1-jagan@amarulasolutions.com> References: <20200604203949.550290-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=PfJbGZud; 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 v3: - none 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};" \