Skip to content

add support for imx8mp-lpddr4-evk#435

Merged
mike-scott merged 17 commits intofoundriesio:masterfrom
mike-scott:master-add-imx8mp
Oct 5, 2021
Merged

add support for imx8mp-lpddr4-evk#435
mike-scott merged 17 commits intofoundriesio:masterfrom
mike-scott:master-add-imx8mp

Conversation

@mike-scott
Copy link
Copy Markdown
Contributor

Patches for:

  • u-boot-fio
  • optee-os-fio
  • boot scripts
  • mfgtool files
  • machine custom changes
  • fstab addition

Copy link
Copy Markdown
Member

@vanmaegima vanmaegima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@MrCry0 MrCry0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@Tim-Anderson Tim-Anderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

CONFIG_CMD_EDITENV=y
CONFIG_CMD_SAVEENV=y
CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="fatload mmc ${emmc_dev}:1 ${loadaddr} /boot.scr; source ${loadaddr}; reset"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might not need to define bootcommand here as usually the board has enough to find and use a boot.scr file, but fine to keep if you want.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah most likely this was copied over from imx8mm, but we're a bit inconsistent:

./meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio/imx8mm-lpddr4-evk/lmp-base.cfg:26:CONFIG_BOOTCOMMAND="fatload mmc ${emmc_dev}:1 ${loadaddr} /boot.scr; source ${loadaddr}; reset"
./meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio/imx7ulpea-ucom/lmp-base.cfg:52:CONFIG_BOOTCOMMAND="mmc rescan; fatload mmc ${mmcdev}:1 ${loadaddr} boot.scr; source ${loadaddr}"
./meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio/imx8qm-mek/lmp-base.cfg:33:CONFIG_BOOTCOMMAND="fatload mmc 0:1 ${scriptaddr} /boot.scr; source ${scriptaddr}"
./meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio/imx8mq-evk/lmp-base.cfg:25:CONFIG_BOOTCOMMAND="fatload mmc 0:1 ${loadaddr} /boot.scr; source ${loadaddr}; reset"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, i'll keep it in and we can clean up all of the machines at once if we want to drop this.

Comment thread meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio/imx8mp-lpddr4-evk/lmp.cfg Outdated
Comment thread meta-lmp-bsp/recipes-security/optee/optee-os-fio_3.10.0.bbappend
Comment thread meta-lmp-bsp/recipes-security/optee/optee-os-fio_3.10.0.bbappend
Comment thread meta-lmp-bsp/recipes-security/optee/optee-os-fio_3.10.0.bbappend
Comment thread meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc Outdated
@ricardosalveti
Copy link
Copy Markdown
Member

@mike-scott @Tim-Anderson looks good, some minor comments and nits.

One thing that would be nice to avoid is having patches without a commit message, several only got the subject. Even if used to repeat the core of the subject line, useful to add if stuff was based on another board/target or similar, to add a bit more context.

Tim-Anderson and others added 12 commits October 5, 2021 15:52
- lmp.cfg for the standard LmP build
- lmp-base.cfg for DISTRO=lmp-base build
- fw_env.config to describe the env size and mount point for userspace

Signed-off-by: Tim Anderson <[email protected]>
[[email protected]: more config changes]
Signed-off-by: Michael Scott <[email protected]>
- Add lmp.cfg fragment for the standard LmP build

Signed-off-by: Tim Anderson <[email protected]>
Signed-off-by: Michael Scott <[email protected]>
- add scripts for the default lmp-base boot script recipe: u-boot-base-scr

Signed-off-by: Tim Anderson <[email protected]>
Signed-off-by: Michael Scott <[email protected]>
- Add ostree compatible boot script for use with kernel fit-image

Signed-off-by: Tim Anderson <[email protected]>
[[email protected]: mx8mp has 0 offset for boot part]
Signed-off-by: Michael Scott <[email protected]>
This patch is a movement only change.

Cleanup file structure:
- Group settings into vendor, soc, machine and secure machine sections
- Added headers for each section
- Alpha sort all settings

