blob: 05660e41a2ea2d3b00bc8f56763aaf783f95c142 [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Sample ACPI table dumps for different devices.
#ifndef ZIRCON_KERNEL_LIB_ACPI_LITE_TEST_DATA_H_
#define ZIRCON_KERNEL_LIB_ACPI_LITE_TEST_DATA_H_
#include <zircon/types.h>
#include <fbl/span.h>
// A set of ACPI tables for a single device.
struct AcpiTableSet {
// The list of tables.
//
// Each entry consists of a block of data located at a particular physical address.
struct Table {
zx_paddr_t phys_addr;
fbl::Span<const uint8_t> data;
};
fbl::Span<const Table> tables;
// Physical address of the RSDP as provided by the bootloader, or 0 if
// auto-discovery should take place on the platform.
zx_paddr_t rsdp;
};
// ACPI tables from QEMU emulator version 5.0.0.
inline constexpr AcpiTableSet kQemuTables = {
.tables =
(AcpiTableSet::Table[]){
{
// RSD PTR
.phys_addr = 0x000f'5860,
.data =
(uint8_t[]){
0x52, 0x53, 0x44, 0x20, 0x50, 0x54, 0x52, 0x20, 0xaf, 0x42,
0x4f, 0x43, 0x48, 0x53, 0x20, 0x00, 0x04, 0x22, 0xfe, 0x7f,
},
},
{
// RSDT
.phys_addr = 0x7ffe'2204,
.data =
(uint8_t[]){
0x52, 0x53, 0x44, 0x54, 0x34, 0x00, 0x00, 0x00, 0x01, 0x8b, 0x42,
0x4f, 0x43, 0x48, 0x53, 0x20, 0x42, 0x58, 0x50, 0x43, 0x52, 0x53,
0x44, 0x54, 0x01, 0x00, 0x00, 0x00, 0x42, 0x58, 0x50, 0x43, 0x01,
0x00, 0x00, 0x00, 0x0c, 0x20, 0xfe, 0x7f, 0x00, 0x21, 0xfe, 0x7f,
0x90, 0x21, 0xfe, 0x7f, 0xc8, 0x21, 0xfe, 0x7f,
},
},
{
// HPET
.phys_addr = 0x7ffe200c,
.data =
(uint8_t[]){
0x48, 0x50, 0x45, 0x54, 0x38, 0x00, 0x00, 0x00, 0x01, 0x03, 0x42, 0x4f,
0x43, 0x48, 0x53, 0x20, 0x42, 0x58, 0x50, 0x43, 0x48, 0x50, 0x45, 0x54,
0x01, 0x00, 0x00, 0x00, 0x42, 0x58, 0x50, 0x43, 0x01, 0x00, 0x00, 0x00,
0x01, 0xa2, 0x86, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xfe,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
},
},
},
.rsdp = 0xf'5860,
};
// ACPI tables provided by Fuchsia's Hypervisor (//src/virtualization).
inline constexpr AcpiTableSet kFuchsiaHypervisor = {
.tables =
(AcpiTableSet::Table[]){
{
// RSD PTR
.phys_addr = 0xe'0000,
.data =
(uint8_t[]){
0x52, 0x53, 0x44, 0x20, 0x50, 0x54, 0x52, 0x20, 0x0d, 0x5a,
0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x0e, 0x00,
},
},
{
// RSDT
.phys_addr = 0xe'0014,
.data =
(uint8_t[]){
0x52, 0x53, 0x44, 0x54, 0x30, 0x00, 0x00, 0x00, 0x01, 0x42, 0x5a, 0x58,
0x00, 0x00, 0x00, 0x00, 0x5a, 0x58, 0x20, 0x41, 0x43, 0x50, 0x49, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x44, 0x00, 0x0e, 0x00, 0xf2, 0x02, 0x0e, 0x00, 0x4a, 0x03, 0x0e, 0x00,
},
},
},
.rsdp = 0xe'0000,
};
// ACPI tables from an Intel NUC 7i5DN.
inline constexpr AcpiTableSet kIntelNuc7i5dnTables = {
.tables =
(AcpiTableSet::Table[]){
{
// RSD PTR
.phys_addr = 0x7fa2'9000,
.data =
(uint8_t[]){
0x52, 0x53, 0x44, 0x20, 0x50, 0x54, 0x52, 0x20, 0x8a, 0x49, 0x4e, 0x54,
0x45, 0x4c, 0x00, 0x02, 0x28, 0x90, 0xa2, 0x7f, 0x24, 0x00, 0x00, 0x00,
0xc0, 0x90, 0xa2, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00,
},
},
{
// XSDT
.phys_addr = 0x7fa2'90c0,
.data =
(uint8_t[]){
0x58, 0x53, 0x44, 0x54, 0x04, 0x01, 0x00, 0x00, 0x01, 0xc8, 0x49, 0x4e,
0x54, 0x45, 0x4c, 0x20, 0x4e, 0x55, 0x43, 0x37, 0x69, 0x35, 0x44, 0x4e,
0x1f, 0x00, 0x00, 0x00, 0x41, 0x4d, 0x49, 0x20, 0x13, 0x00, 0x01, 0x00,
0x30, 0x31, 0xa5, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x48, 0x32, 0xa5, 0x7f,
0x00, 0x00, 0x00, 0x00, 0xd0, 0x32, 0xa5, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x18, 0x33, 0xa5, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x33, 0xa5, 0x7f,
0x00, 0x00, 0x00, 0x00, 0xf8, 0x33, 0xa5, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x58, 0x37, 0xa5, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x38, 0xa5, 0x7f,
0x00, 0x00, 0x00, 0x00, 0x48, 0x6a, 0xa5, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x80, 0x6a, 0xa5, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x6a, 0xa5, 0x7f,
0x00, 0x00, 0x00, 0x00, 0x38, 0xbd, 0xa5, 0x7f, 0x00, 0x00, 0x00, 0x00,
0xe0, 0xce, 0xa5, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x08, 0xd6, 0xa5, 0x7f,
0x00, 0x00, 0x00, 0x00, 0x50, 0xd6, 0xa5, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x00, 0xee, 0xa5, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x98, 0xee, 0xa5, 0x7f,
0x00, 0x00, 0x00, 0x00, 0xe0, 0xef, 0xa5, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x80, 0xf2, 0xa5, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x88, 0x22, 0xa6, 0x7f,
0x00, 0x00, 0x00, 0x00, 0xa0, 0x27, 0xa6, 0x7f, 0x00, 0x00, 0x00, 0x00,
0xd8, 0x27, 0xa6, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x30, 0x28, 0xa6, 0x7f,
0x00, 0x00, 0x00, 0x00, 0x18, 0x3b, 0xa6, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x08, 0x3c, 0xa6, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x40, 0x3c, 0xa6, 0x7f,
0x00, 0x00, 0x00, 0x00, 0x78, 0x3c, 0xa6, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x18, 0x3d, 0xa6, 0x7f, 0x00, 0x00, 0x00, 0x00,
},
},
{
// DBG2
.phys_addr = 0x7fa6'2830,
.data =
(uint8_t[]){
0x44, 0x42, 0x47, 0x32, 0x54, 0x00, 0x00, 0x00, 0x00, 0x98, 0x49, 0x4E,
0x54, 0x45, 0x4C, 0x20, 0x4E, 0x55, 0x43, 0x37, 0x69, 0x35, 0x44, 0x4E,
0x1F, 0x00, 0x00, 0x00, 0x4D, 0x53, 0x46, 0x54, 0x5F, 0x00, 0x00, 0x00,
0x2C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x01,
0x02, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x00, 0x16, 0x00, 0x22, 0x00, 0x01, 0x08, 0x00, 0x00, 0xF8, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x2E, 0x00,
},
},
{
// HPET
.phys_addr = 0x7fa6'3d18,
.data =
(uint8_t[]){
0x48, 0x50, 0x45, 0x54, 0x38, 0x00, 0x00, 0x00, 0x01, 0xBE, 0x49, 0x4E,
0x54, 0x45, 0x4C, 0x20, 0x4E, 0x55, 0x43, 0x37, 0x69, 0x35, 0x44, 0x4E,
0x1F, 0x00, 0x00, 0x00, 0x4D, 0x53, 0x46, 0x54, 0x5F, 0x00, 0x00, 0x00,
0x01, 0xA2, 0x86, 0x80, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xFE,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
},
}},
.rsdp = 0x7fa2'9000,
};
#endif // ZIRCON_KERNEL_LIB_ACPI_LITE_TEST_DATA_H_