mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 22:20:45 +00:00
x86: Check PIRQ routing table sanity in the F segment
Previously the PIRQ routing table sanity check was performed against the original table provided by the platform codes. Now we switch to check its sanity on the final table in the F segment as this one is the one seen by the OS. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
8827227889
commit
283a08e52a
1 changed files with 13 additions and 5 deletions
|
@ -110,11 +110,7 @@ void pirq_route_irqs(struct irq_info *irq, int num)
|
||||||
|
|
||||||
u32 copy_pirq_routing_table(u32 addr, struct irq_routing_table *rt)
|
u32 copy_pirq_routing_table(u32 addr, struct irq_routing_table *rt)
|
||||||
{
|
{
|
||||||
if (rt->signature != PIRQ_SIGNATURE || rt->version != PIRQ_VERSION ||
|
struct irq_routing_table *rom_rt;
|
||||||
rt->size % 16) {
|
|
||||||
debug("Interrupt Routing Table not valid\n");
|
|
||||||
return addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Fix up the table checksum */
|
/* Fix up the table checksum */
|
||||||
rt->checksum = table_compute_checksum(rt, rt->size);
|
rt->checksum = table_compute_checksum(rt, rt->size);
|
||||||
|
@ -125,5 +121,17 @@ u32 copy_pirq_routing_table(u32 addr, struct irq_routing_table *rt)
|
||||||
debug("Copying Interrupt Routing Table to 0x%x\n", addr);
|
debug("Copying Interrupt Routing Table to 0x%x\n", addr);
|
||||||
memcpy((void *)addr, rt, rt->size);
|
memcpy((void *)addr, rt, rt->size);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We do the sanity check here against the copied table after memcpy,
|
||||||
|
* as something might go wrong after the memcpy, which is normally
|
||||||
|
* due to the F segment decode is not turned on to systeam RAM.
|
||||||
|
*/
|
||||||
|
rom_rt = (struct irq_routing_table *)addr;
|
||||||
|
if (rom_rt->signature != PIRQ_SIGNATURE ||
|
||||||
|
rom_rt->version != PIRQ_VERSION || rom_rt->size % 16) {
|
||||||
|
printf("Interrupt Routing Table not valid\n");
|
||||||
|
return addr;
|
||||||
|
}
|
||||||
|
|
||||||
return addr + rt->size;
|
return addr + rt->size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue