Add Add CONFIG_MTD_PARTITIONED_MASTER kernel config for aspeed arm64 - #622
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
cc @chander-nexthop @yxieca @saiarcot895 @nats-nokia for review |
paulmenzel
left a comment
There was a problem hiding this comment.
Thank you for your patch. It’d be great if you amended the commit message:
CONFIG_MTD_PARTITIONED_MASTER=y enables to retain the master (entire, unpartitioned)
Memory Technology Device (MTD) node in user space even when the flash memory is
divided into smaller partitions.
Therefore, this enables full device access which will be useful for low-level utilities,
firmware backups, or flashing tools
Please add a section how to verify, that everything works as expected. New Linux log messages? New devices in /dev/? Please also name the device you tested this on.
CONFIG_MTD_PARTITIONED_MASTER=y retains the master (entire, unpartitioned)
Memory Technology Device (MTD) node in user space even when the flash memory
is divided into smaller partitions. This enables full device access which is
useful for low-level utilities, firmware backups, or flashing tools.
Tested on: AST2700 BMC DUT (Platform: arm64-arista_goldfinch-r0)
Verification:
Without CONFIG_MTD_PARTITIONED_MASTER:
$ cat /proc/mtd
dev: size erasesize name
mtd0: 00400000 00010000 "u-boot"
mtd1: 00020000 00010000 "u-boot-env"
mtd2: 00900000 00010000 "kernel"
mtd3: 052e0000 00010000 "rofs"
mtd4: 02000000 00010000 "rwfs"
mtd5: 08000000 00010000 "bmc-secondary"
$ ls /dev/mtd/by-name/
bmc-secondary -> ../../mtd5
kernel -> ../../mtd2
rofs -> ../../mtd3
rwfs -> ../../mtd4
u-boot -> ../../mtd0
u-boot-env -> ../../mtd1
With CONFIG_MTD_PARTITIONED_MASTER=y:
$ cat /proc/mtd
dev: size erasesize name
mtd0: 08000000 00010000 "bmc-primary"
mtd1: 00400000 00010000 "u-boot"
mtd2: 00020000 00010000 "u-boot-env"
mtd3: 00900000 00010000 "kernel"
mtd4: 052e0000 00010000 "rofs"
mtd5: 02000000 00010000 "rwfs"
mtd6: 08000000 00010000 "bmc-secondary"
$ ls /dev/mtd/by-name/
bmc-primary -> ../../mtd0
bmc-secondary -> ../../mtd6
kernel -> ../../mtd3
rofs -> ../../mtd4
rwfs -> ../../mtd5
u-boot -> ../../mtd1
u-boot-env -> ../../mtd2
The master MTD node "bmc-primary" (128MB, mtd0) and its device nodes
/dev/mtd0 are now visible alongside the individual partitions.
Kernel log messages (dmesg | grep -i mtd) are identical in both cases —
no additional log output is produced by this config option.
Signed-off-by: Prajjwal Singh <prajjwal@arista.com>
ad9608e to
64c72a1
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
@paulmenzel |
nats-nokia
left a comment
There was a problem hiding this comment.
This requires changes on our platform code.
We will adapt our code to have this kernel config change.
|
@DannyIsa @chander-nexthop can you review these changes? This may require changes to your platform code as there will be an additional mtd device visible, and blind usage of that device will cause issues. @prajjwal-arista is there any metadata on that |
|
Thanks @saiarcot895. Checked the Nexthop B27 (Aspeed) paths — no Nexthop impact. Our U-Boot env access is name-based ( @prajjwal-arista one cleanup request: in sonic-buildimage, |
…ASTER With CONFIG_MTD_PARTITIONED_MASTER=y enabled in sonic-linux-kernel (sonic-net/sonic-linux-kernel#622), the master MTD node is retained as mtd0, shifting all partition indices by one. Update FW_ENV_DEFAULT from /dev/mtd1 to /dev/mtd2 to point to the correct u-boot-env partition under the new layout. Signed-off-by: Prajjwal Singh <prajjwal@arista.com>
|
Here is the difference between the master device (mtd0) and a partition (mtd1) visible via udevadm info: Key differences :
|
|
@chander-nexthop I dont see this ENV var being used in sonic-buildimage anywhere. Where is this used? |
No hard dependency, that was dangling reference and I thought its better to clean that up as any future use of that var will result in bugs with this change. Just request a follow up to ensure that PR too gets merged. |
Description
Add
CONFIG_MTD_PARTITIONED_MASTER=yto kernel config for arm64 aspeed config.Why I did it
CONFIG_MTD_PARTITIONED_MASTER=yenables to retain the master (entire, unpartitioned) Memory Technology Device (MTD) node in user space even when the flash memory is divided into smaller partitions.Therefore, this enables full device access which will be useful for low-level utilities, firmware backups, or flashing tools
How I did it
Added
CONFIG_MTD_PARTITIONED_MASTER=yto fileconfig.local/arm64/config.sonic-aspeedHow I tested it
Manual testing -
without the fix:
with the fix:
Backport
Backport required in 202608