Skip to contentSkip to conversation

Initial support for NXP iMX8 (imx8mq-evk)

PATCH Superseded Erik Larsson 5 participants 18 messages Feb 18, 2018 – Feb 19, 2018 Arm i.MX and Layerscape

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

cover Initial support for NXP iMX8 (imx8mq-evk)

This series provides initial support for NXP iMX8.

This series of patches are tested against NXP imx8mq-evk. It only handles basic support for iIMX8, currently no support for GPU, VPU and other HW features. This series makes it possible to build a minimal system for imx8mq-evk.

Erik Larsson (3):
imx-mkimage: new package
imx-atf: new package
add support for iMX8MQ-evk board

 .../common/imx/genimage.cfg.template_imx8          |  40 ++
 board/freescale/common/imx/post-image.sh           |  33 +-
 board/freescale/imx8mqevk/linux-4.9.config         | 625 +++++++++++++++++++++
 configs/freescale_imx8mqevk_defconfig              |  35 ++
 package/Config.in.host                             |   1 +
 package/freescale-imx/Config.in                    |   8 +-
 package/freescale-imx/firmware-imx/Config.in       |   2 +-
 package/freescale-imx/firmware-imx/firmware-imx.mk |   8 +
 package/freescale-imx/imx-atf/Config.in            |   5 +
 package/freescale-imx/imx-atf/imx-atf.hash         |   3 +
 package/freescale-imx/imx-atf/imx-atf.mk           |  23 +
 .../0001-make-bl33-read-env-variables.patch        |  37 ++
 package/freescale-imx/imx-mkimage/Config.in.host   |   5 +
 package/freescale-imx/imx-mkimage/imx-mkimage.hash |   3 +
 package/freescale-imx/imx-mkimage/imx-mkimage.mk   |  23 +
 15 files changed, 846 insertions(+), 5 deletions(-)
 create mode 100644 board/freescale/common/imx/genimage.cfg.template_imx8
 create mode 100644 board/freescale/imx8mqevk/linux-4.9.config
 create mode 100644 configs/freescale_imx8mqevk_defconfig
 create mode 100644 package/freescale-imx/imx-atf/Config.in
 create mode 100644 package/freescale-imx/imx-atf/imx-atf.hash
 create mode 100644 package/freescale-imx/imx-atf/imx-atf.mk
 create mode 100644 package/freescale-imx/imx-mkimage/0001-make-bl33-read-env-variables.patch
 create mode 100644 package/freescale-imx/imx-mkimage/Config.in.host
 create mode 100644 package/freescale-imx/imx-mkimage/imx-mkimage.hash
 create mode 100644 package/freescale-imx/imx-mkimage/imx-mkimage.mk
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/3 imx-mkimage: new package

---
 package/Config.in.host                             |  1 +
 .../0001-make-bl33-read-env-variables.patch        | 37 ++++++++++++++++++++++
 package/freescale-imx/imx-mkimage/Config.in.host   |  5 +++
 package/freescale-imx/imx-mkimage/imx-mkimage.hash |  3 ++
 package/freescale-imx/imx-mkimage/imx-mkimage.mk   | 23 ++++++++++++++
 5 files changed, 69 insertions(+)
 create mode 100644 package/freescale-imx/imx-mkimage/0001-make-bl33-read-env-variables.patch
 create mode 100644 package/freescale-imx/imx-mkimage/Config.in.host
 create mode 100644 package/freescale-imx/imx-mkimage/imx-mkimage.hash
 create mode 100644 package/freescale-imx/imx-mkimage/imx-mkimage.mk
package/Config.in.host +1 -0
index 199a8e9..b1cfa75 100644
@@ -15,6 +15,7 @@ menu "Host utilities"
 	source "package/e2fsprogs/Config.in.host"
 	source "package/e2tools/Config.in.host"
 	source "package/faketime/Config.in.host"
+	source "package/freescale-imx/imx-mkimage/Config.in.host"
 	source "package/fwup/Config.in.host"
 	source "package/genext2fs/Config.in.host"
 	source "package/genimage/Config.in.host"
package/freescale-imx/imx-mkimage/0001-make-bl33-read-env-variables.patch new file +37 -0
new file mode 100644
index 0000000..490eb05
@@ -0,0 +1,37 @@
+From 5ca549356ef889286c12b4d736d9026efafb8fff Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Mon, 29 Jan 2018 08:00:57 +0100
+Subject: [PATCH] Add support for overriding BL32 and BL33 not only BL31
+
+Signed-off-by: Erik Larsson <[email protected]>
+Signed-off-by: Christopher Dahlberg <[email protected]>
+Signed-off-by: Marcus Folkesson <[email protected]>
+---
+ iMX8M/mkimage_fit_atf.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/iMX8M/mkimage_fit_atf.sh b/iMX8M/mkimage_fit_atf.sh
+index 3a3bd10..95a11eb 100755
+--- a/iMX8M/mkimage_fit_atf.sh
++++ b/iMX8M/mkimage_fit_atf.sh
+@@ -15,7 +15,7 @@ else
+	ls -lct bl31.bin | awk '{print $5}' >&2
+ fi
+
+-BL32="tee.bin"
++[ -z "$BL32" ] && BL32="tee.bin"
+
+ if [ ! -f $BL32 ]; then
+	BL32=/dev/null
+@@ -25,7 +25,7 @@ else
+	ls -lct tee.bin | awk '{print $5}' >&2
+ fi
+
+-BL33="u-boot-nodtb.bin"
++[ -z "$BL33" ] && BL33="u-boot-nodtb.bin"
+
+ if [ ! -f $BL33 ]; then
+	echo "ERROR: $BL33 file NOT found" >&2
+--
+2.7.4
+
package/freescale-imx/imx-mkimage/Config.in.host new file +5 -0
new file mode 100644
index 0000000..3cf0966
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HOST_IMX_MKIMAGE
+	bool "host imx-mkimage"
+	help
+	  imx-mkimage is used to combine input images and generate
+	  final boot image with appropriate IVT set.
package/freescale-imx/imx-mkimage/imx-mkimage.hash new file +3 -0
new file mode 100644
index 0000000..08d31ce
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 4ddb144520001c33baa24493f68ef2ea9434ac36bf3ae223f78d7ec581aa484c  imx-mkimage-imx_4.9.51_imx8m_beta.tar.gz
+sha256 231f7edcc7352d7734a96eef0b8030f77982678c516876fcb81e25b32d68564c  iMX8dv/COPYING
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +23 -0
new file mode 100644
index 0000000..a5b1f93
@@ -0,0 +1,23 @@
+################################################################################
+#
+# 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
+
+define HOST_IMX_MKIMAGE_BUILD_CMDS
+	$(MAKE) -C $(@D)/iMX8M -f soc.mak mkimage_imx8
+endef
+
+define HOST_IMX_MKIMAGE_INSTALL_CMDS
+	mkdir -p $(HOST_DIR)/bin
+	$(INSTALL) -m 755 $(@D)/iMX8M/mkimage_imx8 $(HOST_DIR)/bin
+	$(INSTALL) -m 755 $(@D)/iMX8M/mkimage_fit_atf.sh $(HOST_DIR)/bin
+endef
+
+$(eval $(host-generic-package))
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/3 imx-mkimage: new package

Hello,

Thanks for this contribution!

Quoted 18 lines · Erik Larsson
---
 package/Config.in.host                             |  1 +
 .../0001-make-bl33-read-env-variables.patch        | 37 ++++++++++++++++++++++
 package/freescale-imx/imx-mkimage/Config.in.host   |  5 +++
 package/freescale-imx/imx-mkimage/imx-mkimage.hash |  3 ++
 package/freescale-imx/imx-mkimage/imx-mkimage.mk   | 23 ++++++++++++++
 5 files changed, 69 insertions(+)
 create mode 100644 package/freescale-imx/imx-mkimage/0001-make-bl33-read-env-variables.patch
 create mode 100644 package/freescale-imx/imx-mkimage/Config.in.host
 create mode 100644 package/freescale-imx/imx-mkimage/imx-mkimage.hash
 create mode 100644 package/freescale-imx/imx-mkimage/imx-mkimage.mk
