Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ICX7150 u-boot factory default routine
+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