From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by mx.groups.io with SMTP id smtpd.web10.3407.1588236590069251915 for ; Thu, 30 Apr 2020 01:49:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WQiSWxRZ; spf=pass (domain: gmail.com, ip: 209.85.160.194, mailfrom: andrey.warkentin@gmail.com) Received: by mail-qt1-f194.google.com with SMTP id i68so4312681qtb.5 for ; Thu, 30 Apr 2020 01:49:49 -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; bh=6nlcFC0ryxrfsNEqbCKEDQGMpUZGLxVxGyQCCBhhaHA=; b=WQiSWxRZhjnBqP6sXnx3p6jaxnv9mY3guRxmBNoXdMuQfgP+LQW9D6vv/peU0wC93E kVVnxt1Ep/2mSfTYVdVqxaxgPPoGRevdw4eDMYqhOBOVCbVQiPOovBMqTfnVY/BQIa2M Pia5/JUQIoKgxyPW9NQk+/5zJOl7WHmEw73pIna64s/c70t21qTuhu1RlNElUL05oYz3 IgDX0hdBymakO3tkPtlemU1PuKGAMFlktBDuRq8Iz3/gxEHi9kFz1gakSbNXkDYnpGGx Jru6ncPSzKcjLVhf11KRX4InT8JfFJOzojP50BvJPYbAiMKZBLs1MWgmITVBJ+uuZC24 dKtw== 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=6nlcFC0ryxrfsNEqbCKEDQGMpUZGLxVxGyQCCBhhaHA=; b=mwxkIgmqqvnGPCznHxfGc17YEVfz/86R3BwnWxJrhIlYeWub+2J5pFeJ5qDNHnRs8s sIhb7xmSNJMsst9W3VfG6m9LMyVjMjlwUXqN2E2QFhqUKhH2Kxt5PFSSLPpATJWvoFbB yqaTJOxHPYL+YhB3VTIwOj2/OcBZuIGpM9gFwyNf6tO1guFos4nWqrz93DdTXEVh8evn 2HB4nztgL3c/x3zS+TXBGKQyXY19Fsqtc78OTMLY5Doa4DfmVFDIIAqFSI7pjN2SM7cj riCiPRa2S+v4kbdLUNyrwSBqH3Gg0FBmNYey2CjyjTY63DXn2f7wRkfYZJ2n/iCS3iXJ XtCA== X-Gm-Message-State: AGi0Pua6GnbpW8r6mgvi4kCfTkQ6tnD2e7yH13FrJmX1SppHcszji7hI 15jbnTDmpZsrMOY8pubXMwqlzngYzgY= X-Google-Smtp-Source: APiQypI/AKG5RrJHskH/rh15w658v3AMQoMW5jwI60tjGdUZbXOH9u7B+xkiIfbx/33zrNPVhyzR/Q== X-Received: by 2002:ac8:35cc:: with SMTP id l12mr2465127qtb.291.1588236589014; Thu, 30 Apr 2020 01:49:49 -0700 (PDT) Return-Path: Received: from localhost.localdomain (c-98-214-99-181.hsd1.il.comcast.net. [98.214.99.181]) by smtp.gmail.com with ESMTPSA id o12sm1347105qki.103.2020.04.30.01.49.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 01:49:48 -0700 (PDT) From: "Andrei Warkentin" To: devel@edk2.groups.io Cc: ard.biesheuvel@arm.com, leif@nuviainc.com, pete@akeo.ie, philmd@redhat.com Subject: [edk2-platforms][PATCH 1/1] Platform/RPi3: allow overriding TF-A binaries during build Date: Thu, 30 Apr 2020 01:49:39 -0700 Message-Id: <20200430084939.51592-1-andrey.warkentin@gmail.com> X-Mailer: git-send-email 2.17.1 For PFTF developers working on the firmware, being able to use a local TF-A build without extra extra copy operations ends up being very helpful. This can be accomplished via a TFA_BUILD_ARTIFACTS option passed to the edk2 build tool. If/when the Pi 3 and 4 DSC/FDFs become unified, this will be even more important to trivially perform a full clean upstream build for either platform, without having to worry about different TF-A deliverables - Pi 4 uses bl31.bin, while Pi 3 uses fip.bin and bl1.bin. This is like the Pi 4 patch that went in a month ago or so. Signed-off-by: Andrei Warkentin --- Platform/RaspberryPi/RPi3/RPi3.dsc | 16 ++++++++++++++++ Platform/RaspberryPi/RPi3/RPi3.fdf | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3/RPi3.dsc index 54ebfdfb..bb5e9b99 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -33,6 +33,22 @@ DEFINE INCLUDE_TFTP_COMMAND = FALSE DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x8000004F +!ifndef TFA_BUILD_ARTIFACTS + # + # Default TF-A binaries checked into edk2-non-osi. + # + DEFINE TFA_BUILD_BL1 = Platform/RaspberryPi/$(PLATFORM_NAME)/TrustedFirmware/bl1.bin + DEFINE TFA_BUILD_FIP = Platform/RaspberryPi/$(PLATFORM_NAME)/TrustedFirmware/fip.bin +!else + # + # Usually we use the checked-in binaries, but for developers working + # on the firmware, being able to use a local TF-A build without extra copy + # operations ends up being very helpful. + # + DEFINE TFA_BUILD_BL1 = $(TFA_BUILD_ARTIFACTS)/bl1.bin + DEFINE TFA_BUILD_FIP = $(TFA_BUILD_ARTIFACTS)/fip.bin +!endif + ################################################################################ # # Library Class section - list of all Library Classes needed by this Platform. diff --git a/Platform/RaspberryPi/RPi3/RPi3.fdf b/Platform/RaspberryPi/RPi3/RPi3.fdf index e467b5cd..11e3f5a2 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.fdf +++ b/Platform/RaspberryPi/RPi3/RPi3.fdf @@ -51,7 +51,7 @@ NumBlocks = 0x200 # ATF primary boot image # 0x00000000|0x00010000 -FILE = Platform/RaspberryPi/$(PLATFORM_NAME)/TrustedFirmware/bl1.bin +FILE = $(TFA_BUILD_BL1) # # DTB. @@ -63,7 +63,7 @@ DATA = { 0x00 } # ATF secondary boot image in FIP format (BL2 + BL31) # 0x00020000|0x00010000 -FILE = Platform/RaspberryPi/$(PLATFORM_NAME)/TrustedFirmware/fip.bin +FILE = $(TFA_BUILD_FIP) # # UEFI image -- 2.17.1