From mboxrd@z Thu Jan 1 00:00:00 1970 From: Erik Larsson Date: Sat, 3 Mar 2018 19:46:34 +0100 Subject: [Buildroot] [PATCH v4 1/4] imx-mkimage: new package In-Reply-To: <20180303164706.0084b2ec@windsurf.home> References: <1520065060-20046-1-git-send-email-karl.erik.larsson@gmail.com> <1520065060-20046-2-git-send-email-karl.erik.larsson@gmail.com> <20180303164706.0084b2ec@windsurf.home> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Hi Thomas, 2018-03-03 16:47 GMT+01:00 Thomas Petazzoni : > Hello, > > On Sat, 3 Mar 2018 09:17:37 +0100, Erik Larsson wrote: > >> diff --git a/package/imx-mkimage/imx-mkimage.mk b/package/imx-mkimage/imx-mkimage.mk >> new file mode 100644 >> index 0000000..506ae75 >> --- /dev/null >> +++ b/package/imx-mkimage/imx-mkimage.mk >> @@ -0,0 +1,39 @@ >> +################################################################################ >> +# >> +# imx-mkimage >> +# >> +################################################################################ >> + >> +IMX_MKIMAGE_VERSION = imx_4.9.51_imx8m_beta >> +IMX_MKIMAGE_SITE = https://source.codeaurora.org/external/imx/imx-mkimage >> +IMX_MKIMAGE_SITE_METHOD = git >> +IMX_MKIMAGE_LICENSE = GPL-2.0+ >> +IMX_MKIMAGE_LICENSE_FILES = iMX8dv/COPYING >> +HOST_IMX_MKIMAGE_DEPENDENCIES = uboot linux firmware-imx arm-trusted-firmware >> + >> +define HOST_IMX_MKIMAGE_BUILD_CMDS >> + # These files are generated by firmware-imx, uboot and arm-trusted-firmware >> + # Copy the files into the iMX8M folder to make building of this package simple >> + # The NXP engineers has constructed to buildprocess with a bunch of hardcoded >> + # file names and pathes. >> + >> + # Currently this only supports iMX8M. When more hardware is available >> + # this needs to be selectable based on iMX8-version (iMX8M,iMXQ etc). >> + cp $(BINARIES_DIR)/u-boot-spl.bin $(@D)/iMX8M >> + cp $(BINARIES_DIR)/lpddr4_pmu_train* $(@D)/iMX8M >> + cp $(BINARIES_DIR)/fsl-imx8mq-evk.dtb $(@D)/iMX8M >> + cp $(BINARIES_DIR)/bl31.bin $(@D)/iMX8M >> + cp ${BINARIES_DIR}/u-boot-nodtb.bin $(@D)/iMX8M >> + >> + # In soc.mk it's hardcoded that the mkimage tool is named mkimage_uboot >> + # and that it's located in the iMX8M folder. >> + cp $(HOST_DIR)/bin/mkimage $(@D)/iMX8M/mkimage_uboot >> + >> + $(MAKE) -C $(@D) SOC=iMX8M flash_spl_uboot >> +endef >> + >> +define HOST_IMX_MKIMAGE_INSTALL_CMDS >> + $(INSTALL) -D -m 755 $(@D)/iMX8M/flash.bin $(BINARIES_DIR)/imx-boot-imx8mqevk-sd.bin > > I'm not a big fan of the fact that this host package not does not > install any host tool, but instead post-processes images created by > other packages. > > Would it be possible for this package to just install host tools, and > then have a post-image script that uses these host tools to provide the > final flash.bin image ? This first version if this patch-serie did sort of that. It build and installed host tools. And then they were used in post-image.sh. But after a comments/suggestion from Baruch I got encouraged do it this way. This solution is much clearer when reading the code then the first version, but maybe with the drawback of this host-package not really being a host-package as you stated. If you compare this solution with the first you will see that there is a pretty convoluted solution for doing parts that are in the Makefile och imx-mkimage. The main problem here may be the fact that NXP put stuff in there Makefile that rally doesn't have anything with the creation of the tool. > > Thomas > -- > Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) > Embedded Linux and Kernel engineering > http://bootlin.com /Erik