From patchwork Thu Nov 19 07:53:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Stewart X-Patchwork-Id: 1402776 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=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=paral.in Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CcBl30CNlz9sSs for ; Thu, 19 Nov 2020 18:53:50 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A3FF423730; Thu, 19 Nov 2020 07:53:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YG7PMB2aXTdc; Thu, 19 Nov 2020 07:53:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 73360271D6; Thu, 19 Nov 2020 07:53:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id BDA4A1BF3D9 for ; Thu, 19 Nov 2020 07:53:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B8F2923730 for ; Thu, 19 Nov 2020 07:53:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h95mcplTNG6I for ; Thu, 19 Nov 2020 07:53:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by silver.osuosl.org (Postfix) with ESMTPS id 4703223039 for ; Thu, 19 Nov 2020 07:53:37 +0000 (UTC) Received: by mail-pl1-f172.google.com with SMTP id t18so2520459plo.0 for ; Wed, 18 Nov 2020 23:53:37 -0800 (PST) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=nnri7NGxTTOf4CRkLKcdPA51uC6kNhmHjDZ1dy5pxyg=; b=ovNhmgBGyTLW23shVEyBDJxXOKeRk7hjeUdmujhlzeEsJZLE5IneDvU3oBWigXCSJ0 2YvhlEbb9h/j6DspM9/b7FISqG0fH+R6eO+1MsjBRCxUYuGn2EZ+pI3/8ZPgFdRGkJt1 1ajf/z+Y7mgQt+hbKT1LUz7+W33iGt8FLQR+79o/5DVRJkN5FZR4s2iu5Qw793BSjolD U8ixVo8JTHWn5rOLoqJ/oprU9iRsqw9SH1ZrpGRBcG1iZqvTGEBXbA6GLUXIegfhYFDb KLfnAM6YIKe0gI1fgZESfVgjNAwMSInhQ5ZYe1jFuKCIMQXM/93u5/8cApYLO8R8LsTq roJw== X-Gm-Message-State: AOAM530oPUZa9j7wq9gkn2AzClGo/6PQ4I388cRyEfIm408lmncnNFQm ScZALuq0KJy1qFLMyrncTYaMPrRVFP7asg== X-Google-Smtp-Source: ABdhPJzbe/EVghVR+ttQYM8asX2Seu9eVwq07j6PAS10da40ZrY5AR1IPLrmrAtDJS5mETnR+lvtSg== X-Received: by 2002:a17:902:ed0d:b029:d9:d737:6169 with SMTP id b13-20020a170902ed0db02900d9d7376169mr2878724pld.45.1605772416529; Wed, 18 Nov 2020 23:53:36 -0800 (PST) Received: from localhost.localdomain (ip70-191-80-27.sb.sd.cox.net. [70.191.80.27]) by smtp.gmail.com with ESMTPSA id b3sm27120144pfd.66.2020.11.18.23.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 23:53:35 -0800 (PST) From: Christian Stewart To: buildroot@buildroot.org Date: Wed, 18 Nov 2020 23:53:27 -0800 Message-Id: <20201119075328.8599-4-christian@paral.in> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201119075328.8599-1-christian@paral.in> References: <20201119075328.8599-1-christian@paral.in> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 4/5] board: add nvidia jetson tx2 support 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: Peter Korsgaard , Christian Stewart , Asaf Kahlon , Peter Seiderer , Thomas Petazzoni , "Yann E . MORIN" , Adam Duskett , Angelo Compagnucci Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Tested-by: Asaf Kahlon Signed-off-by: Christian Stewart --- v3 -> v4: - thanks Romain for the review - cjs: added gcc + binutils version specifiers - tested against devkit hardware Signed-off-by: Christian Stewart --- board/jetson/tx2/readme.txt | 83 +++++++++++++++++++++++++++++++++++++ board/jetsontx2 | 1 + configs/jetsontx2_defconfig | 64 ++++++++++++++++++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 board/jetson/tx2/readme.txt create mode 120000 board/jetsontx2 create mode 100644 configs/jetsontx2_defconfig diff --git a/board/jetson/tx2/readme.txt b/board/jetson/tx2/readme.txt new file mode 100644 index 0000000000..45fdb50a56 --- /dev/null +++ b/board/jetson/tx2/readme.txt @@ -0,0 +1,83 @@ +NVIDIA Jetson TX2 + +Intro +===== + +This configuration supports the Jetson TX2 devkit. + +Building +======== + +Configure Buildroot +------------------- + +For Jetson TX2: + + $ make jetsontx2_defconfig + +Build the rootfs +---------------- + +You may now build your rootfs with: + + $ make + + +Flashing +======== + +Once the build process is finished you will have the target binaries in the +output/images directory, with a copy of linux4tegra. + +Flashing to the internal eMMC is done by booting to the official recovery mode, +and flashing the system from there. The default factory-flashed TX2 is suitable. + +There are a lot of cases where the TX2 will not boot properly unless all of the +peripherals are fully disconnected, power is disconnected, everything fully +resets, and then the power is introduced back again. + +The recovery mode of the Jetson is used to flash. Entering recovery: + + - Start with the machine powered off + fully unplugged. + - Plug in the device to power, and connect a HDMI display. + - Connect a micro-USB cable from the host PC to the target board. + - Power on the device by holding the start button until the red light is lit. + - Hold down the RST button and REC button simultaneously. + - Release the RST button while holding down the REC button. + - Wait a few seconds, then release the REC button. + +To flash over USB: + +``` +cd output/images/linux4tegra +sudo bash ./flash.sh \ + -I ../rootfs.ext2 \ + -K ../Image \ + -L ../u-boot-dtb.bin \ + -C "ramdisk_size=100000 net.ifnames=0 elevator=deadline" \ + -d ../tegra186-quill-p3310-1000-c03-00-base.dtb \ + jetson-tx2-devkit mmcblk0p1 +``` + +This will run the `flash.sh` script from L4T, and will setup the kernel, u-boot, +persist + boot-up partition mmcblk0p1. This may overwrite your existing work so +use it for initial setup only. + +Bootup Process +============== + +The TX2 boots from the internal eMMC, at mmcblk0p1. + +A "secure boot" process is used, with multiple bootloaders: + + - BootROM -> MB1 (TrustZone) + - MB2/BPMP -> (Non-Trustzone) + - Cboot (uses Little Kernel) + - Uboot + - Kernel + +Uboot is flashed to the mmcblk0p1 emmc partition. + +Cboot could be compiled from source, and the source is available from the +official sources, however, we do not (yet) compile cboot. + diff --git a/board/jetsontx2 b/board/jetsontx2 new file mode 120000 index 0000000000..7404114cc3 --- /dev/null +++ b/board/jetsontx2 @@ -0,0 +1 @@ +./jetson/tx2 \ No newline at end of file diff --git a/configs/jetsontx2_defconfig b/configs/jetsontx2_defconfig new file mode 100644 index 0000000000..5ca832524e --- /dev/null +++ b/configs/jetsontx2_defconfig @@ -0,0 +1,64 @@ +BR2_aarch64=y +BR2_cortex_a57=y +BR2_ARM_FPU_FP_ARMV8=y + +# enable specific optimizations +BR2_TARGET_OPTIMIZATION="-march=armv8-a+crypto -mcpu=cortex-a57+crypto" + +# Toolchain reference: docs.nvidia.com: "Jetson Linux Driver Package Toolchain" +BR2_TOOLCHAIN_BUILDROOT=y +BR2_TOOLCHAIN_BUILDROOT_CXX=y +BR2_TOOLCHAIN_BUILDROOT_GLIBC=y +BR2_TOOLCHAIN_BUILDROOT_WCHAR=y +BR2_TOOLCHAIN_BUILDROOT_LOCALE=y +BR2_BINUTILS_VERSION_2_32_X=y +BR2_GCC_VERSION_7_X=y +BR2_GCC_ENABLE_LTO=n +BR2_USE_MMU=y + +BR2_SYSTEM_DHCP="eth0" + +# Linux headers same as kernel, a 4.9 series +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y +BR2_KERNEL_HEADERS_AS_KERNEL=y + +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y +# patches-l4t-r32.4 +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,madisongh,linux-tegra-4.9,0be1a57448010ae60505acf4e2153638455cee7c)/linux-tegra-4.9.140-r1.tar.gz" +BR2_LINUX_KERNEL_DEFCONFIG="tegra" + +# Build the DTB from the kernel sources +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="_ddot_/_ddot_/_ddot_/_ddot_/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base" + +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y + +BR2_PACKAGE_LINUX4TEGRA=y +BR2_PACKAGE_LINUX4TEGRA_PLATFORM_T186REF=y + +# TODO: NVIDIA_CONTAINER_TOOLKIT requires a go-module integration. +# BR2_PACKAGE_NVIDIA_CONTAINER_TOOLKIT=y + +BR2_PACKAGE_LINUX_FIRMWARE=y +BR2_PACKAGE_LINUX_FIRMWARE_RTL_88XX=y + +# Required tools to create the image +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_JQ=y +BR2_PACKAGE_HOST_PARTED=y + +# Filesystem / image +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="2000M" +# BR2_TARGET_ROOTFS_TAR is not set + +# Uboot +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="p2771-0000-500" +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_TARBALL=y +BR2_TARGET_UBOOT_CUSTOM_TARBALL_LOCATION="$(call github,paralin,u-boot-tegra,e6da093be3cc593ef4294e1922b3391ede9c94da)/u-boot-tegra-l4t-r32.4-v2016.7.tar.gz" +BR2_TARGET_UBOOT_FORMAT_DTB_BIN=y +BR2_TARGET_UBOOT_NEEDS_DTC=y