[PATCH v5 3/7] blk: blkmap: add ramdisk creation utility function

Michal Simek michal.simek at amd.com
Fri Oct 6 13:25:57 CEST 2023



On 9/27/23 11:36, Masahisa Kojima wrote:
> User needs to call several functions to create the ramdisk
> with blkmap.
> This adds the utility function to create blkmap device and
> mount the ramdisk.
> 
> Signed-off-by: Masahisa Kojima <masahisa.kojima at linaro.org>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> ---
>   drivers/block/Makefile        |  1 +
>   drivers/block/blkmap.c        | 15 ----------
>   drivers/block/blkmap_helper.c | 53 +++++++++++++++++++++++++++++++++++
>   include/blkmap.h              | 29 +++++++++++++++++++
>   4 files changed, 83 insertions(+), 15 deletions(-)
>   create mode 100644 drivers/block/blkmap_helper.c
> 
> diff --git a/drivers/block/Makefile b/drivers/block/Makefile
> index a161d145fd..c3ccfc03e5 100644
> --- a/drivers/block/Makefile
> +++ b/drivers/block/Makefile
> @@ -15,6 +15,7 @@ endif
>   obj-$(CONFIG_SANDBOX) += sandbox.o host-uclass.o host_dev.o
>   obj-$(CONFIG_$(SPL_TPL_)BLOCK_CACHE) += blkcache.o
>   obj-$(CONFIG_BLKMAP) += blkmap.o
> +obj-$(CONFIG_BLKMAP) += blkmap_helper.o

you should actually build them only when it is enabled also for SPL/TPL

It means use style like this.

obj-$(CONFIG_$(SPL_TPL_)BLKMAP) += blkmap.o
obj-$(CONFIG_$(SPL_TPL_)BLKMAP) += blkmap_helper.o

Thanks,
Michal


More information about the U-Boot mailing list