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