Added initial support of MCIMX7SABRE board (#1542)
* Added initial support of MCIMX7SABRE board MCIMX7SABRE is NXP iMX7d-based board with 1Gb RAM 2xGBE, 1xmPCIe Change-Id: I62685a55de54fa6109bef2a8e2ee760d831ffa0e * Added initial support of MCIMX7SABRE board MCIMX7SABRE is NXP iMX7d-based board with 1Gb RAM 2xGBE, 1xmPCIe Change-Id: I62685a55de54fa6109bef2a8e2ee760d831ffa0e * Changed BOARDFAMILY from mx7dsabre to imx7d Change-Id: Id351c9f6a8c907b415b804bfe11b86027278ed86 * Disabled MD driver for imx7d Kernel MD driver does not work correctly on NXP-modified kernel Change-Id: I58e8de6ee0b99282c452f594e22f6f7e1ff59ae0
This commit is contained in:
parent
76cafa6915
commit
0797faab9f
9
config/boards/imx7sabre.csc
Normal file
9
config/boards/imx7sabre.csc
Normal file
@ -0,0 +1,9 @@
|
||||
# iMX7d dual core + M4 1Gb RAM SoC 1xmPCIe 2xGBE
|
||||
BOARD_NAME="MCIMX7SABRE"
|
||||
BOARDFAMILY="imx7d"
|
||||
BOOTCONFIG="imx_v7_defconfig"
|
||||
MODULES=""
|
||||
MODULES_NEXT=""
|
||||
#
|
||||
KERNEL_TARGET="default"
|
||||
DESKTOP_TARGET=""
|
||||
3
config/bootenv/imx7d-default.txt
Normal file
3
config/bootenv/imx7d-default.txt
Normal file
@ -0,0 +1,3 @@
|
||||
verbosity=1
|
||||
|
||||
|
||||
5443
config/kernel/linux-imx7d-default.config
Normal file
5443
config/kernel/linux-imx7d-default.config
Normal file
File diff suppressed because it is too large
Load Diff
44
config/sources/imx7d.conf
Normal file
44
config/sources/imx7d.conf
Normal file
@ -0,0 +1,44 @@
|
||||
BOOTSOURCE='https://source.codeaurora.org/external/imx/uboot-imx'
|
||||
BOOTDIR='u-boot-sabre'
|
||||
BOOTBRANCH='branch:imx_v2018.03_4.14.98_2.0.0_ga'
|
||||
BOOTCONFIG="mx7dsabresd_defconfig"
|
||||
#BOOTSCRIPT='boot-imx7d.cmd:boot.cmd'
|
||||
BOOTENV_FILE='imx7d-default.txt'
|
||||
|
||||
UBOOT_TARGET_MAP=";;u-boot-dtb.imx"
|
||||
|
||||
UBOOT_USE_GCC='> 7.0'
|
||||
KERNEL_USE_GCC='> 7.0'
|
||||
|
||||
case $BRANCH in
|
||||
|
||||
default)
|
||||
|
||||
KERNELSOURCE='https://source.codeaurora.org/external/imx/linux-imx'
|
||||
KERNELBRANCH='branch:imx_4.14.98_2.0.0_ga'
|
||||
KERNELDIR='linux-imx7'
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
CPUMIN=396000
|
||||
CPUMAX=996000
|
||||
GOVERNOR=interactive
|
||||
|
||||
SERIALCON=ttymxc0
|
||||
|
||||
|
||||
write_uboot_platform()
|
||||
{
|
||||
dd if=$1/u-boot-dtb.imx of=$2 bs=1K seek=1 status=noxfer conv=fsync > /dev/null 2>&1
|
||||
}
|
||||
|
||||
family_tweaks()
|
||||
{
|
||||
echo;
|
||||
}
|
||||
|
||||
family_tweaks_bsp()
|
||||
{
|
||||
echo
|
||||
}
|
||||
@ -0,0 +1,174 @@
|
||||
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
|
||||
index e15159d..33790aa 100755
|
||||
--- a/scripts/package/builddeb
|
||||
+++ b/scripts/package/builddeb
|
||||
@@ -29,6 +29,31 @@ create_package() {
|
||||
# in case we are in a restrictive umask environment like 0077
|
||||
chmod -R a+rX "$pdir"
|
||||
|
||||
+
|
||||
+ # Create preinstall and post install script to remove dtb
|
||||
+ if [[ "$1" == *dtb* ]]; then
|
||||
+ echo "if [ -d /boot/dtb-$version ]; then mv /boot/dtb-$version /boot/dtb-$version.old; fi" >> $pdir/DEBIAN/preinst
|
||||
+ echo "if [ -d /boot/dtb.old ]; then rm -rf /boot/dtb.old; fi" >> $pdir/DEBIAN/preinst
|
||||
+ echo "if [ -d /dtb ]; then mv /dtb /dtb.old; fi" >> $pdir/DEBIAN/preinst
|
||||
+ echo "if [ -d /boot/dtb ]; then mv /boot/dtb /boot/dtb.old; fi" >> $pdir/DEBIAN/preinst
|
||||
+ echo "exit 0" >> $pdir/DEBIAN/preinst
|
||||
+ chmod 775 $pdir/DEBIAN/preinst
|
||||
+ #
|
||||
+ echo "if [ -d /boot/dtb-$version.old ]; then rm -rf /boot/dtb-$version.old; fi" >> $pdir/DEBIAN/postinst
|
||||
+ echo "ln -sf dtb-$version /boot/dtb > /dev/null 2>&1 || mv /boot/dtb-$version /boot/dtb" >> $pdir/DEBIAN/postinst
|
||||
+ echo "exit 0" >> $pdir/DEBIAN/postinst
|
||||
+ chmod 775 $pdir/DEBIAN/postinst
|
||||
+ fi
|
||||
+
|
||||
+ # Create postinstall script for headers
|
||||
+ if [[ "$1" == *headers* ]]; then
|
||||
+ echo "cd /usr/src/linux-headers-$version; echo \"Compiling headers - please wait ...\"; make -s scripts >/dev/null 2>&1" >> $pdir/DEBIAN/postinst
|
||||
+ echo "exit 0" >> $pdir/DEBIAN/postinst
|
||||
+ chmod 775 $pdir/DEBIAN/postinst
|
||||
+ fi
|
||||
+
|
||||
+
|
||||
+
|
||||
# Create the package
|
||||
dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch}" -p$pname -P"$pdir"
|
||||
dpkg --build "$pdir" ..
|
||||
@@ -94,9 +119,11 @@ sourcename=$KDEB_SOURCENAME
|
||||
tmpdir="$objtree/debian/tmp"
|
||||
kernel_headers_dir="$objtree/debian/hdrtmp"
|
||||
libc_headers_dir="$objtree/debian/headertmp"
|
||||
+dtb_dir="$objtree/debian/dtbtmp"
|
||||
dbg_dir="$objtree/debian/dbgtmp"
|
||||
-packagename=linux-image-$version
|
||||
-kernel_headers_packagename=linux-headers-$version
|
||||
+packagename=linux-image"$LOCALVERSION"
|
||||
+kernel_headers_packagename=linux-headers"$LOCALVERSION"
|
||||
+dtb_packagename=linux-dtb"$LOCALVERSION"
|
||||
libc_headers_packagename=linux-libc-dev
|
||||
dbg_packagename=$packagename-dbg
|
||||
debarch=
|
||||
@@ -124,8 +151,9 @@ esac
|
||||
BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $KCONFIG_CONFIG || true)"
|
||||
|
||||
# Setup the directory structure
|
||||
-rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" $objtree/debian/files
|
||||
-mkdir -m 755 -p "$tmpdir/DEBIAN"
|
||||
+rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" "$dtb_dir" $objtree/debian/files
|
||||
+mkdir -m 755 -p "$dtb_dir/DEBIAN"
|
||||
+mkdir -p "$dtb_dir/boot/dtb-$version" "$dtb_dir/usr/share/doc/$dtb_packagename"mkdir -m 755 -p "$tmpdir/DEBIAN"
|
||||
mkdir -p "$tmpdir/lib" "$tmpdir/boot"
|
||||
mkdir -p "$kernel_headers_dir/lib/modules/$version/"
|
||||
|
||||
@@ -145,7 +173,7 @@ cp "$($MAKE -s image_name)" "$tmpdir/$installed_image_path"
|
||||
if grep -q "^CONFIG_OF=y" $KCONFIG_CONFIG ; then
|
||||
# Only some architectures with OF support have this target
|
||||
if grep -q dtbs_install "${srctree}/arch/$SRCARCH/Makefile"; then
|
||||
- $MAKE KBUILD_SRC= INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install
|
||||
+ $MAKE KBUILD_SRC= INSTALL_DTBS_PATH="$dtb_dir/boot/dtb-$version" dtbs_install
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -212,6 +240,55 @@ EOF
|
||||
chmod 755 "$tmpdir/DEBIAN/$script"
|
||||
done
|
||||
|
||||
+##
|
||||
+## Create sym link to kernel image
|
||||
+##
|
||||
+sed -e "s/set -e//g" -i $tmpdir/DEBIAN/postinst
|
||||
+sed -e "s/exit 0//g" -i $tmpdir/DEBIAN/postinst
|
||||
+cat >> $tmpdir/DEBIAN/postinst <<EOT
|
||||
+if [ "\$(grep nand /proc/partitions)" != "" ] && [ "\$(grep mmc /proc/partitions)" = "" ]; then
|
||||
+ mkimage -A arm -O linux -T kernel -C none -a "0x40008000" -e "0x40008000" -n "Linux kernel" -d /$installed_image_path /boot/uImage > /dev/null 2>&1
|
||||
+ cp /boot/uImage /tmp/uImage
|
||||
+ sync
|
||||
+ mountpoint -q /boot || mount /boot
|
||||
+ cp /tmp/uImage /boot/uImage
|
||||
+ rm -f /$installed_image_path
|
||||
+else
|
||||
+ ln -sf $(basename $installed_image_path) /boot/zImage > /dev/null 2>&1 || mv /$installed_image_path /boot/zImage
|
||||
+ fi
|
||||
+ touch /boot/.next
|
||||
+exit 0
|
||||
+EOT
|
||||
+##
|
||||
+## FAT install workaround
|
||||
+##
|
||||
+sed -e "s/set -e//g" -i $tmpdir/DEBIAN/preinst
|
||||
+sed -e "s/exit 0//g" -i $tmpdir/DEBIAN/preinst
|
||||
+cat >> $tmpdir/DEBIAN/preinst <<EOT
|
||||
+# exit if we are running chroot
|
||||
+if [ "\$(stat -c %d:%i /)" != "\$(stat -c %d:%i /proc/1/root/.)" ]; then exit 0; fi
|
||||
+
|
||||
+check_and_unmount (){
|
||||
+ boot_device=\$(mountpoint -d /boot)
|
||||
+
|
||||
+ for file in /dev/* ; do
|
||||
+ CURRENT_DEVICE=\$(printf "%d:%d" \$(stat --printf="0x%t 0x%T" \$file))
|
||||
+ if [[ "\$CURRENT_DEVICE" = "\$boot_device" ]]; then
|
||||
+ boot_partition=\$file
|
||||
+ break;
|
||||
+ fi
|
||||
+ done
|
||||
+
|
||||
+ bootfstype=\$(blkid -s TYPE -o value \$boot_partition)
|
||||
+ if [ "\$bootfstype" = "vfat" ]; then
|
||||
+ umount /boot;
|
||||
+ rm -f /boot/System.map* /boot/config* /boot/vmlinuz* /boot/zImage /boot/uImage
|
||||
+ fi
|
||||
+}
|
||||
+mountpoint -q /boot && check_and_unmount
|
||||
+EOT
|
||||
+echo "exit 0" >> $tmpdir/DEBIAN/preinst
|
||||
+
|
||||
# Try to determine maintainer and email values
|
||||
if [ -n "$DEBEMAIL" ]; then
|
||||
email=$DEBEMAIL
|
||||
@@ -325,11 +402,20 @@ if grep -q '^CONFIG_GCC_PLUGINS=y' $KCONFIG_CONFIG ; then
|
||||
fi
|
||||
destdir=$kernel_headers_dir/usr/src/linux-headers-$version
|
||||
mkdir -p "$destdir"
|
||||
+######################## headers patch
|
||||
+ZACNI=$(pwd)
|
||||
+cd $destdir
|
||||
+patch -p1 < /tmp/headers-debian-byteshift.patch
|
||||
+cd $ZACNI
|
||||
+######################## headers patch
|
||||
+mkdir -p "$destdir"/net/wireguard;
|
||||
+ touch "$destdir"/net/wireguard/{Kconfig,Makefile} # workaround for Wireguard
|
||||
(cd $srctree; tar -c -f - -T -) < "$objtree/debian/hdrsrcfiles" | (cd $destdir; tar -xf -)
|
||||
(cd $objtree; tar -c -f - -T -) < "$objtree/debian/hdrobjfiles" | (cd $destdir; tar -xf -)
|
||||
(cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be
|
||||
ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build"
|
||||
rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
|
||||
+(cd "$destdir"; make M=scripts clean)
|
||||
|
||||
cat <<EOF >> debian/control
|
||||
|
||||
@@ -343,6 +429,16 @@ EOF
|
||||
|
||||
cat <<EOF >> debian/control
|
||||
|
||||
+Package: $dtb_packagename
|
||||
+Architecture: any
|
||||
+Description: Linux DTB, version $version
|
||||
+ This package contains device blobs from the Linux kernel, version $version.
|
||||
+EOF
|
||||
+
|
||||
+create_package "$dtb_packagename" "$dtb_dir"
|
||||
+
|
||||
+cat <<EOF >> debian/control
|
||||
+
|
||||
Package: $libc_headers_packagename
|
||||
Section: devel
|
||||
Provides: linux-kernel-headers
|
||||
@@ -354,7 +450,7 @@ EOF
|
||||
|
||||
if [ "$ARCH" != "um" ]; then
|
||||
create_package "$kernel_headers_packagename" "$kernel_headers_dir"
|
||||
- create_package "$libc_headers_packagename" "$libc_headers_dir"
|
||||
+ #create_package "$libc_headers_packagename" "$libc_headers_dir"
|
||||
fi
|
||||
|
||||
create_package "$packagename" "$tmpdir"
|
||||
13
patch/u-boot/u-boot-imx7d/u-boot-enable-CMD_IMPORTENV.patch
Normal file
13
patch/u-boot/u-boot-imx7d/u-boot-enable-CMD_IMPORTENV.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/configs/mx7dsabresd_defconfig b/configs/mx7dsabresd_defconfig
|
||||
index 18b02f4..e8d7105 100644
|
||||
--- a/configs/mx7dsabresd_defconfig
|
||||
+++ b/configs/mx7dsabresd_defconfig
|
||||
@@ -15,7 +15,7 @@ CONFIG_CMD_BOOTZ=y
|
||||
# CONFIG_CMD_IMLS is not set
|
||||
# CONFIG_CMD_XIMG is not set
|
||||
# CONFIG_CMD_EXPORTENV is not set
|
||||
-# CONFIG_CMD_IMPORTENV is not set
|
||||
+CONFIG_CMD_IMPORTENV=y
|
||||
CONFIG_CMD_MEMTEST=y
|
||||
CONFIG_CMD_DFU=y
|
||||
CONFIG_CMD_GPIO=y
|
||||
@ -0,0 +1,16 @@
|
||||
diff --git a/board/freescale/common/mmc.c b/board/freescale/common/mmc.c
|
||||
index 9fc3e68..f150892 100644
|
||||
--- a/board/freescale/common/mmc.c
|
||||
+++ b/board/freescale/common/mmc.c
|
||||
@@ -40,11 +40,6 @@ void board_late_mmc_env_init(void)
|
||||
|
||||
env_set_ulong("mmcdev", dev_no);
|
||||
|
||||
- /* Set mmcblk env */
|
||||
- sprintf(mmcblk, "/dev/mmcblk%dp2 rootwait rw",
|
||||
- mmc_map_to_kernel_blk(dev_no));
|
||||
- env_set("mmcroot", mmcblk);
|
||||
-
|
||||
sprintf(cmd, "mmc dev %d", dev_no);
|
||||
run_command(cmd, 0);
|
||||
}
|
||||
65
patch/u-boot/u-boot-imx7d/u-boot-update-boot-scripts.patch
Normal file
65
patch/u-boot/u-boot-imx7d/u-boot-update-boot-scripts.patch
Normal file
@ -0,0 +1,65 @@
|
||||
diff --git a/include/configs/mx7dsabresd.h b/include/configs/mx7dsabresd.h
|
||||
index f5171bb..d617565 100644
|
||||
--- a/include/configs/mx7dsabresd.h
|
||||
+++ b/include/configs/mx7dsabresd.h
|
||||
@@ -43,6 +43,8 @@
|
||||
#define CONFIG_FEC_MXC_MDIO_BASE ENET_IPS_BASE_ADDR
|
||||
#endif
|
||||
|
||||
+#define AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED
|
||||
+
|
||||
/* MMC Config*/
|
||||
#define CONFIG_SYS_FSL_ESDHC_ADDR 0
|
||||
|
||||
@@ -136,8 +138,8 @@
|
||||
CONFIG_MFG_ENV_SETTINGS \
|
||||
TEE_ENV \
|
||||
CONFIG_DFU_ENV_SETTINGS \
|
||||
- "script=boot.scr\0" \
|
||||
- "image=zImage\0" \
|
||||
+ "script=/boot/boot.scr\0" \
|
||||
+ "image=/boot/zImage\0" \
|
||||
"console=ttymxc0\0" \
|
||||
"fdt_high=0xffffffff\0" \
|
||||
"initrd_high=0xffffffff\0" \
|
||||
@@ -150,17 +152,17 @@
|
||||
"panel=TFT43AB\0" \
|
||||
"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
|
||||
"mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
|
||||
- "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
|
||||
+ "mmcroot=/dev/mmcblk0p1 rootwait rw\0" \
|
||||
"mmcautodetect=yes\0" \
|
||||
"mmcargs=setenv bootargs console=${console},${baudrate} " \
|
||||
"root=${mmcroot}\0" \
|
||||
"loadbootscript=" \
|
||||
- "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
|
||||
+ "ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
|
||||
"bootscript=echo Running bootscript from mmc ...; " \
|
||||
"source\0" \
|
||||
- "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
|
||||
- "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
|
||||
- "loadtee=fatload mmc ${mmcdev}:${mmcpart} ${tee_addr} ${tee_file}\0" \
|
||||
+ "loadimage=ext4load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
|
||||
+ "loadfdt=ext4load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
|
||||
+ "loadtee=ext4load mmc ${mmcdev}:${mmcpart} ${tee_addr} ${tee_file}\0" \
|
||||
"mmcboot=echo Booting from mmc ...; " \
|
||||
"run mmcargs; " \
|
||||
"if test ${tee} = yes; then " \
|
||||
@@ -212,7 +214,7 @@
|
||||
"fi;\0" \
|
||||
"findfdt="\
|
||||
"if test $fdt_file = undefined; then " \
|
||||
- "setenv fdt_file imx7d-sdb.dtb; " \
|
||||
+ "setenv fdt_file /boot/dtb/imx7d-sdb.dtb; " \
|
||||
"fi;\0" \
|
||||
|
||||
#define CONFIG_BOOTCOMMAND \
|
||||
@@ -303,7 +305,7 @@
|
||||
#define CONFIG_SYS_FSL_ESDHC_ADDR 0
|
||||
#define CONFIG_SYS_MMC_ENV_DEV 0 /* USDHC1 */
|
||||
#define CONFIG_SYS_MMC_ENV_PART 0 /* user area */
|
||||
-#define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */
|
||||
+#define CONFIG_MMCROOT "/dev/mmcblk0p1" /* USDHC1 */
|
||||
|
||||
/* USB Configs */
|
||||
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
|
||||
Loading…
Reference in New Issue
Block a user