Created
September 4, 2021 08:57
-
-
Save Fohdeesha/97519df0172894a3c92e1a7a367126cf to your computer and use it in GitHub Desktop.
ICX7150 u-boot factory default routine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+int do_factory_default(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) | |
+{ | |
+ int ret = 1; | |
+ char ch; | |
+ | |
+ switch (argc) { | |
+ case 2: | |
+ if(strcmp(argv[1],"set-default") == 0) { | |
+ printf("Execution of \"factory set-default\" will remove all user data like config, keys etc.\n\n"); | |
+ printf("Do you want to continue? (Y/N) "); | |
+ | |
+ ch = getc(); | |
+ printf("%c\n", ch); | |
+ | |
+ if (ch == 'Y') { | |
+ ret = do_set_default(); | |
+ } else { | |
+ printf("\nAborting operation\n"); | |
------------- | |
+static int do_set_default (void) { | |
+ fips_status = 0; | |
+ fips_reset = 1; | |
+ fips_reset_flag = 0; | |
+ setenv("fips_reset", "fipsreset"); | |
+ setenv("fips_status", NULL); | |
+ saveenv(); | |
+ reserve_cmd = normal_mode_cmd; | |
+ fips_reset_flag = 1; | |
+ | |
+ printf("\nCommand executed successfully\n"); | |
+ | |
+ return 0; | |
+} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment