[openwrt/openwrt] imx: introduce 'cortexa7' subtarget

LEDE Commits lede-commits at lists.infradead.org
Wed Nov 3 05:36:24 PDT 2021


pepe2k pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b35cd4d71d9ca761bf1e58465d16006757871ea2

commit b35cd4d71d9ca761bf1e58465d16006757871ea2
Author: Piotr Dymacz <pepe2k at gmail.com>
AuthorDate: Wed Mar 31 09:44:36 2021 +0200

    imx: introduce 'cortexa7' subtarget
    
    This adds some essential files required by new 'cortexa7' subtarget,
    dedicated for Cortex-A7 based NXP i.MX series. For now, the kernel
    config-default focuses only on the i.MX 6UL family, as the following
    changeset will introduce support for i.MX 6ULL based device. Support
    for more platforms (e.g. i.MX 7) might be enabled later, while adding
    more devices.
    
    Signed-off-by: Piotr Dymacz <pepe2k at gmail.com>
---
 target/linux/imx/Makefile                          |  2 +-
 .../imx/cortexa7/base-files/etc/board.d/02_network | 15 ++++++++++++++
 .../cortexa7/base-files/lib/upgrade/platform.sh    | 16 +++++++++++++++
 target/linux/imx/cortexa7/config-default           | 24 ++++++++++++++++++++++
 target/linux/imx/cortexa7/target.mk                |  7 +++++++
 target/linux/imx/image/cortexa7.mk                 | 10 +++++++++
 6 files changed, 73 insertions(+), 1 deletion(-)

diff --git a/target/linux/imx/Makefile b/target/linux/imx/Makefile
index 66ffa9bd31..17f634a7bf 100644
--- a/target/linux/imx/Makefile
+++ b/target/linux/imx/Makefile
@@ -8,7 +8,7 @@ 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:=cortexa9
+SUBTARGETS:=cortexa7 cortexa9
 
 KERNEL_PATCHVER:=5.4
 KERNEL_TESTING_PATCHVER:=5.10
diff --git a/target/linux/imx/cortexa7/base-files/etc/board.d/02_network b/target/linux/imx/cortexa7/base-files/etc/board.d/02_network
new file mode 100644
index 0000000000..75d1c7d1d8
--- /dev/null
+++ b/target/linux/imx/cortexa7/base-files/etc/board.d/02_network
@@ -0,0 +1,15 @@
+. /lib/functions/uci-defaults.sh
+
+board=$(board_name)
+
+board_config_update
+
+case "$board" in
+*)
+	ucidef_set_interfaces_lan_wan "eth0" "eth1"
+	;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/imx/cortexa7/base-files/lib/upgrade/platform.sh b/target/linux/imx/cortexa7/base-files/lib/upgrade/platform.sh
new file mode 100644
index 0000000000..9a613c43b1
--- /dev/null
+++ b/target/linux/imx/cortexa7/base-files/lib/upgrade/platform.sh
@@ -0,0 +1,16 @@
+PART_NAME=firmware
+REQUIRE_IMAGE_METADATA=1
+
+platform_check_image() {
+	return 0
+}
+
+platform_do_upgrade() {
+	local board=$(board_name)
+
+	case "$board" in
+	*)
+		default_do_upgrade "$1"
+		;;
+	esac
+}
diff --git a/target/linux/imx/cortexa7/config-default b/target/linux/imx/cortexa7/config-default
new file mode 100644
index 0000000000..eb1986769e
--- /dev/null
+++ b/target/linux/imx/cortexa7/config-default
@@ -0,0 +1,24 @@
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARM_GIC=y
+CONFIG_CMA=y
+CONFIG_CMA_AREAS=7
+# CONFIG_CMA_DEBUG is not set
+# CONFIG_CMA_DEBUGFS is not set
+CONFIG_CONTIG_ALLOC=y
+# CONFIG_DMA_CMA is not set
+CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
+CONFIG_IRQ_DOMAIN_HIERARCHY=y
+CONFIG_JFFS2_FS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_MEMORY_ISOLATION=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPLIT_FIRMWARE=y
+CONFIG_MTD_SPLIT_FIT_FW=y
+CONFIG_PINCTRL_IMX=y
+CONFIG_PINCTRL_IMX6UL=y
+CONFIG_PM_GENERIC_DOMAINS=y
+CONFIG_PM_GENERIC_DOMAINS_OF=y
+CONFIG_SOC_IMX6=y
+CONFIG_SOC_IMX6UL=y
+CONFIG_SPI_FSL_QUADSPI=y
+CONFIG_SPI_MEM=y
diff --git a/target/linux/imx/cortexa7/target.mk b/target/linux/imx/cortexa7/target.mk
new file mode 100644
index 0000000000..11de87507d
--- /dev/null
+++ b/target/linux/imx/cortexa7/target.mk
@@ -0,0 +1,7 @@
+BOARDNAME:=NXP i.MX with Cortex-A7
+CPU_TYPE:=cortex-a7
+CPU_SUBTYPE:=neon-vfpv4
+
+define Target/Description
+	Build firmware images for NXP i.MX (Cortex-A7) based boards.
+endef
diff --git a/target/linux/imx/image/cortexa7.mk b/target/linux/imx/image/cortexa7.mk
new file mode 100644
index 0000000000..063b89fdd6
--- /dev/null
+++ b/target/linux/imx/image/cortexa7.mk
@@ -0,0 +1,10 @@
+define Device/Default
+  PROFILES := Default
+  FILESYSTEMS := squashfs ext4
+  KERNEL_INSTALL := 1
+  KERNEL_SUFFIX := -uImage
+  KERNEL_NAME := zImage
+  KERNEL := kernel-bin | uImage none
+  KERNEL_LOADADDR := 0x80008000
+  IMAGES :=
+endef



More information about the lede-commits mailing list