From b5742f386fd5b2a713f19b9a311d3c83b2cd2b01 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Fri, 17 Oct 2014 15:27:20 +0300 Subject: toradex: support for the new v2.3 toradex release Kernel is now using dtb, include it in the bootfs. U-boot update to make sdboot the default. Include u-boot script for updating the u-boot. Change-Id: I7e4f01ad3d903fbf807c5bf3904a9f955a59e97a Reviewed-by: Eirik Aavitsland --- conf/distro/include/apalis-imx6.conf | 2 + .../recipes/u-boot/u-boot-script-toradex.bb | 58 ++++++++++++++++++++++ .../u-boot/u-boot-script-toradex/flash_mmc.scr | 2 + .../0001-Update-default-args-for-apalis-imx6.patch | 53 ++++++++++++++++++++ .../recipes/u-boot/u-boot-toradex-fsl_git.bbappend | 26 ++++++++++ 5 files changed, 141 insertions(+) create mode 100644 meta-toradex-extras/recipes/u-boot/u-boot-script-toradex.bb create mode 100644 meta-toradex-extras/recipes/u-boot/u-boot-script-toradex/flash_mmc.scr create mode 100644 meta-toradex-extras/recipes/u-boot/u-boot-toradex-fsl/0001-Update-default-args-for-apalis-imx6.patch create mode 100644 meta-toradex-extras/recipes/u-boot/u-boot-toradex-fsl_git.bbappend diff --git a/conf/distro/include/apalis-imx6.conf b/conf/distro/include/apalis-imx6.conf index 25c87d3..53901a1 100644 --- a/conf/distro/include/apalis-imx6.conf +++ b/conf/distro/include/apalis-imx6.conf @@ -26,7 +26,9 @@ IMAGE_FSTYPES = "tar.gz" BOOTFS_CONTENT = "\ ${KERNEL_IMAGETYPE}:${KERNEL_IMAGETYPE} \ + ${KERNEL_IMAGETYPE}-imx6q-apalis-eval.dtb:imx6q-apalis-eval.dtb \ u-boot-${MACHINE}.imx:u-boot.imx \ + flash_mmc-${MACHINE}.img:flash_mmc.img \ " BOOTFS_DEPENDS = "u-boot:do_deploy" diff --git a/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex.bb b/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex.bb new file mode 100644 index 0000000..4254062 --- /dev/null +++ b/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex.bb @@ -0,0 +1,58 @@ +############################################################################# +## +## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +## +## This file is part of the Qt Enterprise Embedded Scripts of the Qt +## framework. +## +## $QT_BEGIN_LICENSE$ +## Commercial License Usage Only +## Licensees holding valid commercial Qt license agreements with Digia +## with an appropriate addendum covering the Qt Enterprise Embedded Scripts, +## may use this file in accordance with the terms contained in said license +## agreement. +## +## For further information use the contact form at +## http://qt.digia.com/contact-us. +## +## +## $QT_END_LICENSE$ +## +############################################################################# + +LICENSE = "CLOSED" +DEPENDS = "u-boot-mkimage-native" + +PV = "v2.3" + +SRC_URI = "file://flash_mmc.scr" + +inherit deploy + +UPDATESCRIPT = "${WORKDIR}/flash_mmc.scr" + +do_mkimage () { + uboot-mkimage -A arm -O linux -T script -C none -a 0 -e 0 \ + -n "update script" -d ${UPDATESCRIPT} \ + flash_mmc.img +} + +addtask mkimage after do_compile before do_install + +do_deploy () { + install -d ${DEPLOYDIR} + install ${S}/flash_mmc.img ${DEPLOYDIR}/flash_mmc-${MACHINE}-${PV}-${PR}.img + + cd ${DEPLOYDIR} + rm -f flash_mmc-${MACHINE}.img + ln -sf flash_mmc-${MACHINE}-${PV}-${PR}.img flash_mmc-${MACHINE}.img +} + +addtask deploy after do_install before do_build + +do_compile[noexec] = "1" +do_install[noexec] = "1" +do_populate_sysroot[noexec] = "1" + +PACKAGE_ARCH = "${MACHINE_ARCH}" +COMPATIBLE_MACHINE = "(apalis-imx6)" diff --git a/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex/flash_mmc.scr b/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex/flash_mmc.scr new file mode 100644 index 0000000..5b7dc80 --- /dev/null +++ b/meta-toradex-extras/recipes/u-boot/u-boot-script-toradex/flash_mmc.scr @@ -0,0 +1,2 @@ +setenv update_uboot 'fatload mmc ${drive}:1 ${loadaddr} u-boot.imx && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200 && mmc dev 0 && mmc write ${loadaddr} 2 ${blkcnt}' +echo 'enter "run update_uboot" to update the uboot' diff --git a/meta-toradex-extras/recipes/u-boot/u-boot-toradex-fsl/0001-Update-default-args-for-apalis-imx6.patch b/meta-toradex-extras/recipes/u-boot/u-boot-toradex-fsl/0001-Update-default-args-for-apalis-imx6.patch new file mode 100644 index 0000000..c7f0f9b --- /dev/null +++ b/meta-toradex-extras/recipes/u-boot/u-boot-toradex-fsl/0001-Update-default-args-for-apalis-imx6.patch @@ -0,0 +1,53 @@ +From 7872f8e770a202f41fbcf0372b27eb3669c433a1 Mon Sep 17 00:00:00 2001 +From: Samuli Piippo +Date: Mon, 27 Oct 2014 14:53:25 +0200 +Subject: [PATCH] Update default args for apalis imx6 + +Boot from sd card by default, disable kernel logs from tty1, and +disable cursor blinking. +--- + include/configs/apalis-imx6.h | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/include/configs/apalis-imx6.h b/include/configs/apalis-imx6.h +index 3fb17e2..728c5dd 100644 +--- a/include/configs/apalis-imx6.h ++++ b/include/configs/apalis-imx6.h +@@ -205,18 +205,19 @@ + "&& setenv dtbparam \" - ${fdt_addr_r}\" && true\0" + + #define SD_BOOTCMD \ +- "sdargs=ip=off root=/dev/mmcblk1p2 rw,noatime rootfstype=ext3 " \ +- "rootwait\0" \ ++ "drive=2\0" \ + "sdboot=" "run setup; " \ +- "setenv bootargs ${defargs} ${sdargs} ${setupargs} " \ ++ "setenv bootargs ${defargs} ip=off root=/dev/mmcblk${drive}p2 " \ ++ "rw,noatime rootfstype=ext3 rootwait ${setupargs} " \ + "${vidargs}; echo Booting from SD card in 8bit slot...; " \ +- "run sddtbload; fatload mmc 1:1 ${kernel_addr_r} " \ ++ "run sddtbload; fatload mmc ${drive}:1 ${kernel_addr_r} " \ + "${boot_file} && bootm ${kernel_addr_r} ${dtbparam}\0" \ +- "sddtbload=setenv dtbparam; fatload mmc 1:1 ${fdt_addr_r} " \ ++ "sddtbload=setenv dtbparam; fatload mmc ${drive}:1 ${fdt_addr_r} " \ + "${fdt_file} && setenv dtbparam \" - ${fdt_addr_r}\" && true\0" + + #define CONFIG_EXTRA_ENV_SETTINGS \ +- "bootcmd=run emmcboot ; echo ; echo emmcboot failed ; " \ ++ "bootcmd=run sdboot ; echo ; echo sdboot failed ; " \ ++ "run emmcboot ; echo ; echo emmcboot failed ; " \ + "run nfsboot ; echo ; echo nfsboot failed ; " \ + "usb start ;" \ + "setenv stdout serial,vga ; setenv stdin serial,usbkbd\0" \ +@@ -229,7 +230,7 @@ + NFS_BOOTCMD \ + SD_BOOTCMD \ + "setup=setenv setupargs fec_mac=${ethaddr} " \ +- "consoleblank=0 no_console_suspend=1 console=tty1 " \ ++ "consoleblank=0 no_console_suspend=1 vt.global_cursor_default=0 " \ + "console=${console},${baudrate}n8\0 " \ + "setupdate=setenv drive 1; fatload mmc ${drive}:1 ${kernel_addr_r} " \ + "flash_mmc.img || setenv drive 2; fatload mmc ${drive}:1 " \ +-- +1.8.3.2 + diff --git a/meta-toradex-extras/recipes/u-boot/u-boot-toradex-fsl_git.bbappend b/meta-toradex-extras/recipes/u-boot/u-boot-toradex-fsl_git.bbappend new file mode 100644 index 0000000..aa33199 --- /dev/null +++ b/meta-toradex-extras/recipes/u-boot/u-boot-toradex-fsl_git.bbappend @@ -0,0 +1,26 @@ +############################################################################# +## +## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +## +## This file is part of the Qt Enterprise Embedded Scripts of the Qt +## framework. +## +## $QT_BEGIN_LICENSE$ +## Commercial License Usage Only +## Licensees holding valid commercial Qt license agreements with Digia +## with an appropriate addendum covering the Qt Enterprise Embedded Scripts, +## may use this file in accordance with the terms contained in said license +## agreement. +## +## For further information use the contact form at +## http://qt.digia.com/contact-us. +## +## +## $QT_END_LICENSE$ +## +############################################################################# + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +SRC_URI += " \ + file://0001-Update-default-args-for-apalis-imx6.patch \ + " -- cgit v1.2.3-54-g00ecf