| Message ID | 1455059577-7100-4-git-send-email-al.stone@linaro.org |
|---|---|
| State | Accepted |
| Headers | show |
On 2016年02月10日 07:12, Al Stone wrote: > 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 <al.stone@linaro.org> > --- > src/lib/src/fwts_acpi_tables.c | 25 +++++++++++++++++-------- > 1 file changed, 17 insertions(+), 8 deletions(-) > > 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) { > Acked-by: Ivan Hu <ivan.hu@canonical.com>
On 09/02/16 23:12, Al Stone wrote: > 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 <al.stone@linaro.org> > --- > src/lib/src/fwts_acpi_tables.c | 25 +++++++++++++++++-------- > 1 file changed, 17 insertions(+), 8 deletions(-) > > 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) { > Acked-by: Colin Ian King <colin.king@canonical.com>
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) {
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 <al.stone@linaro.org> --- src/lib/src/fwts_acpi_tables.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-)