package/Config.in.host +0 -0
index 199a8e9..b1cfa75 100644

package/Config.in.host menu "Host utilities" · line 18

Quoted 4 lines
package/Config.in.host +1 -0
@@ -15,6 +15,7 @@ menu "Host utilities"
 	source "package/e2fsprogs/Config.in.host"
 	source "package/e2tools/Config.in.host"
 	source "package/faketime/Config.in.host"
+	source "package/freescale-imx/imx-mkimage/Config.in.host"

I'm not sure this package needs to be under package/freescale-imx/. This sub-directory was initially created to share the FREESCALE_IMX_SITE and FREESCALE_IMX_EXTRACT_HELPER definitions, but you don't use them.

Quoted 6 lines
package/freescale-imx/imx-mkimage/0001-make-bl33-read-env-variables.patch new file +0 -0
new file mode 100644
index 0000000..490eb05

package/freescale-imx/imx-mkimage/0001-make-bl33-read-env-variables.patch line 8

Quoted 8 lines
package/freescale-imx/imx-mkimage/0001-make-bl33-read-env-variables.patch new file +8 -0
@@ -0,0 +1,37 @@
+From 5ca549356ef889286c12b4d736d9026efafb8fff Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Mon, 29 Jan 2018 08:00:57 +0100
+Subject: [PATCH] Add support for overriding BL32 and BL33 not only BL31
+
+Signed-off-by: Erik Larsson <[email protected]>
+Signed-off-by: Christopher Dahlberg <[email protected]>
+Signed-off-by: Marcus Folkesson <[email protected]>

What is the upstream status of this patch ?

package/freescale-imx/imx-mkimage/Config.in.host line 5

Quoted 11 lines
package/freescale-imx/imx-mkimage/Config.in.host new file +5 -0
new file mode 100644
index 0000000..3cf0966
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HOST_IMX_MKIMAGE
+	bool "host imx-mkimage"
+	help
+	  imx-mkimage is used to combine input images and generate
+	  final boot image with appropriate IVT set.

We like to have a blank line, and then the URL of the upstream project main page. Here, https://source.codeaurora.org/external/imx/imx-mkimage
might be enough, unless there is a better page.

Quoted 10 lines
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +4 -0
new file mode 100644
index 0000000..a5b1f93
@@ -0,0 +1,23 @@
+################################################################################
+#
+# imx-mkimage
+#

package/freescale-imx/imx-mkimage/imx-mkimage.mk line 14

Quoted 10 lines
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +10 -0
+################################################################################
+
+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
+
+define HOST_IMX_MKIMAGE_BUILD_CMDS
+	$(MAKE) -C $(@D)/iMX8M -f soc.mak mkimage_imx8

Why are you building just the tool in iMX8M ? There is also one in src/ and in iMX8dv. What are the differences ? Should we build/install all of them ? Conditionally ?

package/freescale-imx/imx-mkimage/imx-mkimage.mk line 18

Quoted 2 lines
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +2 -0
+define HOST_IMX_MKIMAGE_INSTALL_CMDS
+	mkdir -p $(HOST_DIR)/bin

This line is not needed... if...

package/freescale-imx/imx-mkimage/imx-mkimage.mk line 20

Quoted 2 lines
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +2 -0
+	$(INSTALL) -m 755 $(@D)/iMX8M/mkimage_imx8 $(HOST_DIR)/bin
+	$(INSTALL) -m 755 $(@D)/iMX8M/mkimage_fit_atf.sh $(HOST_DIR)/bin

You replace those lines by:

	$(INSTALL) -D -m 755 $(@D)/iMX8M/mkimage_imx8 $(HOST_DIR)/bin/mkimage_imx8
	$(INSTALL) -D -m 755 $(@D)/iMX8M/mkimage_fit_atf.sh $(HOST_DIR)/bin/mkimage_fit_atf.sh

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
#3 lore raw

PATCH 1/3 imx-mkimage: new package

Hello,

2018-02-18 15:51 GMT+01:00 Thomas Petazzoni <[email protected]>:

Quoted 20 lines

Hello,

Thanks for this contribution!

Quoted 4 lines · Erik Larsson
---
 package/Config.in.host                             |  1 +
 .../0001-make-bl33-read-env-variables.patch        | 37

++++++++++++++++++++++

Quoted 5 lines
 package/freescale-imx/imx-mkimage/Config.in.host   |  5 +++
 package/freescale-imx/imx-mkimage/imx-mkimage.hash |  3 ++
 package/freescale-imx/imx-mkimage/imx-mkimage.mk   | 23 ++++++++++++++
 5 files changed, 69 insertions(+)
 create mode 100644 package/freescale-imx/imx-

mkimage/0001-make-bl33-read-env-variables.patch

Quoted 4 lines
 create mode 100644 package/freescale-imx/imx-mkimage/Config.in.host
 create mode 100644 package/freescale-imx/imx-mkimage/imx-mkimage.hash
 create mode 100644 package/freescale-imx/imx-mkimage/imx-mkimage.mk
Quoted 15 lines

package/Config.in.host menu "Host utilities" · line 18

Quoted 9 lines
package/Config.in.host +1 -0
index 199a8e9..b1cfa75 100644
@@ -15,6 +15,7 @@ menu "Host utilities"
      source "package/e2fsprogs/Config.in.host"
      source "package/e2tools/Config.in.host"
      source "package/faketime/Config.in.host"
+     source "package/freescale-imx/imx-mkimage/Config.in.host"

I'm not sure this package needs to be under package/freescale-imx/. This sub-directory was initially created to share the FREESCALE_IMX_SITE and FREESCALE_IMX_EXTRACT_HELPER definitions, but you don't use them.

Thanks for the information, I'll move it.

Quoted 8 lines

Review

Quoted 1 line
(quoted diff) +0 -0

b/package/freescale-imx/imx-mkimage/0001-make-bl33-read- env-variables.patch

package/freescale-imx/imx-mkimage/0001-make-bl33-read-

Quoted 4 lines

new file mode 100644
index 0000000..490eb05

package/freescale-imx/imx-mkimage/0001-make-bl33-read- new file +0 -0

env-variables.patch

Quoted 12 lines

package/freescale-imx/imx-mkimage/0001-make-bl33-read- line 8

Quoted 9 lines
package/freescale-imx/imx-mkimage/0001-make-bl33-read- new file +8 -0
@@ -0,0 +1,37 @@
+From 5ca549356ef889286c12b4d736d9026efafb8fff Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Mon, 29 Jan 2018 08:00:57 +0100
+Subject: [PATCH] Add support for overriding BL32 and BL33 not only BL31
+
+Signed-off-by: Erik Larsson <[email protected]>
+Signed-off-by: Christopher Dahlberg <[email protected]>
+Signed-off-by: Marcus Folkesson <[email protected]>

What is the upstream status of this patch ?

I've sent the patch to some of the developers, but still waiting for a reaction.

Quoted 16 lines

Review

Quoted 1 line
(quoted diff) +0 -0

b/package/freescale-imx/imx-mkimage/Config.in.host

package/freescale-imx/imx-mkimage/Config.in.host line 5

Quoted 10 lines

new file mode 100644
index 0000000..3cf0966

package/freescale-imx/imx-mkimage/Config.in.host new file +5 -0
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HOST_IMX_MKIMAGE
+     bool "host imx-mkimage"
+     help
+       imx-mkimage is used to combine input images and generate
+       final boot image with appropriate IVT set.

We like to have a blank line, and then the URL of the upstream project main page. Here, https://source.codeaurora.org/external/imx/imx-mkimage
might be enough, unless there is a better page.

Ok! I'll fix that

Quoted 19 lines

Review

Quoted 2 lines
(quoted diff) +0 -0

b/package/freescale-imx/imx-mkimage/imx-mkimage.mk

package/freescale-imx/imx-mkimage/imx-mkimage.mk line 1

Quoted 6 lines

