| .. | .. |
|---|
| 22 | 22 | #endif |
|---|
| 23 | 23 | |
|---|
| 24 | 24 | #define MTD_PART_NAND_HEAD "mtdparts=" |
|---|
| 25 | | -#define MTD_ROOT_PART_NUM "ubi.mtd=" |
|---|
| 26 | | -#define MTD_ROOT_PART_NAME_UBIFS "root=ubi0:rootfs" |
|---|
| 27 | | -#define MTD_ROOT_PART_NAME_SQUASHFS "root=/dev/ubiblock0_0" |
|---|
| 28 | 25 | #define MTD_PART_INFO_MAX_SIZE 512 |
|---|
| 29 | 26 | #define MTD_SINGLE_PART_INFO_MAX_SIZE 40 |
|---|
| 30 | 27 | |
|---|
| .. | .. |
|---|
| 371 | 368 | mtd = (struct mtd_info *)dev_desc->bdev->priv; |
|---|
| 372 | 369 | if (!mtd) |
|---|
| 373 | 370 | return NULL; |
|---|
| 374 | | -#ifndef CONFIG_SPL_BUILD |
|---|
| 375 | | - char mtd_root_part_info[40] = {0}; |
|---|
| 376 | 371 | |
|---|
| 377 | | - p = part_get_info_by_name(dev_desc, PART_SYSTEM, &info); |
|---|
| 378 | | - if (p > 0) { |
|---|
| 379 | | - if (strstr(env_get("bootargs"), "rootfstype=squashfs")) |
|---|
| 380 | | - snprintf(mtd_root_part_info, ARRAY_SIZE(mtd_root_part_info), "%s%d %s", |
|---|
| 381 | | - MTD_ROOT_PART_NUM, p - 1, MTD_ROOT_PART_NAME_SQUASHFS); |
|---|
| 382 | | - else |
|---|
| 383 | | - snprintf(mtd_root_part_info, ARRAY_SIZE(mtd_root_part_info), "%s%d %s", |
|---|
| 384 | | - MTD_ROOT_PART_NUM, p - 1, MTD_ROOT_PART_NAME_UBIFS); |
|---|
| 385 | | - env_update("bootargs", mtd_root_part_info); |
|---|
| 386 | | - } |
|---|
| 387 | | -#endif |
|---|
| 388 | 372 | mtd_part_info = (char *)calloc(MTD_PART_INFO_MAX_SIZE, sizeof(char)); |
|---|
| 389 | 373 | if (!mtd_part_info) { |
|---|
| 390 | 374 | printf("%s: Fail to malloc!", __func__); |
|---|