mirror of
git://git.openwrt.org/openwrt/openwrt.git
synced 2025-12-20 11:32:09 -05:00
Add new mtdsplit parser "mstc-boot" for the devices manufactured by MSTC
(Mitra Star Technology Corp.). This is necessary to handle dual-boot on
those devices.
This parser splits kernel+rootfs or only rootfs(or UBI) based on the
image in the firmware partition or pre-defined partitions in dts, and
"bootnum" value in the "persist" (or "working") partition.
Note: "bootnum" is used for switching active firmware partitions on the
devices manufactured by MSTC and '1' or '2' are used on most
devices. But some devices use '0' or '1'. (example: I-O DATA
WN-DEAX1800GR)
Sequence:
1. obtain "bootnum" value
2. child nodes exsist (regardless of bootnum)
-> fixed partitions
(active parts : without bootnum (ex.: "kernel", "rootfs")
inactive parts: with bootnum (ex.: "kernel2", "rootfs2"))
3. current partition is active (dt bootnum == mtd bootnum)
-> image-based partitions
Device Tree:
- common
- mstc,bootnum : "bootnum" value for the mtd partition (0/1/2)
- mstc,persist : phandle of "persist" partition containing "bootnum"
value
- fixed partitions
- #address-cells: indicate cell count of address of child nodes (1)
- #size-cells : indicate cell count of size of child nodes (1)
- (child nodes) : define the child partitions
- reg : define the offset and size
- label-base : define the base name of the partition
- (example) : base:"kernel"->"kernel"(active)/"kernel2"(inactive)
example:
partition@3c0000 {
compatible = "mstc,boot";
reg = <0x3c0000 0x3240000>;
label = "firmware1";
mstc,bootnum = <1>;
mstc,persist = <&mtd_persist>;
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
reg = <0x0 0x800000>;
label-base = "kernel";
};
partition@800000 {
reg = <0x800000 0x2a40000>;
label-base = "ubi";
};
};
- image-based partitions
(no additional properties)
example:
partition@5a0000 {
compatible = "mstc,boot";
label = "firmware1";
reg = <0x5a0000 0x3200000>;
mstc,bootnum = <1>;
mstc,persist = <&mtd_persist>;
};
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18976
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||
|---|---|---|
| .. | ||
| Kconfig | ||
| Makefile | ||
| mtdsplit_bcm63xx.c | ||
| mtdsplit_bcm_wfi.c | ||
| mtdsplit_brnimage.c | ||
| mtdsplit_cfe_bootfs.c | ||
| mtdsplit_elf.c | ||
| mtdsplit_eva.c | ||
| mtdsplit_fit.c | ||
| mtdsplit_h3c_vfs.c | ||
| mtdsplit_jimage.c | ||
| mtdsplit_lzma.c | ||
| mtdsplit_minor.c | ||
| mtdsplit_mstc_boot.c | ||
| mtdsplit_seama.c | ||
| mtdsplit_seil.c | ||
| mtdsplit_squashfs.c | ||
| mtdsplit_tplink.c | ||
| mtdsplit_trx.c | ||
| mtdsplit_uimage.c | ||
| mtdsplit_wrgg.c | ||
| mtdsplit.c | ||
| mtdsplit.h | ||