new file mode 100644
index 0000000..a5b1f93

package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +1 -0
@@ -0,0 +1,23 @@
+###########################################################

#####################

package/freescale-imx/imx-mkimage/imx-mkimage.mk

Quoted 4 lines
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +4 -0
+#
+# imx-mkimage
+#
+###########################################################

#####################

package/freescale-imx/imx-mkimage/imx-mkimage.mk

Quoted 3 lines
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +3 -0
+
+IMX_MKIMAGE_VERSION = imx_4.9.51_imx8m_beta
+IMX_MKIMAGE_SITE = https://source.codeaurora.org/

external/imx/imx-mkimage

Quoted 11 lines

package/freescale-imx/imx-mkimage/imx-mkimage.mk line 14

Quoted 6 lines
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +6 -0
+IMX_MKIMAGE_SITE_METHOD = git
+IMX_MKIMAGE_LICENSE = GPL-2.0
+IMX_MKIMAGE_LICENSE_FILES = iMX8dv/COPYING
+
+define HOST_IMX_MKIMAGE_BUILD_CMDS
+     $(MAKE) -C $(@D)/iMX8M -f soc.mak mkimage_imx8

Why are you building just the tool in iMX8M ? There is also one in src/ and in iMX8dv. What are the differences ? Should we build/install all of them ? Conditionally ?

I'm currently only building for IMX8M because that's the only hardware I have access to. Preferably this should be conditional. Do you think I shall add it as a conditional option right away event though I can't test it against other hardware?

Quoted 5 lines

package/freescale-imx/imx-mkimage/imx-mkimage.mk line 18

Quoted 2 lines
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +2 -0
+define HOST_IMX_MKIMAGE_INSTALL_CMDS
+     mkdir -p $(HOST_DIR)/bin

This line is not needed... if...

Ok, I'll fix it!

Quoted 11 lines

package/freescale-imx/imx-mkimage/imx-mkimage.mk line 20

Quoted 3 lines
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +2 -0
+     $(INSTALL) -m 755 $(@D)/iMX8M/mkimage_imx8 $(HOST_DIR)/bin
+     $(INSTALL) -m 755 $(@D)/iMX8M/mkimage_fit_atf.sh $(HOST_DIR)/bin

You replace those lines by:

        $(INSTALL) -D -m 755 $(@D)/iMX8M/mkimage_imx8
$(HOST_DIR)/bin/mkimage_imx8
        $(INSTALL) -D -m 755 $(@D)/iMX8M/mkimage_fit_atf.sh

$(HOST_DIR)/bin/mkimage_fit_atf.sh

Quoted 8 lines

Best regards,

Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering
http://bootlin.com

Thanks for your feedback!

Best regards,
Erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180219/648e79db/attachment.html>

#4 lore raw

PATCH 1/3 imx-mkimage: new package

Hello Erik,

Quoted 20 lines · Erik Larsson
Quoted 8 lines

Review

Quoted 1 line
(quoted diff) +0 -0

b/package/freescale-imx/imx-mkimage/0001-make-bl33-read- env-variables.patch

package/freescale-imx/imx-mkimage/0001-make-bl33-read-

Quoted 4 lines

new file mode 100644
index 0000000..490eb05

package/freescale-imx/imx-mkimage/0001-make-bl33-read- new file +0 -0

env-variables.patch

Quoted 12 lines

package/freescale-imx/imx-mkimage/0001-make-bl33-read- line 8

Quoted 9 lines
package/freescale-imx/imx-mkimage/0001-make-bl33-read- new file +8 -0
@@ -0,0 +1,37 @@
+From 5ca549356ef889286c12b4d736d9026efafb8fff Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Mon, 29 Jan 2018 08:00:57 +0100
+Subject: [PATCH] Add support for overriding BL32 and BL33 not only BL31
+
+Signed-off-by: Erik Larsson <[email protected]>
+Signed-off-by: Christopher Dahlberg <[email protected]>
+Signed-off-by: Marcus Folkesson <[email protected]>  

What is the upstream status of this patch ?

Quoted 2 lines

I've sent the patch to some of the developers, but still waiting for a reaction.

OK. Then who are those other people who have Signed-off on your patch ?

Quoted 8 lines
Quoted 4 lines

Why are you building just the tool in iMX8M ? There is also one in src/ and in iMX8dv. What are the differences ? Should we build/install all of them ? Conditionally ?

I'm currently only building for IMX8M because that's the only hardware I have access to. Preferably this should be conditional. Do you think I shall add it as a conditional option right away event though I can't test it against other hardware?

It's fine to support just what you need today. However, it would be nice to explain it in the commit log and/or in a comment above those lines in the .mk file.

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
#5 lore raw

PATCH 1/3 imx-mkimage: new package

Hello,

2018-02-19 9:02 GMT+01:00 Thomas Petazzoni <[email protected]>:

Quoted 27 lines

Hello Erik,

Quoted 1 line · Erik Larsson
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

env-variables.patch

Quoted 9 lines
Quoted 9 lines

b/package/freescale-imx/imx-mkimage/0001-make-bl33-read- env-variables.patch

package/freescale-imx/imx-mkimage/0001-make-bl33-read-

Quoted 4 lines

new file mode 100644
index 0000000..490eb05

package/freescale-imx/imx-mkimage/0001-make-bl33-read- new file +0 -0

env-variables.patch

package/freescale-imx/imx-mkimage/0001-make-bl33-read- line 1

Quoted 2 lines
package/freescale-imx/imx-mkimage/0001-make-bl33-read- new file +1 -0
@@ -0,0 +1,37 @@
+From 5ca549356ef889286c12b4d736d9026efafb8fff Mon Sep 17 00:00:00

2001

Quoted 3 lines
Quoted 3 lines

package/freescale-imx/imx-mkimage/0001-make-bl33-read- line 4

Quoted 3 lines
package/freescale-imx/imx-mkimage/0001-make-bl33-read- new file +3 -0
+From: Erik Larsson <[email protected]>
+Date: Mon, 29 Jan 2018 08:00:57 +0100
+Subject: [PATCH] Add support for overriding BL32 and BL33 not only

BL31

Quoted 7 lines
Quoted 7 lines

package/freescale-imx/imx-mkimage/0001-make-bl33-read- line 8

Quoted 4 lines
package/freescale-imx/imx-mkimage/0001-make-bl33-read- new file +4 -0
+
+Signed-off-by: Erik Larsson <[email protected]>
+Signed-off-by: Christopher Dahlberg <[email protected]>
+Signed-off-by: Marcus Folkesson <[email protected]>

What is the upstream status of this patch ?

Quoted 5 lines
Quoted 2 lines

I've sent the patch to some of the developers, but still waiting for a reaction.

OK. Then who are those other people who have Signed-off on your patch ?

My colleagues :)

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

Why are you building just the tool in iMX8M ? There is also one in src/ and in iMX8dv. What are the differences ? Should we build/install all of them ? Conditionally ?

I'm currently only building for IMX8M because that's the only hardware I have access to. Preferably this should be conditional. Do you think I

Quoted 8 lines

shall

Quoted 2 lines

add it as a conditional option right away event though I can't test it against other hardware?

It's fine to support just what you need today. However, it would be nice to explain it in the commit log and/or in a comment above those lines in the .mk file.

Okay, I will fix that.

Quoted 9 lines

Thanks a lot!

Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering
http://bootlin.com

Thanks,
Erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180219/4f7c0a5a/attachment.html>

#6 lore raw

PATCH 1/3 imx-mkimage: new package

Thomas, Erik,

Quoted 31 lines · Erik Larsson

Hello,

2018-02-19 9:02 GMT+01:00 Thomas Petazzoni <[email protected]>:

Quoted 27 lines

Hello Erik,

Quoted 1 line · Erik Larsson
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

env-variables.patch

Quoted 9 lines
Quoted 9 lines

b/package/freescale-imx/imx-mkimage/0001-make-bl33-read- env-variables.patch

package/freescale-imx/imx-mkimage/0001-make-bl33-read-

Quoted 4 lines

