From: Chanho Park Date: Tue, 28 Jul 2015 05:37:07 +0000 (+0900) Subject: common: movi: support environment partition X-Git-Tag: submit/tizen/20160318.071304~95 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2923a2ad4010fc9a915c6cb6130689e8be9d8ea9;p=profile%2Fcommon%2Fplatform%2Fkernel%2Fu-boot-artik.git common: movi: support environment partition This patch supports to read and write the environment partition of movi command. The u-boot environment variables are stored in the partition and u-boot load the values from the partition Signed-off-by: Chanho Park --- diff --git a/common/cmd_movi.c b/common/cmd_movi.c index 225dfcc5a..552074548 100644 --- a/common/cmd_movi.c +++ b/common/cmd_movi.c @@ -88,6 +88,11 @@ int do_movi(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) goto usage; attribute = 0x3; break; + case 'e': + if (argc != (6 - location)) + goto usage; + attribute = 0x4; + break; case 'k': if (argc != 5) goto usage; @@ -193,6 +198,25 @@ int do_movi(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) return 1; } + /* Environment */ + if (attribute == 0x4) { + 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 %d Environment.. 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; + } + /* kernel r/w */ if (attribute == 0x5) { for (i=0, image = raw_area_control.image; i<15; i++) {