From patchwork Sun Jan 26 22:50:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Johnson X-Patchwork-Id: 240136 List-Id: U-Boot discussion From: mrjoel at lixil.net (Joel Johnson) Date: Sun, 26 Jan 2020 15:50:04 -0700 Subject: [PATCH v4 07/12] arm: mvebu: clearfog: add SPI offsets In-Reply-To: <20200126225009.7362-1-mrjoel@lixil.net> References: <20200126225009.7362-1-mrjoel@lixil.net> Message-ID: <20200126225009.7362-8-mrjoel@lixil.net> Add reasonable default SPI offsets and ENV size when configured to boot from SPI flash. Signed-off-by: Joel Johnson --- v2 changes: - none v3 changes: - none v4 changes: - none There was some reasonable concern raised about duplicating config entries within a board specific config file rather than making board specific configurations within defconfig. This seems to offer a more board localized mechanism to provide platform defaults for core values. As mentioned in the review, this usage seems to match the Kconfig documented intended usage. As noted at https://www.kernel.org/doc/html/latest/kbuild/kconfig-language.html: "Default values are not limited to the menu entry where they are defined. This means the default can be defined somewhere else or be overridden by an earlier definition." Given that there is some dependency variability with these values I prefer keeping them as Kconfig values, but defer to maintainers. Notably, for the ENV values in this and a later commit, I'm using a pattern already in used several other board configs. --- board/solidrun/clearfog/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/board/solidrun/clearfog/Kconfig b/board/solidrun/clearfog/Kconfig index c910e17093..d3209d9b8e 100644 --- a/board/solidrun/clearfog/Kconfig +++ b/board/solidrun/clearfog/Kconfig @@ -22,4 +22,16 @@ config CLEARFOG_SFP_25GB SGMII connection (requires a supporting SFP). By default, transfer speed of 1.25 Gbps is used, suitable for a more common 1 Gbps SFP module. +config ENV_SECT_SIZE + hex "Environment Sector-Size" + # Use SPI flash erase block size of 4 KiB + default 0x1000 if MVEBU_SPL_BOOT_DEVICE_SPI + # Use optimistic 64 KiB erase block, will vary between actual media + default 0x10000 if MVEBU_SPL_BOOT_DEVICE_MMC + +config SYS_SPI_U_BOOT_OFFS + hex "address of u-boot payload in SPI flash" + default 0x20000 + depends on MVEBU_SPL_BOOT_DEVICE_SPI + endmenu