imx: split into arch-specific subtargets
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>
This commit is contained in:
46
target/linux/imx/cortexa9/base-files/etc/board.d/02_network
Normal file
46
target/linux/imx/cortexa9/base-files/etc/board.d/02_network
Normal file
@@ -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
|
||||
30
target/linux/imx/cortexa9/base-files/lib/imx.sh
Normal file
30
target/linux/imx/cortexa9/base-files/lib/imx.sh
Normal file
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
142
target/linux/imx/cortexa9/base-files/lib/upgrade/platform.sh
Executable file
142
target/linux/imx/cortexa9/base-files/lib/upgrade/platform.sh
Executable file
@@ -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
|
||||
}
|
||||
55
target/linux/imx/cortexa9/config-default
Normal file
55
target/linux/imx/cortexa9/config-default
Normal file
@@ -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
|
||||
7
target/linux/imx/cortexa9/target.mk
Normal file
7
target/linux/imx/cortexa9/target.mk
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user