blob: c9703c6f3c2ac851262fcd07699e4d88ff2d2afd [file] [log] [blame]
Li-Ta Lofd8f02f2004-04-13 21:06:45 +00001/* checkpir.c : This software is released under GPL
Stefan Reinauer997afe62008-01-18 15:34:24 +00002 * For coreboot use only
Jeremy Jackson46d65e82007-04-11 18:44:42 +00003 * Aug 26 2001 , Nikolai Vladychevski, <niko@isl.net.mx>
4 */
Li-Ta Lofd8f02f2004-04-13 21:06:45 +00005
Li-Ta Lofd8f02f2004-04-13 21:06:45 +00006#include <stdio.h>
Jeremy Jackson46d65e82007-04-11 18:44:42 +00007#include "pirq_routing.h"
Li-Ta Lo6463ae72004-04-14 22:24:50 +00008#include "checksum.h"
9
Li-Ta Lofd8f02f2004-04-13 21:06:45 +000010struct irq_routing_table *rt;
11
Jeremy Jackson46d65e82007-04-11 18:44:42 +000012int main(void)
Li-Ta Lofd8f02f2004-04-13 21:06:45 +000013{
14 uint8_t sum, newsum;
15
16 rt = (struct irq_routing_table *) &intel_irq_routing_table;
17 sum = calc_checksum(rt);
18
19 printf("Validating checksum, file: irq_tables.c that was in ./ at compile time...\n");
20 printf("(no other tests are done)\n");
21
22 if (!sum) {
Stefan Reinauer997afe62008-01-18 15:34:24 +000023 printf("Checksum for IRQ Routing table is ok. You can use irq_tables.c in coreboot now.\n");
Li-Ta Lofd8f02f2004-04-13 21:06:45 +000024 } else {
25 newsum = rt->checksum - sum;
26 printf("BAD CHECKSUM for IRQ Routing table !!!!\n");
27 printf("If you want to make it valid, change the checksum to: %#x\n",
28 newsum);
29 }
Jeremy Jackson46d65e82007-04-11 18:44:42 +000030 return 0;
Li-Ta Lofd8f02f2004-04-13 21:06:45 +000031}