From patchwork Tue Feb 9 23:12:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 61605 Delivered-To: patches@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2323826lbl; Tue, 9 Feb 2016 15:13:21 -0800 (PST) X-Received: by 10.60.117.102 with SMTP id kd6mr32339937oeb.73.1455059601657; Tue, 09 Feb 2016 15:13:21 -0800 (PST) Return-Path: Received: from mail-ob0-x22d.google.com (mail-ob0-x22d.google.com. [2607:f8b0:4003:c01::22d]) by mx.google.com with ESMTPS id ed4si215385obb.35.2016.02.09.15.13.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Feb 2016 15:13:21 -0800 (PST) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c01::22d as permitted sender) client-ip=2607:f8b0:4003:c01::22d; Authentication-Results: mx.google.com; spf=pass (google.com: domain of al.stone@linaro.org designates 2607:f8b0:4003:c01::22d as permitted sender) smtp.mailfrom=al.stone@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-ob0-x22d.google.com with SMTP id ba1so3641286obb.3 for ; Tue, 09 Feb 2016 15:13:21 -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=+hcdY9xaY8FeadbYymkIYsbyHcks2sIP88+SexHmZVc=; b=Le7qtn00wrcNS46W33J5KcmzZ51mysHECKeFI+IxGzXWbn06NKng/xhUCptgI4KQsb c7DH3zDQnvyreiicRDSd+Hpg9/wyTumYO9Q/Ql7kxKpClytpwuocLaOWOC2XwdDeDenY HYQ7CYVh/RSoi57/ZzsfxUBdn8y6vCU9WXXX4= 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=+hcdY9xaY8FeadbYymkIYsbyHcks2sIP88+SexHmZVc=; b=fto9QDGETlMpspuXKy75sOPAbpJODKtZ18SbylgUvrdFfilHXszGxrwrCuXNRgKYk0 4VMvCdPsEvRTVcvrpK6HWUx0el0hngOnwrTyoyuJ0KYL4N1u1Yoe0m1oKr8bd/6KEGSk f63TauMlBUuCK0z0gFyLw112CdbGpWWy8pldu/+1K0DEdaOJTkS6iHseJUOSs/c2BHV6 fI42lOE8eX0yngwAK6+0wS9aaC/XlBa2NUYHRWuHaKUpElRaUnyzXDbFzvMHcnYUqLaM FU9dQriqxyskFD/9gkUngY1hekSByQZws/JpKEYNY9megsjKSNN6xclLopG7LYVeA5oX Ii2g== X-Gm-Message-State: AG10YOQP2Oo43X3aZU8ExTW7EwmN7d7szxYM//E4ysBcTZh2cBfbINTAo3EJIqlA+7WXg8s3kXw= X-Received: by 10.60.227.74 with SMTP id ry10mr32202030oec.48.1455059601337; Tue, 09 Feb 2016 15:13:21 -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 q8sm203282oep.2.2016.02.09.15.13.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Feb 2016 15:13:19 -0800 (PST) From: Al Stone To: fwts-devel@lists.ubuntu.com Cc: linaro-acpi@lists.linaro.org, patches@linaro.org, Al Stone Subject: [PATCH v2 3/5] ACPI tables: when bodging up an RSDP, do the right thing for the arch Date: Tue, 9 Feb 2016 16:12:55 -0700 Message-Id: <1455059577-7100-4-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455059577-7100-1-git-send-email-al.stone@linaro.org> References: <1455059577-7100-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 | 25 +++++++++++++++++-------- 1 file changed, 17 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..59fd4ba 100644 --- a/src/lib/src/fwts_acpi_tables.c +++ b/src/lib/src/fwts_acpi_tables.c @@ -1101,14 +1101,23 @@ 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; + } + + if ((rsdp->revision > 0) && (rsdp->length >= 36) && + (rsdp->xsdt_address != xsdt_fake_addr)) { + rsdp->xsdt_address = xsdt_fake_addr; + redo_rsdp_checksum = true; + } } /* And update checksum if we've updated the rsdp */ if (redo_rsdp_checksum) {