diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2022-10-25 18:18:36 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-10-26 17:44:47 +0000 |
commit | bf26485d36600384b10f0a2f934ab2cda47de114 (patch) | |
tree | 908bd610c7cf69608305021e72ff4c7c64924251 /src/mainboard/google | |
parent | 886c1ffc652efe7e0d3345dfb34a38669041e467 (diff) |
soc/amd/common/include: introduce and use FCH_IRQ_ROUTING_ENTRIES
Instead of using magic constants for the fch_pic_routing and
fch_apic_routing array sizes, define FCH_IRQ_ROUTING_ENTRIES in the
common code headers and use this definition. This also allows to drop
the static assert for the array sizes. In the Stoneyridge mainboard code
the equivalent arrays are named mainboard_picr_data and
mainboard_intr_data; also use FCH_IRQ_ROUTING_ENTRIES as fixed array
size there.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I2d7ee46bd013ce413189398a144e46ceac0c2a10
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68818
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r-- | src/mainboard/google/guybrush/mainboard.c | 7 | ||||
-rw-r--r-- | src/mainboard/google/kahlee/mainboard.c | 4 | ||||
-rw-r--r-- | src/mainboard/google/skyrim/mainboard.c | 7 | ||||
-rw-r--r-- | src/mainboard/google/zork/mainboard.c | 7 |
4 files changed, 8 insertions, 17 deletions
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. |