[U-Boot] map mtd partitions address for TWO NOR flash

Hi guys: I have a mpc8313erbd (powerpc arch) demo board. There are one NOR flash and one NAND flash on board. The drivers/mtd/map/mpc8313erbd.c do address map for NOR flash. I want to add another NOR flash and take off the NAND flash. So there are two NOR flash on board. I am trying to do address map for two NOR flash but I don't know how to. Some part of drivers/mtd/map/mpc8313erbd.c code is as following: Do I need to add another mtd_partition structure ? How to assign the partition_info to specific NOR flash (coz the two NOR flash are the same) BTW, I know u-boot can pass the mtdparts parameters to linux kernel. Which mtd partition info linux kernel will use, u-boot mtdparts info or static address map code ? thanks, regards.
static struct mtd_partition partition_info[]={ { .name = "U-Boot", .offset = 0, .size = 0x100000, .mask_flags = MTD_WRITEABLE }, { .name = "Kernel", .offset = MTDPART_OFS_APPEND, .size = 0x200000 }, { .name = "JFFS2", .offset = MTDPART_OFS_APPEND, .size = 0x400000, }, { .name = "dtb", .offset = MTDPART_OFS_APPEND, .size = 0x100000, }, };

Dear "H. Johnny",
In message 50a974c70905132045t73c26b97i9a245219e60fd49b@mail.gmail.com you wrote:
BTW, I know u-boot can pass the mtdparts parameters to linux kernel. Which mtd partition info linux kernel will use, u-boot mtdparts info or static address map code ?
That's a Linux question, isn't it? And as such off topic here...
The answer is: it depends.
If you don't configure CONFIG_MTD_CMDLINE_PARTS into your kernel, then always the static partition map will be used. If you enable CONFIG_MTD_CMDLINE_PARTS and do not provide partition info on the command line, then also the static partition map will be used. If you enable CONFIG_MTD_CMDLINE_PARTS *and* provide partition info on the command line, then the command line information will be used.
Best regards,
Wolfgang Denk

BTW, I know u-boot can pass the mtdparts parameters to linux kernel. Which mtd partition info linux kernel will use, u-boot mtdparts info or static address map code ?
That's a Linux question, isn't it? And as such off topic here...
The answer is: it depends.
If you don't configure CONFIG_MTD_CMDLINE_PARTS into your kernel, then always the static partition map will be used. If you enable CONFIG_MTD_CMDLINE_PARTS and do not provide partition info on the command line, then also the static partition map will be used. If you enable CONFIG_MTD_CMDLINE_PARTS *and* provide partition info on the command line, then the command line information will be used.
Yes, I know but i'm trying to pass mtdparts to linux kernel but it still use static partitions. Thanks for your reply. I will look into the kernel source code.
participants (2)
-
H. Johnny
-
Wolfgang Denk