展讯SC8825的分区表是放在uboot中,路径如下:
u-boot/include/configs/sp8825ea.h
分区表定义在宏中,并通过bootargs传递给kernel
#define MTDPARTS_DEFAULT "mtdparts=sprd-nand:256k(spl),512k(2ndbl),256k(params),512k(vmjaluna),10m(modem),3840k(fixnv),3840k(backupfixnv),5120k(dsp),3840k(runtimenv),10m(bo
ot),10m(recovery),250m(system),180m(userdata),20m(cache),256k(misc),1m(boot_logo),1m(fastboot_logo),3840k(productinfo),512k(kpanic)"
#define CONFIG_BOOTARGS "mem=256M console=ttyS1,115200n8 init=/init " MTDPARTS_DEFAULT
内核中drivers/mtd/cmdlinepart.c会获取mtdparts后的参数
static int mtdpart_setup(char *s)
{
cmdline = s;
return 1;
}
__setup("mtdparts=", mtdpart_setup);
并通过parse_cmdline_partitions函数来解析该参数