1
1
openwrt/target/linux/imx/image/cortexa53.mk
Martin Schiller 07a5e432c8 imx: add support for Kontron OSM-S/BL i.MX8MP
This adds support for the Kontron i.MX8MP OSM-S size system-on-module +
eval board.

CPU:      NXP i.MX8MP @ 1600MHz (quad-core A53)
Memory:   4 (up to 8) GByte LPDDR4-RAM
Storage:  32 (up to 128) GByte eMMC + microSD slot
Ethernet: 2x 1 Gbit/s IEEE (1x with TSN)
UART:     1x UART console output on the Mini-B USB Debug Port
          (signals are really UART on this Mini-B USB port!!!, there is
          an adapter with ftdi available from Kontron)
          1x RS232, 1x RS485
USB:	  2x USB 2.0 Type-A, 1x USB 3.0 Type-C DRP
Misc:	  8 (up to 128) kByte EEPROM (at24), RTC, 2x CAN, HDMI, 1x PCIe

This will create an SD card image for the board.
To use this image you have to bring the board to the recovery boot mode
(normal boot mode is eMMC). At the time of writing, the SoM (or the SoC)
has a bug that the FORCE_RECOVERY signal (switch S1 on the eval board)
doesn't work as long as the eMMC boot0 partition contains data.
Therefore you have to wipe this boot0 partition to be able to boot from
SD card. To do this call the following commands at uboot:

mmc dev 0 1
mmc erase 0 0x2000

After that, the system will try to boot from SD card.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2026-06-01 17:49:36 +02:00

108 lines
3.3 KiB
Makefile

define Build/boot-scr
rm -f $@-boot.scr
mkimage -A arm64 -O linux -T script -C none -a 0 -e 0 \
-d bootscript-$(BOOT_SCRIPT) $@-boot.scr
endef
define Build/boot-img-ext4
rm -fR $@.boot
mkdir -p $@.boot
$(foreach dts,$(DEVICE_DTS), $(CP) $(KDIR)/image-$(dts).dtb $@.boot/$(dts).dtb;)
$(foreach dtbo,$(DEVICE_DTS_OVERLAY), $(CP) $(KDIR)/image-$(dtbo).dtbo $@.boot/$(dtbo).dtbo;)
$(CP) $(IMAGE_KERNEL) $@.boot/$(KERNEL_NAME)
-$(CP) $@-boot.scr $@.boot/boot.scr
make_ext4fs -J -L kernel -l $(CONFIG_TARGET_KERNEL_PARTSIZE)M \
$(if $(SOURCE_DATE_EPOCH),-T $(SOURCE_DATE_EPOCH)) \
$@.bootimg $@.boot
endef
define Build/sdcard-img-ext4
SIGNATURE="$(IMG_PART_SIGNATURE)" \
PARTOFFSET="$(PARTITION_OFFSET)" PADDING=1 \
$(if $(filter $(1),efi),GUID="$(IMG_PART_DISKGUID)") $(SCRIPT_DIR)/gen_image_generic.sh \
$@ \
$(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
256
endef
define Build/sdcard-img-add-uboot
dd if=$(STAGING_DIR_IMAGE)/$(UBOOT)-flash.bin of=$@ bs=1k seek=32 conv=notrunc
endef
define Device/Default
PROFILES := Default
FILESYSTEMS := squashfs ubifs ext4
DEVICE_DTS_DIR := $(DTS_DIR)/freescale
KERNEL_INSTALL := 1
KERNEL_NAME := Image
KERNEL := kernel-bin
endef
define Device/imx8m
DEVICE_VENDOR := NXP
DEVICE_MODEL := i.MX8M
DEVICE_DTS := $(basename $(notdir $(wildcard $(DTS_DIR)/freescale/imx8m*.dts)))
endef
TARGET_DEVICES += imx8m
define Device/gateworks_venice
$(call Device/Default)
FILESYSTEMS := squashfs ext4
DEVICE_VENDOR := Gateworks
DEVICE_MODEL := i.MX8M Venice
SUPPORTED_DEVICES := \
gw,imx8mm-gw71xx-0x \
gw,imx8mm-gw72xx-0x \
gw,imx8mp-gw72xx-2x \
gw,imx8mm-gw73xx-0x \
gw,imx8mp-gw73xx-2x \
gw,imx8mm-gw7901 \
gw,imx8mm-gw7902 \
gw,imx8mn-gw7902 \
gw,imx8mm-gw7903 \
gateworks,imx8mp-gw71xx-2x \
gateworks,imx8mp-gw72xx-2x \
gateworks,imx8mp-gw73xx-2x \
gateworks,imx8mp-gw74xx \
gateworks,imx8mm-gw75xx-0x \
gateworks,imx8mp-gw75xx-2x \
gateworks,imx8mm-gw7904 \
gateworks,imx8mm-gw7905-0x \
gateworks,imx8mp-gw7905-2x
BOOT_SCRIPT := gateworks_venice
PARTITION_OFFSET := 16M
DEVICE_DTS := $(basename $(notdir $(wildcard $(DTS_DIR)/freescale/imx8m*-venice*.dts)))
DEVICE_DTS_OVERLAY := $(basename $(notdir $(wildcard $(DTS_DIR)/freescale/imx8m*-venice*.dtso)))
DEVICE_PACKAGES := \
kmod-hwmon-gsc kmod-rtc-ds1672 kmod-eeprom-at24 \
kmod-gpio-button-hotplug kmod-leds-gpio kmod-pps-gpio \
kmod-lan743x kmod-sky2 kmod-iio-st_accel-i2c \
kmod-can kmod-can-flexcan kmod-can-mcp251x \
kmod-dsa-ksz9477-i2c
IMAGES := img.gz
IMAGE/img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | gzip | append-metadata
endef
TARGET_DEVICES += gateworks_venice
define Device/kontron_osm-s-imx8mp
$(call Device/Default)
FILESYSTEMS := squashfs ext4
DEVICE_VENDOR := Kontron
DEVICE_MODEL := OSM-S/BL i.MX8MP
SUPPORTED_DEVICES := \
kontron,imx8mp-bl-osm-s
BOOT_SCRIPT := kontron_osm-s-imx8mp
PARTITION_OFFSET := 16M
DEVICE_DTS := imx8mp-kontron-bl-osm-s
DEVICE_PACKAGES := \
kmod-can kmod-can-flexcan \
kmod-eeprom-at24 \
kmod-leds-gpio \
kmod-rtc-rv3028
UBOOT := kontron-osm-s-mx8mp
IMAGES := img.gz
IMAGE/img.gz := boot-scr | boot-img-ext4 | sdcard-img-ext4 | sdcard-img-add-uboot | gzip | append-metadata
endef
TARGET_DEVICES += kontron_osm-s-imx8mp