new file mode 100644
index 0000000..490eb05

package/freescale-imx/imx-mkimage/0001-make-bl33-read- new file +0 -0

env-variables.patch

package/freescale-imx/imx-mkimage/0001-make-bl33-read- line 1

Quoted 2 lines
package/freescale-imx/imx-mkimage/0001-make-bl33-read- new file +1 -0
@@ -0,0 +1,37 @@
+From 5ca549356ef889286c12b4d736d9026efafb8fff Mon Sep 17 00:00:00

2001

Quoted 3 lines
Quoted 3 lines

package/freescale-imx/imx-mkimage/0001-make-bl33-read- line 4

Quoted 3 lines
package/freescale-imx/imx-mkimage/0001-make-bl33-read- new file +3 -0
+From: Erik Larsson <[email protected]>
+Date: Mon, 29 Jan 2018 08:00:57 +0100
+Subject: [PATCH] Add support for overriding BL32 and BL33 not only

BL31

Quoted 7 lines
Quoted 7 lines

package/freescale-imx/imx-mkimage/0001-make-bl33-read- line 8

Quoted 4 lines
package/freescale-imx/imx-mkimage/0001-make-bl33-read- new file +4 -0
+
+Signed-off-by: Erik Larsson <[email protected]>
+Signed-off-by: Christopher Dahlberg <[email protected]>
+Signed-off-by: Marcus Folkesson <[email protected]>

What is the upstream status of this patch ?

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

I've sent the patch to some of the developers, but still waiting for a reaction.

OK. Then who are those other people who have Signed-off on your patch ?

My colleagues :)

Yep, we are fine with this.

Quoted 28 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

Why are you building just the tool in iMX8M ? There is also one in src/ and in iMX8dv. What are the differences ? Should we build/install all of them ? Conditionally ?

I'm currently only building for IMX8M because that's the only hardware I have access to. Preferably this should be conditional. Do you think I

Quoted 8 lines

shall

Quoted 2 lines

add it as a conditional option right away event though I can't test it against other hardware?

It's fine to support just what you need today. However, it would be nice to explain it in the commit log and/or in a comment above those lines in the .mk file.

Okay, I will fix that.

Quoted 9 lines

Thanks a lot!

Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering
http://bootlin.com

Quoted 7 lines

Thanks,
Erik

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Best regards
Marcus Folkesson

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180219/a109dfed/attachment.asc>

#7 lore raw

PATCH 1/3 imx-mkimage: new package

In reply to Thomas Petazzoni

Hi Thomas, Erik,

Quoted 18 lines · Thomas Petazzoni

Hello,

Thanks for this contribution!

Quoted 13 lines · Erik Larsson
---
 package/Config.in.host                             |  1 +
 .../0001-make-bl33-read-env-variables.patch        | 37 ++++++++++++++++++++++
 package/freescale-imx/imx-mkimage/Config.in.host   |  5 +++
 package/freescale-imx/imx-mkimage/imx-mkimage.hash |  3 ++
 package/freescale-imx/imx-mkimage/imx-mkimage.mk   | 23 ++++++++++++++
 5 files changed, 69 insertions(+)
 create mode 100644 package/freescale-imx/imx-mkimage/0001-make-bl33-read-env-variables.patch
 create mode 100644 package/freescale-imx/imx-mkimage/Config.in.host
 create mode 100644 package/freescale-imx/imx-mkimage/imx-mkimage.hash
 create mode 100644 package/freescale-imx/imx-mkimage/imx-mkimage.mk
Quoted 14 lines

package/Config.in.host menu "Host utilities" · line 18

Quoted 9 lines
package/Config.in.host +1 -0
index 199a8e9..b1cfa75 100644
@@ -15,6 +15,7 @@ menu "Host utilities"
 	source "package/e2fsprogs/Config.in.host"
 	source "package/e2tools/Config.in.host"
 	source "package/faketime/Config.in.host"
+	source "package/freescale-imx/imx-mkimage/Config.in.host"

I'm not sure this package needs to be under package/freescale-imx/. This sub-directory was initially created to share the FREESCALE_IMX_SITE and FREESCALE_IMX_EXTRACT_HELPER definitions, but you don't use them.

Actually there are plenty of packages in that folder that don't need the extract helper nor the site address. Would you like those moved out of it? (imx-kobs, imx-uuc, imx-vpuwrap etc..).

As a user I find it convenient to have it all in one place but I'd understand moving them around.

Another aspect of that folder is BR2_PACKAGE_FREESCALE_IMX_PLATFORM, although it is accessible at other places, which has an effect on which packages are available.

Quoted 49 lines
Quoted 6 lines
package/freescale-imx/imx-mkimage/0001-make-bl33-read-env-variables.patch new file +0 -0
new file mode 100644
index 0000000..490eb05

package/freescale-imx/imx-mkimage/0001-make-bl33-read-env-variables.patch line 8

Quoted 8 lines
package/freescale-imx/imx-mkimage/0001-make-bl33-read-env-variables.patch new file +8 -0
@@ -0,0 +1,37 @@
+From 5ca549356ef889286c12b4d736d9026efafb8fff Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Mon, 29 Jan 2018 08:00:57 +0100
+Subject: [PATCH] Add support for overriding BL32 and BL33 not only BL31
+
+Signed-off-by: Erik Larsson <[email protected]>
+Signed-off-by: Christopher Dahlberg <[email protected]>
+Signed-off-by: Marcus Folkesson <[email protected]>

What is the upstream status of this patch ?

package/freescale-imx/imx-mkimage/Config.in.host line 5

Quoted 11 lines
package/freescale-imx/imx-mkimage/Config.in.host new file +5 -0
new file mode 100644
index 0000000..3cf0966
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HOST_IMX_MKIMAGE
+	bool "host imx-mkimage"
+	help
+	  imx-mkimage is used to combine input images and generate
+	  final boot image with appropriate IVT set.

We like to have a blank line, and then the URL of the upstream project main page. Here, https://source.codeaurora.org/external/imx/imx-mkimage
might be enough, unless there is a better page.

Quoted 16 lines
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +10 -0
new file mode 100644
index 0000000..a5b1f93
@@ -0,0 +1,23 @@
+################################################################################
+#
+# 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
Quoted 8 lines

package/freescale-imx/imx-mkimage/imx-mkimage.mk line 14

Quoted 4 lines
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +4 -0
+IMX_MKIMAGE_LICENSE_FILES = iMX8dv/COPYING
+
+define HOST_IMX_MKIMAGE_BUILD_CMDS
+	$(MAKE) -C $(@D)/iMX8M -f soc.mak mkimage_imx8

Why are you building just the tool in iMX8M ? There is also one in src/ and in iMX8dv. What are the differences ? Should we build/install all of them ? Conditionally ?

That is where new BR2_PACKAGE_FREESCALE_IMX_PLATFORM values would be needed to separate iMX8M, iMX8QM and iMX8QX.

As a FYI, iMX8dv was some sort of development version of i.MX8, this will not be supported moving forward, only the 3 families listed above.

Regards,
Gary

#8 lore raw

PATCH 1/3 imx-mkimage: new package

Hello,

Quoted 8 lines · Gary Bisson
Quoted 4 lines

I'm not sure this package needs to be under package/freescale-imx/. This sub-directory was initially created to share the FREESCALE_IMX_SITE and FREESCALE_IMX_EXTRACT_HELPER definitions, but you don't use them.

Actually there are plenty of packages in that folder that don't need the extract helper nor the site address. Would you like those moved out of it? (imx-kobs, imx-uuc, imx-vpuwrap etc..).

I don't have a very clear cut opinion about this. If they don't need to be in package/freescale-imx/, then in theory they should be outside yes.

Quoted 3 lines

Another aspect of that folder is BR2_PACKAGE_FREESCALE_IMX_PLATFORM, although it is accessible at other places, which has an effect on which packages are available.

Yeah, but that's just Config.in values, which are available to all packages without problem.

Quoted 9 lines
Quoted 3 lines

