]> Joshua Wise's Git repositories - netwatch.git/commitdiff
Allow arbitrary setup on ich2
authorJoshua Wise <joshua@rebirth.joshuawise.com>
Thu, 4 Sep 2008 01:24:59 +0000 (21:24 -0400)
committerJoshua Wise <joshua@rebirth.joshuawise.com>
Thu, 4 Sep 2008 01:24:59 +0000 (21:24 -0400)
ich2/smm-open-ich2.c

index 9c80dae8ed34ca6de9b16d43af23dd0421692a8f..1e1f79ceab3348550b41f53a3c26d779cba4959a 100644 (file)
@@ -1,4 +1,5 @@
 #include "reg-82815.h"
+#include <stdlib.h>
 
 unsigned long memsz[] = {
        0,                      // 0
@@ -19,7 +20,7 @@ unsigned long memsz[] = {
        512*1024*1024           // F
 };
 
-int main()
+int main(int argc, char **argv)
 {
        unsigned char smramc, drp, drp2;
        unsigned int tom = 0;
@@ -76,5 +77,21 @@ int main()
                printf("ABSEG enabled for both SMM code and data\n");
                break;
        }
+       
+       
+       if (argc < 2)
+       {
+               smramc &= 0xC0;
+               smramc |= 0x04;
+       
+               pci_write8(0, 0, 0, SMRAMC, smramc);
+               printf("With any luck, ABSEG is now enabled as system RAM... enjoy!\n");
+       } else {
+               smramc = strtoul(argv[1], 0, 0);
+               
+               pci_write8(0, 0, 0, SMRAMC, smramc);
+               printf("OK, set it up as you like.\n");
+       }
+       
        return 0;
 }
This page took 0.02942 seconds and 4 git commands to generate.