From patchwork Fri Jan 22 01:14:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 60116 Delivered-To: patches@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp336158lbb; Thu, 21 Jan 2016 17:14:49 -0800 (PST) X-Received: by 10.202.48.6 with SMTP id w6mr220227oiw.97.1453425289397; Thu, 21 Jan 2016 17:14:49 -0800 (PST) Return-Path: Received: from mail-oi0-x233.google.com (mail-oi0-x233.google.com. [2607:f8b0:4003:c06::233]) by mx.google.com with ESMTPS id w2si3460652oia.30.2016.01.21.17.14.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jan 2016 17:14:49 -0800 (PST) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c06::233 as permitted sender) client-ip=2607:f8b0:4003:c06::233; Authentication-Results: mx.google.com; spf=pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c06::233 as permitted sender) smtp.mailfrom=al.stone@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-oi0-x233.google.com with SMTP id w75so38184846oie.0 for ; Thu, 21 Jan 2016 17:14:49 -0800 (PST) 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=RNC13pK1RPd3BhqFGpsiAlYshGKmzeF72nM2PMmxQvk=; b=LgqNzB7fg2tHhn5V2GAcu+R6Pw7Krr1Ka+86fSfEW3gkqeyWItvmE2CBMVC2vmDONp vtet2avXWTiSQxJqsVaAJkGamRaKilu1QMQdTCNgYk2G6p9Tk1Y+vy3ezV1O8KG/zz8k S8DAfPpUQ1dVwyrz+U4+otJ41rEO5y74+5hRo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RNC13pK1RPd3BhqFGpsiAlYshGKmzeF72nM2PMmxQvk=; b=V1+aNocG2x1DcmC4Pt48PjDLYnqC6HYhD4ZGu9J2evMPjg5zcnr+RqMhSUF1IGxpqf 2CyfJo78VmHpc4vMNBM9eiGvqpEXJewCjhufTEZqZOG3Q5qd/JoehXO79netKkMqZxrO QI3xjxSts9UNPVdNBBKk/f/axsacCfT/Op+Jd82uf5r/zsHwppeaV7JrYUQ2A/wktqXn dzZUNlO6wdNJsbq9BuBAC27++Ne426DwHvWwb0lYiYKw2VHWrWxLmKGXrEqoqmVrho9k Mn1xIXk3WLUcI5+TQGz7eHlcvLV9Y+vAUmfq2sO1GFuGqJIs14xjr5JmjcTZFbi6IM42 n8xg== X-Gm-Message-State: AG10YOSyswzKlkyCDKvoZdDZKDhAN9BW74+roNQX95xX01loB83mQU4eQpangAQPQyYXkZHsWLI= X-Received: by 10.202.80.201 with SMTP id e192mr265296oib.14.1453425289080; Thu, 21 Jan 2016 17:14:49 -0800 (PST) Return-Path: Received: from fidelio.ahs3 (c-50-134-239-249.hsd1.co.comcast.net. [50.134.239.249]) by smtp.googlemail.com with ESMTPSA id mj1sm1921252oeb.17.2016.01.21.17.14.46 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jan 2016 17:14:47 -0800 (PST) From: Al Stone To: fwts-devel@lists.ubuntu.com Cc: linaro-acpi@lists.linaro.org, patches@linaro.org, Al Stone Subject: [PATCH 3/5] ACPI tables: when bodging up an RSDP, do the right thing for the arch Date: Thu, 21 Jan 2016 18:14:18 -0700 Message-Id: <1453425260-21576-4-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1453425260-21576-1-git-send-email-al.stone@linaro.org> References: <1453425260-21576-1-git-send-email-al.stone@linaro.org> If it is necessary to create an RSDP table because there is none that can be read, add in only the RSDT or XSDT pointers as needed. For x86, it can be either, but for arm64 it should only be the XSDT address that is used in the RSDP. Signed-off-by: Al Stone --- src/lib/src/fwts_acpi_tables.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) -- 2.5.0 diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c index 0191b6b..83bd1dd 100644 --- a/src/lib/src/fwts_acpi_tables.c +++ b/src/lib/src/fwts_acpi_tables.c @@ -1101,14 +1101,17 @@ static int fwts_acpi_load_tables_fixup(fwts_framework *fw) } /* Now we have all the tables, final fix up is required */ - if (rsdp->rsdt_address != rsdt_fake_addr) { - rsdp->rsdt_address = rsdt_fake_addr; - redo_rsdp_checksum = true; - } - if ((rsdp->revision > 0) && (rsdp->length >= 36) && - (rsdp->xsdt_address != xsdt_fake_addr)) { - rsdp->xsdt_address = xsdt_fake_addr; - redo_rsdp_checksum = true; + if (fw->target_arch == FWTS_ARCH_ARM64) { + if ((rsdp->revision > 0) && (rsdp->length >= 36) && + (rsdp->xsdt_address != xsdt_fake_addr)) { + rsdp->xsdt_address = xsdt_fake_addr; + redo_rsdp_checksum = true; + } + } else { + if (rsdp->rsdt_address != rsdt_fake_addr) { + rsdp->rsdt_address = rsdt_fake_addr; + redo_rsdp_checksum = true; + } } /* And update checksum if we've updated the rsdp */ if (redo_rsdp_checksum) {