Signed-off-by: Michael Scott <[email protected]>
- Add an SoC entry for mx8m
- Drop related machine specific entries

Signed-off-by: Michael Scott <[email protected]>
This patch is a movement only change.

Cleanup file structure:
- Group settings into vendor, soc, machine and secure machine sections
- Added headers for each section
- Alpha sort all settings

Signed-off-by: Michael Scott <[email protected]>
- Add an SoC entry for mx8m
- Drop related machine specific entries

Signed-off-by: Michael Scott <[email protected]>
NOTE: machine setting for imx8mp-lpddr4-evk sets DDR SIZE so that
OP-TEE load/entry happens at 0x56000000 regardless of actual
DDR size.

Signed-off-by: Tim Anderson <[email protected]>
Signed-off-by: Michael Scott <[email protected]>
NOTE: machine setting for imx8mp-lpddr4-evk sets DDR SIZE so that
load/entry happens at 0x56000000 regardless of OP-TEE actual
DDR size.

Signed-off-by: Tim Anderson <[email protected]>
Signed-off-by: Michael Scott <[email protected]>
Add initial scripts for flashing bootloader and full image to eMMC.
Tested with uuu version 1.4.43.

Signed-off-by: Tim Anderson <[email protected]>
Signed-off-by: Michael Scott <[email protected]>
Initial support to build mfgtool artifacts for imx8mp-lpddr4-evk
in an LmP compatible way:
- sign u-boot fit-image
- signed kernel fit-image

Signed-off-by: Tim Anderson <[email protected]>
Signed-off-by: Michael Scott <[email protected]>
Tim-Anderson and others added 5 commits October 5, 2021 16:29
Add imx8mp settings for LmP compatibility:
- signed u-boot fit-image
- use fio recipe for u-boot
- set memory locations for dtb and boot script
- fix ATF dependencies
- specify boot script recipes
- kernel class is signed kernel-lmp-fitimage
- use imxboot with only SPL
- ostree compatible WIC image
- ostree compatible kernel arguments

Signed-off-by: Tim Anderson <[email protected]>
Signed-off-by: Michael Scott <[email protected]>
Custom fstab is needed for mounting vfat boot partition to read
u-boot env for OTA support.

Signed-off-by: Michael Scott <[email protected]>
Relevant changes:
- 34d3891f imx8qm: Add config for imx8qm-mek
- 946fe0e7 imx: turn off CONFIG_MXC_IMX_DMX_HW for imx8mp-lpddr4-evk
- 1119da21 bsp: imx: Add CONFIG_PINCTRL to the imx8mp-lpddr4-evk
- d0cf695e bsp: imx: add bsp for imx8mp-lpddr4-evk

Signed-off-by: Tim Anderson <[email protected]>
Signed-off-by: Michael Scott <[email protected]>
This patch somehow breaks the boot for mfgtools on 8mp and needs
more debugging.

Signed-off-by: Michael Scott <[email protected]>
Relevant changes:
- 0bb88ebb71 [FIO toup] ARM: imx8m: support IMX8MP in imx8m_usb_power_domain
- 557816cb2a [FIO internal] imx8m: set the fuses definitions common for all imx8m parts
- dea236900e [FIO toup] imx8mp_evk: move setting bootcmd to defconfig
- 379dd77761 [FIO internal] imx8mp_evk: use common spl_mmc_get_uboot_raw_sector()
- d9578c7d3d [FIO internal] imx8mp_evk: runtime detection raw sector offsets
- cab88e87ec [FIO internal] imx8mp_evk: drop hardcoded USB configuration
- 22bf38250b [FIO internal] imx8mp_evk: disable DM_I2C for SPL
- c06d7e9458 [FIO internal] imx8mp_evk: disable use of TCPC for SPL
- a37100c494 [FIO toup-squash] spl: imx: re-add missing imx7ulp boot devices
- ba69c026d5 [FIO internal] arch: arm: dts: imx8mm-evk-u-boot: add RPMB dev ID
- a30c05b93b [FIO internal] arch: arm: mach-imx: fiohab: fix typo

