Lines Matching refs:bflow

204 static int cros_read_buf(struct bootflow *bflow, void *buf, ulong size,  in cros_read_buf()  argument
207 struct blk_desc *desc = dev_get_uclass_plat(bflow->blk); in cros_read_buf()
214 (ulong)map_to_sysmem(buf), bflow->blk->name, size, num_blks); in cros_read_buf()
215 ret = blk_read(bflow->blk, start, num_blks, buf); in cros_read_buf()
233 bflow->name = strdup(version); in cros_read_buf()
235 if (!bflow->name) in cros_read_buf()
236 bflow->name = strdup("ChromeOS"); in cros_read_buf()
237 if (!bflow->name) in cros_read_buf()
239 bflow->os_name = strdup("ChromeOS"); in cros_read_buf()
240 if (!bflow->os_name) in cros_read_buf()
243 ret = copy_cmdline(map_sysmem(cmdline, 0), uuid, &bflow->cmdline); in cros_read_buf()
247 if (!bootflow_img_add(bflow, "setup", in cros_read_buf()
252 bflow->x86_setup = map_sysmem(setup, 0); in cros_read_buf()
254 if (!bootflow_img_add(bflow, "cmdline", BFI_CMDLINE, cmdline, 0x1000)) in cros_read_buf()
268 static int cros_read_info(struct bootflow *bflow, const char *uuid, in cros_read_info() argument
271 struct cros_priv *priv = bflow->bootmeth_priv; in cros_read_info()
272 struct udevice *blk = bflow->blk; in cros_read_info()
307 ret = cros_read_buf(bflow, buf, size, in cros_read_info()
312 bflow->x86_setup = NULL; in cros_read_info()
318 if (!bootflow_img_add(bflow, "kernel", in cros_read_info()
326 static int cros_read_kernel(struct bootflow *bflow) in cros_read_kernel() argument
328 struct blk_desc *desc = dev_get_uclass_plat(bflow->blk); in cros_read_kernel()
329 struct cros_priv *priv = bflow->bootmeth_priv; in cros_read_kernel()
335 bflow->size = priv->body_size; in cros_read_kernel()
348 (ulong)map_to_sysmem(buf), bflow->blk->name, priv->body_size, in cros_read_kernel()
350 ret = blk_read(bflow->blk, in cros_read_kernel()
359 bflow->buf = buf; in cros_read_kernel()
360 bflow->x86_setup = map_sysmem(setup, 0); in cros_read_kernel()
365 static int cros_read_bootflow(struct udevice *dev, struct bootflow *bflow) in cros_read_bootflow() argument
374 log_debug("starting, part=%x\n", bflow->part); in cros_read_bootflow()
377 ret = scan_part(bflow->blk, bflow->part, &info, &hdr); in cros_read_bootflow()
388 bflow->bootmeth_priv = priv; in cros_read_bootflow()
390 log_debug("Selected partition %d, header at %lx\n", bflow->part, in cros_read_bootflow()
402 ret = cros_read_info(bflow, uuid, preamble); in cros_read_bootflow()
410 bflow->size = priv->body_size; in cros_read_bootflow()
411 bflow->state = BOOTFLOWST_READY; in cros_read_bootflow()
416 static int cros_read_file(struct udevice *dev, struct bootflow *bflow, in cros_read_file() argument
424 static int cros_read_all(struct udevice *dev, struct bootflow *bflow) in cros_read_all() argument
428 if (bflow->buf) in cros_read_all()
430 ret = cros_read_kernel(bflow); in cros_read_all()
438 static int cros_boot(struct udevice *dev, struct bootflow *bflow) in cros_boot() argument
442 if (!bflow->buf) { in cros_boot()
443 ret = cros_read_kernel(bflow); in cros_boot()
449 ret = zboot_run(map_to_sysmem(bflow->buf), bflow->size, 0, 0, in cros_boot()
450 map_to_sysmem(bflow->x86_setup), in cros_boot()
451 bflow->cmdline); in cros_boot()
453 ret = bootm_boot_start(map_to_sysmem(bflow->buf), in cros_boot()
454 bflow->cmdline); in cros_boot()