imx: split into arch-specific subtargets
authorPiotr Dymacz <pepe2k@gmail.com>
Sun, 28 Mar 2021 22:33:20 +0000 (00:33 +0200)
committerPiotr Dymacz <pepe2k@gmail.com>
Wed, 3 Nov 2021 11:45:40 +0000 (12:45 +0100)
Modern NXP i.MX series includes several different families, based on
single- or multi-core Arm Cortex-A CPUs. To be able to support more
families within a single target, we split the 'imx' in arch-specific
subtargets, starting with 'cortexa9' for the Cortex-A9 based i.MX 6,
already supported by the original 'imx6' target.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
15 files changed:
target/linux/imx/Makefile
target/linux/imx/base-files/etc/board.d/02_network [deleted file]
target/linux/imx/base-files/lib/imx.sh [deleted file]
target/linux/imx/base-files/lib/preinit/79_move_config [deleted file]
target/linux/imx/base-files/lib/upgrade/platform.sh [deleted file]
target/linux/imx/config-5.10
target/linux/imx/config-5.4
target/linux/imx/cortexa9/base-files/etc/board.d/02_network [new file with mode: 0644]
target/linux/imx/cortexa9/base-files/lib/imx.sh [new file with mode: 0644]
target/linux/imx/cortexa9/base-files/lib/preinit/79_move_config [new file with mode: 0644]
target/linux/imx/cortexa9/base-files/lib/upgrade/platform.sh [new file with mode: 0755]
target/linux/imx/cortexa9/config-default [new file with mode: 0644]
target/linux/imx/cortexa9/target.mk [new file with mode: 0644]
target/linux/imx/image/Makefile
target/linux/imx/image/cortexa9.mk [new file with mode: 0644]

index 6f00cba99283b22147aaa948585812a9ed26fae1..66ffa9bd311eb9be32f41155cf03089e51bcc157 100644 (file)
@@ -8,8 +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
-CPU_TYPE:=cortex-a9
-CPU_SUBTYPE:=neon
+SUBTARGETS:=cortexa9
 
 KERNEL_PATCHVER:=5.4
 KERNEL_TESTING_PATCHVER:=5.10
diff --git a/target/linux/imx/base-files/etc/board.d/02_network b/target/linux/imx/base-files/etc/board.d/02_network
deleted file mode 100644 (file)
index 1668b86..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (C) 2013-2015 OpenWrt.org
-#
-
-. /lib/functions/uci-defaults.sh
-
-board=$(board_name)
-
-board_config_update
-
-case "$board" in
-gw,imx6dl-gw51xx |\
-gw,imx6dl-gw52xx |\
-gw,imx6dl-gw5904 |\
-gw,imx6dl-gw5907 |\
-gw,imx6dl-gw5910 |\
-gw,imx6dl-gw5912 |\
-gw,imx6dl-gw5913 |\
-gw,imx6q-gw51xx |\
-gw,imx6q-gw52xx |\
-gw,imx6q-gw5904 |\
-gw,imx6q-gw5907 |\
-gw,imx6q-gw5910 |\
-gw,imx6q-gw5912 |\
-gw,imx6q-gw5913 |\
-solidrun,cubox-i/dl |\
-solidrun,cubox-i/q )
-       ucidef_set_interface_lan 'eth0'
-       ;;
-gw,imx6dl-gw53xx |\
-gw,imx6dl-gw54xx |\
-gw,imx6dl-gw552x |\
-gw,imx6q-gw53xx |\
-gw,imx6q-gw5400-a |\
-gw,imx6q-gw54xx |\
-gw,imx6q-gw552x )
-       ucidef_set_interfaces_lan_wan 'eth0' 'eth1'
-       ;;
-wand,imx6dl-wandboard )
-       ucidef_set_interface_wan 'eth0'
-       ;;
-esac
-
-board_config_flush
-
-exit 0
diff --git a/target/linux/imx/base-files/lib/imx.sh b/target/linux/imx/base-files/lib/imx.sh
deleted file mode 100644 (file)
index 46d2eeb..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright (C) 2010-2013 OpenWrt.org
-#
-
-rootpartuuid() {
-       local cmdline=$(cat /proc/cmdline)
-       local bootpart=${cmdline##*root=}
-       bootpart=${bootpart%% *}
-       local uuid=${bootpart#PARTUUID=}
-       echo ${uuid%-02}
-}
-
-bootdev_from_uuid() {
-       blkid | grep "PTUUID=\"$(rootpartuuid)\"" | cut -d : -f1
-}
-
-bootpart_from_uuid() {
-       blkid | grep $(rootpartuuid)-01 | cut -d : -f1
-}
-
-rootpart_from_uuid() {
-       blkid | grep $(rootpartuuid)-02 | cut -d : -f1
-}
-
-apalis_mount_boot() {
-       mkdir -p /boot
-       [ -f /boot/uImage ] || {
-               mount -o rw,noatime $(bootpart_from_uuid) /boot > /dev/null
-       }
-}
diff --git a/target/linux/imx/base-files/lib/preinit/79_move_config b/target/linux/imx/base-files/lib/preinit/79_move_config
deleted file mode 100644 (file)
index 6ed5932..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-. /lib/imx.sh
-. /lib/functions.sh
-. /lib/upgrade/common.sh
-
-move_config() {
-       local board=$(board_name)
-
-       case "$board" in
-       toradex,apalis_imx6q-eval |\
-       toradex,apalis_imx6q-ixora |\
-       toradex,apalis_imx6q-ixora-v1.1 )
-               if [ -b $(bootpart_from_uuid) ]; then
-                       apalis_mount_boot
-                       [ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /
-                       umount /boot
-               fi
-               ;;
-       esac
-}
-
-boot_hook_add preinit_mount_root move_config
diff --git a/target/linux/imx/base-files/lib/upgrade/platform.sh b/target/linux/imx/base-files/lib/upgrade/platform.sh
deleted file mode 100755 (executable)
index e18d59c..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-#
-# Copyright (C) 2010-2015 OpenWrt.org
-#
-
-. /lib/imx.sh
-
-RAMFS_COPY_BIN='blkid jffs2reset'
-
-enable_image_metadata_check() {
-       case "$(board_name)" in
-               toradex,apalis_imx6q-eval |\
-               toradex,apalis_imx6q-ixora |\
-               toradex,apalis_imx6q-ixora-v1.1 )
-                       REQUIRE_IMAGE_METADATA=1
-                       ;;
-       esac
-}
-enable_image_metadata_check
-
-apalis_copy_config() {
-       apalis_mount_boot
-       cp -af "$UPGRADE_BACKUP" "/boot/$BACKUP_FILE"
-       sync
-       umount /boot
-}
-
-apalis_do_upgrade() {
-       apalis_mount_boot
-       get_image "$1" | tar Oxf - sysupgrade-apalis/kernel > /boot/uImage
-       get_image "$1" | tar Oxf - sysupgrade-apalis/root > $(rootpart_from_uuid)
-       sync
-       umount /boot
-}
-
-platform_check_image() {
-       local board=$(board_name)
-
-       case "$board" in
-       gw,imx6dl-gw51xx |\
-       gw,imx6dl-gw52xx |\
-       gw,imx6dl-gw53xx |\
-       gw,imx6dl-gw54xx |\
-       gw,imx6dl-gw551x |\
-       gw,imx6dl-gw552x |\
-       gw,imx6dl-gw553x |\
-       gw,imx6dl-gw5904 |\
-       gw,imx6dl-gw5907 |\
-       gw,imx6dl-gw5910 |\
-       gw,imx6dl-gw5912 |\
-       gw,imx6dl-gw5913 |\
-       gw,imx6q-gw51xx |\
-       gw,imx6q-gw52xx |\
-       gw,imx6q-gw53xx |\
-       gw,imx6q-gw5400-a |\
-       gw,imx6q-gw54xx |\
-       gw,imx6q-gw551x |\
-       gw,imx6q-gw552x |\
-       gw,imx6q-gw553x |\
-       gw,imx6q-gw5904 |\
-       gw,imx6q-gw5907 |\
-       gw,imx6q-gw5910 |\
-       gw,imx6q-gw5912 |\
-       gw,imx6q-gw5913 )
-               nand_do_platform_check $board $1
-               return $?;
-               ;;
-       toradex,apalis_imx6q-eval |\
-       toradex,apalis_imx6q-ixora |\
-       toradex,apalis_imx6q-ixora-v1.1 )
-               return 0
-               ;;
-       esac
-
-       echo "Sysupgrade is not yet supported on $board."
-       return 1
-}
-
-platform_do_upgrade() {
-       local board=$(board_name)
-
-       case "$board" in
-       gw,imx6dl-gw51xx |\
-       gw,imx6dl-gw52xx |\
-       gw,imx6dl-gw53xx |\
-       gw,imx6dl-gw54xx |\
-       gw,imx6dl-gw551x |\
-       gw,imx6dl-gw552x |\
-       gw,imx6dl-gw553x |\
-       gw,imx6dl-gw5904 |\
-       gw,imx6dl-gw5907 |\
-       gw,imx6dl-gw5910 |\
-       gw,imx6dl-gw5912 |\
-       gw,imx6dl-gw5913 |\
-       gw,imx6q-gw51xx |\
-       gw,imx6q-gw52xx |\
-       gw,imx6q-gw53xx |\
-       gw,imx6q-gw5400-a |\
-       gw,imx6q-gw54xx |\
-       gw,imx6q-gw551x |\
-       gw,imx6q-gw552x |\
-       gw,imx6q-gw553x |\
-       gw,imx6q-gw5904 |\
-       gw,imx6q-gw5907 |\
-       gw,imx6q-gw5910 |\
-       gw,imx6q-gw5912 |\
-       gw,imx6q-gw5913 )
-               nand_do_upgrade "$1"
-               ;;
-       toradex,apalis_imx6q-eval |\
-       toradex,apalis_imx6q-ixora |\
-       toradex,apalis_imx6q-ixora-v1.1 )
-               apalis_do_upgrade "$1"
-               ;;
-       esac
-}
-
-platform_copy_config() {
-       local board=$(board_name)
-
-       case "$board" in
-       toradex,apalis_imx6q-eval |\
-       toradex,apalis_imx6q-ixora |\
-       toradex,apalis_imx6q-ixora-v1.1 )
-               apalis_copy_config
-               ;;
-       esac
-}
-
-platform_pre_upgrade() {
-       local board=$(board_name)
-
-       case "$board" in
-       toradex,apalis_imx6q-eval |\
-       toradex,apalis_imx6q-ixora |\
-       toradex,apalis_imx6q-ixora-v1.1 )
-               [ -z "$UPGRADE_BACKUP" ] && {
-                       jffs2reset -y
-                       umount /overlay
-               }
-               ;;
-       esac
-}
index 73ce01ebdda4d0186aa02622ffa3d8d2896e0734..f8fd0437bb23c4f949751d915f596b1b08102b61 100644 (file)
@@ -1,4 +1,3 @@
-CONFIG_AHCI_IMX=y
 CONFIG_ALIGNMENT_TRAP=y
 CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
