summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mainboard/amd/bilby/mainboard.c7
-rw-r--r--src/mainboard/amd/birman/mainboard.c7
-rw-r--r--src/mainboard/amd/chausie/mainboard.c7
-rw-r--r--src/mainboard/amd/gardenia/mainboard.c4
-rw-r--r--src/mainboard/amd/majolica/mainboard.c7
-rw-r--r--src/mainboard/amd/mandolin/mainboard.c7
-rw-r--r--src/mainboard/amd/pademelon/mainboard.c4
-rw-r--r--src/mainboard/google/guybrush/mainboard.c7
-rw-r--r--src/mainboard/google/kahlee/mainboard.c4
-rw-r--r--src/mainboard/google/skyrim/mainboard.c7
-rw-r--r--src/mainboard/google/zork/mainboard.c7
-rw-r--r--src/soc/amd/common/block/include/amdblocks/amd_pci_util.h2
12 files changed, 24 insertions, 46 deletions
diff --git a/src/mainboard/amd/bilby/mainboard.c b/src/mainboard/amd/bilby/mainboard.c
index c402c29a2f..324c72edef 100644
--- a/src/mainboard/amd/bilby/mainboard.c
+++ b/src/mainboard/amd/bilby/mainboard.c
@@ -27,11 +27,8 @@
* Index/Data pair. These values are chipset and mainboard
* dependent and should be updated accordingly.
*/
-static uint8_t fch_pic_routing[0x80];
-static uint8_t fch_apic_routing[0x80];
-
-_Static_assert(sizeof(fch_pic_routing) == sizeof(fch_apic_routing),
- "PIC and APIC FCH interrupt tables must be the same size");
+static uint8_t fch_pic_routing[FCH_IRQ_ROUTING_ENTRIES];
+static uint8_t fch_apic_routing[FCH_IRQ_ROUTING_ENTRIES];
static const struct fch_irq_routing bilby_fch[] = {
{ PIRQ_A, 8, 16 },
diff --git a/src/mainboard/amd/birman/mainboard.c b/src/mainboard/amd/birman/mainboard.c
index 34c3b4dead..8b27e37f51 100644
--- a/src/mainboard/amd/birman/mainboard.c
+++ b/src/mainboard/amd/birman/mainboard.c
@@ -18,11 +18,8 @@
* Index/Data pair. These values are chipset and mainboard
* dependent and should be updated accordingly.
*/
-static uint8_t fch_pic_routing[0x80];
-static uint8_t fch_apic_routing[0x80];
-
-_Static_assert(sizeof(fch_pic_routing) == sizeof(fch_apic_routing),
- "PIC and APIC FCH interrupt tables must be the same size");
+static uint8_t fch_pic_routing[FCH_IRQ_ROUTING_ENTRIES];
+static uint8_t fch_apic_routing[FCH_IRQ_ROUTING_ENTRIES];
/*
* This controls the device -> IRQ routing.
diff --git a/src/mainboard/amd/chausie/mainboard.c b/src/mainboard/amd/chausie/mainboard.c
index 9251ff2c91..0318e4333e 100644
--- a/src/mainboard/amd/chausie/mainboard.c
+++ b/src/mainboard/amd/chausie/mainboard.c
@@ -16,11 +16,8 @@
* Index/Data pair. These values are chipset and mainboard
* dependent and should be updated accordingly.
*/
-static uint8_t fch_pic_routing[0x80];
-static uint8_t fch_apic_routing[0x80];
-
-_Static_assert(sizeof(fch_pic_routing) == sizeof(fch_apic_routing),
- "PIC and APIC FCH interrupt tables must be the same size");
+static uint8_t fch_pic_routing[FCH_IRQ_ROUTING_ENTRIES];
+static uint8_t fch_apic_routing[FCH_IRQ_ROUTING_ENTRIES];
/*
* This controls the device -> IRQ routing.
diff --git a/src/mainboard/amd/gardenia/mainboard.c b/src/mainboard/amd/gardenia/mainboard.c
index b9c2eaf1c3..8a4da9ff1b 100644
--- a/src/mainboard/amd/gardenia/mainboard.c
+++ b/src/mainboard/amd/gardenia/mainboard.c
@@ -19,7 +19,7 @@
* These values are used by the PCI configuration space,
* MP Tables. TODO: Make ACPI use these values too.
*/
-static const u8 mainboard_picr_data[] = {
+static const u8 mainboard_picr_data[FCH_IRQ_ROUTING_ENTRIES] = {
[0x00] = 0x03, 0x04, 0x05, 0x07, 0x0B, 0x0A, 0x1F, 0x1F,
[0x08] = 0xFA, 0xF1, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F,
[0x10] = 0x1F, 0x1F, 0x1F, 0x03, 0x1F, 0x1F, 0x1F, 0x1F,
@@ -38,7 +38,7 @@ static const u8 mainboard_picr_data[] = {
[0x78] = 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
};
-static const u8 mainboard_intr_data[] = {
+static const u8 mainboard_intr_data[FCH_IRQ_ROUTING_ENTRIES] = {
[0x00] = 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
[0x08] = 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F,
[0x10] = 0x09, 0x1F, 0x1F, 0x10, 0x1F, 0x1F, 0x1F, 0x10,
diff --git a/src/mainboard/amd/majolica/mainboard.c b/src/mainboard/amd/majolica/mainboard.c
index 58f754655f..32b29e4fe6 100644
--- a/src/mainboard/amd/majolica/mainboard.c
+++ b/src/mainboard/amd/majolica/mainboard.c
@@ -15,11 +15,8 @@
* Index/Data pair. These values are chipset and mainboard
* dependent and should be updated accordingly.
*/
-static uint8_t fch_pic_routing[0x80];
-static uint8_t fch_apic_routing[0x80];
-
-_Static_assert(sizeof(fch_pic_routing) == sizeof(fch_apic_routing),
- "PIC and APIC FCH interrupt tables must be the same size");
+static uint8_t fch_pic_routing[FCH_IRQ_ROUTING_ENTRIES];
+static uint8_t fch_apic_routing[FCH_IRQ_ROUTING_ENTRIES];
/*
* This controls the device -> IRQ routing.
diff --git a/src/mainboard/amd/mandolin/mainboard.c b/src/mainboard/amd/mandolin/mainboard.c
index 0f87d9c799..6ae3266154 100644
--- a/src/mainboard/amd/mandolin/mainboard.c
+++ b/src/mainboard/amd/mandolin/mainboard.c
@@ -22,11 +22,8 @@
* Index/Data pair. These values are chipset and mainboard
* dependent and should be updated accordingly.
*/
-static uint8_t fch_pic_routing[0x80];
-static uint8_t fch_apic_routing[0x80];
-
-_Static_assert(sizeof(fch_pic_routing) == sizeof(fch_apic_routing),
- "PIC and APIC FCH interrupt tables must be the same size");
+static uint8_t fch_pic_routing[FCH_IRQ_ROUTING_ENTRIES];
+static uint8_t fch_apic_routing[FCH_IRQ_ROUTING_ENTRIES];
static const struct fch_irq_routing mandolin_fch[] = {
{ PIRQ_A, 8, 16 },
diff --git a/src/mainboard/amd/pademelon/mainboard.c b/src/mainboard/amd/pademelon/mainboard.c
index a013e6ce89..2e55009094 100644
--- a/src/mainboard/amd/pademelon/mainboard.c
+++ b/src/mainboard/amd/pademelon/mainboard.c
@@ -20,7 +20,7 @@
* These values are used by the PCI configuration space,
* MP Tables.
*/
-static const u8 mainboard_picr_data[] = {
+static const u8 mainboard_picr_data[FCH_IRQ_ROUTING_ENTRIES] = {
[0x00] = 0x03, 0x04, 0x05, 0x07, 0x0B, 0x0A, 0x1F, 0x1F,
[0x08] = 0xFA, 0xF1, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F,
[0x10] = 0x1F, 0x1F, 0x1F, 0x03, 0x1F, 0x1F, 0x1F, 0x1F,
@@ -39,7 +39,7 @@ static const u8 mainboard_picr_data[] = {
[0x78] = 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
};
-static const u8 mainboard_intr_data[] = {
+static const u8 mainboard_intr_data[FCH_IRQ_ROUTING_ENTRIES] = {
[0x00] = 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
[0x08] = 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F,
[0x10] = 0x09, 0x1F, 0x1F, 0x10, 0x1F, 0x1F, 0x1F, 0x10,
diff --git a/src/mainboard/google/guybrush/mainboard.c b/src/mainboard/google/guybrush/mainboard.c
index 4bcb52e3fa..bfb0f88dd5 100644
--- a/src/mainboard/google/guybrush/mainboard.c
+++ b/src/mainboard/google/guybrush/mainboard.c
@@ -30,11 +30,8 @@
* Index/Data pair. These values are chipset and mainboard
* dependent and should be updated accordingly.
*/
-static uint8_t fch_pic_routing[0x80];
-static uint8_t fch_apic_routing[0x80];
-
-_Static_assert(sizeof(fch_pic_routing) == sizeof(fch_apic_routing),
- "PIC and APIC FCH interrupt tables must be the same size");
+static uint8_t fch_pic_routing[FCH_IRQ_ROUTING_ENTRIES];
+static uint8_t fch_apic_routing[FCH_IRQ_ROUTING_ENTRIES];
/*
* This controls the device -> IRQ routing.
diff --git a/src/mainboard/google/kahlee/mainboard.c b/src/mainboard/google/kahlee/mainboard.c
index 2cd88b87f8..196d6b865c 100644
--- a/src/mainboard/google/kahlee/mainboard.c
+++ b/src/mainboard/google/kahlee/mainboard.c
@@ -30,7 +30,7 @@
* MP Tables. TODO: Make ACPI use these values too.
*/
-static const u8 mainboard_picr_data[] = {
+static const u8 mainboard_picr_data[FCH_IRQ_ROUTING_ENTRIES] = {
[0x00] = 0x03, 0x04, 0x05, 0x07, 0x0B, 0x1F, 0x1F, 0x1F,
[0x08] = 0xFA, 0xF1, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F,
[0x10] = 0x09, 0x1F, 0x1F, 0x03, 0x1F, 0x1F, 0x1F, 0x03,
@@ -49,7 +49,7 @@ static const u8 mainboard_picr_data[] = {
[0x78] = 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
};
-static const u8 mainboard_intr_data[] = {
+static const u8 mainboard_intr_data[FCH_IRQ_ROUTING_ENTRIES] = {
[0x00] = 0x10, 0x11, 0x12, 0x13, 0x14, 0x1F, 0x16, 0x17,
[0x08] = 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F,
[0x10] = 0x09, 0x1F, 0x1F, 0x10, 0x1F, 0x1F, 0x1F, 0x10,
diff --git a/src/mainboard/google/skyrim/mainboard.c b/src/mainboard/google/skyrim/mainboard.c
index 0b707d745b..58e11f5503 100644
--- a/src/mainboard/google/skyrim/mainboard.c
+++ b/src/mainboard/google/skyrim/mainboard.c
@@ -16,11 +16,8 @@
* Index/Data pair. These values are chipset and mainboard
* dependent and should be updated accordingly.
*/
-static uint8_t fch_pic_routing[0x80];
-static uint8_t fch_apic_routing[0x80];
-
-_Static_assert(sizeof(fch_pic_routing) == sizeof(fch_apic_routing),
- "PIC and APIC FCH interrupt tables must be the same size");
+static uint8_t fch_pic_routing[FCH_IRQ_ROUTING_ENTRIES];
+static uint8_t fch_apic_routing[FCH_IRQ_ROUTING_ENTRIES];
/*
* This controls the device -> IRQ routing.
diff --git a/src/mainboard/google/zork/mainboard.c b/src/mainboard/google/zork/mainboard.c
index fedf1cce3c..bab79b44e0 100644
--- a/src/mainboard/google/zork/mainboard.c
+++ b/src/mainboard/google/zork/mainboard.c
@@ -39,11 +39,8 @@
* Index/Data pair. These values are chipset and mainboard
* dependent and should be updated accordingly.
*/
-static uint8_t fch_pic_routing[0x80];
-static uint8_t fch_apic_routing[0x80];
-
-_Static_assert(sizeof(fch_pic_routing) == sizeof(fch_apic_routing),
- "PIC and APIC FCH interrupt tables must be the same size");
+static uint8_t fch_pic_routing[FCH_IRQ_ROUTING_ENTRIES];
+static uint8_t fch_apic_routing[FCH_IRQ_ROUTING_ENTRIES];
/*
* This controls the device -> IRQ routing.
diff --git a/src/soc/amd/common/block/include/amdblocks/amd_pci_util.h b/src/soc/amd/common/block/include/amdblocks/amd_pci_util.h
index 6543853439..c766d501bd 100644
--- a/src/soc/amd/common/block/include/amdblocks/amd_pci_util.h
+++ b/src/soc/amd/common/block/include/amdblocks/amd_pci_util.h
@@ -11,6 +11,8 @@
#define PCI_INTR_INDEX 0xc00
#define PCI_INTR_DATA 0xc01
+#define FCH_IRQ_ROUTING_ENTRIES 0x80
+
struct fch_irq_routing {
uint8_t intr_index;
uint8_t pic_irq_num;