| // SPDX-License-Identifier: GPL-2.0+ |
| * Copyright (c) 2023, Linaro Limited |
| #include <dm/device-internal.h> |
| int blkmap_create_ramdisk(const char *label, ulong image_addr, ulong image_size, |
| ret = blkmap_create(label, &bm_dev); |
| log_err("failed to create blkmap\n"); |
| bm = dev_get_plat(bm_dev); |
| desc = dev_get_uclass_plat(bm->blk); |
| blknum = image_size >> desc->log2blksz; |
| ret = blkmap_map_pmem(bm_dev, 0, blknum, image_addr); |
| log_err("Unable to map %#llx at block %d : %d\n", |
| (unsigned long long)image_addr, 0, ret); |
| log_info("Block %d+0x" LBAF " mapped to %#llx\n", 0, blknum, |
| (unsigned long long)image_addr); |
| ret = device_probe(bm->blk); |