Message ID | 1519293778-5185-2-git-send-email-karl.erik.larsson@gmail.com |
---|---|
State | Changes Requested |
Headers | show |
Series | Initial support for NXP iMX8 (imx8mq-evk) | expand |
Erik, On Thu, Feb 22, 2018 at 11:02:56AM +0100, Erik Larsson wrote: > This package add support for imx-mkimage for iMX8M. > Currently the only hardware it's tested for. > > Signed-off-by: Erik Larsson <karl.erik.larsson@gmail.com> Still no Crille nor Marcus? :-) Same for the all patches in this set. > --- > package/Config.in.host | 1 + > .../imx-mkimage/0001-remove-git-build-info.patch | 28 +++++++++++++++ > package/imx-mkimage/Config.in.host | 11 ++++++ > package/imx-mkimage/imx-mkimage.hash | 3 ++ > package/imx-mkimage/imx-mkimage.mk | 41 ++++++++++++++++++++++ > 5 files changed, 84 insertions(+) > create mode 100644 package/imx-mkimage/0001-remove-git-build-info.patch > create mode 100644 package/imx-mkimage/Config.in.host > create mode 100644 package/imx-mkimage/imx-mkimage.hash > create mode 100644 package/imx-mkimage/imx-mkimage.mk > > diff --git a/package/Config.in.host b/package/Config.in.host > index 199a8e9..06ef5cb 100644 > --- a/package/Config.in.host > +++ b/package/Config.in.host > @@ -24,6 +24,7 @@ menu "Host utilities" > source "package/go-bootstrap/Config.in.host" > source "package/google-breakpad/Config.in.host" > source "package/gptfdisk/Config.in.host" > + source "package/imx-mkimage/Config.in.host" > source "package/imx-usb-loader/Config.in.host" > source "package/jq/Config.in.host" > source "package/jsmin/Config.in.host" > diff --git a/package/imx-mkimage/0001-remove-git-build-info.patch b/package/imx-mkimage/0001-remove-git-build-info.patch > new file mode 100644 > index 0000000..e472133 > --- /dev/null > +++ b/package/imx-mkimage/0001-remove-git-build-info.patch > @@ -0,0 +1,28 @@ > +From d1bb893300b1bd80eaac27fcc8eb4347f56f83b4 Mon Sep 17 00:00:00 2001 > +From: Erik Larsson <erik.larsson@combitech.se> > +Date: Thu, 22 Feb 2018 09:56:53 +0100 > +Subject: [PATCH] Remove buildinformation step. > + > +Signed-off-by: Erik Larsson <erik.larsson@combitech.se> > +--- > + Makefile | 4 +--- > + 1 file changed, 1 insertion(+), 3 deletions(-) > + > +diff --git a/Makefile b/Makefile > +index 4b449ad..4042a39 100644 > +--- a/Makefile > ++++ b/Makefile > +@@ -33,9 +33,7 @@ $(MKIMG): buildinfo $(SRCS) > + bin: $(MKIMG) > + > + buildinfo: > +- @echo -n '#define MKIMAGE_COMMIT 0x' > src/build_info.h > +- @git rev-parse --short=8 HEAD >> src/build_info.h > +- @echo '' >> src/build_info.h > ++ @echo "#define MKIMAGE_COMMIT 0x0000" > src/build_info.h > + > + help: > + @echo $(CURR_DIR) > +-- > +2.7.4 > + > diff --git a/package/imx-mkimage/Config.in.host b/package/imx-mkimage/Config.in.host > new file mode 100644 > index 0000000..411f67c > --- /dev/null > +++ b/package/imx-mkimage/Config.in.host > @@ -0,0 +1,11 @@ > +config BR2_PACKAGE_HOST_IMX_MKIMAGE > + bool "host imx-mkimage" > + select BR2_PACKAGE_HOST_UBOOT_TOOLS > + select BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT > + depends on BR2_LINUX_KERNEL > + depends on BR2_TARGET_UBOOT > + help > + imx-mkimage is used to combine input images and generate > + final boot image with appropriate IVT set. > + > + https://source.codeaurora.org/external/imx/imx-mkimage > diff --git a/package/imx-mkimage/imx-mkimage.hash b/package/imx-mkimage/imx-mkimage.hash > new file mode 100644 > index 0000000..08d31ce > --- /dev/null > +++ b/package/imx-mkimage/imx-mkimage.hash > @@ -0,0 +1,3 @@ > +# Locally calculated > +sha256 4ddb144520001c33baa24493f68ef2ea9434ac36bf3ae223f78d7ec581aa484c imx-mkimage-imx_4.9.51_imx8m_beta.tar.gz > +sha256 231f7edcc7352d7734a96eef0b8030f77982678c516876fcb81e25b32d68564c iMX8dv/COPYING > diff --git a/package/imx-mkimage/imx-mkimage.mk b/package/imx-mkimage/imx-mkimage.mk > new file mode 100644 > index 0000000..e3c62bb > --- /dev/null > +++ b/package/imx-mkimage/imx-mkimage.mk > @@ -0,0 +1,41 @@ > +################################################################################ > +# > +# 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 The license is GPL-2.0+ as pointed out in v1. Best regards Marcus Folkesson
Hi Erik, On Thu, Feb 22, 2018 at 11:02:56AM +0100, Erik Larsson wrote: > This package add support for imx-mkimage for iMX8M. > Currently the only hardware it's tested for. > > Signed-off-by: Erik Larsson <karl.erik.larsson@gmail.com> > --- > package/Config.in.host | 1 + > .../imx-mkimage/0001-remove-git-build-info.patch | 28 +++++++++++++++ > package/imx-mkimage/Config.in.host | 11 ++++++ > package/imx-mkimage/imx-mkimage.hash | 3 ++ > package/imx-mkimage/imx-mkimage.mk | 41 ++++++++++++++++++++++ > 5 files changed, 84 insertions(+) > create mode 100644 package/imx-mkimage/0001-remove-git-build-info.patch > create mode 100644 package/imx-mkimage/Config.in.host > create mode 100644 package/imx-mkimage/imx-mkimage.hash > create mode 100644 package/imx-mkimage/imx-mkimage.mk > > diff --git a/package/Config.in.host b/package/Config.in.host > index 199a8e9..06ef5cb 100644 > --- a/package/Config.in.host > +++ b/package/Config.in.host > @@ -24,6 +24,7 @@ menu "Host utilities" > source "package/go-bootstrap/Config.in.host" > source "package/google-breakpad/Config.in.host" > source "package/gptfdisk/Config.in.host" > + source "package/imx-mkimage/Config.in.host" > source "package/imx-usb-loader/Config.in.host" > source "package/jq/Config.in.host" > source "package/jsmin/Config.in.host" > diff --git a/package/imx-mkimage/0001-remove-git-build-info.patch b/package/imx-mkimage/0001-remove-git-build-info.patch > new file mode 100644 > index 0000000..e472133 > --- /dev/null > +++ b/package/imx-mkimage/0001-remove-git-build-info.patch > @@ -0,0 +1,28 @@ > +From d1bb893300b1bd80eaac27fcc8eb4347f56f83b4 Mon Sep 17 00:00:00 2001 > +From: Erik Larsson <erik.larsson@combitech.se> > +Date: Thu, 22 Feb 2018 09:56:53 +0100 > +Subject: [PATCH] Remove buildinformation step. > + > +Signed-off-by: Erik Larsson <erik.larsson@combitech.se> > +--- [snip] > diff --git a/package/imx-mkimage/imx-mkimage.mk b/package/imx-mkimage/imx-mkimage.mk > new file mode 100644 > index 0000000..e3c62bb > --- /dev/null > +++ b/package/imx-mkimage/imx-mkimage.mk > @@ -0,0 +1,41 @@ > +################################################################################ > +# > +# 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 > + > + # We must rename this file because mkimage_fit_atf.sh has hardcoded names > + cp ${BINARIES_DIR}/u-boot.bin $(@D)/iMX8M/u-boot-nodtb.bin While testing here again I have seen that NXP provided U-Boot generates an image named u-boot-nodtb.bin in top level directory, which is not the same as u-boot.bin. So you might want to set BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME to u-boot-nodtb.bin, and copy that file directly, without rename. baruch > + > + # 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 > +endef > + > +$(eval $(host-generic-package))
Hi Baruch, 2018-02-25 9:43 GMT+01:00 Baruch Siach <baruch@tkos.co.il>: > Hi Erik, > > On Thu, Feb 22, 2018 at 11:02:56AM +0100, Erik Larsson wrote: >> This package add support for imx-mkimage for iMX8M. >> Currently the only hardware it's tested for. >> >> Signed-off-by: Erik Larsson <karl.erik.larsson@gmail.com> >> --- >> package/Config.in.host | 1 + >> .../imx-mkimage/0001-remove-git-build-info.patch | 28 +++++++++++++++ >> package/imx-mkimage/Config.in.host | 11 ++++++ >> package/imx-mkimage/imx-mkimage.hash | 3 ++ >> package/imx-mkimage/imx-mkimage.mk | 41 ++++++++++++++++++++++ >> 5 files changed, 84 insertions(+) >> create mode 100644 package/imx-mkimage/0001-remove-git-build-info.patch >> create mode 100644 package/imx-mkimage/Config.in.host >> create mode 100644 package/imx-mkimage/imx-mkimage.hash >> create mode 100644 package/imx-mkimage/imx-mkimage.mk >> >> diff --git a/package/Config.in.host b/package/Config.in.host >> index 199a8e9..06ef5cb 100644 >> --- a/package/Config.in.host >> +++ b/package/Config.in.host >> @@ -24,6 +24,7 @@ menu "Host utilities" >> source "package/go-bootstrap/Config.in.host" >> source "package/google-breakpad/Config.in.host" >> source "package/gptfdisk/Config.in.host" >> + source "package/imx-mkimage/Config.in.host" >> source "package/imx-usb-loader/Config.in.host" >> source "package/jq/Config.in.host" >> source "package/jsmin/Config.in.host" >> diff --git a/package/imx-mkimage/0001-remove-git-build-info.patch b/package/imx-mkimage/0001-remove-git-build-info.patch >> new file mode 100644 >> index 0000000..e472133 >> --- /dev/null >> +++ b/package/imx-mkimage/0001-remove-git-build-info.patch >> @@ -0,0 +1,28 @@ >> +From d1bb893300b1bd80eaac27fcc8eb4347f56f83b4 Mon Sep 17 00:00:00 2001 >> +From: Erik Larsson <erik.larsson@combitech.se> >> +Date: Thu, 22 Feb 2018 09:56:53 +0100 >> +Subject: [PATCH] Remove buildinformation step. >> + >> +Signed-off-by: Erik Larsson <erik.larsson@combitech.se> >> +--- > > [snip] > >> diff --git a/package/imx-mkimage/imx-mkimage.mk b/package/imx-mkimage/imx-mkimage.mk >> new file mode 100644 >> index 0000000..e3c62bb >> --- /dev/null >> +++ b/package/imx-mkimage/imx-mkimage.mk >> @@ -0,0 +1,41 @@ >> +################################################################################ >> +# >> +# 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 >> + >> + # We must rename this file because mkimage_fit_atf.sh has hardcoded names >> + cp ${BINARIES_DIR}/u-boot.bin $(@D)/iMX8M/u-boot-nodtb.bin > > While testing here again I have seen that NXP provided U-Boot generates an > image named u-boot-nodtb.bin in top level directory, which is not the same as > u-boot.bin. So you might want to set BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME to > u-boot-nodtb.bin, and copy that file directly, without rename. Thank you! I'll test that, > > baruch > >> + >> + # 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 >> +endef >> + >> +$(eval $(host-generic-package)) > > -- > http://baruch.siach.name/blog/ ~. .~ Tk Open Systems > =}------------------------------------------------ooO--U--Ooo------------{= > - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - /Erik
diff --git a/package/Config.in.host b/package/Config.in.host index 199a8e9..06ef5cb 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -24,6 +24,7 @@ menu "Host utilities" source "package/go-bootstrap/Config.in.host" source "package/google-breakpad/Config.in.host" source "package/gptfdisk/Config.in.host" + source "package/imx-mkimage/Config.in.host" source "package/imx-usb-loader/Config.in.host" source "package/jq/Config.in.host" source "package/jsmin/Config.in.host" diff --git a/package/imx-mkimage/0001-remove-git-build-info.patch b/package/imx-mkimage/0001-remove-git-build-info.patch new file mode 100644 index 0000000..e472133 --- /dev/null +++ b/package/imx-mkimage/0001-remove-git-build-info.patch @@ -0,0 +1,28 @@ +From d1bb893300b1bd80eaac27fcc8eb4347f56f83b4 Mon Sep 17 00:00:00 2001 +From: Erik Larsson <erik.larsson@combitech.se> +Date: Thu, 22 Feb 2018 09:56:53 +0100 +Subject: [PATCH] Remove buildinformation step. + +Signed-off-by: Erik Larsson <erik.larsson@combitech.se> +--- + Makefile | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 4b449ad..4042a39 100644 +--- a/Makefile ++++ b/Makefile +@@ -33,9 +33,7 @@ $(MKIMG): buildinfo $(SRCS) + bin: $(MKIMG) + + buildinfo: +- @echo -n '#define MKIMAGE_COMMIT 0x' > src/build_info.h +- @git rev-parse --short=8 HEAD >> src/build_info.h +- @echo '' >> src/build_info.h ++ @echo "#define MKIMAGE_COMMIT 0x0000" > src/build_info.h + + help: + @echo $(CURR_DIR) +-- +2.7.4 + diff --git a/package/imx-mkimage/Config.in.host b/package/imx-mkimage/Config.in.host new file mode 100644 index 0000000..411f67c --- /dev/null +++ b/package/imx-mkimage/Config.in.host @@ -0,0 +1,11 @@ +config BR2_PACKAGE_HOST_IMX_MKIMAGE + bool "host imx-mkimage" + select BR2_PACKAGE_HOST_UBOOT_TOOLS + select BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT + depends on BR2_LINUX_KERNEL + depends on BR2_TARGET_UBOOT + help + imx-mkimage is used to combine input images and generate + final boot image with appropriate IVT set. + + https://source.codeaurora.org/external/imx/imx-mkimage diff --git a/package/imx-mkimage/imx-mkimage.hash b/package/imx-mkimage/imx-mkimage.hash new file mode 100644 index 0000000..08d31ce --- /dev/null +++ b/package/imx-mkimage/imx-mkimage.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 4ddb144520001c33baa24493f68ef2ea9434ac36bf3ae223f78d7ec581aa484c imx-mkimage-imx_4.9.51_imx8m_beta.tar.gz +sha256 231f7edcc7352d7734a96eef0b8030f77982678c516876fcb81e25b32d68564c iMX8dv/COPYING diff --git a/package/imx-mkimage/imx-mkimage.mk b/package/imx-mkimage/imx-mkimage.mk new file mode 100644 index 0000000..e3c62bb --- /dev/null +++ b/package/imx-mkimage/imx-mkimage.mk @@ -0,0 +1,41 @@ +################################################################################ +# +# 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 + + # We must rename this file because mkimage_fit_atf.sh has hardcoded names + cp ${BINARIES_DIR}/u-boot.bin $(@D)/iMX8M/u-boot-nodtb.bin + + # 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 +endef + +$(eval $(host-generic-package))
This package add support for imx-mkimage for iMX8M. Currently the only hardware it's tested for. Signed-off-by: Erik Larsson <karl.erik.larsson@gmail.com> --- package/Config.in.host | 1 + .../imx-mkimage/0001-remove-git-build-info.patch | 28 +++++++++++++++ package/imx-mkimage/Config.in.host | 11 ++++++ package/imx-mkimage/imx-mkimage.hash | 3 ++ package/imx-mkimage/imx-mkimage.mk | 41 ++++++++++++++++++++++ 5 files changed, 84 insertions(+) create mode 100644 package/imx-mkimage/0001-remove-git-build-info.patch create mode 100644 package/imx-mkimage/Config.in.host create mode 100644 package/imx-mkimage/imx-mkimage.hash create mode 100644 package/imx-mkimage/imx-mkimage.mk