From patchwork Tue May 19 19:23:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1217 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id AA0503F086 for ; Tue, 19 May 2020 21:24:50 +0200 (CEST) Received: by mail-pj1-f69.google.com with SMTP id l7sf716731pjn.5 for ; Tue, 19 May 2020 12:24:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589916289; cv=pass; d=google.com; s=arc-20160816; b=Swa6xc/aEGusHwvZSkyaIQDSigZZykm7Aje9B3YsHWYpdVA8ntYOdTC7LimFKuNsqX C2h4T2THtPeVwqW7tmkV8Nab7RS74rGjQlEOXLYwiCoNok6nKULSipXl/eHN9yImTBxY Q1cURBfJ04YLsDOPUiOxD++nYSNVdhnOdUojC6hNkW65WXssoK+Sa7jpoIZXx6JWoGLQ cw6l53dng84V2JOL49BNFbF3sxCb+DxZLUKvKLGsLvZ9B7Fehuoq3nA96IY4TjSVrXoS fXKYHEtiP+vnHbUZA9jn16o+DKU7gucZ0xEUZ92vAYEDjLz6kwxiigmx7wx8M1DtLcnd 5nTw== 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=59R65sCKX/xhJmJ6uZSUozTNARONRq0coytrQF7cNeY=; b=bp2R37qZ/gXv40NHu+5jbVSCiO990xzKVL4eP5Eyqs2aquvpT6Zgl2CpLMv9mJiIYS 5CdMIz+/RE2QGkIutOkaksiPBOSjn8VylG5uG4ALYjUmeGRkC7+ACgm+XxnMnl6rWmkj Dx9XXtZc+6eS491gQ/JJka9STzHgXATmMTNfYPExwH+aYv0mDYmadZgmkN7ocK/wbCCI hVg3MvrJERQUSNUkawR+hv4c7XHC1msSvWiO7y7Jt8aI7vZaQKbkY3yenoHDhQacpFQW s9os8XlVIPQHdeY2PGz3Kb2MBtwstjrYutKQ6oVJQZsNH0jPdrOI9WG2GmKQM+PGWf7L anKA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Pv1xQCbJ; 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=59R65sCKX/xhJmJ6uZSUozTNARONRq0coytrQF7cNeY=; b=LhRFhqp/JkJEnPq3ktc5vnjkVLU6WsU/id3SYYImgmTcCHiSpvFYlJ2vaKYO1Pw3eN t2LXroPpPfNNIVNf/jdA4GowHMPzNuPa6tVSCccD3YMt8c5X0Fynrae1meMOtOeuol3A A+jF2DAhyVvgqSlbMPr+L7KXmR/FYMHQY1ZMM= 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=59R65sCKX/xhJmJ6uZSUozTNARONRq0coytrQF7cNeY=; b=RDXKD0Qunf5rv0T9vEjaKK2/7rsOL4L4aoa3aht69Gzig1qB815GPBeQd8SWaVkeS6 gYGMzZ9N42yxwsw0i6gYHlfbrdAHDcrB11vhbXy1AuTbxnDt1yjqdS6RPh1+f+PXdxld UukhN9QoTo0CK9POF0vn5VTVQYMtxrO2lrGyLvJauxb1/FheSqyLXv5Oioq7nQ6zw9RS ndkgn6bU054U+IEk5ZlQmGwUDXA68pMHWVVfCNONya6akoonsTIbz00IBCXuq9XFIL70 aFcby6IUcCtE2A1taZRUsy7qWTD7paizs568QKJrgVGFr4ZXmRe80mH7HnlWJUGh3BVw BmRQ== X-Gm-Message-State: AOAM533Hu0eabrR5wC8iRvQyU2Zu5dzb+DSDws9HfSoEepjN2ovkizva vtB1XCeDNnZEaUEAzWYIGWQXtplY X-Google-Smtp-Source: ABdhPJySYTFjuW0nK2eYM1sclG3A+EgYSAXmawsCzj86Oh11H3rPkhx1JYWnOOyzUiftNYOfcWhgxw== X-Received: by 2002:a17:90a:c7d8:: with SMTP id gf24mr1099242pjb.218.1589916289505; Tue, 19 May 2020 12:24:49 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:8f8f:: with SMTP id z15ls92725plo.8.gmail; Tue, 19 May 2020 12:24:49 -0700 (PDT) X-Received: by 2002:a17:90a:358c:: with SMTP id r12mr1032417pjb.161.1589916288997; Tue, 19 May 2020 12:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589916288; cv=none; d=google.com; s=arc-20160816; b=KPc9otTKpnQTGwLPzwkp0hYIm1rGnvEaFSULw4i6RZvjMlDgn/jKMzAt7whAYXQ9a5 rJGDCAFd8gO7vYmNnhdUGndLnNaVw5FjrfjLTS5RhrMsQyYX/+H6j0ET374hBeH1nVXi mVd87MAjyXNMHy7gOnE/NCBhUqODVvD00H20kcGlG7NDIZt0YT/JANnJ+MStsiK8mQzm dFwjkMYj4dzQqh7D0B+FYs0/6RTX4FsRBza8h7bvdtcMasJtMwA247UrXalESLS2Ntg7 IP1a1U5d4yFaKNZ/jeJiOxzHB7BXBSqXGMStb6EifDzZkvQLfOHy4ZEr5IPDWvgvCssi 9vDg== 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=QN1n4c5LMxVf1YaYQWpBH3NQf3Ufv/ksTgLkPGZFTCM=; b=wljG9KNxiPByjMPlAzL58QxkBYmFhSUsdm5sJ85Q21fn6WDFHt69jL4V9fT9fRjlOO ghXOplifWbStzu5DR0MEX6k3b5wNYAw5MlnAzs/wJnfZXiuCcWMAe5UOIX26/470uQpF D3w6uVQuIfau0WwWMWjI8SpJ+0V/ZgLLzDgjGHvXqmqIpYdDneuJyrJvYYHkF8zos05Z KXnxwRE4md9bH7NyMDp0q0qTlpViAq8nCkLDMi3AWCY2S3pyjcjZ/nw2hSpphhUJ1BE4 v8CnFFQnsP8z3zpdqeADalzYj15AnD4Z9REg8ER98PtN6ktE1yID7ZKnlYBd26NnZ1gF 89mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Pv1xQCbJ; 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 q7sor388797pli.66.2020.05.19.12.24.48 for (Google Transport Security); Tue, 19 May 2020 12:24:48 -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:7b86:: with SMTP id w6mr968557pll.292.1589916288629; Tue, 19 May 2020 12:24:48 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:713c:4a0a:47eb:ffcd]) by smtp.gmail.com with ESMTPSA id w192sm222553pff.126.2020.05.19.12.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 12:24:47 -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 v2 6/9] env: Enable SPI flash env for SiFive FU540 Date: Wed, 20 May 2020 00:53:37 +0530 Message-Id: <20200519192340.16624-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519192340.16624-1-jagan@amarulasolutions.com> References: <20200519192340.16624-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=Pv1xQCbJ; 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 --- Changes for v2: - move env offsets from generic to cpu Kconfig 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..417926d2cf 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 CONFIG_ENV_IS_IN_SPI_FLASH + +config ENV_OFFSET + default 0x505000 + +config ENV_SIZE + default 0x20000 + +config ENV_SECT_SIZE + default 0x10000 + +endif # CONFIG_ENV_IS_IN_SPI_FLASH