image[part_num].attribute = 0x4;
strcpy(image[part_num].description, "environment");
dbg("env: %d\n", image[part_num].start_blk);
-
-
- /* For eMMC partition BLOCK Change*/
- if (location == 0)
- image[part_num].start_blk = image[part_num].start_blk + 1;
- part_num++;
-
- /* image 5 should be kernel */
-#ifdef CONFIG_KERNEL_OFFSET
- image[part_num].start_blk = CONFIG_KERNEL_OFFSET * 2048;
-#else
- image[part_num].start_blk = image[part_num - 1].start_blk + MOVI_ENV_BLKCNT;
-#endif
- image[part_num].used_blk = MOVI_ZIMAGE_BLKCNT;
- image[part_num].size = PART_SIZE_KERNEL;
- image[part_num].attribute = 0x5;
- strcpy(image[part_num].description, "kernel");
- dbg("knl: %d\n", image[part_num].start_blk);
part_num++;
- /* image 6 should be RFS */
- image[part_num].start_blk = image[part_num - 1].start_blk + MOVI_ZIMAGE_BLKCNT;
- image[part_num].used_blk = MOVI_ROOTFS_BLKCNT;
- image[part_num].size = PART_SIZE_ROOTFS;
- image[part_num].attribute = 0x6;
- strcpy(image[part_num].description, "rfs");
- dbg("rfs: %d\n", image[part_num].start_blk);
- part_num++;
-
-#ifdef CONFIG_CHARGER_LOGO
- image[part_num].start_blk = image[part_num - 1].start_blk + MOVI_ROOTFS_BLKCNT;
- image[part_num].used_blk = MOVI_CHARGER_LOGO_BLKCNT;
- image[part_num].size = PART_SIZE_CHARGER_LOGO;
- image[part_num].attribute = 0x7;
- strcpy(image[part_num].description, "charger");
- dbg("charger: %d\n", image[part_num].start_blk);
- part_num++;
-#endif
-#ifdef CONFIG_BOOT_LOGO
- image[part_num].start_blk = image[part_num - 1].start_blk + MOVI_CHARGER_LOGO_BLKCNT;
- image[part_num].used_blk = MOVI_BOOT_LOGO_BLKCNT;
- image[part_num].size = PART_SIZE_BOOT_LOGO;
- image[part_num].attribute = 0x8;
- strcpy(image[part_num].description, "bootlogo");
- dbg("bootlogo: %d\n", image[part_num].start_blk);
- part_num++;
-#endif
for (i = part_num; i < 15; i++) {
raw_area_control.image[i].start_blk = 0;
raw_area_control.image[i].used_blk = 0;
goto usage;
attribute = 0x4;
break;
- case 'k':
- if (argc != 5)
- goto usage;
- attribute = 0x5;
- break;
- case 'r':
- if (argc != 6)
- goto usage;
- attribute = 0x6;
- break;
-#ifdef CONFIG_CHARGER_LOGO
- case 'c':
- if (argc != (6 - location))
- goto usage;
- attribute = 0x7;
- break;
-#endif
-#ifdef CONFIG_BOOT_LOGO
- case 'l':
- if (argc != (6 - location))
- goto usage;
- attribute = 0x8;
- break;
-#endif
default:
goto usage;
}
return 1;
}
- /* kernel r/w */
- if (attribute == 0x5) {
- for (i=0, image = raw_area_control.image; i<15; i++) {
- if (image[i].attribute == attribute)
- break;
- }
- start_blk = image[i].start_blk;
- blkcnt = image[i].used_blk;
- printf("%s kernel..device %d Start %ld, Count %ld ", rw ? "writing" : "reading",
- dev_num, start_blk, blkcnt);
- sprintf(run_cmd, "mmc %s %d 0x%lx 0x%lx 0x%lx",
- rw ? "write" : "read", dev_num,
- addr, start_blk, blkcnt);
- run_command(run_cmd, dev_num);
- printf("completed\n");
- return 1;
- }
-
- /* root file system r/w */
- if (attribute == 0x6) {
- rfs_size = simple_strtoul(argv[5], NULL, 16);
-
- for (i=0, image = raw_area_control.image; i<15; i++) {
- if (image[i].attribute == attribute)
- break;
- }
- start_blk = image[i].start_blk;
- blkcnt = rfs_size/MOVI_BLKSIZE +
- ((rfs_size&(MOVI_BLKSIZE-1)) ? 1 : 0);
- image[i].used_blk = blkcnt;
- printf("%s RFS..device %d Start %ld, Count %ld ", rw ? "writing":"reading",
- dev_num, start_blk, blkcnt);
- sprintf(run_cmd,"mmc %s %d 0x%lx 0x%lx 0x%lx",
- rw ? "write":"read", dev_num,
- addr, start_blk, blkcnt);
- run_command(run_cmd, dev_num);
- printf("completed\n");
- return 1;
- }
-
-#ifdef CONFIG_CHARGER_LOGO
- if (attribute == 0x7) {
- for (i=0, image = raw_area_control.image; i<15; i++) {
- if (image[i].attribute == attribute)
- break;
- }
- start_blk = image[i].start_blk;
- blkcnt = image[i].used_blk;
- printf("%s charger logo..device %d Start %ld, Count %ld ", rw ? "writing" : "reading",
- dev_num, start_blk, blkcnt);
- sprintf(run_cmd, "mmc %s %d 0x%lx 0x%lx 0x%lx",
- rw ? "write" : "read", dev_num,
- addr, start_blk, blkcnt);
- run_command(run_cmd, dev_num);
- printf("completed\n");
- return 1;
- }
-#endif
-#ifdef CONFIG_BOOT_LOGO
- if (attribute == 0x8) {
- for (i=0, image = raw_area_control.image; i<15; i++) {
- if (image[i].attribute == attribute)
- break;
- }
- start_blk = image[i].start_blk;
- blkcnt = image[i].used_blk;
- printf("%s bootlogo.. %d Start %ld, Count %ld ", rw ? "writing" : "reading",
- dev_num, start_blk, blkcnt);
- sprintf(run_cmd, "mmc %s %d 0x%lx 0x%lx 0x%lx",
- rw ? "write" : "read", dev_num,
- addr, start_blk, blkcnt);
- run_command(run_cmd, dev_num);
- printf("completed\n");
- return 1;
- }
-#endif
return 1;
usage:
"movi read {fwbl1 | bl2 | u-boot | tzsw} {device_number} {addr} - Read data from sd/mmc\n"
"movi write {fwbl1 | bl2 | u-boot | tzsw} {device_number} {addr} - Read data from sd/mmc\n"
"#COMMON#\n"
- "movi read kernel {device_number} {addr} - Read data from device\n"
- "movi write kernel {device_number} {addr} - Write data to device\n"
- "movi read rootfs {device_number} {addr} [bytes(hex)] - Read rootfs data from device by size\n"
- "movi write rootfs {device_number} {addr} [bytes(hex)] - Write rootfs data to device by size\n"
"movi read {sector#} {device_number} {bytes(hex)} {addr} - instead of this, you can use \"mmc read\"\n"
"movi write {sector#} {device_number} {bytes(hex)} {addr} - instead of this, you can use \"mmc write\"\n"
);