From patchwork Mon Mar 18 23:21:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1058134 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="EpvmzdRn"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44NXJL6Vh4z9s70 for ; Tue, 19 Mar 2019 10:21:54 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 991C385F6E; Mon, 18 Mar 2019 23:21:51 +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 ScC-dS9LVt9M; Mon, 18 Mar 2019 23:21:50 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id C75E185EA5; Mon, 18 Mar 2019 23:21:50 +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 7E3B01BF281 for ; Mon, 18 Mar 2019 23:21:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 79EC286E15 for ; Mon, 18 Mar 2019 23:21:49 +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 sL7Z4eGHWoKf for ; Mon, 18 Mar 2019 23:21:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id F2FA986365 for ; Mon, 18 Mar 2019 23:21:47 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id n9so14879254wrr.9 for ; Mon, 18 Mar 2019 16:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=DF+ZWo/gY0pWNdXDAzO7SmuxMsCdaDZc62BJ371qwVM=; b=EpvmzdRnagmQ4lhZ3gQFDvusSNeSFqU2q84H92x56PmmR0d7GLTTIn7dn6jJgLkT8Q 30IHc8AXswUM3YCK1OYx1+VsJBU+c1VZgE2BX0jAT/Th7PNPWsu4XlsPsapUiQ2bKHQ/ B3Up7hSae/ru2nqI/SjcspZint1Yy1+OmuI8nqKXs//aKub5NBVMU7LZ+kaRY6vhmuzt 2pkJnhkvajTyw7FnmXCbCRzJ66eMe4UUgDt0rxInmuwLO5Qgc8ViA66AdVcMJ422f5WI QVgPKg/lZftYVEt/W6hwKUVDNPEip0gpkpJQFx/9TP+dR09OspVzfI06U1WI7RlT8R2g 3rIw== 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; bh=DF+ZWo/gY0pWNdXDAzO7SmuxMsCdaDZc62BJ371qwVM=; b=rNPEuZVG1jEq8pwy+X/k86JPxEy597a4WR83hSAKCcGhaWhy8yL8iB4xvvceMFY5gG aARcHaJqNuw9q04av6odedOc96Wr/8YqTPV2CimIKOCvljMx3rnc/vUglPOnlupPW69X XiMpoIdEyHAbLoExF+TV2ypd4EaehN2dpAm70rWUM2AooWqXFBi2JP8ansgg0W4G4cBk 2/oDTPaer9SRtboE4LUKigaarT9LfMAbZvF+lodbX5nbao76PpcpN04DvmHVKIfPUqOi XRvD/+R8WUFvdnZNuZsr5pHakPxe2RsZADcOjz5C1dHDhrYj9aJoogfZYK3KgCQVf1xW ucnA== X-Gm-Message-State: APjAAAUT3wZsZYgVfrAwl9r4K9IKkltXngSjPjByWA/BGvu6CCavTjPq /7K/SQB7FAc0XtBOJ/Z/Tncs0sEkkAaU3A== X-Google-Smtp-Source: APXvYqw0K7bZvwSXLmp/3dbFZOR/jq0WbQOSG1iPjiiQM/OuXChw6hsXFBFyGyDeH/WkcUOxPkUawA== X-Received: by 2002:adf:9cc4:: with SMTP id h4mr13686344wre.327.1552951306240; Mon, 18 Mar 2019 16:21:46 -0700 (PDT) Received: from lmenx29q.home (lfbn-1-4937-18.w90-104.abo.wanadoo.fr. [90.104.163.18]) by smtp.gmail.com with ESMTPSA id e193sm1687016wmg.18.2019.03.18.16.21.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Mar 2019 16:21:45 -0700 (PDT) From: Etienne Carriere To: buildroot@buildroot.org Date: Tue, 19 Mar 2019 00:21:02 +0100 Message-Id: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 Subject: [Buildroot] [PATCH v2 1/8] boot/arm-trusted-firmware: support 32bit Arm targets 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: Etienne Carriere , Ricardo Martincoski , Sergey Matyukevich MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This change allows one to build the TF-A (Trusted Firmware A) for 32bit architectures Armv7 and Armv8 platforms. TF-A supports these configuration since release v1.5. Change dependency on BR2_aarch64 into a dependency on either BR2_ARM_CPU_ARMV8A/BR2_ARM_CPU_ARMV7A to better define the target architectures supported by the package. Set package configuration directive ARM_ARCH_MAJOR according to BR2_ARM_CPU_ARMV8A/BR2_ARM_CPU_ARMV7A. Set package configuration directive ARCH based on BR2_aarch64/BR2_arm. Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - Set ARM_ARCH_MAJOR and ARCH according to Buildroot directives BR2_ARM_CPU_ARMV8A/BR2_ARM_CPU_ARMV7A and BR2_aarch64/BR2_arm. --- boot/arm-trusted-firmware/Config.in | 3 ++- boot/arm-trusted-firmware/arm-trusted-firmware.mk | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in index 823a351..428a4ce 100644 --- a/boot/arm-trusted-firmware/Config.in +++ b/boot/arm-trusted-firmware/Config.in @@ -1,6 +1,7 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE bool "ARM Trusted Firmware (ATF)" - depends on BR2_aarch64 && BR2_TARGET_UBOOT + depends on (BR2_ARM_CPU_ARMV8A || BR2_ARM_CPU_ARMV7A) && \ + BR2_TARGET_UBOOT help Enable this option if you want to build the ATF for your ARM based embedded device. diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk index 8ca3864..fb80bd1 100644 --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk @@ -35,6 +35,18 @@ ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \ $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES)) \ PLAT=$(ARM_TRUSTED_FIRMWARE_PLATFORM) +ifeq ($(BR2_ARM_CPU_ARMV7A),y) +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ARM_ARCH_MAJOR=7 +else ifeq ($(BR2_ARM_CPU_ARMV8A),y) +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ARM_ARCH_MAJOR=8 +endif + +ifeq ($(BR2_arm),y) +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ARCH=aarch32 +else ifeq ($(BR2_aarch64),y) +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ARCH=aarch64 +endif + ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33),y) ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/u-boot.bin ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot From patchwork Mon Mar 18 23:21:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1058135 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="acKVwry7"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44NXJN0mtMz9s71 for ; Tue, 19 Mar 2019 10:21:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6AC2987938; Mon, 18 Mar 2019 23:21:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id krupi0wazLLW; Mon, 18 Mar 2019 23:21:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id A92A4878B3; Mon, 18 Mar 2019 23:21:52 +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 028F91BF281 for ; Mon, 18 Mar 2019 23:21:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0012586365 for ; Mon, 18 Mar 2019 23:21:49 +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 gColAw6Bdjdw for ; Mon, 18 Mar 2019 23:21:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id F091C86576 for ; Mon, 18 Mar 2019 23:21:48 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id n19so14739098wmi.1 for ; Mon, 18 Mar 2019 16:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JYo30HDagZ7ReYrGjVCv/J/H/v0VfSjMt5EalNAtDe4=; b=acKVwry7RQTZPW+3LcqZQLDlDqKZjigAuz/iyrBKoWqRRTjSThRZjPVIUvJ+ioiFPb YXwxRDDGeLioENMN2fNxLu8S8rMG0+JIwam+nXtbucpCTqZZhFaX0Yfjm0N2eoiaNxEa Omf8BLd1BK5PGwiGWuQAvpcNUjaNb6ulVKZzsUsahm5pPCtQWi05YeYeNE5jqwSiAT1R q7vh6GSh1yIvJOSLAI4emRj6du9qRQmKfiUVVZQb9gofEnOBcC5KMNnfdbbu4lugHJvs Ccod33ZiXV1Dp+QNVkXdw99zQd4hBnZjGPDJsYuWDmleFf5h6u7/gEyM/BGqvKyG9eXM ZhJQ== 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; bh=JYo30HDagZ7ReYrGjVCv/J/H/v0VfSjMt5EalNAtDe4=; b=NCrNj1CvUWPxsx35GmOUPZ1PLSEfXysuOf+8LJX5a3K+ad5Hq36dRM2kIfPLBjX1I2 3cTgPXfbgXj9yBPYOeIeSiSp3wP6mKf//8KkkH0FkZ7PGC1DoVFhr2eRKvcE7RgxBgOZ 21syWxg0JBm/YCLNoVs6E9NsDXE1uGhsYQGyWd4pWoFrGJWG1ngnGUiPhal3XbMNKy/Z A8uAC7/CgusVVALQia2b5g3MSRNqx1gVzbNs+swzxi8A64mJR0O3s4LFu5igdPDI0QIH KSq32n7hg3epJhhxyYBfK4im9s6G1akmSyeqi1cBPPq1D6Bt8tox5hgFVGejjlULX2/K 42Ow== X-Gm-Message-State: APjAAAVo7JguNjE4KX677a0NKH/JyRbAqFivUHCjRuF3QM58zpCMBAN8 qywT/pSf1zsnLCg0/anyfWKWeOnHMVXHhQ== X-Google-Smtp-Source: APXvYqwPzFRfueNEy2w3nr9fSpcMLjGV8Xudoh4Qx8qdB8tkAUSktB+Na1Rhb3mU/Qu9UMn15TFovA== X-Received: by 2002:a1c:96ce:: with SMTP id y197mr1001507wmd.126.1552951307097; Mon, 18 Mar 2019 16:21:47 -0700 (PDT) Received: from lmenx29q.home (lfbn-1-4937-18.w90-104.abo.wanadoo.fr. [90.104.163.18]) by smtp.gmail.com with ESMTPSA id e193sm1687016wmg.18.2019.03.18.16.21.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Mar 2019 16:21:46 -0700 (PDT) From: Etienne Carriere To: buildroot@buildroot.org Date: Tue, 19 Mar 2019 00:21:03 +0100 Message-Id: <1552951269-16967-2-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> References: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> Subject: [Buildroot] [PATCH v2 2/8] boot/arm-trusted-firmware: in-tree and OP-TEE BL32 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: Etienne Carriere , Ricardo Martincoski , Sergey Matyukevich MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This change allows one to build trusted firmware (TF-A) with OP-TEE as BL32 secure payload. When BR2_TARGET_ARM_TRUSTED_FIRMWARE_INTREE_BL32 is enabled TF-A builds a BL32 stage according the TF-A configuration directive. If these specify no BL3 stage then TF-A will build without BL32 support. This is the default configuration and reflects TF-A legacy integration in BR. When BR2_TARGET_ARM_TRUSTED_FIRMWARE_OPTEE_AS_BL32 is enabled TF-A builds with support for the OP-TEE OS as BL32. Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - No change --- boot/arm-trusted-firmware/Config.in | 30 +++++++++++++++++++++++ boot/arm-trusted-firmware/arm-trusted-firmware.mk | 13 ++++++++++ 2 files changed, 43 insertions(+) diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in index 428a4ce..a1a0c54 100644 --- a/boot/arm-trusted-firmware/Config.in +++ b/boot/arm-trusted-firmware/Config.in @@ -91,6 +91,36 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT bl31.bin. This is used for example by the Xilinx version of U-Boot SPL to load ATF on the ZynqMP SoC. +choice + prompt "Select BL32 stage" + default BR2_TARGET_ARM_TRUSTED_FIRMWARE_INTREE_BL32 + help + Select BL32 stage for the trusted firmware + +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_INTREE_BL32 + bool "Intree or no BL32 stage" + help + This option shall be set if the BL32 image is built from + trusted firmware sources (i.e sp_min, tsp) or when no BL32 + is expected. + + When the BL32 stage shall be built from ATF source tree, + the target BL32 payload shall be defined from configuration + BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES, either + using directive SPD= (Aarch64 platforms, + i.e SPD=tspd) or AARCH32_SP= (Aarch32 and Armv7 + platforms, i.e "AARCH32_SP=sp_min"). If no SPD or AARCH32_SP + directive is specified, ATF will build without BL32 support. + +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_OPTEE_AS_BL32 + bool "OP-TEE OS as BL32" + depends on BR2_TARGET_OPTEE_OS + help + This option allows to embed OP-TEE OS as the BL32 part of + the ARM Trusted Firmware boot sequence. + +endchoice + config BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33 bool "Use U-Boot as BL33" depends on BR2_TARGET_UBOOT diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk index fb80bd1..0ea4c0e 100644 --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk @@ -47,6 +47,19 @@ else ifeq ($(BR2_aarch64),y) ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ARCH=aarch64 endif +ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_OPTEE_AS_BL32),y) +ARM_TRUSTED_FIRMWARE_DEPENDENCIES += optee-os +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL32=$(BINARIES_DIR)/tee-header_v2.bin +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL32_EXTRA1=$(BINARIES_DIR)/tee-pager_v2.bin +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL32_EXTRA2=$(BINARIES_DIR)/tee-pageable_v2.bin +ifeq ($(BR2_aarch64),y) +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SPD=opteed +endif +ifeq ($(BR2_arm),y) +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += AARCH32_SP=optee +endif +endif # BR2_TARGET_ARM_TRUSTED_FIRMWARE_OPTEE_AS_BL32 + ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33),y) ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/u-boot.bin ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot From patchwork Mon Mar 18 23:21:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1058138 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="IC/denGA"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44NXJR5q61z9s6w for ; Tue, 19 Mar 2019 10:21:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 44B0886E15; Mon, 18 Mar 2019 23:21:56 +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 Jd3X7vUXuP3d; Mon, 18 Mar 2019 23:21:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 6B59286E2A; Mon, 18 Mar 2019 23:21:53 +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 013ED1BF281 for ; Mon, 18 Mar 2019 23:21:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id F366E2C85C for ; Mon, 18 Mar 2019 23:21:50 +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 E270VsyqiWlH for ; Mon, 18 Mar 2019 23:21:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by silver.osuosl.org (Postfix) with ESMTPS id B6BF9264D6 for ; Mon, 18 Mar 2019 23:21:49 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id n19so14739112wmi.1 for ; Mon, 18 Mar 2019 16:21:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7fO8P4A4AI+OPMaD6fqR7VtALBj3iqlcgxJp09VpeZU=; b=IC/denGA4B8bpEdrxU/Li/z91l9v+iWXZaZ1jowjZmzH2UMCPYdrg9ggb5jwK0UdKL c652gnlXW0aJu1AZQz+/+GOppWMovdrE1uaJUGJmTds3OrAdjoF+wdfPPtwLWlEsSmXX EH4lmoxw+WJYgTA8UlyVj3XjYBn9oJDkQFFUSFOqGDyvK4AvhTE7rAnKvrks1CBm4784 JLA/S74wOWsiTzEOk5qvXGD3yzGo4vUHzPKND7S+T1w6QMn7VP2qd8cE0I7I4qmH13kn z5pgQzV8nOdYWRv/sve/HYdrIe7LtmwgH+3+ljUv4vgREDIoJ9s7TP0u2B1mbDWEVpVM IOZg== 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; bh=7fO8P4A4AI+OPMaD6fqR7VtALBj3iqlcgxJp09VpeZU=; b=Knye5HM1vmprtc8aZjhp1epTtw9CeD8TKytQ8wphP6DpRwpbWiY9bH8LAu4MyIlmHi YjOp5YOrIk8KpSDiDSdSPcQ6qVkxEIbr1kjIpTw6vRyaaU9FtIITQ0STl94GyWqzq3AA Iblxs0p7jbr6jfoa6GY1qv7BnVkxJgqvl6vGgbAAX8nYPK53gAxGln0B8vNIg8jSBB2l LryiADPkDoc8gNFkjOeKSVRvblPInQuFg9AqiFgNP6QnSpJT7s4qbFepdtnqTRLYKvks PSb/vlH6N7QLOODqAkI0f/QhoRW99zT4BRj5W7e9nqi3Fc5AgaQH4nmW07fv6umG/8c3 /g7Q== X-Gm-Message-State: APjAAAXFPEXFTAPX1DyI/eppRcQxas75k7iWgveh1MpqbbdDdmc44ycg yemIAqtDrnU/mRNk/9WxDorL61PEdhW7lA== X-Google-Smtp-Source: APXvYqzLGYtxrTtI5ocyrNARJufIOChSmAO5bhTB0d7bzXrbpXMUhhI9Nah4c8pURie64NGgPUL0Dg== X-Received: by 2002:a1c:7903:: with SMTP id l3mr1053955wme.22.1552951307906; Mon, 18 Mar 2019 16:21:47 -0700 (PDT) Received: from lmenx29q.home (lfbn-1-4937-18.w90-104.abo.wanadoo.fr. [90.104.163.18]) by smtp.gmail.com with ESMTPSA id e193sm1687016wmg.18.2019.03.18.16.21.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Mar 2019 16:21:47 -0700 (PDT) From: Etienne Carriere To: buildroot@buildroot.org Date: Tue, 19 Mar 2019 00:21:04 +0100 Message-Id: <1552951269-16967-3-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> References: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> Subject: [Buildroot] [PATCH v2 3/8] boot/arm-trusted-firmware: support debug mode 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: Etienne Carriere , Ricardo Martincoski , Sergey Matyukevich MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When the trusted firmware is built with debug support (DEBUG defined), the generated images are located at a specific path. The non debug images are located in generated directory build//release/ while the debug images are located in generated directory build//debug/. This change introduces boolean BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG to define whether the release or debug configuration is used to build trusted firmware. Note that enabling trusted firmware debug support, i.e BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="... DEBUG=1 ..." without enabling BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG will fail since Buildroot will get generated files from the wrong path. Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - No change --- boot/arm-trusted-firmware/Config.in | 7 +++++++ boot/arm-trusted-firmware/arm-trusted-firmware.mk | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in index a1a0c54..9a152b9 100644 --- a/boot/arm-trusted-firmware/Config.in +++ b/boot/arm-trusted-firmware/Config.in @@ -136,4 +136,11 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES Additional parameters for the ATF build E.G. 'DEBUG=1 LOG_LEVEL=20' +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG + bool "Debug mode of the trusted firmware" + default n + help + Enable this directive if trusted firmware is built in debug + mode. + endif diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk index 0ea4c0e..68be00d 100644 --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk @@ -28,7 +28,13 @@ endif ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES = YES ARM_TRUSTED_FIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM)) + +ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG),y) +ARM_TRUSTED_FIRMWARE_MAKE_OPTS += DEBUG=1 +ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/debug +else ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release +endif ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \ CROSS_COMPILE="$(TARGET_CROSS)" \ From patchwork Mon Mar 18 23:21:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1058137 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="tzKtY7jp"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44NXJR1kSYz9s70 for ; Tue, 19 Mar 2019 10:21:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id CDCD687AA1; Mon, 18 Mar 2019 23:21:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PV+RXaVh4W-v; Mon, 18 Mar 2019 23:21:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 297F6879A6; Mon, 18 Mar 2019 23:21:54 +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 D41731BF281 for ; Mon, 18 Mar 2019 23:21:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D219F21538 for ; Mon, 18 Mar 2019 23:21:51 +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 oHK3WARzGg02 for ; Mon, 18 Mar 2019 23:21:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by silver.osuosl.org (Postfix) with ESMTPS id 4891021517 for ; Mon, 18 Mar 2019 23:21:50 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id w1so13030103wrp.2 for ; Mon, 18 Mar 2019 16:21:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=yXc/IfD+Cm4lcbW+ykrrEox+Q/61eAWaQZoQ2zIn+Uo=; b=tzKtY7jpUZADBAiP7UMIjbVdapxNj7LnYz4/t04LF0D4mWG3hLu1Y3f8tykfT7V7pX hyPcMiujEHeyxz0+/a/feSnFpR+zM4GQM/l0VfvvZ15N/7cpaKw6EsIWyw2miGaZ6DMB cEHaPzMgW2B1ZJYAK7xYM5t2bXL4crAZnwpW0CyIobby1kr4J4lwUTleD4lep2S0atIO oMMXMW9yqjMa0v4R1XZ9eTFXhknDdbxEYznLicj5BLS6WzynXIHKfhGyfgdZpNWn3gGU NuAHhiP3bh52Rln7UJ9nk5RZf2o8m4JhrTnDZdl+fHDd4PxMG+y3Wegq8n1oTzW4TrO1 0ErQ== 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; bh=yXc/IfD+Cm4lcbW+ykrrEox+Q/61eAWaQZoQ2zIn+Uo=; b=cOQeKNfsPTVx/hE37lj1q1CQywOQtk2ujlo2fFTipKLeMTVVnDsBcqb7Rk9DioD5qY aDNK2q8Owze2IrAsmlLIFaXjT8kI7oraRx0iTg8jgV+iL7W7Uh/xECP86qYAiSXfUY+L dwfxhQKCp6uP8GZ/hBDcEkIPWQl5S1A8+vk4f29VH6FZiltXKGmTNdo1d0+VfuwhlW+f BNxcClrOVTizIqfi4X4GYkJKuvJyVqWV3i18mxlms21NzosOhltV3LeIJJPjNuPZ8Hcj DADhigTwg2LqqUKP5Mj6RZY20DF8HoJxeXi80Bg/ig0PtCNxzrPAL+569gSG2r+Rd47W WaLA== X-Gm-Message-State: APjAAAUQ7uqc2yCs/gDDC/qfHptbCPq0bBjgGDPjMpqnvi14zkwjXVoz ky5Dt/CA2hHF5Fsaw5myZZOylMxwHmTLiw== X-Google-Smtp-Source: APXvYqzABH16OuNYKlmD21EaFV9SLy08fd0ChnqXUDDeU9/LnWL5xLmVC3aFumfvOhFa0U76odizpw== X-Received: by 2002:adf:dc08:: with SMTP id t8mr14814296wri.103.1552951308718; Mon, 18 Mar 2019 16:21:48 -0700 (PDT) Received: from lmenx29q.home (lfbn-1-4937-18.w90-104.abo.wanadoo.fr. [90.104.163.18]) by smtp.gmail.com with ESMTPSA id e193sm1687016wmg.18.2019.03.18.16.21.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Mar 2019 16:21:48 -0700 (PDT) From: Etienne Carriere To: buildroot@buildroot.org Date: Tue, 19 Mar 2019 00:21:05 +0100 Message-Id: <1552951269-16967-4-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> References: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> Subject: [Buildroot] [PATCH v2 4/8] boot/arm-trusted-firmware: support alternate image files 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: Etienne Carriere , Ricardo Martincoski , Sergey Matyukevich MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Some platform may generate specific boot image files instead of the generic files *.bin when building TF-A package. This change introduces new configuration directive for the arm-trusted-firmware boot package. BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_IMAGE_NAMES is boolean. When disabled, install boot image files are .../*.bin. When enabled, BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL_IMAGE_NAMES shall lists the names of the generated boot image files. Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - No change --- boot/arm-trusted-firmware/Config.in | 20 ++++++++++++++++++++ boot/arm-trusted-firmware/arm-trusted-firmware.mk | 14 +++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/boot/arm-trusted-firmware/Config.in b/boot/arm-trusted-firmware/Config.in index 9a152b9..bb88760 100644 --- a/boot/arm-trusted-firmware/Config.in +++ b/boot/arm-trusted-firmware/Config.in @@ -121,6 +121,26 @@ config BR2_TARGET_ARM_TRUSTED_FIRMWARE_OPTEE_AS_BL32 endchoice +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_IMAGE_NAMES + bool "Use custom binary boot image filenames" + help + If not set, build generates the boot image files with the + generic filename that is images with .bin extension. These + are copied to the output images/ directory. + + If enabled, use BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL_IMAGES + to list the generated file names. + +config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL_IMAGE_NAMES + string "Binary boot image filenames" + depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_IMAGE_NAMES + help + This is used when TF-A platform generates boot image files + with custom file names. When so, this should list the path + of the generated files location relatively to the package + build root directory. These files are copied to the output + images/ directory. + config BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33 bool "Use U-Boot as BL33" depends on BR2_TARGET_UBOOT diff --git a/boot/arm-trusted-firmware/arm-trusted-firmware.mk b/boot/arm-trusted-firmware/arm-trusted-firmware.mk index 68be00d..45c2311 100644 --- a/boot/arm-trusted-firmware/arm-trusted-firmware.mk +++ b/boot/arm-trusted-firmware/arm-trusted-firmware.mk @@ -135,6 +135,18 @@ define ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL_ELF endef endif +ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_IMAGE_NAMES),y) +define ARM_TRUSTED_FIRMWARE_BL_IMAGES_INSTALL + $(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL_IMAGE_NAMES)), \ + cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/ \ + ) +endef +else +define ARM_TRUSTED_FIRMWARE_BL_IMAGES_INSTALL + cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin $(BINARIES_DIR)/ +endef +endif + define ARM_TRUSTED_FIRMWARE_BUILD_CMDS $(ARM_TRUSTED_FIRMWARE_BUILD_FIPTOOL) $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \ @@ -143,7 +155,7 @@ define ARM_TRUSTED_FIRMWARE_BUILD_CMDS endef define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS - cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/*.bin $(BINARIES_DIR)/ + $(ARM_TRUSTED_FIRMWARE_BL_IMAGES_INSTALL) $(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL) $(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL_ELF) endef From patchwork Mon Mar 18 23:21:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1058136 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="VRHplaSo"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44NXJQ1M2pz9s6w for ; Tue, 19 Mar 2019 10:21:58 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D872385F8B; Mon, 18 Mar 2019 23:21:55 +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 hWW1nRwaXpqO; Mon, 18 Mar 2019 23:21:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 37A0085F69; Mon, 18 Mar 2019 23:21:55 +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 1DF6B1BF281 for ; Mon, 18 Mar 2019 23:21:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1B94286576 for ; Mon, 18 Mar 2019 23:21:52 +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 uzfhe+nCv8VN for ; Mon, 18 Mar 2019 23:21:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by whitealder.osuosl.org (Postfix) with ESMTPS id 565B586365 for ; Mon, 18 Mar 2019 23:21:51 +0000 (UTC) Received: by mail-wr1-f47.google.com with SMTP id y15so18964102wro.4 for ; Mon, 18 Mar 2019 16:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4qFCMMtQ1NRpEdRx+tAVPXEnagKR64kMOPsSMBkLiRc=; b=VRHplaSoxl1qCjOGXDhJnqgyM5u7OfV/cbpVP8fWEBq7LnH6Fmu6AYrMczV9qhqKgq fnIeVg3lG5cTqJ6gID1zRL2DBSwtwzsEO+4ncJRfg03nTUfVQvGZKecdGiF67fL0toNi qp08suHw6T/QRVAmV0BtoMHAELqT9bwbmbfJ8R1oeagpnpOH7VY8XS8cAhXa3U0UNb6g d11tYN9sX/y5tz6ZBJPdRglljU/kTWXemwS8Mk7e42PoIHCz6ICZgOCzcyHItsOgPXdK sM/zFEbsutz1LBAF5kSEMbmCQZIPz3zjRgUvsQRakjfJy2MF1f2urTl6n1HaCyrwQ3xC smdQ== 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; bh=4qFCMMtQ1NRpEdRx+tAVPXEnagKR64kMOPsSMBkLiRc=; b=QZhjUL15hByMaTByibZINWUevOJ7yuHCrslGeaDHz8RGOoclE/ZcTu6ym2yONhoRad 47B74ZD73JdZJuXrs6AfZLLpvFPY9oBIpoWJHcyhK8ZY1QFtiYXOJosCzxKZ5SRhm5m3 MDvypdU0mGH7ALSt72Y3UQmdlKzZXb6W5XxFXRJlpCx1z/vU3xcHcFSn9pWoxxKrHwS+ rtxVoaO94AH6RCmG54nIMwj0+pc0msPqhdSp26nToLkJBJ62Y4V4QJgbays0su63L9nZ JXHTEHa7KPT0WLOjmkEWoz7QdjHNjZ+DTeqjAKF4ABgEgme0QctjTy/mEnuTi05Z+Ucq d6ag== X-Gm-Message-State: APjAAAVjW6bYJAek0JMoDzO4QkxRciD+k1Pg351OyQRgB7PmrBsIo49p quV5qtBoIaGAtzh6Sd8gtlbsRCI38AG8Rg== X-Google-Smtp-Source: APXvYqyl2OL4phxM2HLRIeqLlYWrHj9cJAL0CT/X7U92WqoGPURljhLYf+oqjd509/oplfkrv/fFPQ== X-Received: by 2002:a5d:6849:: with SMTP id o9mr9838124wrw.166.1552951309773; Mon, 18 Mar 2019 16:21:49 -0700 (PDT) Received: from lmenx29q.home (lfbn-1-4937-18.w90-104.abo.wanadoo.fr. [90.104.163.18]) by smtp.gmail.com with ESMTPSA id e193sm1687016wmg.18.2019.03.18.16.21.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Mar 2019 16:21:49 -0700 (PDT) From: Etienne Carriere To: buildroot@buildroot.org Date: Tue, 19 Mar 2019 00:21:06 +0100 Message-Id: <1552951269-16967-5-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> References: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> Subject: [Buildroot] [PATCH v2 5/8] package/optee-test: fix dependency in TAs build 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: Etienne Carriere , Ricardo Martincoski , Sergey Matyukevich MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fix TA build command to build TA libraries before TAs. Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - New commit not in v1 series. --- package/optee-test/optee-test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/optee-test/optee-test.mk b/package/optee-test/optee-test.mk index 73accf3..abed09d 100644 --- a/package/optee-test/optee-test.mk +++ b/package/optee-test/optee-test.mk @@ -16,7 +16,7 @@ OPTEE_TEST_CONF_OPTS = -DOPTEE_TEST_SDK=$(OPTEE_OS_SDK) # Trusted Application are not built from CMake due to ta_dev_kit # dependencies. We must build and install them on target. define OPTEE_TEST_BUILD_TAS - $(foreach f,$(wildcard $(@D)/ta/*/Makefile), \ + $(foreach f,$(wildcard $(@D)/ta/*_lib/Makefile) $(wildcard $(@D)/ta/*/Makefile), \ $(TARGET_CONFIGURE_OPTS) \ $(MAKE) CROSS_COMPILE=$(TARGET_CROSS) \ TA_DEV_KIT_DIR=$(OPTEE_OS_SDK) \ From patchwork Mon Mar 18 23:21:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1058141 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bnedy/Nl"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44NXJb6HKCz9s6w for ; Tue, 19 Mar 2019 10:22:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 22D5687C14; Mon, 18 Mar 2019 23:22:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lRxCtfPlfQma; Mon, 18 Mar 2019 23:22:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 5342987B3E; Mon, 18 Mar 2019 23:22:00 +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 966481BF966 for ; Mon, 18 Mar 2019 23:21:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 93B108723C for ; Mon, 18 Mar 2019 23:21:54 +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 h8oLRNGxnXtc for ; Mon, 18 Mar 2019 23:21:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id 9E92486576 for ; Mon, 18 Mar 2019 23:21:52 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id u10so12116467wmj.5 for ; Mon, 18 Mar 2019 16:21:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Uoq1K8Swy+3CBDUn5vCYiIMYSIFHK97lC3YAdshjKg8=; b=bnedy/NlS3Zr72n3gnJvsyreXn0anMM4vmvA/+lXiOzpKy5EL5vn3AWPlUnjWLvF5s g7ujKCdovakUgcamCfM8s1iToyYU49cNLoZDbZ+3acqhBeDe9zh0yRYVbqi21obxS/a7 aKaeBWo8050yctNwmW7kGJab/XgnKsLBsevo/oE/CFpUvNoNTtbhjW55py1c5AyhV7Tq 6PBzaJkdYUqtwstoSr/aiI7VEMIjF5PaCYi6LuEybtWPLYPvdm+vVu+3UaSfwDgww7kd vvtZ12rvEw5QqzeIOm2BwV6ABZZC5N0FUVSZJwjtmn8ROXKcf3M+m5mhzn+dr/JvRJKS hU7g== 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; bh=Uoq1K8Swy+3CBDUn5vCYiIMYSIFHK97lC3YAdshjKg8=; b=qJImRpe8CGO4QDkOTxnuhbuE5c+X/0ARqWZOFBijxSxUMUzh0aYEZMaw54dXaQz5Ad iwq1qqdtbMVATCkO2l/ytA/UQhIiz6NnwgkU/sxQMtM568LiOoKC3Vad7RQy1A5KpxP6 qxoCIa/5gw4KxYCLQBZ8B5CbIg6ewRBgcv8VeMJxBbZ1TF3auJwOe8/1Iex8wDAKCrqc 4iyzwlUmMYtYfpa3Bjb3HsZdnsCCmEsG6jewzC9T1s98LCK9D6UzGQVwlO8oF6N5ouKP VEk0LiUSsJyn+JY7RzhxMgUlhL6tGeVNLyylxCZRoemMRkyZLC9CV2d43wsDfP4FJrw0 p9Pw== X-Gm-Message-State: APjAAAXqyJToqiqPIKjwfPeXN963u1ruW3p7+rx+itaczpwDL/Liekye C7ZErWTkuZeej1pdCQUM2PItVvuNozHMgw== X-Google-Smtp-Source: APXvYqzNKnk5VMqfd6pYnjrJnM4rdb43M37sx6QUsGC2vIxpcw5yggdX9lYjc/dg/Nbd4SBSV22JlA== X-Received: by 2002:a1c:40d6:: with SMTP id n205mr970166wma.146.1552951310844; Mon, 18 Mar 2019 16:21:50 -0700 (PDT) Received: from lmenx29q.home (lfbn-1-4937-18.w90-104.abo.wanadoo.fr. [90.104.163.18]) by smtp.gmail.com with ESMTPSA id e193sm1687016wmg.18.2019.03.18.16.21.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Mar 2019 16:21:50 -0700 (PDT) From: Etienne Carriere To: buildroot@buildroot.org Date: Tue, 19 Mar 2019 00:21:07 +0100 Message-Id: <1552951269-16967-6-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> References: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> Subject: [Buildroot] [PATCH v2 6/8] configs/qemu_armv7a_tz_virt: Armv7-A emulation with TrustZone services 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: Etienne Carriere , Ricardo Martincoski , Sergey Matyukevich MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This change introduces a Qemu board for an Armv7-A target executing with OP-TEE secure world services. The target Linux based normal world embeds the standard minimal filesystem with OP-TEE non-secure components embedded files from OP-TEE test, examples and benchmark packages. The Linux custom configuration is dumped from the vexpress_defconfig with few added fragments: OP-TEE driver and 9p for virtual filesystem to ease file manipulation and exchanges through Qemu virtfs support. U-Boot qemu_arm defconfig is modified with a configuration fragment to set boot command, enable semihosting and remove U-Boot persistent environment storage support. The standard way for booting OP-TEE with a non-secure world companion use the Arm Trusted Firmware-A as bootloader. OP-TEE OS provides the BL32 image and U-boot the BL33 image. The boot scenario is: TF-A bootloader (BL1/BL2) => OP-TEE (BL32) => U-boot (BL33). | Executes as secure | Secure | Execs as Non-secure | Loads BL32/BL33 in RAM | Jumps to BL33 | Always booted after | Jumps to BL32 once done | as Non-secure | secure world inits Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - Bump kernel to 4.19. - Use kernel defconfig and add optee and 9p as config fragments. - Remove ARM_ARCH_MAJOR from platform configuration directive BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES. --- board/qemu/armv7a-tz-virt/linux.fragment | 8 ++ board/qemu/armv7a-tz-virt/readme.txt | 145 +++++++++++++++++++++++++++++++ board/qemu/armv7a-tz-virt/u-boot.config | 7 ++ configs/qemu_armv7a_tz_virt_defconfig | 48 ++++++++++ 4 files changed, 208 insertions(+) create mode 100644 board/qemu/armv7a-tz-virt/linux.fragment create mode 100644 board/qemu/armv7a-tz-virt/readme.txt create mode 100644 board/qemu/armv7a-tz-virt/u-boot.config create mode 100644 configs/qemu_armv7a_tz_virt_defconfig diff --git a/board/qemu/armv7a-tz-virt/linux.fragment b/board/qemu/armv7a-tz-virt/linux.fragment new file mode 100644 index 0000000..8fca146 --- /dev/null +++ b/board/qemu/armv7a-tz-virt/linux.fragment @@ -0,0 +1,8 @@ +### Enable OP-TEE +CONFIG_TEE=y +CONFIG_OPTEE=y +### Enable 9P VFS +CONFIG_NET_9P=y +CONFIG_NET_9P_VIRTIO=y +CONFIG_9P_FS=y +CONFIG_9P_FS_POSIX_ACL=y diff --git a/board/qemu/armv7a-tz-virt/readme.txt b/board/qemu/armv7a-tz-virt/readme.txt new file mode 100644 index 0000000..c5b54dc --- /dev/null +++ b/board/qemu/armv7a-tz-virt/readme.txt @@ -0,0 +1,145 @@ +Board qemu_armv7a_tz_virt builds a Qemu Armv7-A target system with +OP-TEE running in the TrustZone secure wolrd setup and a Linux based +OS running in the non-secure wolrd. The board also builds the Qemu +host to run the Arm target emulation. + + make qemu_armv7a_tz_virt_defconfig + make + +BIOS used in the Qemu host is the Arm Trusted Firmware-A (TF-A). TF-A +uses Qemu semihosting file access to access boot image files. The +Qemu platform is quite specific for that in TF-A and one needs to +rename some image files and run the emulation from the image directory +for TF-A to boot the secure and non-secure world. + +I.e: + ln -s ./u-boot.bin output/images/bl33.bin + ln -s ./tee-header_v2.bin output/images/bl32.bin + ln -s ./tee-pager_v2.bin output/images/bl32_extra1.bin + ln -s ./tee-pageable_v2.bin output/images/bl32_extra2.bin + +Run the emulation from the output/images directory with: + + cd output/images && ../host/bin/qemu-system-arm \ + -machine virt -machine secure=on -cpu cortex-a15 \ + -smp 1 -s -m 1024 -d unimp \ + -serial stdio \ + -netdev user,id=vmnic -device virtio-net-device,netdev=vmnic \ + -semihosting-config enable,target=native \ + -bios bl1.bin + +The boot stage traces (if any) followed by the login prompt will appear +in the terminal that started Qemu. + +If you want to emulate more cores use "-smp {1|2|3|4}" to select the +number of cores. + +Note "-netdev user,id=vmnic -device virtio-net-device,netdev=vmnic" +brings virtfs support for file sharing with the hosted Linux OS. Board +Linux configuration file for armv7a-tz-virt enables the requiredresources. +BR2_PACKAGE_HOST_QEMU_VIRTFS=y build Qemu with required resources. + +Tested with QEMU 2.12.0 + +-- Boot Details -- + +TF-A is used as Qemu BIOS. Its BL1 image boots and load its BL2 image. In turn, this +image loads the OP-TEE secure world (Armv7-A BL32 stage) and the U-boot as non-secure +bootloader (BL33 stage). + +The Qemu natively host and loads in RAM the Qemu Arm target device tree. OP-TEE reads +and modifes its content according to OP-TEE configuration. + +Enable TF-A traces from LOG_LEVEL (I.e LOG_LEVEL=40) from +BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES. + +-- OP-TEE Traces -- + +Secure boot stages and/or secure runtime services may use a serial link for +their traces. + +The Arm Trusted Firmware outputs its traces on the Qemu standard (first) +serial interface. + +The OP-TEE OS uses the Qemu second serial interface. + +To get the OP-TEE OS traces one shall append a second -serial argument after +-serial stdio in the Qemu command line. I.e the following enables 2 serial +consoles over telnet connections: + + cd output/images && ../host/bin/qemu-system-arm \ + -machine virt -machine secure=on -cpu cortex-a15 \ + -smp 1 -s -m 1024 -d unimp \ + -serial telnet:127.0.0.1:1235,server \ + -serial telnet:127.0.0.1:1236,server \ + -netdev user,id=vmnic -device virtio-net-device,netdev=vmnic \ + -semihosting-config enable,target=native \ + -bios bl1.bin + +Qemu is now waiting for the telnet connection. From another shell, open a +telnet connection on the port for the U-boot and Linux consoles: + telnet 127.0.0.1 1235 + +and again for the secure console + telnet 127.0.0.1 1236 + +-- Using gdb -- + +One can debug the OP-TEE secure world using GDB through the Qemu host. +To do so, one can simply run the qemu-system-arm emulation then +run a GDB client and connect the Qemu internal GDB server. + +The example below assumes we run Qemu and the GDB client from the same +host computer. We use option -S of qemu-system-arm to make Qemu +waiting for the GDB continue instruction before booting the images. + +From a first shell: + cd output/images && ../host/bin/qemu-system-arm \ + -machine virt -machine secure=on -cpu cortex-a15 \ + -smp 1 -s -m 1024 -d unimp \ + -serial stdio \ + -netdev user,id=vmnic -device virtio-net-device,netdev=vmnic \ + -semihosting-config enable,target=native \ + -bios bl1.bin \ + -S + +From a second shell: + ./output/host/bin/arm-linux-gnueabihf-gd + GNU gdb (GNU Toolchain for the A-profile Architecture 8.2-2018-08 (arm-rel-8.23)) 8.1.1.20180704-git + Copyright (C) 2018 Free Software Foundation, Inc. + ... + For help, type "help". + Type "apropos word" to search for commands related to "word". + (gdb) + +From this GDB console, connect target, load OP-TEE core symbols, set a +breakpoint to its entry (__text_start) and start emulation: + + (gdb) target remote 127.0.0.1:1234 + (gdb) symbol-file ../build/optee_os-/out/arm/core/tee.elf + (gdb) hbreak __text_start + Hardware assisted breakpoint 1 at 0xe100000: file core/arch/arm/kernel/generic_entry_a32.S, line 246. + (gdb) cont + Continuing. + + Thread 1 hit Breakpoint 1, _start () at core/arch/arm/kernel/generic_entry_a32.S:246 + 246 bootargs_entry + (gdb) + + +Emulation has started, TF-A has loaded OP-TEE and U-boot images in memory and +has booted OP-TEE. Emulation stopped at OP-TEE core entry. + + +Note: Qemu hosts a GDB service listening to TCP port 1234, as set through +qemu-system-arm commandline option -s. + + +Note: GDB server used above (from image/host/bin) was built from Buildroot +using the following extra configuration directives: + + BR2_ENABLE_DEBUG=y + BR2_PACKAGE_GDB=y + BR2_PACKAGE_HOST_GDB=y + BR2_TOOLCHAIN_BUILDROOT_CXX=y + BR2_TOOLCHAIN_BUILDROOT_GLIBC=y diff --git a/board/qemu/armv7a-tz-virt/u-boot.config b/board/qemu/armv7a-tz-virt/u-boot.config new file mode 100644 index 0000000..fd74bf1 --- /dev/null +++ b/board/qemu/armv7a-tz-virt/u-boot.config @@ -0,0 +1,7 @@ +CONFIG_SYS_TEXT_BASE=0x60000000 +CONFIG_BOOTCOMMAND="fdt addr ${fdt_addr} && fdt resize 1000 && smhload zImage ${kernel_addr_r} && smhload rootfs.cpio.gz ${ramdisk_addr_r} ramdisk_addr_end && setenv bootargs console=ttyAMA0,115200 earlyprintk=serial,ttyAMA0,115200 && fdt chosen ${ramdisk_addr_r} ${ramdisk_addr_end} && bootz ${kernel_addr_r} - ${fdt_addr}" +CONFIG_SEMIHOSTING=y +# Drop flash accesses +CONFIG_ENV_IS_IN_FLASH=n +CONFIG_MTD=n +CONFIG_MTD_NOR_FLASH=n diff --git a/configs/qemu_armv7a_tz_virt_defconfig b/configs/qemu_armv7a_tz_virt_defconfig new file mode 100644 index 0000000..0c78270 --- /dev/null +++ b/configs/qemu_armv7a_tz_virt_defconfig @@ -0,0 +1,48 @@ +# Architecture +BR2_arm=y +BR2_cortex_a15=y +BR2_ARM_ENABLE_NEON=y +BR2_ARM_ENABLE_VFP=y +BR2_ARM_FPU_VFPV3D16=y +# System +BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0" +# Filesystems (support several boot config) +BR2_TARGET_ROOTFS_CPIO=y +BR2_TARGET_ROOTFS_CPIO_GZIP=y +BR2_TARGET_ROOTFS_EXT2=y +# Linux 4.16 series +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.16" +BR2_LINUX_KERNEL_DEFCONFIG="vexpress" +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/qemu/armv7a-tz-virt/linux.fragment" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="vexpress-v2p-ca15_a7" +# TF-A for booting OP-TEE secure and uboot/linux non secure +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/ARM-software/arm-trusted-firmware.git" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="v2.0" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="qemu" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_OPTEE_AS_BL32=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="BL32_RAM_LOCATION=tdram LOG_LEVEL=30" +#BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG=y +# OP-TEE components +BR2_TARGET_OPTEE_OS=y +BR2_TARGET_OPTEE_OS_PLATFORM="vexpress-qemu_virt" +BR2_TARGET_OPTEE_OS_ADDITIONAL_VARIABLES="CFG_TEE_CORE_LOG_LEVEL=2" +BR2_PACKAGE_OPTEE_CLIENT=y +BR2_PACKAGE_OPTEE_TEST=y +BR2_PACKAGE_OPTEE_EXAMPLES=y +BR2_PACKAGE_OPTEE_BENCHMARK=y +# U-boot for booting the dear Linux kernel +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="qemu_arm" +BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/qemu/armv7a-tz-virt/u-boot.config" +# Qemu emulator for the Arm target +BR2_PACKAGE_HOST_QEMU=y +BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y +BR2_PACKAGE_HOST_QEMU_VIRTFS=y From patchwork Mon Mar 18 23:21:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1058139 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ZC0yE5CD"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44NXJW0Mwxz9s6w for ; Tue, 19 Mar 2019 10:22:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0CF82878CD; Mon, 18 Mar 2019 23:22:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dIohaig6Up9r; Mon, 18 Mar 2019 23:21:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 7E58F878F1; Mon, 18 Mar 2019 23:21:59 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 84F531BF281 for ; Mon, 18 Mar 2019 23:21:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8077D85F61 for ; Mon, 18 Mar 2019 23:21:54 +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 4dH_zTU3WjhZ for ; Mon, 18 Mar 2019 23:21:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 7A89C85F8B for ; Mon, 18 Mar 2019 23:21:53 +0000 (UTC) Received: by mail-wr1-f45.google.com with SMTP id j9so4800378wrn.6 for ; Mon, 18 Mar 2019 16:21:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gFMXvmpxmeGXdCg5KuCKYp7H1uM6ZyjAtm2mNMPXCj0=; b=ZC0yE5CDrhu76VTBxk0o0Gcr8PtnuINkRhl7x5xHyDvYIIXCm6mynyzklOKQ8ZCUTD E7gJDRLo0XdzuEtU6mcimYt4tiKWhgmscI55Y3BAhqjWWTK93NPdUspxnfOMoc3aDTF1 wcPUAhIDkUrWGSUnEb0xL3ApxhA4ikW3e42KZVSQvFZ81EhC+9YV+GNUNCt6I+C3LnU6 OOkmis2jwJWL4jJkp3OxmZItebWxyNZ9XGpMuEkAsxR+8li/bEiK8aH8HK4VIfwkMHcc RErqlBtV1zMUK8vhWNN7IqGMTiiqQpZlBy6/rRbQ+amPeWnrU4oKP9iDlBmvxHuSQm1i czAQ== 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; bh=gFMXvmpxmeGXdCg5KuCKYp7H1uM6ZyjAtm2mNMPXCj0=; b=LGt+uyzoLw+xzQAip+kGnMUyfRK1lEQmCVFBwPnKfHsCTGjmN6qNFuCrUZ1QTe5Oic kDTcHklAq5Z3tHHdupf1cuyZmSQ2dwzqH4u8u168wlLgrQhZqsE3RFYoJlCt+HStKTKV xMgrcmDRPw7400VDEHjW2AkJV2VZwAIbny2QvgFgKdz6vFCZjLg7FTAS730douIhOHoL GdcibIZ1wAcFJaVQ5UdZFym9cbtSSu1XzQLLQQCTLkGXbTYF/r64OHq69xL2hhZFML53 0Sd1xvdEm3qpMPwZAk2uHgBAmvffFRjJb9m2jls2VcK6T7QzQnvKDgsqJ8/9N2oi8dNb CN1Q== X-Gm-Message-State: APjAAAVnRxJjIxEfpAO8b30kZvT6LGlbV1CxA8xYYn+xlItEF7ABQcQJ UJ7s8y3xF09NbASaZf4WbGzk1Ff93Ck6PA== X-Google-Smtp-Source: APXvYqzjqX4L1lxJnCUCfDSBC3uc8KFi1KVys2pfTy/9XZ72TV7ntb4RSMWPwiHoZVtl/pLht+5QXg== X-Received: by 2002:adf:b6a3:: with SMTP id j35mr14437799wre.25.1552951311814; Mon, 18 Mar 2019 16:21:51 -0700 (PDT) Received: from lmenx29q.home (lfbn-1-4937-18.w90-104.abo.wanadoo.fr. [90.104.163.18]) by smtp.gmail.com with ESMTPSA id e193sm1687016wmg.18.2019.03.18.16.21.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Mar 2019 16:21:51 -0700 (PDT) From: Etienne Carriere To: buildroot@buildroot.org Date: Tue, 19 Mar 2019 00:21:08 +0100 Message-Id: <1552951269-16967-7-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> References: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> Subject: [Buildroot] [PATCH v2 7/8] testing: test can use the locally generated qemu host tool 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: Etienne Carriere , Ricardo Martincoski , Sergey Matyukevich MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This change adds argument local to emulator boot method. When local is True, emulator.py runs the qemu host tool locally generated by the test. Otherwise the test uses the qemu host as found from PATH. Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - No commit not in v1 series. --- support/testing/infra/emulator.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/support/testing/infra/emulator.py b/support/testing/infra/emulator.py index 802e89d..5fbf213 100644 --- a/support/testing/infra/emulator.py +++ b/support/testing/infra/emulator.py @@ -1,5 +1,7 @@ import pexpect +import os + import infra @@ -8,6 +10,7 @@ class Emulator(object): def __init__(self, builddir, downloaddir, logtofile, timeout_multiplier): self.qemu = None self.downloaddir = downloaddir + self.builddir = builddir self.logfile = infra.open_log_file(builddir, "run", logtofile) # We use elastic runners on the cloud to runs our tests. Those runners # can take a long time to run the emulator. Use a timeout multiplier @@ -30,13 +33,22 @@ class Emulator(object): # # options: array of command line options to pass to Qemu # - def boot(self, arch, kernel=None, kernel_cmdline=None, options=None): + # local: if True, the locally built qemu host tool is used instead of a + # qemu host tool found from the PATH. + # + def boot(self, arch, kernel=None, kernel_cmdline=None, options=None, + local=None): if arch in ["armv7", "armv5"]: qemu_arch = "arm" else: qemu_arch = arch - qemu_cmd = ["qemu-system-{}".format(qemu_arch), + if local: + basedir = os.path.join(self.builddir, "host/bin/") + else: + basedir = "" + + qemu_cmd = [basedir + "qemu-system-{}".format(qemu_arch), "-serial", "stdio", "-display", "none"] From patchwork Mon Mar 18 23:21:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Carriere X-Patchwork-Id: 1058140 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="QI7gstyi"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44NXJX4HM6z9s6w for ; Tue, 19 Mar 2019 10:22:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 044BB872CF; Mon, 18 Mar 2019 23:22:03 +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 sGQx38U4YGnk; Mon, 18 Mar 2019 23:22:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 562B987234; Mon, 18 Mar 2019 23:22:01 +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 BB68A1BF281 for ; Mon, 18 Mar 2019 23:21:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B654287291 for ; Mon, 18 Mar 2019 23:21:56 +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 N+FDGKqLDkuP for ; Mon, 18 Mar 2019 23:21:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by whitealder.osuosl.org (Postfix) with ESMTPS id 7226C87248 for ; Mon, 18 Mar 2019 23:21:54 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id n9so14879428wrr.9 for ; Mon, 18 Mar 2019 16:21:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CDcLEHQxnQZlfsMmjecNEztRszzTG6Eya+49ZmmiShk=; b=QI7gstyiW9ClCGDU3yqY+32d1g27jBSYO95WDkDmM/nDRM9ozqwKYQkOs/Qeiof9sE CzTvr43hQ2s/d3C/+synHGwFL+WOhBUlmhmJeM2SnIWLJ9VOHsB93+JcJmV8GGk0T7dA NqfiBx/E0lIQJHRbvgLkkhhTIDi6xytglyvH4ZV1Sa3gahnRcM9l5vwuR5IP1aA1vFPs wdovckmFa08ZYUGVR/3uxTidbTigBfwpgi7Vj/z5QedGUAGR7zg0mFgJWOGKw4X0+bC6 zypRqlG6eMrxHLdXz+gbk8IJu1tNUOk5bztwhEwgqkpsQSYRd0jr2anWb40ZE4ChAtj0 gqew== 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; bh=CDcLEHQxnQZlfsMmjecNEztRszzTG6Eya+49ZmmiShk=; b=GQ9nzWuftVfFNFSz4i5d313z1Wnr4Yxy54plhnueQ/MTzUNONEHFWQNSu+b6Eyv+KT LLYeKUTfCz6CbCDEmtXR9u4glq86aTdUICuvUueVQaTUrJHwOes4CJTj4p9zTlSVGEkw xFWIrOlZ7bgRNEUroPLCwJCfXk9IgQTjkziMSpnHQB3g8GVOgxnxIhYkiX3wI8+kJwlZ IK8t/ePFXr1CM4JJv5VudtqzjV0ri6H1UiWVEK61KABMMV9Al+566FVVCpRfi1asIl4B fevJHg1BTl86o6VFDiURmJ40+W7BdVwoXioofvbH7HWAxwku9v81kkTbW5GDNTvYPAcU ST5A== X-Gm-Message-State: APjAAAVWtvYW127BAX5cDr77eyUAkfm79SBjDd/LwjTwVVLlom+rnw+g MEwnJ9ivSxNnUi/vrg48TD7e4SbOXvX5RA== X-Google-Smtp-Source: APXvYqzF+B11chIBtYzThShCV35m62x4qYx2GrwgSvqcms5Ia8sqwJ8ikvek+/phvrmOgaTvVkkjbQ== X-Received: by 2002:a5d:6252:: with SMTP id m18mr13588194wrv.199.1552951312873; Mon, 18 Mar 2019 16:21:52 -0700 (PDT) Received: from lmenx29q.home (lfbn-1-4937-18.w90-104.abo.wanadoo.fr. [90.104.163.18]) by smtp.gmail.com with ESMTPSA id e193sm1687016wmg.18.2019.03.18.16.21.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Mar 2019 16:21:52 -0700 (PDT) From: Etienne Carriere To: buildroot@buildroot.org Date: Tue, 19 Mar 2019 00:21:09 +0100 Message-Id: <1552951269-16967-8-git-send-email-etienne.carriere@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> References: <1552951269-16967-1-git-send-email-etienne.carriere@linaro.org> Subject: [Buildroot] [PATCH v2 8/8] support/testing: test_optee.py: test optee boot and testsuite 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: Etienne Carriere , Ricardo Martincoski , Sergey Matyukevich MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Run a Qemu emulation over qemu_armv7a_tz_virt_defconfig and run the embedded OP-TEE regression test suite (xtest). Tool xtest dumps traces that contain '# ' (hash + space) which corrupts infra/emulator.py sequence which use such traces to find shell prompt when command is completed. To overcome the issue the xtest traces are shown only if the test failed. One can run the test from something like: $> ./support/testing/run-tests \ -o output/optee-runtest -d output/dwl \ tests.package.test_optee Signed-off-by: Etienne Carriere --- Changes v1 -> v2: - Add argument local=True to test emulator to use the qemu host built from test configuration. - Fix typo in trace "Silent test takes a while, be patient..." --- support/testing/tests/package/test_optee.py | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 support/testing/tests/package/test_optee.py diff --git a/support/testing/tests/package/test_optee.py b/support/testing/tests/package/test_optee.py new file mode 100644 index 0000000..fdf391a --- /dev/null +++ b/support/testing/tests/package/test_optee.py @@ -0,0 +1,40 @@ +import os + +import infra.basetest + + +class TestOptee(infra.basetest.BRTest): + + with open(os.path.join(os.getcwd(), 'configs/qemu_armv7a_tz_virt_defconfig'), 'r') as config_file: + config = "".join(line for line in config_file if line[:1]!='#') + \ + """ + BR2_TOOLCHAIN_EXTERNAL=y + """ + + def test_run(self): + qemu_options = ['-machine', 'virt,secure=on'] + qemu_options.extend(['-cpu', 'cortex-a15']) + qemu_options.extend(['-m', '1024']) + qemu_options.extend(['-semihosting-config', 'enable,target=native']) + qemu_options.extend(['-bios', 'bl1.bin']) + + # Prepare env for Qemu/armv7a to find the boot images + os.chdir(os.path.join(self.builddir, 'images')) + if not os.path.exists('bl33.bin'): + os.symlink('u-boot.bin', 'bl33.bin') + if not os.path.exists('bl32.bin'): + os.symlink('tee-header_v2.bin', 'bl32.bin') + if not os.path.exists('bl32_extra1.bin'): + os.symlink('tee-pager_v2.bin', 'bl32_extra1.bin') + if not os.path.exists('bl32_extra2.bin'): + os.symlink('tee-pageable_v2.bin', 'bl32_extra2.bin') + + self.emulator.boot(arch='armv7', options=qemu_options, local=True) + self.emulator.login() + + # Trick test trace since it prints "# " and corrupts emulator run method + # Print test trace only if test fails. + cmd = 'echo "Silent test takes a while, be patient..."; ' + \ + 'xtest -t regression > /tmp/xtest.log || (cat /tmp/xtest.log && false)' + output, exit_code = self.emulator.run(cmd, timeout=240) + self.assertEqual(exit_code, 0)