-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This supports build for the NXP imx8mm-lpddr4-evk reference platform.
More work is needed: - add Balena website details for this board at given links - "contracts" have not been looked at - writing to /dev/ttymxc0 seems to reset the board - need to check support for secure boot / secure filesystem - need to support image flasher - testing Changelog-entry: Add support for NXP imx8mm-lpddr4-evk board Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk> Remove extraneous patch Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk> Default to balenaOS image flasher We have made changes to correctly enable build of the flasher image which has been tested to run up and flash the onboard EVK eMMC part correctly. This then boots and runs up to the BalenaOS prompt TODO: - Still need to verify portal HostOS update works but will do that when device is supported through portal Changelog-entry: Default imx8mm-lpddr4-evk board to image-flasher Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk> Use correct Yocto MACHINE name imx8mm-lpddr4-evk I was overriding this to append -nxp to enable use of IMX_DEFAULT_BSP="nxp" but am now adding this in layer.conf instead so we can use the original machine name Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk> iwlwifi: Add support for Intel iwlwifi devices We're using an M.2 WiFi module AX210NGW which this change supports Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk> linux-fslc-imx: Changes for peer review - inherit kernel-balena not kernel-resin - tidy up comments - make settings board specific for disabling kernel versioning and kernel patches - don't disable apparmour as this done elsewhere - don't optimise for size as we set f/s size for EVK board Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk>
- Loading branch information
Showing
20 changed files
with
269 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
deviceTypesCommon = require '@resin.io/device-types/common' | ||
{ networkOptions, commonImg, instructions } = deviceTypesCommon | ||
|
||
BOARD_POWEROFF = 'Remove and re-connect power to the board.' | ||
BOARD_SHUTDOWN = 'Monitor the device in Balena dashboard to see when it entered the post-provisioning state. Leave the state settle for around 10 seconds.' | ||
|
||
postProvisioningInstructions = [ | ||
BOARD_SHUTDOWN | ||
instructions.REMOVE_INSTALL_MEDIA | ||
instructions.BOARD_REPOWER | ||
] | ||
|
||
module.exports = | ||
version: 1 | ||
slug: 'imx8mm-lpddr4-evk' | ||
name: 'NXP i.MX8M Mini LPDDR4 EVK' | ||
arch: 'aarch64' | ||
state: 'development' | ||
|
||
stateInstructions: | ||
postProvisioning: postProvisioningInstructions | ||
|
||
instructions: [ | ||
instructions.ETCHER_SD | ||
instructions.EJECT_SD | ||
instructions.FLASHER_WARNING | ||
BOARD_POWEROFF | ||
].concat(postProvisioningInstructions) | ||
|
||
gettingStartedLink: | ||
windows: 'https://docs.resin.io/imx8mm-lpddr4-evk/nodejs/getting-started/#adding-your-first-device' | ||
osx: 'https://docs.resin.io/imx8mm-lpddr4-evk/nodejs/getting-started/#adding-your-first-device' | ||
linux: 'https://docs.resin.io/imx8mm-lpddr4-evk/nodejs/getting-started/#adding-your-first-device' | ||
|
||
yocto: | ||
machine: 'imx8mm-lpddr4-evk' | ||
image: 'balena-image-flasher' | ||
fstype: 'balenaos-img' | ||
version: 'yocto-honister' | ||
deployArtifact: 'balena-image-flasher-imx8mm-lpddr4-evk.balenaos-img' | ||
compressed: true | ||
|
||
options: [ networkOptions.group ] | ||
|
||
configuration: | ||
config: | ||
partition: | ||
primary: 1 | ||
path: '/config.json' | ||
|
||
initialization: commonImg.initialization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
layers/meta-balena-fsl-arm/recipes-bsp/u-boot/files/0002-fixup-imx8mm-evk-fdt-addr.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
diff -ur git.org/include/configs/imx8mm_evk.h git/include/configs/imx8mm_evk.h | ||
--- git.org/include/configs/imx8mm_evk.h 2023-09-19 17:04:45.921296582 +0100 | ||
+++ git/include/configs/imx8mm_evk.h 2023-09-19 17:06:34.504395138 +0100 | ||
@@ -138,8 +138,8 @@ | ||
"image=Image\0" \ | ||
"splashimage=0x50000000\0" \ | ||
"console=ttymxc1,115200\0" \ | ||
- "fdt_addr_r=0x43000000\0" \ | ||
- "fdt_addr=0x43000000\0" \ | ||
+ "fdt_addr_r=0x44000000\0" \ | ||
+ "fdt_addr=0x44000000\0" \ | ||
"fdt_high=0xffffffffffffffff\0" \ | ||
"boot_fit=no\0" \ | ||
"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ |
3 changes: 3 additions & 0 deletions
3
layers/meta-balena-fsl-arm/recipes-bsp/u-boot/files/balenaos_tweaks-imx.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CONFIG_ENV_SIZE=0x4000 | ||
CONFIG_ENV_IS_NOWHERE=y | ||
CONFIG_CMD_SAVEENV=n |
1 change: 1 addition & 0 deletions
1
layers/meta-balena-fsl-arm/recipes-bsp/u-boot/files/increase-early-malloc.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONFIG_SYS_MALLOC_F_LEN=0x10000 |
12 changes: 12 additions & 0 deletions
12
layers/meta-balena-fsl-arm/recipes-bsp/u-boot/u-boot-imx_%.bbappend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
UBOOT_KCONFIG_SUPPORT="1" | ||
BALENA_UBOOT_DEVICE_TYPES="mmc" | ||
inherit resin-u-boot | ||
|
||
FILESEXTRAPATHS:prepend := "${THISDIR}/files:" | ||
|
||
SRC_URI:append:imx8mm-lpddr4-evk = " \ | ||
file://0001-nitrogen8mm_env-common-Force-using-default-environment.patch \ | ||
file://0002-fixup-imx8mm-evk-fdt-addr.patch \ | ||
file://balenaos_tweaks-imx.cfg \ | ||
file://increase-early-malloc.cfg \ | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...s/meta-balena-fsl-arm/recipes-kernel/linux/linux-fslc-imx/0001-disable-audio-codecs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
diff -ur kernel-source.org/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi kernel-source/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi | ||
--- kernel-source.org/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi 2023-09-20 14:08:41.822947549 +0100 | ||
+++ kernel-source/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi 2023-09-20 16:08:00.194748554 +0100 | ||
@@ -130,6 +130,7 @@ | ||
audio-cpu = <&sai1>; | ||
audio-codec = <&ak4458_1>, <&ak4458_2>; | ||
reset-gpios = <&pca6416 4 GPIO_ACTIVE_LOW>; | ||
+ status = "disabled"; | ||
}; | ||
|
||
sound-ak5558 { | ||
@@ -409,6 +410,7 @@ | ||
reg = <0x10>; | ||
AVDD-supply = <®_audio_board>; | ||
DVDD-supply = <®_audio_board>; | ||
+ status = "disabled"; | ||
}; | ||
|
||
ak4458_2: ak4458@12 { | ||
@@ -416,6 +418,7 @@ | ||
reg = <0x12>; | ||
AVDD-supply = <®_audio_board>; | ||
DVDD-supply = <®_audio_board>; | ||
+ status = "disabled"; | ||
}; | ||
|
||
ak5558: ak5558@13 { | ||
@@ -424,6 +427,7 @@ | ||
reset-gpios = <&pca6416 3 GPIO_ACTIVE_LOW>; | ||
AVDD-supply = <®_audio_board>; | ||
DVDD-supply = <®_audio_board>; | ||
+ status = "disabled"; | ||
}; | ||
|
||
ak4497: ak4497@11 { | ||
@@ -433,6 +437,7 @@ | ||
AVDD-supply = <®_audio_board>; | ||
DVDD-supply = <®_audio_board>; | ||
dsd-path = <1>; | ||
+ status = "disabled"; | ||
}; | ||
|
||
ov5640_mipi: ov5640_mipi@3c { |
11 changes: 11 additions & 0 deletions
11
layers/meta-balena-fsl-arm/recipes-kernel/linux/linux-fslc-imx/0002-disable-caam-jr2.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
diff -ur kernel-source.org/arch/arm64/boot/dts/freescale/imx8mm.dtsi kernel-source/arch/arm64/boot/dts/freescale/imx8mm.dtsi | ||
--- kernel-source.org/arch/arm64/boot/dts/freescale/imx8mm.dtsi 2023-09-20 18:56:03.116395438 +0100 | ||
+++ kernel-source/arch/arm64/boot/dts/freescale/imx8mm.dtsi 2023-09-20 19:00:09.565594489 +0100 | ||
@@ -941,6 +941,7 @@ | ||
compatible = "fsl,sec-v4.0-job-ring"; | ||
reg = <0x3000 0x1000>; | ||
interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>; | ||
+ status = "disabled"; | ||
}; | ||
}; | ||
|
13 changes: 13 additions & 0 deletions
13
layers/meta-balena-fsl-arm/recipes-kernel/linux/linux-fslc-imx/enable-iwlwifi.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CONFIG_IWLWIFI=y | ||
CONFIG_IWLWIFI_LEDS=y | ||
CONFIG_IWLDVM=y | ||
CONFIG_IWLMVM=y | ||
# CONFIG_IWLWIFI_BCAST_FILTERING is not set | ||
|
||
# | ||
# Debugging Options | ||
# | ||
# CONFIG_IWLWIFI_DEBUG is not set | ||
# end of Debugging Options | ||
|
||
# CONFIG_MXC_GPU_VIV is not set |
13 changes: 13 additions & 0 deletions
13
layers/meta-balena-fsl-arm/recipes-kernel/linux/linux-fslc-imx_%.bbappend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FILESEXTRAPATHS:append := ":${THISDIR}/${PN}" | ||
|
||
inherit kernel-balena | ||
|
||
# Disable commit SHA in kernel version string | ||
SCMVERSION:imx8mm-lpddr4-evk ="n" | ||
|
||
SRC_URI:append:imx8mm-lpddr4-evk = " \ | ||
file://0001-disable-audio-codecs.patch \ | ||
file://0002-disable-caam-jr2.patch \ | ||
file://enable-iwlwifi.cfg \ | ||
" | ||
|
1 change: 1 addition & 0 deletions
1
layers/meta-balena-fsl-arm/recipes-support/balena-info/balena-info.bbappend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
TTYS:append:nitrogen8mm = " ttymxc1" | ||
TTYS:append:imx8mm-lpddr4-evk = " ttymxc1" |
38 changes: 38 additions & 0 deletions
38
...-fsl-arm/recipes-support/hostapp-update-hooks/files/99-flash-bootloader-imx8mm-lpddr4-evk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# Script used by hostapps updater to flash bootloader onto internal media | ||
# | ||
|
||
set -o errexit | ||
|
||
# machine specific data | ||
uboot_file="imx-boot" | ||
uboot_block_size=1024 | ||
uboot_seek_blocks=33 | ||
device="/dev/mmcblk2boot0" | ||
|
||
update_files="uboot" | ||
|
||
for i in $update_files; do | ||
current_update_file=$(eval echo \$${i}_file) | ||
block_size=$(eval echo \$${i}_block_size) | ||
seek_blocks=$(eval echo \$${i}_seek_blocks) | ||
|
||
# calculate size and md5sum of the binary to update from the update bundle | ||
update_size=$(ls -al /resin-boot/$current_update_file | awk '{print $5}') | ||
update_md5sum=$(md5sum /resin-boot/$current_update_file | awk '{print $1'}) | ||
|
||
let skip_bytes=$block_size*$seek_blocks | ||
|
||
# calculate md5sum of the data already written to $device, using $update_size bytes and skipping $skip_bytes from $device | ||
existing_md5sum=$(dd if=$device bs=1 skip=$skip_bytes count=$update_size status=none | md5sum | awk '{print $1}') | ||
|
||
# This hw partition should NOT be erased on imx8mm-lpddr4-evk, as it might contain an u-boot eMMC environment | ||
if [ ! "$existing_md5sum" = "$update_md5sum" ]; then | ||
echo "Will update u-boot on /dev/mmcblk2boot0" | ||
echo 0 > /sys/block/mmcblk2boot0/force_ro | ||
dd if=/resin-boot/$current_update_file of=$device conv=fdatasync seek=$seek_blocks bs=$block_size | ||
echo 1 > /sys/block/mmcblk2boot0/force_ro | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...l-arm/recipes-support/resin-init/resin-init-flasher-board-imx8mm/resin-init-flasher-board
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# Initial flashing of u-boot | ||
# | ||
|
||
set -o errexit | ||
|
||
# machine specific data | ||
uboot_file="imx-boot" | ||
uboot_block_size=1024 | ||
uboot_seek_blocks=33 | ||
uboot_device="/dev/mmcblk2boot0" | ||
|
||
# This hw partition should never be erased on the iMX8MM | ||
# as it might contain an eMMC u-boot environment | ||
echo 0 > /sys/block/mmcblk2boot0/force_ro | ||
dd if=/mnt/boot/$uboot_file of=$uboot_device conv=fdatasync seek=$uboot_seek_blocks bs=$uboot_block_size | ||
echo 1 > /sys/block/mmcblk2boot0/force_ro |
File renamed without changes.
3 changes: 2 additions & 1 deletion
3
layers/meta-balena-fsl-arm/recipes-support/resin-init/resin-init-flasher-board.bbappend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
FILESEXTRAPATHS:append := "${THISDIR}/${PN}" | ||
FILESEXTRAPATHS:append:nitrogen8mm := "${THISDIR}/${PN}-nitrogen8mm" | ||
FILESEXTRAPATHS:append:imx8mm-lpddr4-evk := "${THISDIR}/${PN}-imx8mm" |
1 change: 1 addition & 0 deletions
1
layers/meta-balena-fsl-arm/recipes-support/resin-init/resin-init-flasher.bbappend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Flash to internal eMMC - kernel always enumerates emmc as mmcblk2 | ||
INTERNAL_DEVICE_KERNEL:solidrun-imx6 = "mmcblk2" | ||
INTERNAL_DEVICE_KERNEL:nitrogen8mm = "mmcblk0" | ||
INTERNAL_DEVICE_KERNEL:imx8mm-lpddr4-evk = "mmcblk2" |