From patchwork Fri Jan 12 21:37:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Harvey X-Patchwork-Id: 1939221 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=vLlCBiC5; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VmdRN1sQBz1ydW for ; Sat, 25 May 2024 20:28:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=fuGGk+3YQ+fDfwsKboH00l/cxgSMk9ehooyp+bVTyrg=; b=vLlCBiC5mvaEUL P1F4vTaJ8auQwbi0bqqJ9JCIdmtsARuNWdlzFvXMcF1WyRrmt/rDYGnsf9Mss7Mh5GRBkX1c2dvAq VeeYUNmxOOo//Kr7+s/dhIVaKCDBRlYvqqQ2848pAjDzC4VwR1drfh11V0vzswz73QKxcw03pXAmJ x2JlRiPaVEV0fz77DXNlsJ66/q1ZrFA9mmmf/GmBN7U7Om+Yt1ilhY3LCKSvITT7J8kRSCqOln65L fNnZCZCkBnkmua+kzzNNly9dkeAi8zZ8GDA55vBZHFYEnVklpFh09l5cOWg5vLi0yK0zIK3fvUHid CslgVQQy3IUd/vSEXUGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAoch-0000000AmiI-1T4z; Sat, 25 May 2024 10:27:35 +0000 Received: from finn.gateworks.com ([108.161.129.64] helo=finn.localdomain) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rOPE9-0043lc-0u for openwrt-devel@lists.openwrt.org; Fri, 12 Jan 2024 21:38:11 +0000 Received: from 068-189-091-139.biz.spectrum.com ([68.189.91.139] helo=tharvey.pdc.gateworks.com) by finn.localdomain with esmtp (Exim 4.95) (envelope-from ) id 1rOPE0-000ggk-2L; Fri, 12 Jan 2024 21:38:00 +0000 From: Tim Harvey To: openwrt-devel@lists.openwrt.org, Piotr Dymacz , Yuantian Tang , Koen Vandeputte , Robert Marko , Luka Perkov , Damir Samardzic , Lech Perczak , =?utf-8?q?Petr_=C5=A0tetiar?= Cc: Tim Harvey Subject: [PATCH v2] imx: add imx8m support Date: Fri, 12 Jan 2024 13:37:58 -0800 Message-Id: <20240112213758.3521750-1-tharvey@gateworks.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240112_133809_345619_66C90617 X-CRM114-Status: GOOD ( 15.14 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add imx8m support: - add a cortexa53 subtarget to imx - move ARCH and KERNELNAME to subtargets No device-specific targets or firmware images are created yet but all imx8m* dtbs will be built. enabling CONFIG_TARGET_ROOTFS_INITRAMFS results in openwrt-imx-cortexa53-imx8m-initramfs-kernel.bin which has been successfully booted on an imx8mm-evk using the following: Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Mailman-Approved-At: Sat, 25 May 2024 03:27:31 -0700 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add imx8m support: - add a cortexa53 subtarget to imx - move ARCH and KERNELNAME to subtargets No device-specific targets or firmware images are created yet but all imx8m* dtbs will be built. enabling CONFIG_TARGET_ROOTFS_INITRAMFS results in openwrt-imx-cortexa53-imx8m-initramfs-kernel.bin which has been successfully booted on an imx8mm-evk using the following: u-boot=> tftpboot $fdt_addr_r image-imx8mm-evk.dtb && \ tftpboot $kernel_addr_r openwrt-imx-cortexa53-imx8m-initramfs-kernel.bin && \ booti $kernel_addr_r - $fdt_addr_r Signed-off-by: Tim Harvey --- v2: - fix build failure regarding ubifs image generation - remove kernel patches (these all go away when we move to 6.1 and I've already submitted a series to add 6.1 support to imx) - add a generic imx8m device that picks up imx8m dtb's - show example of how I'm booting this in commit log --- target/linux/imx/Makefile | 5 +- target/linux/imx/cortexa53/config-default | 96 +++++++++++++++++++++++ target/linux/imx/cortexa53/target.mk | 8 ++ target/linux/imx/cortexa7/target.mk | 2 + target/linux/imx/cortexa9/target.mk | 2 + target/linux/imx/image/cortexa53.mk | 16 ++++ 6 files changed, 125 insertions(+), 4 deletions(-) create mode 100644 target/linux/imx/cortexa53/config-default create mode 100644 target/linux/imx/cortexa53/target.mk create mode 100644 target/linux/imx/image/cortexa53.mk diff --git a/target/linux/imx/Makefile b/target/linux/imx/Makefile index 5f7f9db589..53c1ccce0c 100644 --- a/target/linux/imx/Makefile +++ b/target/linux/imx/Makefile @@ -4,19 +4,16 @@ include $(TOPDIR)/rules.mk -ARCH:=arm BOARD:=imx BOARDNAME:=NXP i.MX FEATURES:=audio display fpu gpio pcie rtc usb usbgadget squashfs targz nand ubifs boot-part rootfs-part -SUBTARGETS:=cortexa7 cortexa9 +SUBTARGETS:=cortexa7 cortexa9 cortexa53 KERNEL_PATCHVER:=5.15 KERNEL_TESTING_PATCHVER:=6.1 include $(INCLUDE_DIR)/target.mk -KERNELNAME:=zImage dtbs - DEFAULT_PACKAGES += uboot-envtools mkf2fs e2fsprogs blkid $(eval $(call BuildTarget)) diff --git a/target/linux/imx/cortexa53/config-default b/target/linux/imx/cortexa53/config-default new file mode 100644 index 0000000000..de52260489 --- /dev/null +++ b/target/linux/imx/cortexa53/config-default @@ -0,0 +1,96 @@ +CONFIG_64BIT=y +CONFIG_ARM64=y +CONFIG_ARM64_4K_PAGES=y +CONFIG_ARM64_VA_BITS_39=y +CONFIG_ARM64_CRYPTO=y +CONFIG_ARCH_NXP=y +CONFIG_CRYPTO_AES_ARM64=y +CONFIG_CRYPTO_AES_ARM64_CE=y +CONFIG_CRYPTO_AES_ARM64_CE_BLK=y +CONFIG_CRYPTO_AES_ARM64_CE_CCM=y +CONFIG_CRYPTO_BLAKE2S=y +CONFIG_CRYPTO_GHASH_ARM64_CE=y +CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y +CONFIG_CRYPTO_SHA1_ARM64_CE=y +CONFIG_CRYPTO_SHA256_ARM64=y +CONFIG_CRYPTO_SHA2_ARM64_CE=y +CONFIG_CRYPTO_SHA512_ARM64=y +CONFIG_CRYPTO_SHA512_ARM64_CE=y +CONFIG_CRYPTO_ZSTD=y +CONFIG_UNMAP_KERNEL_AT_EL0=y +CONFIG_RODATA_FULL_DEFAULT_ENABLED=y +CONFIG_ARM64_TAGGED_ADDR_ABI=y +CONFIG_ARCH_MMAP_RND_BITS=18 +CONFIG_VMAP_STACK=y +CONFIG_MEMORY_ISOLATION=y +CONFIG_CMA=y +CONFIG_CMA_AREAS=7 +# CONFIG_CMA_DEBUG is not set +# CONFIG_CMA_DEBUGFS is not set +# CONFIG_CMA_SYSFS is not set +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_CONTIG_ALLOC=y +CONFIG_ZONE_DMA32=y +CONFIG_ARM_IMX_CPUFREQ_DT=y +CONFIG_ARM64_CRYPTO=y +CONFIG_EXTRA_FIRMWARE="imx/sdma/sdma-imx7d.bin" +CONFIG_EXTRA_FIRMWARE_DIR="firmware" +CONFIG_PCI=y +CONFIG_PCIEAER=y +CONFIG_PCIEPORTBUS=y +CONFIG_PCIE_PME=y +CONFIG_PHY_FSL_IMX8M_PCIE=y +CONFIG_PCIEAER=y +CONFIG_PCIEPORTBUS=y +CONFIG_PCIE_DW=y +CONFIG_PCIE_DW_HOST=y +CONFIG_PCIE_PME=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_IMX6=y +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +CONFIG_PINCTRL_IMX=y +CONFIG_DWMAC_DWC_QOS_ETH=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_SINGLE=y +CONFIG_PINCTRL_IMX=y +CONFIG_PINCTRL_IMX8MM=y +CONFIG_PINCTRL_IMX8MN=y +CONFIG_PINCTRL_IMX8MP=y +CONFIG_PINCTRL_IMX8MQ=y +CONFIG_THERMAL=y +CONFIG_IMX8MM_THERMAL=y +CONFIG_REGULATOR_MP5416=y +CONFIG_REGULATOR_PCA9450=y +CONFIG_USB_CONN_GPIO=y +CONFIG_NOP_USB_XCEIV=y +CONFIG_USB_OTG=y +CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_DUAL_ROLE=y +# CONFIG_USB_DWC3_GADGET is not set +# CONFIG_USB_DWC3_HOST is not set +CONFIG_USB_DWC3_IMX8MP=y +# CONFIG_MMC_SDHCI_PCI is not set +CONFIG_CLK_IMX8MM=y +CONFIG_CLK_IMX8MN=y +CONFIG_CLK_IMX8MP=y +CONFIG_CLK_IMX8MQ=y +CONFIG_CLK_IMX8QXP=y +CONFIG_SOC_IMX8M=y +# CONFIG_IMX_DSP is not set +# CONFIG_IMX_SCU is not set +CONFIG_EXTCON_USB_GPIO=y +CONFIG_PHY_FSL_IMX8MQ_USB=y +# CONFIG_PHY_MIXEL_LVDS_PHY is not set +CONFIG_RESET_IMX7=y +CONFIG_INTERCONNECT=y +CONFIG_INTERCONNECT_IMX=y +CONFIG_INTERCONNECT_IMX8MM=y +CONFIG_INTERCONNECT_IMX8MN=y +CONFIG_INTERCONNECT_IMX8MQ=y +CONFIG_INTERCONNECT_IMX8MP=y +# CONFIG_DMA_CMA is not set +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y diff --git a/target/linux/imx/cortexa53/target.mk b/target/linux/imx/cortexa53/target.mk new file mode 100644 index 0000000000..b9b32d1829 --- /dev/null +++ b/target/linux/imx/cortexa53/target.mk @@ -0,0 +1,8 @@ +ARCH:=aarch64 +BOARDNAME:=NXP i.MX with Cortex-A53 (ARM64) +CPU_TYPE:=cortex-a53 +KERNELNAME:=Image dtbs + +define Target/Description + Build firmware images for NXP i.MX (Cortex-A53) based boards. +endef diff --git a/target/linux/imx/cortexa7/target.mk b/target/linux/imx/cortexa7/target.mk index 11de87507d..1fec64b00c 100644 --- a/target/linux/imx/cortexa7/target.mk +++ b/target/linux/imx/cortexa7/target.mk @@ -1,6 +1,8 @@ +ARCH:=arm BOARDNAME:=NXP i.MX with Cortex-A7 CPU_TYPE:=cortex-a7 CPU_SUBTYPE:=neon-vfpv4 +KERNELNAME:=zImage dtbs define Target/Description Build firmware images for NXP i.MX (Cortex-A7) based boards. diff --git a/target/linux/imx/cortexa9/target.mk b/target/linux/imx/cortexa9/target.mk index 9bd63c7be1..cc48a8dbd0 100644 --- a/target/linux/imx/cortexa9/target.mk +++ b/target/linux/imx/cortexa9/target.mk @@ -1,6 +1,8 @@ +ARCH:=arm BOARDNAME:=NXP i.MX with Cortex-A9 CPU_TYPE:=cortex-a9 CPU_SUBTYPE:=neon +KERNELNAME:=zImage dtbs define Target/Description Build firmware images for NXP i.MX (Cortex-A9) based boards. diff --git a/target/linux/imx/image/cortexa53.mk b/target/linux/imx/image/cortexa53.mk new file mode 100644 index 0000000000..075f86c8c1 --- /dev/null +++ b/target/linux/imx/image/cortexa53.mk @@ -0,0 +1,15 @@ +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