From patchwork Tue Jun 29 10:06:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1498269 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=hI0sUPTc; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GDgB96Mh9z9sWD for ; Tue, 29 Jun 2021 20:06:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id A96D760597; Tue, 29 Jun 2021 10:06:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LAqE66SX_JwC; Tue, 29 Jun 2021 10:06:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id C672C607B7; Tue, 29 Jun 2021 10:06:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id F05341BF2F9 for ; Tue, 29 Jun 2021 10:06:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id DEF844011D for ; Tue, 29 Jun 2021 10:06:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cKMp8pqj04J5 for ; Tue, 29 Jun 2021 10:06:51 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by smtp2.osuosl.org (Postfix) with ESMTPS id B05B140117 for ; Tue, 29 Jun 2021 10:06:51 +0000 (UTC) Received: by mail-ej1-x62c.google.com with SMTP id c17so9475363ejk.13 for ; Tue, 29 Jun 2021 03:06:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dci00Vy7RTvMDj3RNTbTAgjePs5I18ge25tMe+ty6rA=; b=hI0sUPTcBxMxmZ+q9LrfFxSSEUnMkzLsjz+QXIsItSWxLixgxiH4mv3fH+loKg0YxY kU1FgkUSHpv+7bwaWIOWEW+Tm54m7p2xbGxPS5kJKbzb/+CjnHwtFDqKAc9Mo+L0KqCN Fans7VBy+qI4BSmtPBH0OobFQ6Na708PLgl5qw/LmIcWc+0IXnNTmiE65BCK3StLd6RS CSnNTHq93IaD81XRpo9udGTxqHBSGL6r041UX9RcvmTR4ryFEHSrDCO4KLLlEV/boOSI cfML0Hzev/nGywholRrJ3eRuLz5F7i3EBfZSOxwu9BOtR08BB+8lfmmJNfqLIJ5FtjUi 1kuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dci00Vy7RTvMDj3RNTbTAgjePs5I18ge25tMe+ty6rA=; b=FF63rrxJ4o4upCx9c55X6Z8GLzzdNPnA8XLrFFkP13tLBD4hXiPQwqbBf/xcacBq/T gQ0xnFw+xoLTa6sSk6lv/Mu9/YpIgAtnCsqfXz1Q4FEO//NwKV1suwV1QUeaNhWvzqlG 40cyuMMkR9+TPmnS/W5I9W8ScUbmWgV2vqAsihUAhOc9PsYi5t0lLaLkGNHOZznVq2Xr WMHFh6Z7W+Gp8VONP+55cA2uiDkxR0Lk/rWjEeTpCHI66UA/PI4vXqx/tqXCEdd63KmI ZcyNJORKerDPwRVyQc1Jkr2HazFeBXHnBBI42srzKHSWR1BfHY67oUHjIzRFgJGDW5tx T8Ww== X-Gm-Message-State: AOAM533qoR6YRr5p5YL0Rzq5Q6l2eRZM2RgYAf6bFmogalelW4CzC1TE 7IO/Hj8Y4VW6PHxENRuboors2wPLOXU= X-Google-Smtp-Source: ABdhPJz7Oe1v9D/hbXA+4J0dwHr827tlpzE0poLHOglVODLJ0KZ2CnED0W5lR4vbGL8pz9iNamLz7g== X-Received: by 2002:a17:906:b191:: with SMTP id w17mr30023174ejy.10.1624961209593; Tue, 29 Jun 2021 03:06:49 -0700 (PDT) Received: from hthiery.kontron.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id y27sm7496797ejk.89.2021.06.29.03.06.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 03:06:49 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Tue, 29 Jun 2021 12:06:31 +0200 Message-Id: <20210629100630.1963-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] configs/kontron_pitx_imx8m: new defconfig X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Thiery , Michael Walle Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Heiko Thiery --- DEVELOPERS | 2 + board/kontron/pitx-imx8m/boot.cmd | 8 +++ board/kontron/pitx-imx8m/genimage.cfg | 16 ++++++ board/kontron/pitx-imx8m/post-build.sh | 4 ++ board/kontron/pitx-imx8m/post-image.sh | 4 ++ board/kontron/pitx-imx8m/readme.txt | 74 ++++++++++++++++++++++++++ configs/kontron_pitx_imx8m_defconfig | 54 +++++++++++++++++++ 7 files changed, 162 insertions(+) create mode 100644 board/kontron/pitx-imx8m/boot.cmd create mode 100644 board/kontron/pitx-imx8m/genimage.cfg create mode 100755 board/kontron/pitx-imx8m/post-build.sh create mode 100755 board/kontron/pitx-imx8m/post-image.sh create mode 100644 board/kontron/pitx-imx8m/readme.txt create mode 100644 configs/kontron_pitx_imx8m_defconfig diff --git a/DEVELOPERS b/DEVELOPERS index 2031a40e14..aba7a50e9d 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1121,6 +1121,8 @@ F: package/python-sip/ F: package/uhd/ N: Heiko Thiery +F: board/kontron/pitx-imx8m/ +F: configs/kontron_pitx_imx8m_defconfig F: package/altera-stapl/ F: package/ipmitool/ F: package/libnetconf2/ diff --git a/board/kontron/pitx-imx8m/boot.cmd b/board/kontron/pitx-imx8m/boot.cmd new file mode 100644 index 0000000000..4d89235392 --- /dev/null +++ b/board/kontron/pitx-imx8m/boot.cmd @@ -0,0 +1,8 @@ +echo "Root File Sytem on MMC${devnum}" +setenv rootfs /dev/mmcblk${devnum}p1 +setenv bootargs root=${rootfs} rootwait rw ${extrabootargs} + +load ${devtype} ${devnum} ${kernel_addr_r} boot/Image +load ${devtype} ${devnum} ${fdt_addr_r} boot/imx8mq-kontron-pitx-imx8m.dtb + +booti ${kernel_addr_r} - ${fdt_addr_r} diff --git a/board/kontron/pitx-imx8m/genimage.cfg b/board/kontron/pitx-imx8m/genimage.cfg new file mode 100644 index 0000000000..c335b0c026 --- /dev/null +++ b/board/kontron/pitx-imx8m/genimage.cfg @@ -0,0 +1,16 @@ +image sdcard.img { + hdimage { + } + + partition imx-boot { + in-partition-table = "no" + image = "imx8-boot-sd.bin" + offset = 33k + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + offset = 8M + } +} diff --git a/board/kontron/pitx-imx8m/post-build.sh b/board/kontron/pitx-imx8m/post-build.sh new file mode 100755 index 0000000000..4574221fe5 --- /dev/null +++ b/board/kontron/pitx-imx8m/post-build.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +mkdir -p $TARGET_DIR/boot/ +cp $BINARIES_DIR/boot.scr $TARGET_DIR/boot/boot.scr diff --git a/board/kontron/pitx-imx8m/post-image.sh b/board/kontron/pitx-imx8m/post-image.sh new file mode 100755 index 0000000000..66351f250f --- /dev/null +++ b/board/kontron/pitx-imx8m/post-image.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +support/scripts/genimage.sh -c $(dirname $0)/genimage.cfg +exit $? diff --git a/board/kontron/pitx-imx8m/readme.txt b/board/kontron/pitx-imx8m/readme.txt new file mode 100644 index 0000000000..7c85dd4377 --- /dev/null +++ b/board/kontron/pitx-imx8m/readme.txt @@ -0,0 +1,74 @@ +Kontron pitx-imx8m +================== + +https://www.kontron.com/produkte/pitx-imx8m/p155258 + + +How to build it +=============== + +Configure buildroot: + + $ make kontron_pitx_imx8m_defconfig + +Change settings to fit your needs (optional): + + $ make menuconfig + +Compile everything and buildr the rootfs image: + + $ make + + +Result of the build +=================== + +After building, the output/images directory contains: + + output/images/ + ├── bl31.bin + ├── boot.scr + ├── ddr_fw.bin + ├── Image + ├── imx8-boot-sd.bin + ├── imx8mq-kontron-pitx-imx8m.dtb + ├── lpddr4_pmu_train_fw.bin + ├── rootfs.ext2 + ├── rootfs.ext4 -> rootfs.ext2 + ├── rootfs.tar + ├── sdcard.img + ├── signed_hdmi_imx8m.bin + ├── u-boot.bin + ├── u-boot.itb + ├── u-boot-nodtb.bin + ├── u-boot-spl.bin + └── u-boot-spl-ddr.bin + + +Flashing the SD card image +========================== + +To install the image on a SDCard simply copy sdcard.img to the storage (e.g. SD, eMMC) + + $ sudo dd if=output/images/sdcard.img of= + + +Preparing the board +=================== + + * Connect a serial line to the board + * Insert the SD card + * Make sure the boot source selection DIP switches are set correctly + * SW1 1-4 OFF + * SW1 2-3 OFF + * Power-up the board + + +Booting the board +================= + +By default the bootloader will search for the first valid image, starting +with the internal eMMC. To make sure the bootloader loads bootscript from +the correct location (SD card) set the boot_targets environment variable: + + $ setenv boot_targets mmc1 diff --git a/configs/kontron_pitx_imx8m_defconfig b/configs/kontron_pitx_imx8m_defconfig new file mode 100644 index 0000000000..4053e1e398 --- /dev/null +++ b/configs/kontron_pitx_imx8m_defconfig @@ -0,0 +1,54 @@ +# Architecture +BR2_aarch64=y +BR2_ARM_FPU_VFPV3=y + +# System +BR2_TARGET_GENERIC_GETTY_PORT="ttymxc2" +BR2_ROOTFS_POST_BUILD_SCRIPT="board/freescale/common/imx/imx8-bootloader-prepare.sh board/kontron/pitx-imx8m/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/kontron/pitx-imx8m/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="${UBOOT_DIR}/arch/arm/dts/pitx-imx8mq.dtb" + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.13" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mq-kontron-pitx-imx8m" +BR2_LINUX_KERNEL_INSTALL_TARGET=y +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y + +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_13=y + +BR2_PACKAGE_FREESCALE_IMX=y +BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M=y +BR2_PACKAGE_FIRMWARE_IMX=y + +# Filesystem / image +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="120M" + +# Bootloader +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.5" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mq" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_TARBALL=y +BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="https://gitlab.kontron.com/imx/u-boot-imx/-/archive/PITX-IMX8M-R12/u-boot-imx-PITX-IMX8M-R12.tar.gz" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="pitx-imx8m" +BR2_TARGET_UBOOT_NEEDS_DTC=y +BR2_TARGET_UBOOT_FORMAT_CUSTOM=y +BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-nodtb.bin" +BR2_TARGET_UBOOT_SPL=y + +# Required host tools to create the SD/eMMC image +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_IMX_MKIMAGE=y +BR2_PACKAGE_HOST_UBOOT_TOOLS=y +BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y +BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT=y +BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="board/kontron/pitx-imx8m/boot.cmd"