Why are you building just the tool in iMX8M ? There is also one in src/ and in iMX8dv. What are the differences ? Should we build/install all of them ? Conditionally ?

That is where new BR2_PACKAGE_FREESCALE_IMX_PLATFORM values would be needed to separate iMX8M, iMX8QM and iMX8QX.

As a FYI, iMX8dv was some sort of development version of i.MX8, this will not be supported moving forward, only the 3 families listed above.

OK, thanks for the info!

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
#9 lore raw

PATCH 1/3 imx-mkimage: new package

In reply to Erik Larsson
Quoted 1 line · Erik Larsson

Ask Christopher if he should be stated here as well.

package/freescale-imx/imx-mkimage/imx-mkimage.mk line 10

Quoted 10 lines
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +10 -0
+################################################################################
+#
+# 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

This should actually be GPL-2.0+ as stated in several source files... despite our internal review.

Quoted 20 lines
package/freescale-imx/imx-mkimage/imx-mkimage.mk new file +13 -0
+IMX_MKIMAGE_LICENSE_FILES = iMX8dv/COPYING
+
+define HOST_IMX_MKIMAGE_BUILD_CMDS
+	$(MAKE) -C $(@D)/iMX8M -f soc.mak mkimage_imx8
+endef
+
+define HOST_IMX_MKIMAGE_INSTALL_CMDS
+	mkdir -p $(HOST_DIR)/bin
+	$(INSTALL) -m 755 $(@D)/iMX8M/mkimage_imx8 $(HOST_DIR)/bin
+	$(INSTALL) -m 755 $(@D)/iMX8M/mkimage_fit_atf.sh $(HOST_DIR)/bin
+endef
+
+$(eval $(host-generic-package))
Signature · 6 lines
2.7.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Best regards
Marcus Folkesson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180219/8638281e/attachment.asc>

#10 lore raw

PATCH 2/3 imx-atf: new package

In reply to Erik Larsson
---
 package/freescale-imx/Config.in            |  4 ++++
 package/freescale-imx/imx-atf/Config.in    |  5 +++++
 package/freescale-imx/imx-atf/imx-atf.hash |  3 +++
 package/freescale-imx/imx-atf/imx-atf.mk   | 23 +++++++++++++++++++++++
 4 files changed, 35 insertions(+)
 create mode 100644 package/freescale-imx/imx-atf/Config.in
 create mode 100644 package/freescale-imx/imx-atf/imx-atf.hash
 create mode 100644 package/freescale-imx/imx-atf/imx-atf.mk
package/freescale-imx/Config.in +4 -0
index b5e5ab2..2535caa 100644
@@ -88,4 +88,8 @@ source "package/freescale-imx/imx-gpu-viv/Config.in"
 source "package/freescale-imx/kernel-module-imx-gpu-viv/Config.in"
 endif
 
+if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M
+	source "package/freescale-imx/imx-atf/Config.in"
+endif
+
 endif
package/freescale-imx/imx-atf/Config.in new file +5 -0
new file mode 100644
index 0000000..200203d
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_IMX_ATF
+	bool "imx-atf"
+	help
+	  ARM Trusted Firmware provides a reference implementation
+	  of secure world software for `ARMv8-A`
package/freescale-imx/imx-atf/imx-atf.hash new file +3 -0
new file mode 100644
index 0000000..5b653a7
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 aa5879af507df44b9981d75852e2a520612c6c5c43dc423480ca36b6deff5160  imx-atf-imx_4.9.51_imx8m_beta.tar.gz
+sha256 487795b8023df866259fa159bab94706b747fb0d623b7913f1c4955c0ab5f164  license.rst
package/freescale-imx/imx-atf/imx-atf.mk new file +23 -0
new file mode 100644
index 0000000..f0aa988
@@ -0,0 +1,23 @@
+################################################################################
+#
+# imx-atf
+#
+################################################################################
+
+IMX_ATF_VERSION = imx_4.9.51_imx8m_beta
+IMX_ATF_SITE = https://source.codeaurora.org/external/imx/imx-atf
+IMX_ATF_SITE_METHOD = git
+IMX_AFT_LICENSE = BSD-3-Clause
+IMX_AFT_LICESE_FILES = license.rst
+
+define IMX_ATF_BUILD_CMDS
+	$(TARGET_MAKE_ENV) \
+	CROSS_COMPILE=$(TARGET_CROSS) \
+	$(MAKE) -C $(@D) PLAT=imx8mq bl31
+endef
+
+define IMX_ATF_INSTALL_TARGET_CMDS
+	cp $(@D)/build/imx8mq/release/bl31.bin $(BINARIES_DIR)/imx-boot
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.7.4
#11 lore raw

PATCH 2/3 imx-atf: new package

Hi Erik,

Quoted 10 lines · Erik Larsson
---
 package/freescale-imx/Config.in            |  4 ++++
 package/freescale-imx/imx-atf/Config.in    |  5 +++++
 package/freescale-imx/imx-atf/imx-atf.hash |  3 +++
 package/freescale-imx/imx-atf/imx-atf.mk   | 23 +++++++++++++++++++++++
 4 files changed, 35 insertions(+)
 create mode 100644 package/freescale-imx/imx-atf/Config.in
 create mode 100644 package/freescale-imx/imx-atf/imx-atf.hash
 create mode 100644 package/freescale-imx/imx-atf/imx-atf.mk

We have an arm-trusted-firmware already at boot/arm-trusted-firmware/. Any reason you can't use that?

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#12 lore raw

PATCH 2/3 imx-atf: new package

Hi Baruch,

2018-02-18 14:46 GMT+01:00 Baruch Siach <[email protected]>:

Quoted 14 lines

Hi Erik,

Quoted 10 lines · Erik Larsson
---
 package/freescale-imx/Config.in            |  4 ++++
 package/freescale-imx/imx-atf/Config.in    |  5 +++++
 package/freescale-imx/imx-atf/imx-atf.hash |  3 +++
 package/freescale-imx/imx-atf/imx-atf.mk   | 23 +++++++++++++++++++++++
 4 files changed, 35 insertions(+)
 create mode 100644 package/freescale-imx/imx-atf/Config.in
 create mode 100644 package/freescale-imx/imx-atf/imx-atf.hash
 create mode 100644 package/freescale-imx/imx-atf/imx-atf.mk
Quoted 3 lines

We have an arm-trusted-firmware already at boot/arm-trusted-firmware/. Any reason you can't use that?

Sorry to say, but I completely missed that there already where an ATF-package. After a first glance there shouldn't be any reason not to use boot/arm-trusted-firmware. I will look into this.

Quoted 10 lines

baruch

--
http://baruch.siach.name/blog/ ~. .~ Tk Open
Systems =}------------------------------------------------ooO--U-- Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180218/06346e60/attachment.html>

#13 lore raw

PATCH 3/3 add support for iMX8MQ-evk board

In reply to Erik Larsson
---
 .../common/imx/genimage.cfg.template_imx8          |  40 ++
 board/freescale/common/imx/post-image.sh           |  33 +-
 board/freescale/imx8mqevk/linux-4.9.config         | 625 +++++++++++++++++++++
 configs/freescale_imx8mqevk_defconfig              |  35 ++
 package/freescale-imx/Config.in                    |   4 +-
 package/freescale-imx/firmware-imx/Config.in       |   2 +-
 package/freescale-imx/firmware-imx/firmware-imx.mk |   8 +
 7 files changed, 742 insertions(+), 5 deletions(-)
 create mode 100644 board/freescale/common/imx/genimage.cfg.template_imx8
 create mode 100644 board/freescale/imx8mqevk/linux-4.9.config
 create mode 100644 configs/freescale_imx8mqevk_defconfig
