From patchwork Wed Jun 15 12:40:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Prado X-Patchwork-Id: 635860 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rV66Z0PP0z9t1J for ; Wed, 15 Jun 2016 22:59:34 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=e-labworks-com.20150623.gappssmtp.com header.i=@e-labworks-com.20150623.gappssmtp.com header.b=i1cdFmOv; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9579589E7A; Wed, 15 Jun 2016 12:59:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3X7Lcj-Zjehc; Wed, 15 Jun 2016 12:59:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 80F40896AB; Wed, 15 Jun 2016 12:59:30 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 395761C150D for ; Wed, 15 Jun 2016 12:59:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3445E8BF15 for ; Wed, 15 Jun 2016 12:59:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vlz+CAmgZW-b for ; Wed, 15 Jun 2016 12:59:28 +0000 (UTC) X-Greylist: delayed 00:18:03 by SQLgrey-1.7.6 Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0D5428A919 for ; Wed, 15 Jun 2016 12:59:28 +0000 (UTC) Received: by mail-qk0-f194.google.com with SMTP id a186so2395809qkf.0 for ; Wed, 15 Jun 2016 05:59:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=e-labworks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=ohhzgzOT8ZCVYAmeNBXwsvPQUWNctFRTUXGPB2C9VZk=; b=i1cdFmOvm/CoNGXXbYtMf7Qs+VJczdX76L4mKdpFL2N3z2ag5yZjese9fAPHlj5Ptx aWyMCIDeADSF38fvV2pQbIJ1hvkrLweS4BAGQp6FrR3BhcaegNBpJozOvnCO98JX9IYX QMSGwjy0mGKvmP2fKl2r8IsquMKLdEyJTyKBVBZonN3pvRJtofbXELXX90UN0bR6IHQ1 Fe5Bzkk8vTiU8+BolRgdtT8A6aUMHMFcKuZYJ9hl0UfnUOIMyHerNnpqrhjzIpul0IW5 4JSjRZcqb5BBYwUyrlDCSahZBrgYXboziKygbP/IFgPmRIKsHuADIXCi9v7FdF7IS9zJ 16rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ohhzgzOT8ZCVYAmeNBXwsvPQUWNctFRTUXGPB2C9VZk=; b=EREYDHtuPClht9SRregKjCG35tWWaMUOMw+BnyQPhtdbVLZE3LyDN214JJBbsw+seE hfHEfFMQzXWqEt9/ASo3/z8ltJU6/00/Ffilx/HfQpB5tG85Y72UbOOuL42S5NHyJWBr 9PfirM/PsQUXfacRkcqwyQpyISeLeajPtjoIdzwAmI1Nq4PnGrNRjuxH/w+519TUVmhr csFliMtB2QBXyEAkmQA/HMXvf8pJhfSNoqtpBp48uk6y9mjVj9PXyFP8cfHQiBDswNeL ND1hUruQlrWrU1jOzgZgtcPO8ngZSuR5DYoNLhLXPQvhlnnOHq08NUZcOz/oXCSEYXRw wC7A== X-Gm-Message-State: ALyK8tJOYpRhxFxtV3LA/uO6pYrq1i4okZ9H2CltxXBq23kkW73Gvb91yWWAoWHNRIIotg== X-Received: by 10.55.111.66 with SMTP id k63mr12636444qkc.22.1465994484363; Wed, 15 Jun 2016 05:41:24 -0700 (PDT) Received: from localhost.localdomain ([177.32.209.20]) by smtp.gmail.com with ESMTPSA id e133sm3031760qhd.27.2016.06.15.05.41.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Jun 2016 05:41:23 -0700 (PDT) From: Sergio Prado To: buildroot@buildroot.org Date: Wed, 15 Jun 2016 09:40:59 -0300 Message-Id: <1465994459-6502-1-git-send-email-sergio.prado@e-labworks.com> X-Mailer: git-send-email 1.9.1 Subject: [Buildroot] [PATCH v2] configs/toradex_apalis_imx6_defconfig: new board X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Sergio Prado --- Changes v1 -> v2: - using $(dirname $0) as board working dir for genimage config file - removing extra "=" signs from readme file - added explanation on how to use uEnv.txt - using BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_14 --- board/toradex/apalis-imx6/genimage.cfg | 15 ++++++++++ board/toradex/apalis-imx6/post-image.sh | 20 +++++++++++++ board/toradex/apalis-imx6/readme.txt | 52 +++++++++++++++++++++++++++++++++ board/toradex/apalis-imx6/uEnv.txt | 6 ++++ configs/toradex_apalis_imx6_defconfig | 24 +++++++++++++++ 5 files changed, 117 insertions(+) create mode 100644 board/toradex/apalis-imx6/genimage.cfg create mode 100755 board/toradex/apalis-imx6/post-image.sh create mode 100644 board/toradex/apalis-imx6/readme.txt create mode 100644 board/toradex/apalis-imx6/uEnv.txt create mode 100644 configs/toradex_apalis_imx6_defconfig diff --git a/board/toradex/apalis-imx6/genimage.cfg b/board/toradex/apalis-imx6/genimage.cfg new file mode 100644 index 000000000000..3458dc4f09fa --- /dev/null +++ b/board/toradex/apalis-imx6/genimage.cfg @@ -0,0 +1,15 @@ +# Minimal SD card image for the Toradex Apalis i.MX6 COM +# +# It does not need a boot section for a bootloader since it is +# booted from its internal flash memory (eMMC). + +image sdcard.img { + hdimage { + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext2" + size = 512M + } +} diff --git a/board/toradex/apalis-imx6/post-image.sh b/board/toradex/apalis-imx6/post-image.sh new file mode 100755 index 000000000000..2b49f9d3d094 --- /dev/null +++ b/board/toradex/apalis-imx6/post-image.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +GENIMAGE_CFG="$(dirname $0)/genimage.cfg" +GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" + +# copy the uEnv.txt to the output/images directory +cp board/toradex/apalis-imx6/uEnv.txt $BINARIES_DIR/uEnv.txt + +rm -rf "${GENIMAGE_TMP}" + +# generate rootfs.img +genimage \ + --rootpath "${TARGET_DIR}" \ + --tmppath "${GENIMAGE_TMP}" \ + --inputpath "${BINARIES_DIR}" \ + --outputpath "${BINARIES_DIR}" \ + --config "${GENIMAGE_CFG}" + +RET=${?} +exit ${RET} diff --git a/board/toradex/apalis-imx6/readme.txt b/board/toradex/apalis-imx6/readme.txt new file mode 100644 index 000000000000..8375d6563c8d --- /dev/null +++ b/board/toradex/apalis-imx6/readme.txt @@ -0,0 +1,52 @@ +Toradex Apalis i.MX6 Computer on Module + +Intro +===== + +The Apalis iMX6 is a small form-factor Computer on Module that comes in +both quad core and dual core versions based on Freescale i.MX6Q and +Freescale i.MX6D SoCs respectively. The Cortex A9 quad core and dual +core CPU peaks at 1 GHz for commercial temperature variant, while the +industrial temperature variant has a peak frequency of 800 MHz. + +https://www.toradex.com/computer-on-modules/apalis-arm-family/freescale-imx-6 + +It supports two carrier boards: + +Apalis Evaluation Board +https://www.toradex.com/products/carrier-boards/apalis-evaluation-board + +Ixora Carrier Board +https://www.toradex.com/products/carrier-boards/ixora-carrier-board + +How to build it +=============== + +Configure Buildroot: + + $ make toradex_apalis_imx6_defconfig + +Compile everything and build the rootfs image: + + $ make + +How to boot the image +===================== + +The board only boots from its internal flash memory eMMC, so the +bootloader image should be copied to it, following the procedures +described in Toradex website. + +http://developer.toradex.com/knowledge-base/flashing-linux-on-imx6-modules + +Buildroot prepares a "sdcard.img" in output/images/ with the kernel +image, device tree and a root filesystem, ready to be dumped on an +SD card. + + $ dd if=output/images/sdcard.img of=/dev/sdX bs=1M + +To boot from the SD card, you should change the U-Boot environment. Since U-Boot +is running from internal eMMC, you will need to access its command line prompt +and manually set the necessary variables to boot from the external SD card. For +convenience, you can use uEnv.txt provided in output/images/ as a reference to +create the necessary U-Boot variables to boot from the SD card. diff --git a/board/toradex/apalis-imx6/uEnv.txt b/board/toradex/apalis-imx6/uEnv.txt new file mode 100644 index 000000000000..96ab80cfb6fa --- /dev/null +++ b/board/toradex/apalis-imx6/uEnv.txt @@ -0,0 +1,6 @@ +boot_file=zImage +fdt_file=imx6q-apalis_v1_0-ixora.dtb +sdargs=ip=off root=/dev/mmcblk1p1 rw,noatime rootfstype=ext4 rootwait +sddtbload=ext2load mmc 2:1 ${fdt_addr_r} boot/${fdt_file} +sdkernelload=ext2load mmc 2:1 ${kernel_addr_r} boot/${boot_file} +bootcmd=run setup; setenv bootargs ${defargs} ${sdargs} ${setupargs} ${vidargs}; echo Booting from SD card...; run sddtbload; run sdkernelload; bootz ${kernel_addr_r} - ${fdt_addr_r} diff --git a/configs/toradex_apalis_imx6_defconfig b/configs/toradex_apalis_imx6_defconfig new file mode 100644 index 000000000000..74d1fb3b9c46 --- /dev/null +++ b/configs/toradex_apalis_imx6_defconfig @@ -0,0 +1,24 @@ +BR2_arm=y +BR2_cortex_a9=y +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_14=y +BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/toradex/apalis-imx6/post-image.sh" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_GIT=y +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.toradex.com/linux-toradex.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="8f237ebe42f2cb911245369276a6b3043c2815f2" +BR2_LINUX_KERNEL_DEFCONFIG="apalis_imx6" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-apalis-eval imx6q-apalis-ixora imx6q-apalis_v1_0-eval imx6q-apalis_v1_0-ixora" +BR2_LINUX_KERNEL_INSTALL_TARGET=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_GIT=y +BR2_TARGET_UBOOT_CUSTOM_REPO_URL="git://git.toradex.com/u-boot-toradex.git" +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="1ef4a29e8cea0239411dde64f9617ad76248fd02" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="apalis_imx6" +BR2_TARGET_UBOOT_FORMAT_CUSTOM=y +BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.imx" +BR2_PACKAGE_HOST_GENIMAGE=y