Signed-off-by: Michael Scott <[email protected]>
@mike-scott
Copy link
Copy Markdown
Contributor Author

  • Rebased on latest master
  • Split out the non-functional changes in the 2 OP-TEE clean up patches.
  • Addressed all comments except imx8qm machine questions in OP-TEE recipe clean ups (this is not inherited from the mx8m SoC).

Diff from previous version:

diff --git a/meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc b/meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc
index f4c57d2d..53a305d3 100644
--- a/meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc
+++ b/meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc
@@ -385,7 +385,6 @@ IMXBOOT_TARGETS_mx8mp = "flash_evk_spl"
 ## iMX8MP EVK
 OSTREE_KERNEL_ARGS_imx8mp-lpddr4-evk ?= "console=tty1 console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200 root=/dev/mmcblk2p2 rootfstype=ext4"
 SOTA_CLIENT_FEATURES_append_imx8mp-lpddr4-evk = " ubootenv"
-MACHINE_FEATURES_remove_imx8mp-lpddr4-evk = "qca9377 qca6174"
 UBOOT_MACHINE_imx8mp-lpddr4-evk = "imx8mp_evk_config"
 BOOTSCR_LOAD_ADDR_imx8mp-lpddr4-evk = "0x44800000"

diff --git a/meta-lmp-bsp/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_%.bbappend b/meta-lmp-bsp/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_%.bbappend
index fa87ac7f..00e21c9d 100644
--- a/meta-lmp-bsp/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_%.bbappend
+++ b/meta-lmp-bsp/dynamic-layers/freescale-layer/recipes-bsp/imx-mkimage/imx-boot_%.bbappend
@@ -4,7 +4,7 @@ DEPENDS_remove = "optee-os"
 DEPENDS += "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'virtual/optee-os', '', d)}"


-# TEMP: Need to figure out why this is breaking mfgtool builds on mx8mp
+# TODO: Need to figure out why this is breaking mfgtool builds on mx8mp
 # For now only apply the patch to mx8mm and mx8mq
 SRC_URL_append_mx8mm = " \
      file://0001-iMX8M-support-SPL-ddr-sign.patch \
@@ -12,7 +12,6 @@ SRC_URL_append_mx8mm = " \
 SRC_URL_append_mx8mq = " \
      file://0001-iMX8M-support-SPL-ddr-sign.patch \
 "
-
 SRC_URI_append_mx8m = " \
      file://0002-iMX8M-add-SPL-only-build.patch \
      file://0003-iMX8M-add-support-for-packing-HDMI-fw-in-SPL-only-bo.patch \
diff --git a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio/imx8mp-lpddr4-evk/lmp.cfg b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio/imx8mp-lpddr4-evk/lmp.cfg
index bd912863..aa7f330c 100644
--- a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio/imx8mp-lpddr4-evk/lmp.cfg
+++ b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-fio/imx8mp-lpddr4-evk/lmp.cfg
@@ -34,7 +34,7 @@ CONFIG_FIT_SIGNATURE=y
 CONFIG_FIT_SIGNATURE_STRICT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_SECONDARY_BOOT_RUNTIME_DETECTION=y
-# TODO: fix hard-coded seconday boot offset
+# TODO: fix hard-coded secondary boot offset
 # defined in fuse 0x490 [22:19] IMG_CNTN_SET1_OFFSET
 # default value is 0x0 == 4MB offset
 CONFIG_SECONDARY_BOOT_SECTOR_OFFSET=0x1000

@mike-scott
Copy link
Copy Markdown
Contributor Author

Adding a note from @rsalveti here: we will want a new PR to combine the settings for the mx8qm SoC. (resolving those questions in this PR)

@mike-scott mike-scott merged commit 5ce0a9d into foundriesio:master Oct 5, 2021
@mike-scott mike-scott deleted the master-add-imx8mp branch July 21, 2023 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants