From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5036C433EF for ; Wed, 24 Nov 2021 22:32:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0EF4782FDC; Wed, 24 Nov 2021 23:32:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=skibo.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=skibo.net header.i=@skibo.net header.b="IOegRzM0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D296982FB4; Wed, 24 Nov 2021 23:32:26 +0100 (CET) Received: from dog.birch.relay.mailchannels.net (dog.birch.relay.mailchannels.net [23.83.209.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E47D182FDC for ; Wed, 24 Nov 2021 23:32:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=skibo.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=thomas-git@skibo.net X-Sender-Id: dreamhost|x-authsender|thomas-git@skibo.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 301E0E13C2; Wed, 24 Nov 2021 22:32:19 +0000 (UTC) Received: from pdx1-sub0-mail-a207.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B4132E158C; Wed, 24 Nov 2021 22:32:18 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|thomas-git@skibo.net Received: from pdx1-sub0-mail-a207.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.99.149.17 (trex/6.4.3); Wed, 24 Nov 2021 22:32:19 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|thomas-git@skibo.net X-MailChannels-Auth-Id: dreamhost X-Thoughtful-Cold: 0027d92e56258397_1637793139033_1362981355 X-MC-Loop-Signature: 1637793139033:2626602845 X-MC-Ingress-Time: 1637793139033 Received: from localhost.localdomain (unknown [98.207.154.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: thomas-git@skibo.net) by pdx1-sub0-mail-a207.dreamhost.com (Postfix) with ESMTPSA id 4Hzwjt34j6z1TK; Wed, 24 Nov 2021 14:32:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=skibo.net; s=skibo.net; t=1637793138; bh=5+Wzvq7WH9iB8StlnLc0EvhWDHk=; h=From:To:Cc:Subject:Date:Content-Transfer-Encoding; b=IOegRzM0mBN5fZN/JbMXJ9ydfP22zTQ4fw4rZ0tj++KOWbURRWgu/GIMkZekzYjtH AW44lur7zrtTPpvT/i7gF8n5TQ9TIf5zygEuGs2PceTC/lFuC+KCx6bOpqopXjGR6f gNTou1lVxgDYXvUuCFkZP6DUX4ORMXeL3il7nVJA= From: Thomas Skibo To: u-boot@lists.denx.de Cc: ycliang@andestech.com, Thomas Skibo Subject: [PATCH v3 2/2] riscv: Enable SPI flash env for SiFive Unmatched. Date: Wed, 24 Nov 2021 14:32:10 -0800 Message-Id: <20211124223210.5281-3-thomas-git@skibo.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211124223210.5281-1-thomas-git@skibo.net> References: <20211124223210.5281-1-thomas-git@skibo.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Enable saving environment to SPI flash memory on SiFive Unmatched. Signed-off-by: Thomas Skibo --- arch/riscv/cpu/fu740/Kconfig | 13 +++++++++++++ board/sifive/unmatched/Kconfig | 1 + 2 files changed, 14 insertions(+) diff --git a/arch/riscv/cpu/fu740/Kconfig b/arch/riscv/cpu/fu740/Kconfig index 049a0a0584..3e0c1fddc8 100644 --- a/arch/riscv/cpu/fu740/Kconfig +++ b/arch/riscv/cpu/fu740/Kconfig @@ -40,3 +40,16 @@ config SIFIVE_FU740 imply DM_I2C imply SYS_I2C_OCORES imply SPL_I2C + +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 diff --git a/board/sifive/unmatched/Kconfig b/board/sifive/unmatched/Kconfig index fb2c1fbb58..fe213fd504 100644 --- a/board/sifive/unmatched/Kconfig +++ b/board/sifive/unmatched/Kconfig @@ -26,6 +26,7 @@ config SPL_OPENSBI_LOAD_ADDR config BOARD_SPECIFIC_OPTIONS # dummy def_bool y select SIFIVE_FU740 + select ENV_IS_IN_SPI_FLASH select SUPPORT_SPL select RESET_SIFIVE select BINMAN -- 2.25.1