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