summaryrefslogtreecommitdiff
path: root/arch/x86/cpu/irq.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2016-05-11 07:44:57 -0700
committerBin Meng <bmeng.cn@gmail.com>2016-05-23 15:18:00 +0800
commit10d569ea1a6083eec6022dfd1e6b35e74c962ee3 (patch)
tree2c23445b2e70b405509d59116017b585e9cc0162 /arch/x86/cpu/irq.c
parent1e2f7b9e8e077cb6937204c305d554ef7a970be5 (diff)
x86: Fix up PIRQ routing table checksum earlier
PIRQ routing table checksum is fixed up in copy_pirq_routing_table(), which is fine if we only write the configuration table once. But with the SeaBIOS case, when we write the table for the second time, the checksum will be fixed up to zero per the checksum algorithm, which is caused by the checksum field not being zero before fix up, since the checksum has already been calculated in the first run. To fix this, move the checksum fixup to create_pirq_routing_table(), so that copy_pirq_routing_table() only does what its function name suggests: copy the table to somewhere else. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/cpu/irq.c')
-rw-r--r--arch/x86/cpu/irq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/cpu/irq.c b/arch/x86/cpu/irq.c
index 86183b034e..df3cd0abc7 100644
--- a/arch/x86/cpu/irq.c
+++ b/arch/x86/cpu/irq.c
@@ -13,6 +13,7 @@
#include <asm/irq.h>
#include <asm/pci.h>
#include <asm/pirq_routing.h>
+#include <asm/tables.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -214,6 +215,9 @@ static int create_pirq_routing_table(struct udevice *dev)
rt->size = irq_entries * sizeof(struct irq_info) + 32;
+ /* Fix up the table checksum */
+ rt->checksum = table_compute_checksum(rt, rt->size);
+
pirq_routing_table = rt;
return 0;