board/freescale/common/imx/genimage.cfg.template_imx8 new file +40 -0
new file mode 100644
index 0000000..138beff
@@ -0,0 +1,40 @@
+# Minimal SD card image for the Freescale boards Template for SPL Boot
+#
+# We mimic the .sdcard Freescale's image format:
+# * the SD card must have 33 kB free space at the beginning,
+# * U-Boot is integrated into imx-boot-imx8mqevk-sd.bin and is dumped as is,
+# * a FAT partition at offset 64MB is containing Image and DTB files
+# * a single root filesystem partition is required (ext2, ext3 or ext4)
+#
+
+image boot.vfat {
+  vfat {
+    files = {
+      %FILES%
+    }
+  }
+  size = 64M
+}
+
+image sdcard.img {
+  hdimage {
+  }
+
+  partition imx-boot {
+    in-partition-table = "no"
+    image = "imx-boot-imx8mqevk-sd.bin"
+    offset = 33K
+  }
+
+  partition boot {
+    partition-type = 0xC
+    bootable = "true"
+    image = "boot.vfat"
+    offset = 8M
+  }
+
+  partition rootfs {
+    partition-type = 0x83
+    image = "rootfs.ext2"
+  }
+}
board/freescale/common/imx/post-image.sh +30 -3
index b239743..e3082a3 100755
@@ -7,10 +7,10 @@
 #
 dtb_list()
 {
-	local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})"
+	local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([\/a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})"
 
 	for dt in $DTB_LIST; do
-		echo -n "\"$dt.dtb\", "
+		echo -n "\"`basename $dt`.dtb\", "
 	done
 }
 
@@ -23,6 +23,8 @@ linux_image()
 {
 	if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
 		echo "\"uImage\""
+	elif grep -Eq "^BR2_LINUX_KERNEL_IMAGE=y$" ${BR2_CONFIG}; then
+		echo "\"Image\""
 	else
 		echo "\"zImage\""
 	fi
@@ -30,19 +32,44 @@ linux_image()
 
 genimage_type()
 {
-	if grep -Eq "^BR2_TARGET_UBOOT_SPL=y$" ${BR2_CONFIG}; then
+	if grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M=y$" ${BR2_CONFIG}; then
+		echo "genimage.cfg.template_imx8"
+	elif grep -Eq "^BR2_TARGET_UBOOT_SPL=y$" ${BR2_CONFIG}; then
 		echo "genimage.cfg.template_spl"
 	else
 		echo "genimage.cfg.template"
 	fi
 }
 
+gen_imx8_boot()
+{
+	objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem_pad.bin
+	objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem_pad.bin
+	objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem_pad.bin
+	cat ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem_pad.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem_pad.bin > ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_fw.bin
+	cat ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem_pad.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_dmem.bin > ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_fw.bin
+	cat ${BINARIES_DIR}/u-boot-spl.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_fw.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_fw.bin > ${BINARIES_DIR}/u-boot-spl-ddr.bin
+	rm -f ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_fw.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_fw.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem_pad.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem_pad.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem_pad.bin
+
+	BL31=${BINARIES_DIR}/imx-boot/bl31.bin BL33=${BINARIES_DIR}/u-boot.bin mkimage_fit_atf.sh ${BINARIES_DIR}/fsl-imx8mq-evk.dtb > ${BINARIES_DIR}/imx-boot/u-boot.its
+	pushd ${BINARIES_DIR}
+	mkimage -E -p 0x3000 -f ${BINARIES_DIR}/imx-boot/u-boot.its ${BINARIES_DIR}/u-boot.itb
+	popd
+        rm -f ${BINARIES_DIR}/imx-boot/u-boot.its
+
+	mkimage_imx8 -fit -loader ${BINARIES_DIR}/u-boot-spl-ddr.bin 0x7E1000 -second_loader ${BINARIES_DIR}/u-boot.itb 0x40200000 0x60000 -out ${BINARIES_DIR}/imx-boot-imx8mqevk-sd.bin
+}
+
 main()
 {
 	local FILES="$(dtb_list) $(linux_image)"
 	local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)"
 	local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
 
+	if grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M=y$" ${BR2_CONFIG}; then
+		$(gen_imx8_boot)
+	fi
+
 	sed -e "s/%FILES%/${FILES}/" \
 		board/freescale/common/imx/$(genimage_type) > ${GENIMAGE_CFG}
 
board/freescale/imx8mqevk/linux-4.9.config new file +625 -0

625 lines not on this page · raw message

configs/freescale_imx8mqevk_defconfig new file +35 -0
new file mode 100644
index 0000000..a2ec07e
@@ -0,0 +1,35 @@
+BR2_aarch64=y
+BR2_ARM_FPU_VFPV3=y
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/linux-imx"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="imx_4.9.51_imx8m_beta"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/freescale/imx8mqevk/linux-4.9.config"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/fsl-imx8mq-evk"
+BR2_PACKAGE_FREESCALE_IMX=y
+BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M=y
+BR2_PACKAGE_FIRMWARE_IMX=y
+BR2_PACKAGE_IMX_ATF=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/uboot-imx"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="imx_v2017.03_4.9.51_imx8m_beta"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mq_evk"
+BR2_TARGET_UBOOT_FORMAT_IMX=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_IMX_MKIMAGE=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y
package/freescale-imx/Config.in +3 -1
index 2535caa..adda403 100644
@@ -1,6 +1,6 @@
 menuconfig BR2_PACKAGE_FREESCALE_IMX
 	bool "Freescale i.MX libraries"
-	depends on BR2_arm
+	depends on BR2_arm || BR2_aarch64
 	help
 	  Those packages provide hardware acceleration for GPU or VPU,
 	  hardware optimization or some hardware tools for Freescale
@@ -40,6 +40,8 @@ config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6UL
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7
 	bool "imx7d/imx7ulp"
 
+config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M
+	bool "imx8m"
 endchoice
 
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM
package/freescale-imx/firmware-imx/Config.in +1 -1
index fca280a..56d5b80 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_FIRMWARE_IMX
 	bool "firmware-imx"
-	depends on BR2_arm # Only relevant for i.MX
+	depends on BR2_arm || BR2_aarch64 # Only relevant for i.MX
 	help
 	  Firmware blobs for the Freescale i.MX SoCs.
 
package/freescale-imx/firmware-imx/firmware-imx.mk +8 -0
index 630afca..040a088 100644
@@ -18,6 +18,13 @@ define FIRMWARE_IMX_EXTRACT_CMDS
 	$(call FREESCALE_IMX_EXTRACT_HELPER,$(DL_DIR)/$(FIRMWARE_IMX_SOURCE))
 endef
 
+ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M),y)
+define FIRMWARE_IMX_INSTALL_TARGET_CMDS
+	mkdir -p $(BINARIES_DIR)/imx-boot
+	cp $(@D)/firmware/ddr/synopsys/lpddr4_pmu_train_*.bin $(BINARIES_DIR)/imx-boot
+	cp $(@D)/firmware/hdmi/cadence/signed_hdmi_imx8m.bin $(BINARIES_DIR)/imx-boot
+endef
+else
 define FIRMWARE_IMX_INSTALL_TARGET_CMDS
 	mkdir -p $(TARGET_DIR)/lib/firmware/imx
 	for blobdir in $(FIRMWARE_IMX_BLOBS); do \
@@ -27,5 +34,6 @@ define FIRMWARE_IMX_INSTALL_TARGET_CMDS
 	mv $(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw.nonrestricted \
 		$(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw
 endef
+endif
 
 $(eval $(generic-package))
Signature · 1 line
2.7.4
#14 lore raw

PATCH 3/3 add support for iMX8MQ-evk board

Hi Erik,

Quoted 8 lines · Erik Larsson
board/freescale/common/imx/post-image.sh +8 -0
+gen_imx8_boot()
+{
+	objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem_pad.bin
+	objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0 ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem_pad.bin
+	objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0 ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem_pad.bin
+	cat ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem_pad.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem_pad.bin > ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_fw.bin
+	cat ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem_pad.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_dmem.bin > ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_fw.bin
+	cat ${BINARIES_DIR}/u-boot-spl.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_fw.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_fw.bin > ${BINARIES_DIR}/u-boot-spl-ddr.bin

board/freescale/common/imx/post-image.sh linux_image() · line 61

Quoted 10 lines
board/freescale/common/imx/post-image.sh +10 -0
+	rm -f ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_fw.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_fw.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem_pad.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem_pad.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem_pad.bin
+
+	BL31=${BINARIES_DIR}/imx-boot/bl31.bin BL33=${BINARIES_DIR}/u-boot.bin mkimage_fit_atf.sh ${BINARIES_DIR}/fsl-imx8mq-evk.dtb > ${BINARIES_DIR}/imx-boot/u-boot.its
+	pushd ${BINARIES_DIR}
+	mkimage -E -p 0x3000 -f ${BINARIES_DIR}/imx-boot/u-boot.its ${BINARIES_DIR}/u-boot.itb
+	popd
+        rm -f ${BINARIES_DIR}/imx-boot/u-boot.its
+
+	mkimage_imx8 -fit -loader ${BINARIES_DIR}/u-boot-spl-ddr.bin 0x7E1000 -second_loader ${BINARIES_DIR}/u-boot.itb 0x40200000 0x60000 -out ${BINARIES_DIR}/imx-boot-imx8mqevk-sd.bin
+}

Instead of reproducing the convoluted way of generating the i.MX8 boot image, can't you just copy the files into the iMX8M/ subdirectory of imx-mkimage, and run there 'make SOC=iMX8M flash_spl_uboot'?

[...]

Quoted 52 lines
package/freescale-imx/Config.in +3 -1
index 2535caa..adda403 100644
@@ -1,6 +1,6 @@
 menuconfig BR2_PACKAGE_FREESCALE_IMX
 	bool "Freescale i.MX libraries"
-	depends on BR2_arm
+	depends on BR2_arm || BR2_aarch64
 	help
 	  Those packages provide hardware acceleration for GPU or VPU,
 	  hardware optimization or some hardware tools for Freescale
@@ -40,6 +40,8 @@ config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6UL
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7
 	bool "imx7d/imx7ulp"
 
+config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M
+	bool "imx8m"
 endchoice
 
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM
package/freescale-imx/firmware-imx/Config.in +1 -1
index fca280a..56d5b80 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_FIRMWARE_IMX
 	bool "firmware-imx"
-	depends on BR2_arm # Only relevant for i.MX
+	depends on BR2_arm || BR2_aarch64 # Only relevant for i.MX
 	help
 	  Firmware blobs for the Freescale i.MX SoCs.
 
package/freescale-imx/firmware-imx/firmware-imx.mk +7 -0
index 630afca..040a088 100644
@@ -18,6 +18,13 @@ define FIRMWARE_IMX_EXTRACT_CMDS
 	$(call FREESCALE_IMX_EXTRACT_HELPER,$(DL_DIR)/$(FIRMWARE_IMX_SOURCE))
 endef
 
+ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M),y)
+define FIRMWARE_IMX_INSTALL_TARGET_CMDS
+	mkdir -p $(BINARIES_DIR)/imx-boot
+	cp $(@D)/firmware/ddr/synopsys/lpddr4_pmu_train_*.bin $(BINARIES_DIR)/imx-boot
+	cp $(@D)/firmware/hdmi/cadence/signed_hdmi_imx8m.bin $(BINARIES_DIR)/imx-boot
+endef
+else
 define FIRMWARE_IMX_INSTALL_TARGET_CMDS
 	mkdir -p $(TARGET_DIR)/lib/firmware/imx
 	for blobdir in $(FIRMWARE_IMX_BLOBS); do \

package/freescale-imx/firmware-imx/firmware-imx.mk define FIRMWARE_IMX_INSTALL_TARGET_CMDS · line 37

