Configure mtdparts for use in linux

This commit is contained in:
Lukas Schmid 2024-05-29 20:25:20 +02:00
parent c5258ce271
commit 06e4a2a576
5 changed files with 19 additions and 5 deletions

View File

@ -212,8 +212,9 @@
flash@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "jedec,spi-nor";
reg = <0>;
compatible = "jedec,spi-nor";
label = "firmware";
spi-max-frequency = <40000000>;
};

View File

@ -1,4 +1,4 @@
LABEL default
kernel /boot/zImage
fdt /boot/sun8i-v3s-netcube-kumquat.dtb
append root=/dev/mmcblk0p1 rootwait console=${console} rootfstype=ext4 panic=3
append root=/dev/mmcblk0p1 rootwait console=${console} rootfstype=ext4 panic=3 ${mtdparts}

View File

@ -0,0 +1,12 @@
# Configuration file for fw_(printenv/setenv) utility.
# Up to two entries are valid, in this case the redundant
# environment sector is assumed present.
# Notice, that the "Number of sectors" is not required on NOR and SPI-dataflash.
# Futhermore, if the Flash sector size is omitted, this value is assumed to
# be the same as the Environment size, which is valid for NOR and SPI-dataflash
# Device offset must be prefixed with 0x to be parsed as a hexadecimal value.
# MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd1 0x0000 0x40000
/dev/mtd2 0x0000 0x40000

View File

@ -212,8 +212,9 @@
flash@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "jedec,spi-nor";
reg = <0>;
compatible = "jedec,spi-nor";
label = "firmware";
spi-max-frequency = <40000000>;
};

View File

@ -19,8 +19,8 @@ CONFIG_CMD_EEPROM=y
CONFIG_CMD_I2C=y
CONFIG_CMD_MTD=y
CONFIG_CMD_RTC=y
CONFIG_MTDIDS_DEFAULT="nor0=flash"
CONFIG_MTDPARTS_DEFAULT="mtdparts=flash:512k(u-boot)ro,256k(u-boot-env1),256k(u-boot-env2),-(user)"
CONFIG_MTDIDS_DEFAULT="nor0=firmware"
CONFIG_MTDPARTS_DEFAULT="mtdparts=firmware:512k(u-boot)ro,256k(u-boot-env1),256k(u-boot-env2),-(user)"
CONFIG_CMD_DIAG=y
# CONFIG_ENV_IS_IN_FAT is not set
CONFIG_ENV_IS_IN_MMC=y