Add detection/dump support for ServerEngines SE-SM 4210-P01.
[coreboot.git] / util / getpir / checkpir.c
index e86af492158717afaa1b4eaf0b51632c61fb0bd9..c9703c6f3c2ac851262fcd07699e4d88ff2d2afd 100644 (file)
@@ -1,33 +1,15 @@
 /* checkpir.c : This software is released under GPL
  For Linuxbios use only
  Aug 26 2001 , Nikolai Vladychevski, <niko@isl.net.mx>
-*/
* For coreboot use only
* Aug 26 2001 , Nikolai Vladychevski, <niko@isl.net.mx>
+ */
 
-#include <unistd.h>
 #include <stdio.h>
-#include <string.h>
+#include "pirq_routing.h"
+#include "checksum.h"
 
-#include <device/pci.h>
-#include <pirq_routing.h>
-
-#define PIRQ_SIGNATURE  (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
-#define PIRQ_VERS 0x0100
-
-struct irq_info se_arr[50];
 struct irq_routing_table *rt;
 
-int calc_checksum(struct irq_routing_table *rt)
-{
-       long sum = 0, i;
-       uint8_t *addr, sum2 = 0;
-
-       addr = (uint8_t *) rt;
-       for (i = 0; i < rt->size; i++)
-               sum2 += addr[i];
-       return (sum2);
-}
-
-main()
+int main(void)
 {
        uint8_t sum, newsum;
 
@@ -38,11 +20,12 @@ main()
        printf("(no other tests are done)\n");
 
        if (!sum) {
-               printf("Checksum for IRQ Routing table is ok. You can use it in LinuxBios now\n");
+               printf("Checksum for IRQ Routing table is ok. You can use irq_tables.c in coreboot now.\n");
        } else {
                newsum = rt->checksum - sum;
                printf("BAD CHECKSUM for IRQ Routing table !!!!\n");
                printf("If you want to make it valid, change the checksum to: %#x\n",
                       newsum);
        }
+       return 0;
 }