nand flash 8G, page size 4K , 64pages/block, block size 256Kbytes
1、NuWriter:
header-nand.json:
{
"header":
{
"version": "0x20210119",
"spiinfo":
{
"pagesize": "4096",
"sparearea": "224",
"pageperblk": "64",
"quadread": "0x6B",
"readsts": "0x05",
"writests": "0x01",
"stsvalue": "0x02",
"dummy1": "0",
"dummy2": "1",
"suspintvl": "1"
},
"secureboot": "no",
"entrypoint": "0x28000000",
"aeskey" : "5E76953BF598581F925B7995157844747FABE669ABF000345E0EE21B63624D59",
"ecdsakey": "5E76953BF598581F925B7995157844747FABE669ABF000345E0EE21B63624D59",
"image":
[
{
"offset": "0x300000",
"loadaddr": "0x28023000",
"type": "3",
"file": "bl2.dtb"
},
{
"offset": "0x380000",
"loadaddr": "0x28000000",
"type": "4",
"file": "bl2.bin"
}
]
}
}
pack-nand.json:
{
"image":
[
{
"offset": "0x000000",
"file": "header.bin",
"type": 1
},
{
"offset": "0x300000",
"file": "bl2.dtb",
"type": 0
},
{
"offset": "0x380000",
"file": "bl2.bin",
"type": 0
},
{
"offset": "0x400000",
"file": "fip.bin-nand",
"type": 1
},
{
"offset": "0x600000",
"file": "uboot-env.bin-nand",
"type": 1
},
{
"offset": "0x700000",
"file": "Image.dtb",
"type": 1
},
{
"offset": "0x800000",
"file": "Image",
"type": 1
},
{
"offset": "0x1C00000",
"file": "rootfs.ubi",
"type": 1
}
]
}
2、TFA:
ma35d1.dtsi:
nand: nand@401A0000 {
compatible = "nuvoton,ma35d1-nand";
nand-on-flash-bbt;
/* nand information */
nand-ecc-strength = <8>;
nand-ecc-step-size = <512>;
nand-page-size = <4096>;
nand-oob-size = <224>;
nand-page-count = <64>;
nand-block-count = <4096>;
nand-image-offset = <0x400000>;
};
3、uboot:
CONFIG_NAND_BOOT=y
CONFIG_ENV_SIZE=0x100000
CONFIG_ENV_OFFSET=0x600000
CONFIG_MTDPARTS_DEFAULT="mtdparts=nand0:6m(uboot),1m(uboot-env),1m(device-tree),20m(kernel),100m(rootfs)"
4、Linux:
ma35d1.dtsi:
nand-ecc-strength = <8>;
nand-ecc-step-size = <512>;
nand-on-flash-bbt;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
uboot@0 {
label = "nand-uboot";
reg = <0x0000000 0x600000>;
read-only;
};
uboot-env@600000 {
label = "nand-uboot-env";
reg = <0x600000 0x100000>;
};
device-tree@700000 {
label = "nand-device-tree";
reg = <0x700000 0x100000>;
};
kernel@800000 {
label = "nand-kernel";
reg = <0x800000 0x1400000>;
};
rootfs@1C00000 {
label = "nand-rootfs";
reg = <0x1C00000 0x6400000>;
};
};
};
5、Rootfs:
BR2_TARGET_ROOTFS_UBI_PEBSIZE=0x40000
BR2_TARGET_ROOTFS_UBI_SUBSIZE=4096
BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x3E000
BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE=0x1000
BR2_TARGET_ROOTFS_UBIFS_MAXLEBCNT=400
|
|