No subject

Sun Dec 9 17:34:17 CET 2012

0        -- Resource Indicator -- RO. tied to 1 to indicate I/O space

Should it be
pmbase_value = pci_read_long(LPCBridge, 0x40) & 0xff80;

Is shifting necessary, too (see attached file)?

On my machine, output from my variant:
Extracted address from PMBASE: 0x00000800
Offset to SMI_EN  (PMBASE + 0x30): 0x00000830
Offset to SMI_STS (PMBASE + 0x34): 0x00000834
Value in SMI_EN:  0xffffffff
Value in SMI_STS: 0xffffffff

Output from Stefans variant:
the same as from above

Output from my variant with shift:
Extracted address from PMBASE: 0x00000010
Offset to SMI_EN  (PMBASE + 0x30): 0x00000040
Offset to SMI_STS (PMBASE + 0x34): 0x00000044
Value in SMI_EN:  0x00000801
Value in SMI_STS: 0x00000010

Output from Stefans variant with shift:
 the same as from above
Which of these four variants is correct?



Building a website is a piece of cake. 
Yahoo! Small Business gives you all the tools to get online.
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<br>>> Hello,<br>>>     pmbase_value = pci_read_long(LPCBridge, 0x40);<br>><br>>This neads to read <br>><br>      >pmbase_value = pci_read_long(LPCBridge, 0x40) & 0xfffffffe ;<br>><br>>I have not checked the data sheets but I would bet the lowest bit is<br>>enable.<br><br>From datasheet ICH3M, according to PMBASE:<br>31:16 --  reserved<br>15:7   --  Base address <br>6:1     -- reserved<br>0        -- Resource Indicator -- RO. tied to 1 to indicate I/O space<br><br>Should it be<br>pmbase_value = pci_read_long(LPCBridge, 0x40) & 0xff80;<br>?<br><br>Is shifting necessary, too (see attached file)?<br><br>On my machine, output from my variant:<br>Extracted address from PMBASE: 0x00000800<br>Offset to SMI_EN  (PMBASE + 0x30): 0x00000830<br>Offset to SMI_STS (PMBASE + 0x34): 0x00000834<br>Value in SMI_EN:  0xffffffff<br>Value in SMI_STS:
 0xffffffff<br><br>Output from Stefans variant:<br>the same as from above<br><br>Output from my variant with shift:<br>Extracted address from PMBASE: 0x00000010<br>Offset to SMI_EN  (PMBASE + 0x30): 0x00000040<br>Offset to SMI_STS (PMBASE + 0x34): 0x00000044<br>Value in SMI_EN:  0x00000801<br>Value in SMI_STS: 0x00000010<br><br>Output from Stefans variant with shift:<br> the same as from above<br> <br>Which of these four variants is correct?<br><br>Regards<br><br>Andon<br><br><p> 
      <hr size=1>Building a website is a piece of cake. <br>Yahoo! Small Business gives you <a href="*">all the tools to get online.</a>
Content-Type: text/x-csrc; name="get_content_of_pmbase_libpci.c"
Content-Description: 2332724126-get_content_of_pmbase_libpci.c
Content-Disposition: inline; filename="get_content_of_pmbase_libpci.c"

#include <stdio.h>
#include <pci/pci.h>  

int main(void) {

	struct pci_access *pacc;
	struct pci_dev *LPCBridge;
	u32 pmbase_value, smi_en_offset, smi_sts_offset, smi_en_value, smi_sts_value;

	pacc = pci_alloc();
	LPCBridge = pci_get_dev(pacc, 0, 0, 0x1f, 0);
	//pmbase_value = pci_read_long(LPCBridge, 0x40) & 0xff80; /* my variant */
	//pmbase_value = pci_read_long(LPCBridge, 0x40) & 0xfffffffe; /* Stefans variant */
	//pmbase_value = (pci_read_long(LPCBridge, 0x40) & 0xff80) >> 7; /* my variant with shift */
        pmbase_value = (pci_read_long(LPCBridge, 0x40) & 0xfffffffe) >> 7; /* Stefans variant with shift */
	printf("Extracted address from PMBASE: 0x%08x\n", pmbase_value);
	smi_en_offset  = pmbase_value + 0x30;
	smi_sts_offset = pmbase_value + 0x34;
	printf("Offset to SMI_EN  (PMBASE + 0x30): 0x%08x\n", smi_en_offset);
	printf("Offset to SMI_STS (PMBASE + 0x34): 0x%08x\n", smi_sts_offset);

	smi_en_value =   pci_read_long(LPCBridge, smi_en_offset);
	smi_sts_value =  pci_read_long(LPCBridge, smi_sts_offset);
	printf("Value in SMI_EN:  0x%08x\n", smi_en_value);
	printf("Value in SMI_STS: 0x%08x\n", smi_sts_value);

	return 0;


More information about the coreboot mailing list