@@ -18,16 +17,13 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_ARM=y
 CONFIG_ARM_ARCH_TIMER=y
 CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
-CONFIG_ARM_CPU_SUSPEND=y
 CONFIG_ARM_CRYPTO=y
 CONFIG_ARM_ERRATA_754322=y
 CONFIG_ARM_ERRATA_764369=y
 CONFIG_ARM_ERRATA_775420=y
 CONFIG_ARM_ERRATA_814220=y
-CONFIG_ARM_GIC=y
 CONFIG_ARM_HAS_SG_CHAIN=y
 CONFIG_ARM_HEAVY_MB=y
-CONFIG_ARM_IMX6Q_CPUFREQ=y
 # CONFIG_ARM_IMX_CPUFREQ_DT is not set
 CONFIG_ARM_L1_CACHE_SHIFT=6
 CONFIG_ARM_L1_CACHE_SHIFT_6=y
@@ -40,27 +36,22 @@ CONFIG_ASN1=y
 CONFIG_ASSOCIATIVE_ARRAY=y
 CONFIG_ATA=y
 CONFIG_ATAGS=y
+# CONFIG_ATA_SFF is not set
 CONFIG_AUTO_ZRELADDR=y
 CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
 CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_MQ_PCI=y
 CONFIG_BLK_PM=y
 CONFIG_BLK_SCSI_REQUEST=y
 CONFIG_CACHE_L2X0=y
 CONFIG_CLKDEV_LOOKUP=y
 CONFIG_CLKSRC_IMX_GPT=y
 CONFIG_CLKSRC_MMIO=y
-CONFIG_CLK_IMX6Q=y
-CONFIG_CLK_IMX6SL=y
-CONFIG_CLK_IMX6SX=y
 # CONFIG_CLK_IMX8MM is not set
 # CONFIG_CLK_IMX8MN is not set
 # CONFIG_CLK_IMX8MP is not set
 # CONFIG_CLK_IMX8MQ is not set
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_CLZ_TAB=y
-CONFIG_CMDLINE="pci=nomsi"
-CONFIG_CMDLINE_EXTEND=y
 CONFIG_COMMON_CLK=y
 CONFIG_COMPAT_32BIT_TIME=y
 CONFIG_CPUFREQ_DT=y
@@ -162,7 +153,6 @@ CONFIG_DMA_OPS=y
 CONFIG_DMA_REMAP=y
 CONFIG_DMA_VIRTUAL_CHANNELS=y
 CONFIG_DTC=y
-CONFIG_E1000E=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
 CONFIG_ENCRYPTED_KEYS=y
@@ -173,10 +163,9 @@ CONFIG_EXTCON=y
 CONFIG_EXTRA_FIRMWARE="imx/sdma/sdma-imx6q.bin"
 CONFIG_EXTRA_FIRMWARE_DIR="firmware"
 CONFIG_F2FS_FS=y
-CONFIG_FEC=y
+# CONFIG_FEC is not set
 CONFIG_FIXED_PHY=y
 CONFIG_FIX_EARLYCON_MEM=y
-CONFIG_FSL_GUTS=y
 CONFIG_FS_ENCRYPTION=y
 CONFIG_FS_ENCRYPTION_ALGS=y
 CONFIG_FS_IOMAP=y
@@ -193,12 +182,9 @@ CONFIG_GENERIC_EARLY_IOREMAP=y
 CONFIG_GENERIC_GETTIMEOFDAY=y
 CONFIG_GENERIC_IDLE_POLL_SETUP=y
 CONFIG_GENERIC_IRQ_CHIP=y
-CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
 CONFIG_GENERIC_IRQ_MULTI_HANDLER=y
 CONFIG_GENERIC_IRQ_SHOW=y
 CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
-CONFIG_GENERIC_MSI_IRQ=y
-CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
 CONFIG_GENERIC_PCI_IOMAP=y
 CONFIG_GENERIC_PINCONF=y
 CONFIG_GENERIC_PINCTRL_GROUPS=y
@@ -212,11 +198,8 @@ CONFIG_GENERIC_VDSO_32=y
 # CONFIG_GIANFAR is not set
 CONFIG_GLOB=y
 CONFIG_GPIOLIB=y
-CONFIG_GPIOLIB_IRQCHIP=y
 CONFIG_GPIO_GENERIC=y
 CONFIG_GPIO_MXC=y
-CONFIG_GPIO_PCA953X=y
-CONFIG_GPIO_PCA953X_IRQ=y
 CONFIG_GRO_CELLS=y
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDEN_BRANCH_PREDICTOR=y
@@ -227,7 +210,6 @@ CONFIG_HAS_IOPORT_MAP=y
 CONFIG_HAVE_SMP=y
 CONFIG_HWMON=y
 CONFIG_HW_RANDOM=y
-CONFIG_HW_RANDOM_IMX_RNGC=y
 CONFIG_HZ_FIXED=0
 CONFIG_HZ_PERIODIC=y
 CONFIG_I2C=y
@@ -245,7 +227,6 @@ CONFIG_IMX_IRQSTEER=y
 CONFIG_IMX_SDMA=y
 CONFIG_IMX_THERMAL=y
 # CONFIG_IMX_WEIM is not set
-# CONFIG_INITRAMFS_FORCE is not set
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_IO_URING=y
 CONFIG_IRQCHIP=y
@@ -262,13 +243,11 @@ CONFIG_LOCK_DEBUGGING_SUPPORT=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
 CONFIG_LZO_COMPRESS=y
 CONFIG_LZO_DECOMPRESS=y
-CONFIG_MARVELL_PHY=y
 CONFIG_MDIO_BUS=y
 CONFIG_MDIO_DEVICE=y
 CONFIG_MDIO_DEVRES=y
 CONFIG_MEMFD_CREATE=y
 CONFIG_MFD_SYSCON=y
-CONFIG_MICREL_PHY=y
 CONFIG_MIGHT_HAVE_CACHE_L2X0=y
 CONFIG_MIGRATION=y
 CONFIG_MMC=y
@@ -276,10 +255,7 @@ CONFIG_MMC_BLOCK=y
 CONFIG_MMC_CQHCI=y
 # CONFIG_MMC_MXC is not set
 CONFIG_MMC_SDHCI=y
-CONFIG_MMC_SDHCI_ESDHC_IMX=y
-CONFIG_MMC_SDHCI_IO_ACCESSORS=y
-CONFIG_MMC_SDHCI_OF_ESDHC=y
-# CONFIG_MMC_SDHCI_PCI is not set
+# CONFIG_MMC_SDHCI_ESDHC_IMX is not set
 CONFIG_MMC_SDHCI_PLTFM=y
 CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_MPILIB=y
@@ -300,9 +276,6 @@ CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEON=y
 CONFIG_NET_DEVLINK=y
 CONFIG_NET_DSA=y
-# CONFIG_NET_DSA_MSCC_FELIX is not set
-CONFIG_NET_DSA_MV88E6XXX=y
-CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y
 CONFIG_NET_DSA_TAG_DSA=y
 CONFIG_NET_DSA_TAG_EDSA=y
 CONFIG_NET_FLOW_LIMIT=y
@@ -331,26 +304,11 @@ CONFIG_OUTER_CACHE=y
 CONFIG_OUTER_CACHE_SYNC=y
 CONFIG_PADATA=y
 CONFIG_PAGE_OFFSET=0x80000000
-CONFIG_PCI=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_PERF_USE_VMALLOC=y
 CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 CONFIG_PHYLINK=y
 CONFIG_PINCTRL=y
-CONFIG_PINCTRL_IMX=y
-CONFIG_PINCTRL_IMX6Q=y
-CONFIG_PINCTRL_IMX6SL=y
-CONFIG_PINCTRL_IMX6SX=y
 # CONFIG_PINCTRL_IMX8MM is not set
 # CONFIG_PINCTRL_IMX8MN is not set
 # CONFIG_PINCTRL_IMX8MP is not set
@@ -358,8 +316,6 @@ CONFIG_PINCTRL_IMX6SX=y
 CONFIG_PL310_ERRATA_769419=y
 CONFIG_PM=y
 CONFIG_PM_CLK=y
-CONFIG_PM_GENERIC_DOMAINS=y
-CONFIG_PM_GENERIC_DOMAINS_OF=y
 CONFIG_PM_OPP=y
 CONFIG_PPS=y
 CONFIG_PTP_1588_CLOCK=y
@@ -375,28 +331,20 @@ CONFIG_RD_GZIP=y
 CONFIG_RD_LZO=y
 CONFIG_RD_XZ=y
 CONFIG_REGMAP=y
-CONFIG_REGMAP_I2C=y
 CONFIG_REGMAP_MMIO=y
 CONFIG_REGULATOR=y
-CONFIG_REGULATOR_ANATOP=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
-CONFIG_REGULATOR_LTC3676=y
-CONFIG_REGULATOR_PFUZE100=y
 CONFIG_RESET_CONTROLLER=y
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
 CONFIG_RTC_CLASS=y
 # CONFIG_RTC_DRV_CMOS is not set
-CONFIG_RTC_DRV_DS1307=y
-CONFIG_RTC_DRV_DS1672=y
 # CONFIG_RTC_DRV_IMXDI is not set
 # CONFIG_RTC_DRV_MXC is not set
 # CONFIG_RTC_DRV_MXC_V2 is not set
 CONFIG_RTC_I2C_AND_SPI=y
 CONFIG_RWSEM_SPIN_ON_OWNER=y
-CONFIG_SATA_HOST=y
 CONFIG_SCSI=y
-CONFIG_SENSORS_AD7418=y
 CONFIG_SERIAL_8250_FSL=y
 CONFIG_SERIAL_IMX=y
 CONFIG_SERIAL_IMX_CONSOLE=y
@@ -410,11 +358,10 @@ CONFIG_SOC_BUS=y
 # CONFIG_SOC_IMX50 is not set
 # CONFIG_SOC_IMX51 is not set
 # CONFIG_SOC_IMX53 is not set
-CONFIG_SOC_IMX6=y
-CONFIG_SOC_IMX6Q=y
-CONFIG_SOC_IMX6SL=y
+# CONFIG_SOC_IMX6Q is not set
+# CONFIG_SOC_IMX6SL is not set
 # CONFIG_SOC_IMX6SLL is not set
-CONFIG_SOC_IMX6SX=y
+# CONFIG_SOC_IMX6SX is not set
 # CONFIG_SOC_IMX6UL is not set
 # CONFIG_SOC_IMX7D is not set
 # CONFIG_SOC_IMX7ULP is not set
index 6f5142b01258a8d584a331d349b9865ce3f045a0..3e6cf4746a02c0e52a51cf545d5845bb38d6d45e 100644 (file)
@@ -1,4 +1,3 @@
-CONFIG_AHCI_IMX=y
 CONFIG_ALIGNMENT_TRAP=y
 CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_CLOCKSOURCE_DATA=y
@@ -15,16 +14,13 @@ CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
 CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_ARM=y
-CONFIG_ARM_CPU_SUSPEND=y
 CONFIG_ARM_CRYPTO=y
 CONFIG_ARM_ERRATA_754322=y
 CONFIG_ARM_ERRATA_764369=y
 CONFIG_ARM_ERRATA_775420=y
 CONFIG_ARM_ERRATA_814220=y
-CONFIG_ARM_GIC=y
 CONFIG_ARM_HAS_SG_CHAIN=y
 CONFIG_ARM_HEAVY_MB=y
-CONFIG_ARM_IMX6Q_CPUFREQ=y
 # CONFIG_ARM_IMX_CPUFREQ_DT is not set
 CONFIG_ARM_L1_CACHE_SHIFT=6
 CONFIG_ARM_L1_CACHE_SHIFT_6=y
@@ -37,10 +33,10 @@ CONFIG_ASN1=y
 CONFIG_ASSOCIATIVE_ARRAY=y
 CONFIG_ATA=y
 CONFIG_ATAGS=y
+# CONFIG_ATA_SFF is not set
 CONFIG_AUTO_ZRELADDR=y
 CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
 CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_MQ_PCI=y
 CONFIG_BLK_PM=y
 CONFIG_BLK_SCSI_REQUEST=y
 CONFIG_CACHE_L2X0=y
@@ -49,8 +45,6 @@ CONFIG_CLKSRC_IMX_GPT=y
 CONFIG_CLKSRC_MMIO=y
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_CLZ_TAB=y
-CONFIG_CMDLINE="pci=nomsi"
-CONFIG_CMDLINE_EXTEND=y
 CONFIG_COMMON_CLK=y
 CONFIG_COMPAT_32BIT_TIME=y
 CONFIG_CPUFREQ_DT=y
@@ -160,7 +154,6 @@ CONFIG_DMA_OF=y
 CONFIG_DMA_REMAP=y
 CONFIG_DMA_VIRTUAL_CHANNELS=y
 CONFIG_DTC=y
-CONFIG_E1000E=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
 CONFIG_ENCRYPTED_KEYS=y
@@ -171,10 +164,9 @@ CONFIG_EXTCON=y
 CONFIG_EXTRA_FIRMWARE="imx/sdma/sdma-imx6q.bin"
 CONFIG_EXTRA_FIRMWARE_DIR="firmware"
 CONFIG_F2FS_FS=y
-CONFIG_FEC=y
+# CONFIG_FEC is not set
 CONFIG_FIXED_PHY=y
 CONFIG_FIX_EARLYCON_MEM=y
-CONFIG_FSL_GUTS=y
 CONFIG_FS_ENCRYPTION=y
 CONFIG_FS_IOMAP=y
 CONFIG_FS_MBCACHE=y
@@ -189,12 +181,9 @@ CONFIG_GENERIC_CPU_AUTOPROBE=y
 CONFIG_GENERIC_EARLY_IOREMAP=y
 CONFIG_GENERIC_IDLE_POLL_SETUP=y
 CONFIG_GENERIC_IRQ_CHIP=y
-CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
 CONFIG_GENERIC_IRQ_MULTI_HANDLER=y
 CONFIG_GENERIC_IRQ_SHOW=y
 CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
-CONFIG_GENERIC_MSI_IRQ=y
-CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
 CONFIG_GENERIC_PCI_IOMAP=y
 CONFIG_GENERIC_PINCONF=y
 CONFIG_GENERIC_PINCTRL_GROUPS=y
@@ -207,11 +196,8 @@ CONFIG_GENERIC_TIME_VSYSCALL=y
 # CONFIG_GIANFAR is not set
 CONFIG_GLOB=y
 CONFIG_GPIOLIB=y
-CONFIG_GPIOLIB_IRQCHIP=y
 CONFIG_GPIO_GENERIC=y
 CONFIG_GPIO_MXC=y
-CONFIG_GPIO_PCA953X=y
-CONFIG_GPIO_PCA953X_IRQ=y
 CONFIG_GRO_CELLS=y
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDEN_BRANCH_PREDICTOR=y
@@ -238,12 +224,10 @@ CONFIG_IMX_IRQSTEER=y
 CONFIG_IMX_SDMA=y
 CONFIG_IMX_THERMAL=y
 # CONFIG_IMX_WEIM is not set
-# CONFIG_INITRAMFS_FORCE is not set
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_IO_URING=y
 CONFIG_IRQCHIP=y
 CONFIG_IRQ_DOMAIN=y
-CONFIG_IRQ_DOMAIN_HIERARCHY=y
 CONFIG_IRQ_FORCED_THREADING=y
 CONFIG_IRQ_WORK=y
 CONFIG_JBD2=y
@@ -254,12 +238,10 @@ CONFIG_LOCK_DEBUGGING_SUPPORT=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
 CONFIG_LZO_COMPRESS=y
 CONFIG_LZO_DECOMPRESS=y
-CONFIG_MARVELL_PHY=y
 CONFIG_MDIO_BUS=y
 CONFIG_MDIO_DEVICE=y
 CONFIG_MEMFD_CREATE=y
 CONFIG_MFD_SYSCON=y
-CONFIG_MICREL_PHY=y
 CONFIG_MIGHT_HAVE_CACHE_L2X0=y
 CONFIG_MIGRATION=y
 CONFIG_MMC=y
@@ -267,10 +249,7 @@ CONFIG_MMC_BLOCK=y
 CONFIG_MMC_CQHCI=y
 # CONFIG_MMC_MXC is not set
 CONFIG_MMC_SDHCI=y
-CONFIG_MMC_SDHCI_ESDHC_IMX=y
-CONFIG_MMC_SDHCI_IO_ACCESSORS=y
-CONFIG_MMC_SDHCI_OF_ESDHC=y
-# CONFIG_MMC_SDHCI_PCI is not set
+# CONFIG_MMC_SDHCI_ESDHC_IMX is not set
 CONFIG_MMC_SDHCI_PLTFM=y
 CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_MPILIB=y
@@ -290,8 +269,6 @@ CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEON=y
 CONFIG_NET_DEVLINK=y
 CONFIG_NET_DSA=y
-CONFIG_NET_DSA_MV88E6XXX=y
-CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y
 CONFIG_NET_DSA_TAG_DSA=y
 CONFIG_NET_DSA_TAG_EDSA=y
 CONFIG_NET_FLOW_LIMIT=y
@@ -320,31 +297,14 @@ CONFIG_OUTER_CACHE=y
 CONFIG_OUTER_CACHE_SYNC=y
 CONFIG_PADATA=y
 CONFIG_PAGE_OFFSET=0x80000000
-CONFIG_PCI=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_PERF_USE_VMALLOC=y
 CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 CONFIG_PHYLINK=y
 CONFIG_PINCTRL=y
-CONFIG_PINCTRL_IMX=y
-CONFIG_PINCTRL_IMX6Q=y
-CONFIG_PINCTRL_IMX6SL=y
-CONFIG_PINCTRL_IMX6SX=y
 CONFIG_PL310_ERRATA_769419=y
 CONFIG_PM=y
 CONFIG_PM_CLK=y
-CONFIG_PM_GENERIC_DOMAINS=y
-CONFIG_PM_GENERIC_DOMAINS_OF=y
 CONFIG_PM_OPP=y
 CONFIG_PPS=y
 CONFIG_PTP_1588_CLOCK=y
@@ -361,27 +321,20 @@ CONFIG_RD_LZO=y
 CONFIG_RD_XZ=y
 CONFIG_REFCOUNT_FULL=y
 CONFIG_REGMAP=y
-CONFIG_REGMAP_I2C=y
 CONFIG_REGMAP_MMIO=y
 CONFIG_REGULATOR=y
-CONFIG_REGULATOR_ANATOP=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y
-CONFIG_REGULATOR_LTC3676=y
-CONFIG_REGULATOR_PFUZE100=y
 CONFIG_RESET_CONTROLLER=y
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
 CONFIG_RTC_CLASS=y
 # CONFIG_RTC_DRV_CMOS is not set
-CONFIG_RTC_DRV_DS1307=y
-CONFIG_RTC_DRV_DS1672=y
 # CONFIG_RTC_DRV_IMXDI is not set
 # CONFIG_RTC_DRV_MXC is not set
 # CONFIG_RTC_DRV_MXC_V2 is not set
 CONFIG_RTC_I2C_AND_SPI=y
 CONFIG_RWSEM_SPIN_ON_OWNER=y
 CONFIG_SCSI=y
