Skip to content

Commit

Permalink
ACPICA: Add support for new PCCT subtables
Browse files Browse the repository at this point in the history
ACPICA commit e7b817e3c405a4fb9ae9ee7ae4992b8c1f20d284

Extended PCC Subspaces (types 3 and 4)

Link: acpica/acpica@e7b817e3
Signed-off-by: David E. Box <[email protected]>
Signed-off-by: Bob Moore <[email protected]>
Signed-off-by: Lv Zheng <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
debox1 authored and rafaeljw committed Jun 12, 2017
1 parent bff7f90 commit c7a1dfb
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 10 deletions.
10 changes: 5 additions & 5 deletions drivers/mailbox/pcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p)
struct acpi_pcct_hw_reduced_type2 *pcct2_ss = chan->con_priv;
u32 id = chan - pcc_mbox_channels;

doorbell_ack = &pcct2_ss->doorbell_ack_register;
doorbell_ack = &pcct2_ss->platform_ack_register;
doorbell_ack_preserve = pcct2_ss->ack_preserve_mask;
doorbell_ack_write = pcct2_ss->ack_write_mask;

Expand Down Expand Up @@ -416,11 +416,11 @@ static int parse_pcc_subspace(struct acpi_subtable_header *header,
static int pcc_parse_subspace_irq(int id,
struct acpi_pcct_hw_reduced *pcct_ss)
{
pcc_doorbell_irq[id] = pcc_map_interrupt(pcct_ss->doorbell_interrupt,
pcc_doorbell_irq[id] = pcc_map_interrupt(pcct_ss->platform_interrupt,
(u32)pcct_ss->flags);
if (pcc_doorbell_irq[id] <= 0) {
pr_err("PCC GSI %d not registered\n",
pcct_ss->doorbell_interrupt);
pcct_ss->platform_interrupt);
return -EINVAL;
}

Expand All @@ -429,8 +429,8 @@ static int pcc_parse_subspace_irq(int id,
struct acpi_pcct_hw_reduced_type2 *pcct2_ss = (void *)pcct_ss;

pcc_doorbell_ack_vaddr[id] = acpi_os_ioremap(
pcct2_ss->doorbell_ack_register.address,
pcct2_ss->doorbell_ack_register.bit_width / 8);
pcct2_ss->platform_ack_register.address,
pcct2_ss->platform_ack_register.bit_width / 8);
if (!pcc_doorbell_ack_vaddr[id]) {
pr_err("Failed to ioremap PCC ACK register\n");
return -ENOMEM;
Expand Down
77 changes: 72 additions & 5 deletions include/acpi/actbl3.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ struct acpi_mpst_shared {
/*******************************************************************************
*
* PCCT - Platform Communications Channel Table (ACPI 5.0)
* Version 1
* Version 2 (ACPI 6.2)
*
******************************************************************************/

Expand All @@ -487,7 +487,9 @@ enum acpi_pcct_type {
ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2 = 2, /* ACPI 6.1 */
ACPI_PCCT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE = 3, /* ACPI 6.2 */
ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE = 4, /* ACPI 6.2 */
ACPI_PCCT_TYPE_RESERVED = 5 /* 5 and greater are reserved */
};

/*
Expand All @@ -513,7 +515,7 @@ struct acpi_pcct_subspace {

struct acpi_pcct_hw_reduced {
struct acpi_subtable_header header;
u32 doorbell_interrupt;
u32 platform_interrupt;
u8 flags;
u8 reserved;
u64 base_address;
Expand All @@ -530,7 +532,7 @@ struct acpi_pcct_hw_reduced {

struct acpi_pcct_hw_reduced_type2 {
struct acpi_subtable_header header;
u32 doorbell_interrupt;
u32 platform_interrupt;
u8 flags;
u8 reserved;
u64 base_address;
Expand All @@ -541,11 +543,67 @@ struct acpi_pcct_hw_reduced_type2 {
u32 latency;
u32 max_access_rate;
u16 min_turnaround_time;
struct acpi_generic_address doorbell_ack_register;
struct acpi_generic_address platform_ack_register;
u64 ack_preserve_mask;
u64 ack_write_mask;
};

/* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */

struct acpi_pcct_ext_pcc_master {
struct acpi_subtable_header header;
u32 platform_interrupt;
u8 flags;
u8 reserved1;
u64 base_address;
u32 length;
struct acpi_generic_address doorbell_register;
u64 preserve_mask;
u64 write_mask;
u32 latency;
u32 max_access_rate;
u32 min_turnaround_time;
struct acpi_generic_address platform_ack_register;
u64 ack_preserve_mask;
u64 ack_set_mask;
u64 reserved2;
struct acpi_generic_address cmd_complete_register;
u64 cmd_complete_mask;
struct acpi_generic_address cmd_update_register;
u64 cmd_update_preserve_mask;
u64 cmd_update_set_mask;
struct acpi_generic_address error_status_register;
u64 error_status_mask;
};

/* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */

struct acpi_pcct_ext_pcc_slave {
struct acpi_subtable_header header;
u32 platform_interrupt;
u8 flags;
u8 reserved1;
u64 base_address;
u32 length;
struct acpi_generic_address doorbell_register;
u64 preserve_mask;
u64 write_mask;
u32 latency;
u32 max_access_rate;
u32 min_turnaround_time;
struct acpi_generic_address platform_ack_register;
u64 ack_preserve_mask;
u64 ack_set_mask;
u64 reserved2;
struct acpi_generic_address cmd_complete_register;
u64 cmd_complete_mask;
struct acpi_generic_address cmd_update_register;
u64 cmd_update_preserve_mask;
u64 cmd_update_set_mask;
struct acpi_generic_address error_status_register;
u64 error_status_mask;
};

/* Values for doorbell flags above */

#define ACPI_PCCT_INTERRUPT_POLARITY (1)
Expand All @@ -563,6 +621,15 @@ struct acpi_pcct_shared_memory {
u16 status;
};

/* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */

struct acpi_pcct_ext_pcc_shared_memory {
u32 signature;
u32 flags;
u32 length;
u32 command;
};

/*******************************************************************************
*
* PMTT - Platform Memory Topology Table (ACPI 5.0)
Expand Down

0 comments on commit c7a1dfb

Please sign in to comment.