From: E Shattow <e@freeshell.de>
To: u-boot@lists.u-boot-project.org,
Minda Chen <minda.chen@starfivetech.com>,
Hal Feng <hal.feng@starfivetech.com>,
Tom Rini <trini@konsulko.com>
Cc: Leo Liang <leo.liang@sifive.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
E Shattow <e@freeshell.de>
Subject: [PATCH v2] configs: starfive: enable mtdparts on visionfive2
Date: Thu, 22 Oct 2026 04:09:06 -0700 [thread overview]
Message-ID: <20261022110913.1415753-1-e@freeshell.de> (raw)
add default mtdparts and mtdids consistent with Linux v7.3 Cadence QSPI
driver .get_name() handler cqspi_get_name() and jh7110-common.dtsi
Signed-off-by: E Shattow <e@freeshell.de>
---
This allows us to update the documentation to be slightly less likely
that the user would type the wrong offset by using mtd part names:
- loady && sf update $loadaddr 0 $filesize
- StarFive # loady && sf update $loadaddr 0 $filesize
+ loady && sf update $loadaddr spl
+ StarFive # loady && sf update $loadaddr spl
However that documentation update is planned for after the mtdparts
addition lands in release. It would be preferable to derive mtdparts
layout at runtime from device tree; if there is some way to do that
sensibly please offer some advice how to do so in the review. Thanks!
Refer to discussion of mtd-id for SpacemiT K3 [1] and Linux v7.3 Cadence QSPI
driver [2].
1: https://lore.kernel.org/u-boot/20261022103907.1415045-3-e@freeshell.de/
2: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/spi/spi-cadence-quadspi.c?h=v7.3#n1724
static const char *cqspi_get_name(struct spi_mem *mem)
{
struct cqspi_st *cqspi = spi_controller_get_devdata(mem->spi->controller);
struct device *dev = &cqspi->pdev->dev;
return devm_kasprintf(dev, GFP_KERNEL, "%s.%d", dev_name(dev),
spi_get_chipselect(mem->spi, 0));
}
In the typical situation for JH-7110 SoC then dev_name(dev) is "13010000.spi"
and spi_get_chipselect(mem->spi, 0) returns a value of zero.
Changes in v2:
- use Linux v7.3 cqspi_get_name() typical result for mtdparts layout
name; this is done for compatibility in the non-default configuration
of matching cmdline mtdparts mtd-id when Linux MTD_OF_PARTS is disabled
---
configs/starfive_visionfive2_defconfig | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/configs/starfive_visionfive2_defconfig b/configs/starfive_visionfive2_defconfig
index 45de1c1cb671..e2a1f10dbc0a 100644
--- a/configs/starfive_visionfive2_defconfig
+++ b/configs/starfive_visionfive2_defconfig
@@ -78,6 +78,9 @@ CONFIG_CMD_WDT=y
CONFIG_CMD_WGET=y
CONFIG_WGET_HTTPS=y
CONFIG_CMD_BOOTSTAGE=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nor0=13010000.spi.0"
+CONFIG_MTDPARTS_DEFAULT="13010000.spi.0:960k(spl),64k(uboot-env),-(uboot)"
CONFIG_OF_BOARD=y
CONFIG_DEVICE_TREE_INCLUDES="starfive-visionfive2-u-boot.dtsi"
CONFIG_OF_LIST="starfive/jh7110-deepcomputing-fml13v01 starfive/jh7110-milkv-mars starfive/jh7110-milkv-marscm-emmc starfive/jh7110-milkv-marscm-lite starfive/jh7110-orangepi-rv starfive/jh7110-pine64-star64 starfive/jh7110-starfive-visionfive-2-v1.2a starfive/jh7110-starfive-visionfive-2-v1.3b starfive/jh7110-starfive-visionfive-2-lite starfive/jh7110-starfive-visionfive-2-lite-emmc"
@@ -107,6 +110,7 @@ CONFIG_SPI_FLASH_EON=y
CONFIG_SPI_FLASH_GIGADEVICE=y
CONFIG_SPI_FLASH_ISSI=y
CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_MTD=y
CONFIG_DM_MDIO=y
CONFIG_DM_ETH_PHY=y
CONFIG_DWC_ETH_QOS=y
base-commit: 903c9578eeb36d72f087082da494c605ddaed3b2
--
2.53.0
next reply other threads:[~2026-10-22 11:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 11:09 E Shattow [this message]
2026-11-02 16:03 ` [PATCH v2] configs: starfive: enable mtdparts on visionfive2 Leo Liang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261022110913.1415753-1-e@freeshell.de \
--to=e@freeshell.de \
--cc=hal.feng@starfivetech.com \
--cc=leo.liang@sifive.com \
--cc=minda.chen@starfivetech.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox