From patchwork Mon Jul 8 19:18:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1129301 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Mke9NBTw"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45jG5p1QJkz9sDB for ; Tue, 9 Jul 2019 05:41:02 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id DE858C21E75; Mon, 8 Jul 2019 19:29:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8FDF2C21E68; Mon, 8 Jul 2019 19:21:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 38771C21ECA; Mon, 8 Jul 2019 19:21:17 +0000 (UTC) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by lists.denx.de (Postfix) with ESMTPS id E104DC21DCA for ; Mon, 8 Jul 2019 19:21:13 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id f4so22332438ioh.6 for ; Mon, 08 Jul 2019 12:21:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2Zw9WR+oiGH7tGP+dfdItFFAGuQq8ZOj0h+PASKm3Kw=; b=Mke9NBTwuMtDzF6c8S6xqZPBSzWsBi8zKzrOmNgoj2PFl0J3+gUdw4ycllW06EojXR agU1u1I85UoCdOsI7iB+mbPy/G5m6n0siNwf+llxBS/sWFPNSFgkIpyBCtaNWu3u0ocC KZUwNdU8CIwMsn9FctFv5Rnxl56HE3h9nx5xc= 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=2Zw9WR+oiGH7tGP+dfdItFFAGuQq8ZOj0h+PASKm3Kw=; b=lz4ntmxOu7xBwNi0+ymqCAigUVorzT2kF9SqkzMR0s+33FUdwvnjo4yfHWwxWrflv5 LdsMALZUCB6LIXRROV4Ab1dTlwl2pdbN3wB69xwOYvV024crC01zmyfB0N3RbI8SBuSU MmuKyUKtnmUcxN5k4sZoTFU9LDzUJsD9h04nrRnsH/OPR5fwDMkt+h+SrIIYxklslyDA 73hytmq+ylTWEQXVpI57NLb9wE8S9JIek92gHugUK0mgolHaI9j0OiLPhA8K8VgsrrAr /wYM2QNzA4LN6qMiW5j1Jk/VAVmqKEasTKzWfgGGE9v2SCV+rYsAbFbfgH9YKYDBKKTT 7Nqg== X-Gm-Message-State: APjAAAWY0MOywqb38dbjvVuIFQ3GG/StIGiteTyEw5tHU94uK1nt9glF H9VYTMOY4dJvpfALU+zggYJBL7nokU0= X-Google-Smtp-Source: APXvYqyjfDY3I2CAcM+ev1H29dqsn0IFVCdL3dcLrRyh2yM6mDPfWBT47SkxVllDSMU0jDxQ2Hkh7g== X-Received: by 2002:a5d:8252:: with SMTP id n18mr15761211ioo.230.1562613672765; Mon, 08 Jul 2019 12:21:12 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id j1sm15545094iop.14.2019.07.08.12.21.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 12:21:12 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 8 Jul 2019 13:18:38 -0600 Message-Id: <20190708191856.138863-20-sjg@chromium.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190708191856.138863-1-sjg@chromium.org> References: <20190708191856.138863-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH v2 19/37] binman: Don't assume there is an ME region X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present having a descriptor means that there is an ME (Intel Management Engine) entry as well. The descriptor provides the ME location and assumes that it is present. For some SoCs this is not true. Before providing the location of a potentially non-existent entry, check if it is present. Update the comment in the ME entry also. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- Changes in v2: None tools/binman/README.entries | 2 ++ tools/binman/entry.py | 9 +++++++++ tools/binman/etype/intel_descriptor.py | 10 +++++++--- tools/binman/etype/intel_me.py | 2 ++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/tools/binman/README.entries b/tools/binman/README.entries index 357946d6305..702fc9fda08 100644 --- a/tools/binman/README.entries +++ b/tools/binman/README.entries @@ -206,6 +206,8 @@ does not directly execute code in the ME binary. A typical filename is 'me.bin'. +The position of this entry is generally set by the intel-descriptor entry. + See README.x86 for information about x86 binary blobs. diff --git a/tools/binman/entry.py b/tools/binman/entry.py index e8d0adec1e9..7ead997e0fd 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -544,3 +544,12 @@ features to produce new behaviours. # the data grows. This should not fail, but check it to be sure. if not self.ObtainContents(): self.Raise('Cannot obtain contents when expanding entry') + + def HasSibling(self, name): + """Check if there is a sibling of a given name + + Returns: + True if there is an entry with this name in the the same section, + else False + """ + return name in self.section.GetEntries() diff --git a/tools/binman/etype/intel_descriptor.py b/tools/binman/etype/intel_descriptor.py index 661063457ed..65ba2391e69 100644 --- a/tools/binman/etype/intel_descriptor.py +++ b/tools/binman/etype/intel_descriptor.py @@ -60,6 +60,10 @@ class Entry_intel_descriptor(Entry_blob): for i in range(MAX_REGIONS): self._regions.append(Region(self.data, frba, i)) - # Set the offset for ME only, for now, since the others are not used - return {'intel-me': [self._regions[REGION_ME].base, - self._regions[REGION_ME].size]} + # Set the offset for ME (Management Engine) only, for now, since the + # others are not used + info = {} + if self.HasSibling('intel-me'): + info['intel-me'] = [self._regions[REGION_ME].base, + self._regions[REGION_ME].size] + return info diff --git a/tools/binman/etype/intel_me.py b/tools/binman/etype/intel_me.py index 247c5b33866..c932ec52225 100644 --- a/tools/binman/etype/intel_me.py +++ b/tools/binman/etype/intel_me.py @@ -22,6 +22,8 @@ class Entry_intel_me(Entry_blob): A typical filename is 'me.bin'. + The position of this entry is generally set by the intel-descriptor entry. + See README.x86 for information about x86 binary blobs. """ def __init__(self, section, etype, node):