X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/399b932481303c09ebed1cfaaa88538ffa4746ba..789ebb2d04033053b3cfeaa73648e3a1c3b3d8f5:/hardware/ich7/smm-open-ich7.c?ds=inline diff --git a/hardware/ich7/smm-open-ich7.c b/hardware/ich7/smm-open-ich7.c new file mode 100644 index 0000000..2d69e3f --- /dev/null +++ b/hardware/ich7/smm-open-ich7.c @@ -0,0 +1,31 @@ +/* smm-open-ich7.c + * SMRAM open utility for Intel 82865 northbridge + * NetWatch system management mode administration console + * + * Copyright (c) 2008 Jacob Potter and Joshua Wise. All rights reserved. + * This program is free software; you can redistribute and/or modify it under + * the terms found in the file LICENSE in the root of this source tree. + * + */ + +#include "reg-82865.h" + +void main() +{ + unsigned char smramc, esmramc; + unsigned int toud; + + smramc = pci_read8(0, 0, 0, SMRAMC); + esmramc = pci_read8(0, 0, 0, ESMRAMC); + + toud = (pci_read16(0, 0, 0, 0xC4) >> 3) << 19; + printf("Usable DRAM: %d bytes\n", toud); + + printf("SMRAMC: %02x\n", smramc); + printf("ESMRAMC: %02x\n", smramc); + if (smramc & SMRAMC_LOCK) + { + printf("SMRAM is locked, cannot load anything :-(\n"); + return; + } +}