Quoted 4 lines
package/freescale-imx/firmware-imx/firmware-imx.mk +1 -0
@@ -27,5 +34,6 @@ define FIRMWARE_IMX_INSTALL_TARGET_CMDS
 	mv $(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw.nonrestricted \
 		$(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw
 endef
+endif

These changes should be in a separate patch to firmware-imx.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#15 lore raw

PATCH 3/3 add support for iMX8MQ-evk board

Hello,

2018-02-18 15:47 GMT+01:00 Baruch Siach <[email protected]>:

Quoted 41 lines

Hi Erik,

board/freescale/common/imx/post-image.sh linux_image()

Quoted 3 lines · Erik Larsson
board/freescale/common/imx/post-image.sh +3 -0
+gen_imx8_boot()
+{
+     objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem_pad.bin

Quoted 1 line

+ objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem_pad.bin

Quoted 1 line

+ objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem_pad.bin

Quoted 1 line

+ cat ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem_pad.bin

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem_pad.bin > ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_fw.bin

Quoted 1 line

+ cat ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem_pad.bin

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_dmem.bin > ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_fw.bin

Quoted 1 line

+ cat ${BINARIES_DIR}/u-boot-spl.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_fw.bin

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_fw.bin > ${BINARIES_DIR}/u-boot-spl-ddr.bin

Quoted 1 line

+ rm -f ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_fw.bin

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_fw.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem_pad.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem_pad.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem_pad.bin

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+     BL31=${BINARIES_DIR}/imx-boot/bl31.bin

BL33=${BINARIES_DIR}/u-boot.bin mkimage_fit_atf.sh ${BINARIES_DIR}/fsl-imx8mq-evk.dtb > ${BINARIES_DIR}/imx-boot/u-boot.its

Review

Quoted 2 lines
(quoted diff) +2 -0
+     pushd ${BINARIES_DIR}
+     mkimage -E -p 0x3000 -f ${BINARIES_DIR}/imx-boot/u-boot.its

${BINARIES_DIR}/u-boot.itb

board/freescale/common/imx/post-image.sh linux_image()

Quoted 4 lines
board/freescale/common/imx/post-image.sh +4 -0
+     popd
+        rm -f ${BINARIES_DIR}/imx-boot/u-boot.its
+
+     mkimage_imx8 -fit -loader ${BINARIES_DIR}/u-boot-spl-ddr.bin

0x7E1000 -second_loader ${BINARIES_DIR}/u-boot.itb 0x40200000 0x60000 -out ${BINARIES_DIR}/imx-boot-imx8mqevk-sd.bin

Quoted 8 lines
Quoted 1 line

+}

Instead of reproducing the convoluted way of generating the i.MX8 boot image,
can't you just copy the files into the iMX8M/ subdirectory of imx-mkimage, and
run there 'make SOC=iMX8M flash_spl_uboot'?

Yes this is pretty convoluted, just as you say. There are some issues with doing this in the imx-mkimage (at least I think so, please let me know if I'm wrong :) ).
The main Makefile of imx-mkimage has a step called buildinfo which reads information from its git repository, in buildroot there are no git repository during build time. This can off course be fixed using a small patch in the packet. The other problem is that we need to have a way of selecting which file is used as BL33 in the mkimage_fit_aft.sh which is called from iMX8M/soc.mk. This can also be fixed with a packet patch, or we can simply copy our u-boot.bin and call it u-boot-nodtb.bin as mkimage_fit_atf.sh is expecting it to be called.

Please let my know what you think!

Quoted 62 lines

[...]

package/freescale-imx/

Quoted 1 line
package/freescale-imx/ renamed from package/freescale-imx/Config.in +0 -0

Config.in

Review

Quoted 21 lines

index 2535caa..adda403 100644

package/freescale-imx/Config.in +3 -1
@@ -1,6 +1,6 @@
 menuconfig BR2_PACKAGE_FREESCALE_IMX
      bool "Freescale i.MX libraries"
-     depends on BR2_arm
+     depends on BR2_arm || BR2_aarch64
      help
        Those packages provide hardware acceleration for GPU or VPU,
        hardware optimization or some hardware tools for Freescale
@@ -40,6 +40,8 @@ config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6UL
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7
      bool "imx7d/imx7ulp"
 
+config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M
+     bool "imx8m"
 endchoice
 
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM
(quoted diff) +0 -0

b/package/freescale-imx/firmware-imx/Config.in

Review

Quoted 12 lines

index fca280a..56d5b80 100644

package/freescale-imx/firmware-imx/Config.in +1 -1
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_FIRMWARE_IMX
      bool "firmware-imx"
-     depends on BR2_arm # Only relevant for i.MX
+     depends on BR2_arm || BR2_aarch64 # Only relevant for i.MX
      help
        Firmware blobs for the Freescale i.MX SoCs.
 
(quoted diff) +0 -0

b/package/freescale-imx/firmware-imx/firmware-imx.mk

package/freescale-imx/firmware-imx/firmware-imx.mk define FIRMWARE_IMX_EXTRACT_CMDS · line 18

Quoted 5 lines

index 630afca..040a088 100644

package/freescale-imx/firmware-imx/firmware-imx.mk +0 -0
@@ -18,6 +18,13 @@ define FIRMWARE_IMX_EXTRACT_CMDS
      $(call FREESCALE_IMX_EXTRACT_HELPER,$(DL_DIR)/$(FIRMWARE_IMX_

SOURCE))

package/freescale-imx/firmware-imx/firmware-imx.mk define FIRMWARE_IMX_EXTRACT_CMDS

Quoted 6 lines
package/freescale-imx/firmware-imx/firmware-imx.mk +4 -0
 endef
 
+ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M),y)
+define FIRMWARE_IMX_INSTALL_TARGET_CMDS
+     mkdir -p $(BINARIES_DIR)/imx-boot
+     cp $(@D)/firmware/ddr/synopsys/lpddr4_pmu_train_*.bin

$(BINARIES_DIR)/imx-boot

package/freescale-imx/firmware-imx/firmware-imx.mk define FIRMWARE_IMX_EXTRACT_CMDS · line 25

Quoted 1 line
package/freescale-imx/firmware-imx/firmware-imx.mk +1 -0
+     cp $(@D)/firmware/hdmi/cadence/signed_hdmi_imx8m.bin

$(BINARIES_DIR)/imx-boot

package/freescale-imx/firmware-imx/firmware-imx.mk define FIRMWARE_IMX_INSTALL_TARGET_CMDS · line 34

Quoted 7 lines
package/freescale-imx/firmware-imx/firmware-imx.mk +2 -0
+endef
+else
 define FIRMWARE_IMX_INSTALL_TARGET_CMDS
      mkdir -p $(TARGET_DIR)/lib/firmware/imx
      for blobdir in $(FIRMWARE_IMX_BLOBS); do \
@@ -27,5 +34,6 @@ define FIRMWARE_IMX_INSTALL_TARGET_CMDS
      mv $(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw.nonrestricted

\

Quoted 6 lines

package/freescale-imx/firmware-imx/firmware-imx.mk define FIRMWARE_IMX_INSTALL_TARGET_CMDS · line 37

Quoted 3 lines
package/freescale-imx/firmware-imx/firmware-imx.mk +1 -0
              $(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw
 endef
+endif

These changes should be in a separate patch to firmware-imx.

Ok, I will fix that!

Quoted 10 lines

baruch

--
http://baruch.siach.name/blog/ ~. .~ Tk Open
Systems =}------------------------------------------------ooO--U-- Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

Erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180219/ecd58e84/attachment.html>

#16 lore raw

PATCH 3/3 add support for iMX8MQ-evk board

Hi Erik,

Quoted 46 lines · Erik Larsson

2018-02-18 15:47 GMT+01:00 Baruch Siach <[email protected]>:

Quoted 37 lines · Erik Larsson

board/freescale/common/imx/post-image.sh linux_image()

Quoted 3 lines
board/freescale/common/imx/post-image.sh +3 -0
+gen_imx8_boot()
+{
+     objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem_pad.bin

Quoted 1 line

+ objcopy -I binary -O binary --pad-to 0x4000 --gap-fill=0x0

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem_pad.bin

Quoted 1 line

+ objcopy -I binary -O binary --pad-to 0x8000 --gap-fill=0x0

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem_pad.bin

Quoted 1 line

+ cat ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem_pad.bin

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem_pad.bin > ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_fw.bin

Quoted 1 line

+ cat ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem_pad.bin

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_dmem.bin > ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_fw.bin

Quoted 1 line

+ cat ${BINARIES_DIR}/u-boot-spl.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_fw.bin

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_fw.bin > ${BINARIES_DIR}/u-boot-spl-ddr.bin

Quoted 1 line

+ rm -f ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_fw.bin

${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_fw.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_imem_pad.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_1d_dmem_pad.bin ${BINARIES_DIR}/imx-boot/lpddr4_pmu_train_2d_imem_pad.bin

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+     BL31=${BINARIES_DIR}/imx-boot/bl31.bin

BL33=${BINARIES_DIR}/u-boot.bin mkimage_fit_atf.sh ${BINARIES_DIR}/fsl-imx8mq-evk.dtb > ${BINARIES_DIR}/imx-boot/u-boot.its

Review

Quoted 2 lines
(quoted diff) +2 -0
+     pushd ${BINARIES_DIR}
+     mkimage -E -p 0x3000 -f ${BINARIES_DIR}/imx-boot/u-boot.its

${BINARIES_DIR}/u-boot.itb

board/freescale/common/imx/post-image.sh linux_image()

Quoted 4 lines
board/freescale/common/imx/post-image.sh +4 -0
+     popd
+        rm -f ${BINARIES_DIR}/imx-boot/u-boot.its
+
+     mkimage_imx8 -fit -loader ${BINARIES_DIR}/u-boot-spl-ddr.bin
Quoted 8 lines

0x7E1000 -second_loader ${BINARIES_DIR}/u-boot.itb 0x40200000 0x60000 -out ${BINARIES_DIR}/imx-boot-imx8mqevk-sd.bin

Quoted 1 line

+}

Instead of reproducing the convoluted way of generating the i.MX8 boot image, can't you just copy the files into the iMX8M/ subdirectory of imx-mkimage, and run there 'make SOC=iMX8M flash_spl_uboot'?

Quoted 7 lines

Yes this is pretty convoluted, just as you say. There are some issues with doing this in the imx-mkimage (at least I think so, please let me know if I'm wrong :) ).
The main Makefile of imx-mkimage has a step called buildinfo which reads information from its git repository, in buildroot there are no git repository during build time. This can off course be fixed using a small patch in the packet.

Yes. I think that patching the top-level Makefile is preferable.

Quoted 5 lines

The other problem is that we need to have a way of
selecting which file is used as BL33 in the mkimage_fit_aft.sh which is called from iMX8M/soc.mk. This can also be fixed with a packet patch, or we can simply copy our u-boot.bin and call it u-boot-nodtb.bin as mkimage_fit_atf.sh is expecting it to be called.

Renaming u-boot.bin to u-boot-nodtb.bin is a small price to pay for not having to duplicate the logic of iMX8M/soc.mak in Buildroot. This logic has changed in the recent past, and I don't think we want to chase the creative imagination of NXP engineers.

Over at the U-Boot mailing list Fabio indicated[1] that imx-mkimage will merge into the U-Boot mkimage. So hopefully we can get rid of this mess at some point.

[1] https://patchwork.ozlabs.org/patch/857974/#1843851

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#17 lore raw

PATCH 3/3 add support for iMX8MQ-evk board

In reply to Erik Larsson
Quoted 1 line · Erik Larsson

Ask Christopher if he want to be stated here as well.

board/freescale/common/imx/post-image.sh line 10

Quoted 11 lines

---

board/freescale/common/imx/post-image.sh +1 -1
index b239743..e3082a3 100755
@@ -7,10 +7,10 @@
 #
 dtb_list()
 {
-	local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})"
+	local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([\/a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})"

Just a thought.. is ${BR2_LINUX_KERNEL_INTREE_DTS_NAME} available in postscripts?
It would be nice if we could avoid this sed magic.

I'm not in an environment that I can check this by myself.

board/freescale/common/imx/post-image.sh line 15

Quoted 6 lines
board/freescale/common/imx/post-image.sh +1 -1
 	for dt in $DTB_LIST; do
-		echo -n "\"$dt.dtb\", "
+		echo -n "\"`basename $dt`.dtb\", "
 	done
 }

Best regards
Marcus Folkesson

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180219/4d67c64f/attachment.asc>