Lines Matching refs:bflow

342 static int bootflow_check(struct bootflow_iter *iter, struct bootflow *bflow)  in bootflow_check()  argument
349 ret = bootmeth_get_bootflow(iter->method, bflow); in bootflow_check()
357 ret = bootdev_get_bootflow(dev, iter, bflow); in bootflow_check()
383 struct bootflow *bflow) in bootflow_scan_first() argument
413 ret = bootflow_check(iter, bflow); in bootflow_scan_first()
421 ret = bootflow_scan_next(iter, bflow); in bootflow_scan_first()
429 int bootflow_scan_next(struct bootflow_iter *iter, struct bootflow *bflow) in bootflow_scan_next() argument
440 ret = bootflow_check(iter, bflow); in bootflow_scan_next()
457 void bootflow_init(struct bootflow *bflow, struct udevice *bootdev, in bootflow_init() argument
460 memset(bflow, '\0', sizeof(*bflow)); in bootflow_init()
461 bflow->dev = bootdev; in bootflow_init()
462 bflow->method = meth; in bootflow_init()
463 bflow->state = BOOTFLOWST_BASE; in bootflow_init()
464 alist_init_struct(&bflow->images, struct bootflow_img); in bootflow_init()
467 void bootflow_free(struct bootflow *bflow) in bootflow_free() argument
471 free(bflow->name); in bootflow_free()
472 free(bflow->subdir); in bootflow_free()
473 free(bflow->fname); in bootflow_free()
474 if (!(bflow->flags & BOOTFLOWF_STATIC_BUF)) in bootflow_free()
475 free(bflow->buf); in bootflow_free()
476 free(bflow->os_name); in bootflow_free()
477 free(bflow->fdt_fname); in bootflow_free()
478 free(bflow->bootmeth_priv); in bootflow_free()
480 alist_for_each(img, &bflow->images) in bootflow_free()
482 alist_empty(&bflow->images); in bootflow_free()
485 void bootflow_remove(struct bootflow *bflow) in bootflow_remove() argument
487 bootflow_free(bflow); in bootflow_remove()
491 int bootflow_read_all(struct bootflow *bflow) in bootflow_read_all() argument
495 if (bflow->state != BOOTFLOWST_READY) in bootflow_read_all()
498 ret = bootmeth_read_all(bflow->method, bflow); in bootflow_read_all()
506 int bootflow_boot(struct bootflow *bflow) in bootflow_boot() argument
510 if (bflow->state != BOOTFLOWST_READY) in bootflow_boot()
513 ret = bootmeth_boot(bflow->method, bflow); in bootflow_boot()
525 int bootflow_run_boot(struct bootflow_iter *iter, struct bootflow *bflow) in bootflow_run_boot() argument
529 printf("** Booting bootflow '%s' with %s\n", bflow->name, in bootflow_run_boot()
530 bflow->method->name); in bootflow_run_boot()
532 (bflow->flags & BOOTFLOWF_USE_PRIOR_FDT)) in bootflow_run_boot()
534 ret = bootflow_boot(bflow); in bootflow_run_boot()
543 bootflow_state_get_name(bflow->state)); in bootflow_run_boot()
546 printf("Boot method '%s' not supported\n", bflow->method->name); in bootflow_run_boot()
553 ret2 = bootflow_iter_drop_bootmeth(iter, bflow->method); in bootflow_run_boot()
556 bflow->method->name); in bootflow_run_boot()
635 int bootflow_cmdline_set(struct bootflow *bflow, const char *value) in bootflow_cmdline_set() argument
645 free(bflow->cmdline); in bootflow_cmdline_set()
646 bflow->cmdline = cmdline; in bootflow_cmdline_set()
659 struct bootflow *bflow; in on_bootargs() local
665 bflow = std->cur_bootflow; in on_bootargs()
666 if (!bflow) in on_bootargs()
672 ret = bootflow_cmdline_set(bflow, value); in on_bootargs()
677 bootflow_cmdline_set(bflow, NULL); in on_bootargs()
878 int bootflow_cmdline_set_arg(struct bootflow *bflow, const char *set_arg, in bootflow_cmdline_set_arg() argument
885 ret = cmdline_set_arg(buf, sizeof(buf), bflow->cmdline, set_arg, in bootflow_cmdline_set_arg()
890 ret = bootflow_cmdline_set(bflow, buf); in bootflow_cmdline_set_arg()
896 free(bflow->cmdline); in bootflow_cmdline_set_arg()
897 bflow->cmdline = cmd; in bootflow_cmdline_set_arg()
900 ret = env_set("bootargs", bflow->cmdline); in bootflow_cmdline_set_arg()
917 int bootflow_cmdline_get_arg(struct bootflow *bflow, const char *arg, in bootflow_cmdline_get_arg() argument
923 ret = cmdline_get_arg(bflow->cmdline, arg, &pos); in bootflow_cmdline_get_arg()
926 *val = bflow->cmdline + pos; in bootflow_cmdline_get_arg()
931 int bootflow_cmdline_auto(struct bootflow *bflow, const char *arg) in bootflow_cmdline_auto() argument
961 ret = bootflow_cmdline_set_arg(bflow, arg, buf, true); in bootflow_cmdline_auto()
980 struct bootflow_img *bootflow_img_add(struct bootflow *bflow, const char *fname, in bootflow_img_add() argument
994 ptr = alist_add(&bflow->images, img); in bootflow_img_add()
1001 int bootflow_get_seq(const struct bootflow *bflow) in bootflow_get_seq() argument
1010 return alist_calc_index(&std->bootflows, bflow); in bootflow_get_seq()