-CONFIG_SENSORS_AD7418=y
 # CONFIG_SENSORS_DRIVETEMP is not set
 CONFIG_SERIAL_8250_FSL=y
 CONFIG_SERIAL_IMX=y
@@ -395,11 +348,10 @@ CONFIG_SOC_BUS=y
 # CONFIG_SOC_IMX50 is not set
 # CONFIG_SOC_IMX51 is not set
 # CONFIG_SOC_IMX53 is not set
-CONFIG_SOC_IMX6=y
-CONFIG_SOC_IMX6Q=y
-CONFIG_SOC_IMX6SL=y
+# CONFIG_SOC_IMX6Q is not set
+# CONFIG_SOC_IMX6SL is not set
 # CONFIG_SOC_IMX6SLL is not set
-CONFIG_SOC_IMX6SX=y
+# CONFIG_SOC_IMX6SX is not set
 # CONFIG_SOC_IMX6UL is not set
 # CONFIG_SOC_IMX7D is not set
 # CONFIG_SOC_IMX7ULP is not set
diff --git a/target/linux/imx/cortexa9/base-files/etc/board.d/02_network b/target/linux/imx/cortexa9/base-files/etc/board.d/02_network
new file mode 100644 (file)
index 0000000..1668b86
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2013-2015 OpenWrt.org
+#
+
+. /lib/functions/uci-defaults.sh
+
+board=$(board_name)
+
+board_config_update
+
+case "$board" in
+gw,imx6dl-gw51xx |\
+gw,imx6dl-gw52xx |\
+gw,imx6dl-gw5904 |\
+gw,imx6dl-gw5907 |\
+gw,imx6dl-gw5910 |\
+gw,imx6dl-gw5912 |\
+gw,imx6dl-gw5913 |\
+gw,imx6q-gw51xx |\
+gw,imx6q-gw52xx |\
+gw,imx6q-gw5904 |\
+gw,imx6q-gw5907 |\
+gw,imx6q-gw5910 |\
+gw,imx6q-gw5912 |\
+gw,imx6q-gw5913 |\
+solidrun,cubox-i/dl |\
+solidrun,cubox-i/q )
+       ucidef_set_interface_lan 'eth0'
+       ;;
+gw,imx6dl-gw53xx |\
+gw,imx6dl-gw54xx |\
+gw,imx6dl-gw552x |\
+gw,imx6q-gw53xx |\
+gw,imx6q-gw5400-a |\
+gw,imx6q-gw54xx |\
+gw,imx6q-gw552x )
+       ucidef_set_interfaces_lan_wan 'eth0' 'eth1'
+       ;;
+wand,imx6dl-wandboard )
+       ucidef_set_interface_wan 'eth0'
+       ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/imx/cortexa9/base-files/lib/imx.sh b/target/linux/imx/cortexa9/base-files/lib/imx.sh
new file mode 100644 (file)
index 0000000..46d2eeb
--- /dev/null
@@ -0,0 +1,30 @@
+#
+# Copyright (C) 2010-2013 OpenWrt.org
+#
+
+rootpartuuid() {
+       local cmdline=$(cat /proc/cmdline)
+       local bootpart=${cmdline##*root=}
+       bootpart=${bootpart%% *}
+       local uuid=${bootpart#PARTUUID=}
+       echo ${uuid%-02}
+}
+
+bootdev_from_uuid() {
+       blkid | grep "PTUUID=\"$(rootpartuuid)\"" | cut -d : -f1
+}
+
+bootpart_from_uuid() {
+       blkid | grep $(rootpartuuid)-01 | cut -d : -f1
+}
+
+rootpart_from_uuid() {
+       blkid | grep $(rootpartuuid)-02 | cut -d : -f1
+}
+
+apalis_mount_boot() {
+       mkdir -p /boot
+       [ -f /boot/uImage ] || {
+               mount -o rw,noatime $(bootpart_from_uuid) /boot > /dev/null
+       }
+}
diff --git a/target/linux/imx/cortexa9/base-files/lib/preinit/79_move_config b/target/linux/imx/cortexa9/base-files/lib/preinit/79_move_config
new file mode 100644 (file)
index 0000000..6ed5932
--- /dev/null
@@ -0,0 +1,21 @@
+. /lib/imx.sh
+. /lib/functions.sh
+. /lib/upgrade/common.sh
+
+move_config() {
+       local board=$(board_name)
+
+       case "$board" in
+       toradex,apalis_imx6q-eval |\
+       toradex,apalis_imx6q-ixora |\
+       toradex,apalis_imx6q-ixora-v1.1 )
+               if [ -b $(bootpart_from_uuid) ]; then
+                       apalis_mount_boot
+                       [ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /
+                       umount /boot
+               fi
+               ;;
+       esac
+}
+
+boot_hook_add preinit_mount_root move_config
diff --git a/target/linux/imx/cortexa9/base-files/lib/upgrade/platform.sh b/target/linux/imx/cortexa9/base-files/lib/upgrade/platform.sh
new file mode 100755 (executable)
index 0000000..e18d59c
--- /dev/null
@@ -0,0 +1,142 @@
+#
+# Copyright (C) 2010-2015 OpenWrt.org
+#
+
+. /lib/imx.sh
+
+RAMFS_COPY_BIN='blkid jffs2reset'
+
+enable_image_metadata_check() {
+       case "$(board_name)" in
+               toradex,apalis_imx6q-eval |\
+               toradex,apalis_imx6q-ixora |\
+               toradex,apalis_imx6q-ixora-v1.1 )
+                       REQUIRE_IMAGE_METADATA=1
+                       ;;
+       esac
+}
+enable_image_metadata_check
+
+apalis_copy_config() {
+       apalis_mount_boot
+       cp -af "$UPGRADE_BACKUP" "/boot/$BACKUP_FILE"
+       sync
+       umount /boot
+}
+
+apalis_do_upgrade() {
+       apalis_mount_boot
+       get_image "$1" | tar Oxf - sysupgrade-apalis/kernel > /boot/uImage
+       get_image "$1" | tar Oxf - sysupgrade-apalis/root > $(rootpart_from_uuid)
+       sync
+       umount /boot
+}
+
+platform_check_image() {
+       local board=$(board_name)
+
+       case "$board" in
+       gw,imx6dl-gw51xx |\
+       gw,imx6dl-gw52xx |\
+       gw,imx6dl-gw53xx |\
+       gw,imx6dl-gw54xx |\
+       gw,imx6dl-gw551x |\
+       gw,imx6dl-gw552x |\
+       gw,imx6dl-gw553x |\
+       gw,imx6dl-gw5904 |\
+       gw,imx6dl-gw5907 |\
+       gw,imx6dl-gw5910 |\
+       gw,imx6dl-gw5912 |\
+       gw,imx6dl-gw5913 |\
+       gw,imx6q-gw51xx |\
+       gw,imx6q-gw52xx |\
+       gw,imx6q-gw53xx |\
+       gw,imx6q-gw5400-a |\
+       gw,imx6q-gw54xx |\
+       gw,imx6q-gw551x |\
+       gw,imx6q-gw552x |\
+       gw,imx6q-gw553x |\
+       gw,imx6q-gw5904 |\
+       gw,imx6q-gw5907 |\
+       gw,imx6q-gw5910 |\
+       gw,imx6q-gw5912 |\
+       gw,imx6q-gw5913 )
+               nand_do_platform_check $board $1
+               return $?;
+               ;;
+       toradex,apalis_imx6q-eval |\
+       toradex,apalis_imx6q-ixora |\
+       toradex,apalis_imx6q-ixora-v1.1 )
+               return 0
+               ;;
+       esac
+
+       echo "Sysupgrade is not yet supported on $board."
+       return 1
+}
+
+platform_do_upgrade() {
+       local board=$(board_name)
+
+       case "$board" in
+       gw,imx6dl-gw51xx |\
+       gw,imx6dl-gw52xx |\
+       gw,imx6dl-gw53xx |\
+       gw,imx6dl-gw54xx |\
+       gw,imx6dl-gw551x |\
+       gw,imx6dl-gw552x |\
+       gw,imx6dl-gw553x |\
+       gw,imx6dl-gw5904 |\
+       gw,imx6dl-gw5907 |\
+       gw,imx6dl-gw5910 |\
+       gw,imx6dl-gw5912 |\
+       gw,imx6dl-gw5913 |\
+       gw,imx6q-gw51xx |\
+       gw,imx6q-gw52xx |\
+       gw,imx6q-gw53xx |\
+       gw,imx6q-gw5400-a |\
+       gw,imx6q-gw54xx |\
+       gw,imx6q-gw551x |\
+       gw,imx6q-gw552x |\
+       gw,imx6q-gw553x |\
+       gw,imx6q-gw5904 |\
+       gw,imx6q-gw5907 |\
+       gw,imx6q-gw5910 |\
+       gw,imx6q-gw5912 |\
+       gw,imx6q-gw5913 )
+               nand_do_upgrade "$1"
+               ;;
+       toradex,apalis_imx6q-eval |\
+       toradex,apalis_imx6q-ixora |\
+       toradex,apalis_imx6q-ixora-v1.1 )
+               apalis_do_upgrade "$1"
+               ;;
+       esac
+}
+
+platform_copy_config() {
+       local board=$(board_name)
+
+       case "$board" in
+       toradex,apalis_imx6q-eval |\
+       toradex,apalis_imx6q-ixora |\
+       toradex,apalis_imx6q-ixora-v1.1 )
+               apalis_copy_config
+               ;;
+       esac
+}
+
+platform_pre_upgrade() {
+       local board=$(board_name)
+
+       case "$board" in
+       toradex,apalis_imx6q-eval |\
+       toradex,apalis_imx6q-ixora |\
+       toradex,apalis_imx6q-ixora-v1.1 )
+               [ -z "$UPGRADE_BACKUP" ] && {
+                       jffs2reset -y
+                       umount /overlay
+               }
+               ;;
+       esac
+}
diff --git a/target/linux/imx/cortexa9/config-default b/target/linux/imx/cortexa9/config-default
new file mode 100644 (file)
index 0000000..5210dc0
--- /dev/null
@@ -0,0 +1,55 @@
+CONFIG_AHCI_IMX=y
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_IMX6Q_CPUFREQ=y
+CONFIG_ATA_SFF=y
+CONFIG_BLK_MQ_PCI=y
+CONFIG_CMDLINE="pci=nomsi"
+CONFIG_CMDLINE_EXTEND=y
+CONFIG_E1000E=y
+CONFIG_FEC=y
+CONFIG_FSL_GUTS=y
+CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
+CONFIG_GENERIC_MSI_IRQ=y
+CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
+CONFIG_GPIOLIB_IRQCHIP=y
+CONFIG_GPIO_PCA953X=y
+CONFIG_GPIO_PCA953X_IRQ=y
+# CONFIG_INITRAMFS_FORCE is not set
+CONFIG_IRQ_DOMAIN_HIERARCHY=y
+CONFIG_MARVELL_PHY=y
+CONFIG_MICREL_PHY=y
+CONFIG_MMC_SDHCI_ESDHC_IMX=y
+CONFIG_MMC_SDHCI_IO_ACCESSORS=y
+CONFIG_MMC_SDHCI_OF_ESDHC=y
+# CONFIG_MMC_SDHCI_PCI is not set
+CONFIG_NET_DSA_MV88E6XXX=y
+CONFIG_NET_DSA_MV88E6XXX_GLOBAL2=y
+CONFIG_PCI=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_PINCTRL_IMX6Q=y
+CONFIG_PINCTRL_IMX6SL=y
+CONFIG_PINCTRL_IMX6SX=y
+CONFIG_PM_GENERIC_DOMAINS=y
+CONFIG_PM_GENERIC_DOMAINS_OF=y
+CONFIG_REGMAP_I2C=y
+CONFIG_REGULATOR_ANATOP=y
+CONFIG_REGULATOR_LTC3676=y
+CONFIG_REGULATOR_PFUZE100=y
+CONFIG_RTC_DRV_DS1307=y
+CONFIG_RTC_DRV_DS1672=y
+CONFIG_SENSORS_AD7418=y
+CONFIG_SOC_IMX6=y
+CONFIG_SOC_IMX6Q=y
+CONFIG_SOC_IMX6SL=y
+CONFIG_SOC_IMX6SX=y
diff --git a/target/linux/imx/cortexa9/target.mk b/target/linux/imx/cortexa9/target.mk
new file mode 100644 (file)
index 0000000..9bd63c7
--- /dev/null
@@ -0,0 +1,7 @@
+BOARDNAME:=NXP i.MX with Cortex-A9
+CPU_TYPE:=cortex-a9
+CPU_SUBTYPE:=neon
+
+define Target/Description
+       Build firmware images for NXP i.MX (Cortex-A9) based boards.
+endef
index 5f8e5f1c04f35772eba782a0d8d1ce1f08969961..895fb7a6b76bdcff315b1464f8d4e986585402a0 100644 (file)
@@ -5,223 +5,6 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
-#################################################
-# Images
-#################################################
-
-DEVICE_VARS += MKUBIFS_OPTS UBOOT
-
-define Build/boot-overlay
-       rm -rf $@.boot
-       mkdir -p $@.boot
-
-       $(CP) $@ $@.boot/$(IMG_PREFIX)-uImage
-       ln -sf $(IMG_PREFIX)-uImage $@.boot/uImage
-
-       $(foreach dts,$(DEVICE_DTS), \
-               $(CP) \
-                       $(DTS_DIR)/$(dts).dtb \
-                       $@.boot/$(IMG_PREFIX)-$(dts).dtb; \
-               ln -sf \
-                       $(IMG_PREFIX)-$(dts).dtb \
-                       $@.boot/$(dts).dtb; \
-       )
-       mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
-               -n '$(DEVICE_ID) OpenWrt bootscript' \
-               -d ./bootscript-$(DEVICE_NAME) \
-               $@.boot/6x_bootscript-$(DEVICE_NAME)
-
-       $(STAGING_DIR_HOST)/bin/mkfs.ubifs \
-               --space-fixup --compr=zlib --squash-uids \
-               $(MKUBIFS_OPTS) -c 16248 \
-               -o $@.boot.ubifs -d $@.boot
-
-       $(TAR) -C $@.boot -cf $@.boot.tar .
-endef
-
-define Build/bootfs.tar.gz
-       rm -rf $@.boot
-       mkdir -p $@.boot
-
-       $(TAR) -C $@.boot -xf $(IMAGE_KERNEL).boot.tar
-       $(TAR) -C $@.boot \
-               --numeric-owner --owner=0 --group=0 --transform "s,./,./boot/," \
-               -czvf $@ .
-endef
-
-define Build/recovery-scr
-       mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
-       -n '$(DEVICE_ID) OpenWrt recovery bootscript' \
-       -d ./recovery-$(DEVICE_NAME) $@
-endef
-
-define Build/imx6-combined-image-prepare
-       rm -rf $@.boot
-       mkdir -p $@.boot
-endef
-
-define Build/imx6-combined-image-clean
-       rm -rf $@.boot $@.fs
-endef
-
-define Build/imx6-combined-image
-       $(CP) $(IMAGE_KERNEL) $@.boot/uImage
-
-       $(foreach dts,$(DEVICE_DTS), \
-               $(CP) \
-                       $(DTS_DIR)/$(dts).dtb \
-                       $@.boot/;
-       )
-
-       mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
-               -n '$(DEVICE_ID) OpenWrt bootscript' \
-               -d bootscript-$(DEVICE_NAME) \
-               $@.boot/boot.scr
-
-       cp $@ $@.fs
-
-       $(SCRIPT_DIR)/gen_image_generic.sh $@ \
-               $(CONFIG_TARGET_KERNEL_PARTSIZE) \
-               $@.boot \
-               $(CONFIG_TARGET_ROOTFS_PARTSIZE) \
-               $@.fs \
-               1024
-endef
-
-define Build/imx6-sdcard
-       $(Build/imx6-combined-image-prepare)
-
-       $(CP) $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.img $@.boot/u-boot.img
-       $(Build/imx6-combined-image)
-       dd if=$(STAGING_DIR_IMAGE)/$(UBOOT)-SPL of=$@ bs=1024 seek=1 conv=notrunc
-
-       $(Build/imx6-combined-image-clean)
-endef
-
-define Build/apalis-emmc
-       $(Build/imx6-combined-image-prepare)
-       $(Build/imx6-combined-image)
-       $(Build/imx6-combined-image-clean)
-endef
-
-#################################################
-# Devices
-#################################################
-
-KERNEL_LOADADDR=0x10008000
-
-define Device/Default
-  PROFILES := Generic
-  FILESYSTEMS := squashfs ext4
-  KERNEL_INSTALL := 1
-  KERNEL_SUFFIX := -uImage
-  KERNEL_NAME := zImage
-  KERNEL := kernel-bin | uImage none
-  IMAGES :=
-endef
-
-define Device/gateworks_ventana
-  DEVICE_VENDOR := Gateworks
-  DEVICE_MODEL := Ventana family
-  DEVICE_VARIANT := normal NAND flash
-  DEVICE_NAME := ventana
-  DEVICE_DTS:= \
-       imx6dl-gw51xx \
-       imx6dl-gw52xx \
-       imx6dl-gw53xx \
-       imx6dl-gw54xx \
-       imx6dl-gw551x \
-       imx6dl-gw552x \
-       imx6dl-gw553x \
-       imx6dl-gw5904 \
-       imx6dl-gw5907 \
-       imx6dl-gw5910 \
-       imx6dl-gw5912 \
-       imx6dl-gw5913 \
-       imx6q-gw51xx \
-       imx6q-gw52xx \
-       imx6q-gw53xx \
-       imx6q-gw54xx \
-       imx6q-gw5400-a \
-       imx6q-gw551x \
-       imx6q-gw552x \
-       imx6q-gw553x \
-       imx6q-gw5904 \
-       imx6q-gw5907 \
-       imx6q-gw5910 \
-       imx6q-gw5912 \
-       imx6q-gw5913
-  DEVICE_PACKAGES := kmod-sky2 kmod-sound-core kmod-sound-soc-imx \
-       kmod-sound-soc-imx-sgtl5000 kmod-can kmod-can-flexcan kmod-can-raw \
-       kmod-hwmon-gsc kmod-leds-gpio kmod-pps-gpio kobs-ng
-  KERNEL += | boot-overlay
-  IMAGES := nand.ubi bootfs.tar.gz dtb
-  IMAGE/nand.ubi := append-ubi
-  IMAGE/bootfs.tar.gz := bootfs.tar.gz
-  IMAGE/dtb := install-dtb
-  UBINIZE_PARTS = boot=$$(KDIR_KERNEL_IMAGE).boot.ubifs=15
-  PAGESIZE := 2048
-  BLOCKSIZE := 128k
-  MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB
-endef
-TARGET_DEVICES += gateworks_ventana
-
-define Device/gateworks_ventana-large
-  $(Device/gateworks_ventana)
-  DEVICE_VARIANT := large NAND flash
-  IMAGES := nand.ubi
-  PAGESIZE := 4096
-  BLOCKSIZE := 256k
-  MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB
-endef
-TARGET_DEVICES += gateworks_ventana-large
-
-define Device/solidrun_cubox-i
-  DEVICE_VENDOR := SolidRun
-  DEVICE_MODEL := CuBox-i
-  DEVICE_DTS := \
-       imx6q-cubox-i \
-       imx6dl-cubox-i \
-       imx6q-hummingboard \
-       imx6dl-hummingboard
-  DEVICE_PACKAGES := kmod-drm-imx kmod-drm-imx-hdmi kmod-usb-hid
-  UBOOT := mx6cuboxi
-  KERNEL := kernel-bin
-  KERNEL_SUFFIX := -zImage
-  FILESYSTEMS := squashfs
-  IMAGES := combined.bin dtb
-  IMAGE/combined.bin := append-rootfs | pad-extra 128k | imx6-sdcard
-  IMAGE/dtb := install-dtb
-endef
-TARGET_DEVICES += solidrun_cubox-i
-
-define Device/toradex_apalis
-  DEVICE_VENDOR := Toradex
-  DEVICE_MODEL := Apalis family
-  SUPPORTED_DEVICES := apalis,ixora apalis,eval
-  DEVICE_DTS := \
-       imx6q-apalis-eval \
-       imx6q-apalis-ixora \
-       imx6q-apalis-ixora-v1.1
-  DEVICE_PACKAGES := \
-       kmod-can kmod-can-flexcan kmod-can-raw \
-       kmod-leds-gpio kmod-gpio-button-hotplug \
-       kmod-pps-gpio kmod-rtc-ds1307
-  FILESYSTEMS := squashfs
-  IMAGES := combined.bin sysupgrade.bin
-  DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2)
-  IMAGE/combined.bin := append-rootfs | pad-extra 128k | apalis-emmc
-  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
-  ARTIFACTS := recovery.scr
-  ARTIFACT/recovery.scr := recovery-scr
-endef
-TARGET_DEVICES += toradex_apalis
-
-define Device/wandboard_dual
-  DEVICE_VENDOR := Wandboard
-  DEVICE_MODEL := Dual
-  DEVICE_DTS := imx6dl-wandboard
-endef
-TARGET_DEVICES += wandboard_dual
+include $(SUBTARGET).mk
 
 $(eval $(call BuildImage))
diff --git a/target/linux/imx/image/cortexa9.mk b/target/linux/imx/image/cortexa9.mk
new file mode 100644 (file)
index 0000000..75e19dc
--- /dev/null
@@ -0,0 +1,210 @@
+DEVICE_VARS += MKUBIFS_OPTS UBOOT
+
+define Build/boot-overlay
+       rm -rf $@.boot
+       mkdir -p $@.boot
+
+       $(CP) $@ $@.boot/$(IMG_PREFIX)-uImage
+       ln -sf $(IMG_PREFIX)-uImage $@.boot/uImage
+
+       $(foreach dts,$(DEVICE_DTS), \
+               $(CP) \
+                       $(DTS_DIR)/$(dts).dtb \
+                       $@.boot/$(IMG_PREFIX)-$(dts).dtb; \
+               ln -sf \
+                       $(IMG_PREFIX)-$(dts).dtb \
+                       $@.boot/$(dts).dtb; \
+       )
+       mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
+               -n '$(DEVICE_ID) OpenWrt bootscript' \
+               -d ./bootscript-$(DEVICE_NAME) \
+               $@.boot/6x_bootscript-$(DEVICE_NAME)
+
+       $(STAGING_DIR_HOST)/bin/mkfs.ubifs \
+               --space-fixup --compr=zlib --squash-uids \
+               $(MKUBIFS_OPTS) -c 16248 \
+               -o $@.boot.ubifs -d $@.boot
+
+       $(TAR) -C $@.boot -cf $@.boot.tar .
+endef
+
+define Build/bootfs.tar.gz
+       rm -rf $@.boot
+       mkdir -p $@.boot
+
+       $(TAR) -C $@.boot -xf $(IMAGE_KERNEL).boot.tar
+       $(TAR) -C $@.boot \
+               --numeric-owner --owner=0 --group=0 --transform "s,./,./boot/," \
+               -czvf $@ .
+endef
+
+define Build/recovery-scr
+       mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
+       -n '$(DEVICE_ID) OpenWrt recovery bootscript' \
+       -d ./recovery-$(DEVICE_NAME) $@
+endef
+
+define Build/imx6-combined-image-prepare
+       rm -rf $@.boot
+       mkdir -p $@.boot
+endef
+
+define Build/imx6-combined-image-clean
+       rm -rf $@.boot $@.fs
+endef
+
+define Build/imx6-combined-image
+       $(CP) $(IMAGE_KERNEL) $@.boot/uImage
+
+       $(foreach dts,$(DEVICE_DTS), \
+               $(CP) \
+                       $(DTS_DIR)/$(dts).dtb \
+                       $@.boot/;
+       )
+
+       mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
+               -n '$(DEVICE_ID) OpenWrt bootscript' \
+               -d bootscript-$(DEVICE_NAME) \
+               $@.boot/boot.scr
+
+       cp $@ $@.fs
+
+       $(SCRIPT_DIR)/gen_image_generic.sh $@ \
+               $(CONFIG_TARGET_KERNEL_PARTSIZE) \
+               $@.boot \
+               $(CONFIG_TARGET_ROOTFS_PARTSIZE) \
+               $@.fs \
+               1024
+endef
+
+define Build/imx6-sdcard
+       $(Build/imx6-combined-image-prepare)
+
+       $(CP) $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.img $@.boot/u-boot.img
+       $(Build/imx6-combined-image)
+       dd if=$(STAGING_DIR_IMAGE)/$(UBOOT)-SPL of=$@ bs=1024 seek=1 conv=notrunc
+
+       $(Build/imx6-combined-image-clean)
+endef
+
+define Build/apalis-emmc
+       $(Build/imx6-combined-image-prepare)
+       $(Build/imx6-combined-image)
+       $(Build/imx6-combined-image-clean)
+endef
+
+
+define Device/Default
+  PROFILES := Default
+  FILESYSTEMS := squashfs ext4
+  KERNEL_INSTALL := 1
+  KERNEL_SUFFIX := -uImage
+  KERNEL_NAME := zImage
+  KERNEL := kernel-bin | uImage none
+  KERNEL_LOADADDR := 0x10008000
+  IMAGES :=
+endef
+
+define Device/gateworks_ventana
+  DEVICE_VENDOR := Gateworks
+  DEVICE_MODEL := Ventana family
+  DEVICE_VARIANT := normal NAND flash
+  DEVICE_NAME := ventana
+  DEVICE_DTS:= \
+       imx6dl-gw51xx \
+       imx6dl-gw52xx \
+       imx6dl-gw53xx \
+       imx6dl-gw54xx \
+       imx6dl-gw551x \
+       imx6dl-gw552x \
+       imx6dl-gw553x \
+       imx6dl-gw5904 \
+       imx6dl-gw5907 \
+       imx6dl-gw5910 \
+       imx6dl-gw5912 \
+       imx6dl-gw5913 \
+       imx6q-gw51xx \
+       imx6q-gw52xx \
+       imx6q-gw53xx \
+       imx6q-gw54xx \
+       imx6q-gw5400-a \
+       imx6q-gw551x \
+       imx6q-gw552x \
+       imx6q-gw553x \
+       imx6q-gw5904 \
+       imx6q-gw5907 \
+       imx6q-gw5910 \
+       imx6q-gw5912 \
+       imx6q-gw5913
+  DEVICE_PACKAGES := kmod-sky2 kmod-sound-core kmod-sound-soc-imx \
+       kmod-sound-soc-imx-sgtl5000 kmod-can kmod-can-flexcan kmod-can-raw \
+       kmod-hwmon-gsc kmod-leds-gpio kmod-pps-gpio kobs-ng
+  KERNEL += | boot-overlay
+  IMAGES := nand.ubi bootfs.tar.gz dtb
+  IMAGE/nand.ubi := append-ubi
+  IMAGE/bootfs.tar.gz := bootfs.tar.gz
+  IMAGE/dtb := install-dtb
+  UBINIZE_PARTS = boot=$$(KDIR_KERNEL_IMAGE).boot.ubifs=15
+  PAGESIZE := 2048
+  BLOCKSIZE := 128k
+  MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB
+endef
+TARGET_DEVICES += gateworks_ventana
+
+define Device/gateworks_ventana-large
+  $(Device/gateworks_ventana)
+  DEVICE_VARIANT := large NAND flash
+  IMAGES := nand.ubi
+  PAGESIZE := 4096
+  BLOCKSIZE := 256k
+  MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB
+endef
+TARGET_DEVICES += gateworks_ventana-large
+
+define Device/solidrun_cubox-i
+  DEVICE_VENDOR := SolidRun
+  DEVICE_MODEL := CuBox-i
+  DEVICE_DTS := \
+       imx6q-cubox-i \
+       imx6dl-cubox-i \
+       imx6q-hummingboard \
+       imx6dl-hummingboard
+  DEVICE_PACKAGES := kmod-drm-imx kmod-drm-imx-hdmi kmod-usb-hid
+  UBOOT := mx6cuboxi
+  KERNEL := kernel-bin
+  KERNEL_SUFFIX := -zImage
+  FILESYSTEMS := squashfs
+  IMAGES := combined.bin dtb
+  IMAGE/combined.bin := append-rootfs | pad-extra 128k | imx6-sdcard
+  IMAGE/dtb := install-dtb
+endef
+TARGET_DEVICES += solidrun_cubox-i
+
+define Device/toradex_apalis
+  DEVICE_VENDOR := Toradex
+  DEVICE_MODEL := Apalis family
+  SUPPORTED_DEVICES := apalis,ixora apalis,eval
+  DEVICE_DTS := \
+       imx6q-apalis-eval \
+       imx6q-apalis-ixora \
+       imx6q-apalis-ixora-v1.1
+  DEVICE_PACKAGES := \
+       kmod-can kmod-can-flexcan kmod-can-raw \
+       kmod-leds-gpio kmod-gpio-button-hotplug \
+       kmod-pps-gpio kmod-rtc-ds1307
+  FILESYSTEMS := squashfs
+  IMAGES := combined.bin sysupgrade.bin
+  DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2)
+  IMAGE/combined.bin := append-rootfs | pad-extra 128k | apalis-emmc
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  ARTIFACTS := recovery.scr
+  ARTIFACT/recovery.scr := recovery-scr
+endef
+TARGET_DEVICES += toradex_apalis
+
+define Device/wandboard_dual
+  DEVICE_VENDOR := Wandboard
+  DEVICE_MODEL := Dual
+  DEVICE_DTS := imx6dl-wandboard
+endef
+TARGET_DEVICES += wandboard_dual