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>
#include <asm/irq.h>
#include <asm/pci.h>
#include <asm/pirq_routing.h>
+#include <asm/tables.h>
DECLARE_GLOBAL_DATA_PTR;
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;
#include <pci.h>
#include <asm/pci.h>
#include <asm/pirq_routing.h>
-#include <asm/tables.h>
static bool irq_already_routed[16];
{
struct irq_routing_table *rom_rt;
- /* Fix up the table checksum */
- rt->checksum = table_compute_checksum(rt, rt->size);
-
/* Align the table to be 16 byte aligned */
addr = ALIGN(addr, 16);