>> Hello,
>>     pmbase_value = pci_read_long(LPCBridge, 0x40);
>
>This neads to read 
>
      >pmbase_value = pci_read_long(LPCBridge, 0x40) & 0xfffffffe ;
>
>I have not checked the data sheets but I would bet the lowest bit is
>enable.

>From datasheet ICH3M, according to PMBASE:
31:16 --  reserved
15:7   --  Base address 
6:1     -- reserved
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?

Regards

Andon


       
---------------------------------
Building a website is a piece of cake. 
Yahoo! Small Business gives you all the tools to get online.
#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();
	pci_init(pacc);
	
	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;
}






-- 
linuxbios mailing list
[email protected]
http://www.linuxbios.org/mailman/listinfo/linuxbios

Reply via email to