On Sat, Oct 11, 2008 at 11:56 PM, ron minnich <[EMAIL PROTECTED]> wrote:
>> and PCI IO address mask is 0x3FFF, right ?
>
> I think so, unless it is 3fff<<3

Yes, in the register, it is shifted by 3 bytes

> Then we just need C code :-)

That is another story...

Here is the python script, I have tested it on my SN25p / opteron 165

I attached the output from a run under legacy BIOS:
$ AMDK8MemMap.py -i > output.txt

with a
$ lspci -xxx -s 0:0:18.1 > lspci.txt
for reference

Could someone double check I did not misinterpreted the doc in the
decoding of the registers.

I would be interested in having the output of the tool and the lspci,
like above, from something more interesting, like a Tyan 2 or 4
processors motherboard. I'm also interested in --test output.

Try --help to have the list of available options.

I did not use the "Fam 0Fh" 32559.pdf documentation, because I
only have an opteron 939 to test on. But after a quick glance,
it all looks the same, so it should work as-is.

I'd also like comments, and any ideas for further improvements.

If this is useful, it is:
Signed-off-by: Vincent Legoll <[EMAIL PROTECTED]>
and could go somewhere in the utils directory...

-- 
Vincent Legoll

Attachment: AMDK8MemMap.py
Description: Binary data

0x00:     Ox1022 - Vendor ID
0x02:     Ox1101 - Device ID
0x04:     Ox0000 - Command
0x06:     Ox0000 - Status
0x08:       Ox00 - Revision ID
0x09:       Ox00 - Program Interface
0x0A:       Ox00 - Subclass Code
0x0B:       Ox06 - Base Class Code
0x0C:       Ox00 - Cache Line Size
0x0D:       Ox00 - Latency Timer
0x0E:       Ox80 - Header Type
0x0F:       Ox00 - Built In Self Test
0x10: Ox00000000 - Base Address 0
0x14: Ox00000000 - Base Address 1
0x18: Ox00000000 - Base Address 2
0x1C: Ox00000000 - Base Address 3
0x20: Ox00000000 - Base Address 4
0x24: Ox00000000 - Base Address 5
0x28: Ox00000000 - Card Bus CIS Pointer
0x2C:     Ox0000 - Subsystem Vendor ID
0x2E:     Ox0000 - Subsystem ID
0x30: Ox00000000 - ROM Base Address
0x34: Ox00000000 - Capabilities
0x38: Ox00000000 - Reserved
0x3C:       Ox00 - Interrupt Line
0x3D:       Ox00 - Interrupt Pin
0x3E:       Ox00 - Minimum GNT
0x3F:       Ox00 - Maximum Latency
0x40: Ox00000003 - DRAM Base 0
         DRAM Base: 0x0000000000
         Read Enable: 0x1
         Write Enable: 0x1
         Interleave Enable: No interleave
0x44: Ox007F0000 - DRAM Limit 0
         DRAM Limit: 0x007FFFFFFF
         Dst Node ID: 0
         Interleave Select: 0b0
0x48: Ox00000000 - DRAM Base 1
         DRAM Base: 0x0000000000
         Read Enable: 0x0
         Write Enable: 0x0
         Interleave Enable: No interleave
0x4C: Ox00000001 - DRAM Limit 1
         DRAM Limit: 0x0000FFFFFF
         Dst Node ID: 1
         Interleave Select: 0b0
0x50: Ox00000000 - DRAM Base 2
         DRAM Base: 0x0000000000
         Read Enable: 0x0
         Write Enable: 0x0
         Interleave Enable: No interleave
0x54: Ox00000002 - DRAM Limit 2
         DRAM Limit: 0x0000FFFFFF
         Dst Node ID: 2
         Interleave Select: 0b0
0x58: Ox00000000 - DRAM Base 3
         DRAM Base: 0x0000000000
         Read Enable: 0x0
         Write Enable: 0x0
         Interleave Enable: No interleave
0x5C: Ox00000003 - DRAM Limit 3
         DRAM Limit: 0x0000FFFFFF
         Dst Node ID: 3
         Interleave Select: 0b0
0x60: Ox00000000 - DRAM Base 4
         DRAM Base: 0x0000000000
         Read Enable: 0x0
         Write Enable: 0x0
         Interleave Enable: No interleave
0x64: Ox00000004 - DRAM Limit 4
         DRAM Limit: 0x0000FFFFFF
         Dst Node ID: 4
         Interleave Select: 0b0
0x68: Ox00000000 - DRAM Base 5
         DRAM Base: 0x0000000000
         Read Enable: 0x0
         Write Enable: 0x0
         Interleave Enable: No interleave
0x6C: Ox00000005 - DRAM Limit 5
         DRAM Limit: 0x0000FFFFFF
         Dst Node ID: 5
         Interleave Select: 0b0
0x70: Ox00000000 - DRAM Base 6
         DRAM Base: 0x0000000000
         Read Enable: 0x0
         Write Enable: 0x0
         Interleave Enable: No interleave
0x74: Ox00000006 - DRAM Limit 6
         DRAM Limit: 0x0000FFFFFF
         Dst Node ID: 6
         Interleave Select: 0b0
0x78: Ox00000000 - DRAM Base 7
         DRAM Base: 0x0000000000
         Read Enable: 0x0
         Write Enable: 0x0
         Interleave Enable: No interleave
0x7C: Ox00000007 - DRAM Limit 7
         DRAM Limit: 0x0000FFFFFF
         Dst Node ID: 7
         Interleave Select: 0b0
0x80: Ox00E00003 - Memory Mapped I/O Base 0
         MMIO Base: 0x00E0000000
         Read Enable: 0x1
         Write Enable: 0x1
         CPU Disable: 0x0
         Lock: 0x0
0x84: Ox00EFFF80 - Memory Mapped I/O Limit 0
         MMIO Limit: 0x00EFFFFFFF
         Dst Node ID: 0
         Dst Link ID: 0
         Non Posted: 0x1
0x88: Ox00FEB003 - Memory Mapped I/O Base 1
         MMIO Base: 0x00FEB00000
         Read Enable: 0x1
         Write Enable: 0x1
         CPU Disable: 0x0
         Lock: 0x0
0x8C: Ox00FEC080 - Memory Mapped I/O Limit 1
         MMIO Limit: 0x00FEC0FFFF
         Dst Node ID: 0
         Dst Link ID: 0
         Non Posted: 0x1
0x90: Ox00000000 - Memory Mapped I/O Base 2
         MMIO Base: 0x0000000000
         Read Enable: 0x0
         Write Enable: 0x0
         CPU Disable: 0x0
         Lock: 0x0
0x94: Ox00000000 - Memory Mapped I/O Limit 2
         MMIO Limit: 0x000000FFFF
         Dst Node ID: 0
         Dst Link ID: 0
         Non Posted: 0x0
0x98: Ox00000000 - Memory Mapped I/O Base 3
         MMIO Base: 0x0000000000
         Read Enable: 0x0
         Write Enable: 0x0
         CPU Disable: 0x0
         Lock: 0x0
0x9C: Ox00000000 - Memory Mapped I/O Limit 3
         MMIO Limit: 0x000000FFFF
         Dst Node ID: 0
         Dst Link ID: 0
         Non Posted: 0x0
0xA0: Ox00000000 - Memory Mapped I/O Base 4
         MMIO Base: 0x0000000000
         Read Enable: 0x0
         Write Enable: 0x0
         CPU Disable: 0x0
         Lock: 0x0
0xA4: Ox00000000 - Memory Mapped I/O Limit 4
         MMIO Limit: 0x000000FFFF
         Dst Node ID: 0
         Dst Link ID: 0
         Non Posted: 0x0
0xA8: Ox00000000 - Memory Mapped I/O Base 5
         MMIO Base: 0x0000000000
         Read Enable: 0x0
         Write Enable: 0x0
         CPU Disable: 0x0
         Lock: 0x0
0xAC: Ox00000000 - Memory Mapped I/O Limit 5
         MMIO Limit: 0x000000FFFF
         Dst Node ID: 0
         Dst Link ID: 0
         Non Posted: 0x0
0xB0: Ox00000A03 - Memory Mapped I/O Base 6
         MMIO Base: 0x00000A0000
         Read Enable: 0x1
         Write Enable: 0x1
         CPU Disable: 0x0
         Lock: 0x0
0xB4: Ox00000B00 - Memory Mapped I/O Limit 6
         MMIO Limit: 0x00000BFFFF
         Dst Node ID: 0
         Dst Link ID: 0
         Non Posted: 0x0
0xB8: Ox00800003 - Memory Mapped I/O Base 7
         MMIO Base: 0x0080000000
         Read Enable: 0x1
         Write Enable: 0x1
         CPU Disable: 0x0
         Lock: 0x0
0xBC: Ox00FED300 - Memory Mapped I/O Limit 7
         MMIO Limit: 0x00FED3FFFF
         Dst Node ID: 0
         Dst Link ID: 0
         Non Posted: 0x0
0xC0: Ox00000000 - PCI I/O Base 0
         PCI IO Base: 0x0000
         Read Enable: 0x0
         Write Enable: 0x0
         VGA Enable: 0x0
         ISA Enable: 0x0
0xC4: Ox00000000 - PCI I/O Limit 0
         PCI IO Limit: 0x0000
         Dst Node ID: 0
         Dst Link ID: 0
0xC8: Ox00001013 - PCI I/O Base 1
         PCI IO Base: 0x0001
         Read Enable: 0x1
         Write Enable: 0x1
         VGA Enable: 0x1
         ISA Enable: 0x0
0xCC: Ox000FF000 - PCI I/O Limit 1
         PCI IO Limit: 0x00FF
         Dst Node ID: 0
         Dst Link ID: 0
0xD0: Ox00000000 - PCI I/O Base 2
         PCI IO Base: 0x0000
         Read Enable: 0x0
         Write Enable: 0x0
         VGA Enable: 0x0
         ISA Enable: 0x0
0xD4: Ox00000000 - PCI I/O Limit 2
         PCI IO Limit: 0x0000
         Dst Node ID: 0
         Dst Link ID: 0
0xD8: Ox00000000 - PCI I/O Base 3
         PCI IO Base: 0x0000
         Read Enable: 0x0
         Write Enable: 0x0
         VGA Enable: 0x0
         ISA Enable: 0x0
0xDC: Ox00000000 - PCI I/O Limit 3
         PCI IO Limit: 0x0000
         Dst Node ID: 0
         Dst Link ID: 0
0xE0: OxFF000003 - Configuration Base & Limit 0
         Bus Num Base: 0xFF
         Bus Num Limit: 0x00
         Read Enable: 0x1
         Write Enable: 0x1
         Device Number Compare Enable: 0x0
         Dst Node ID: 0
         Dst Link ID: 0
0xE4: Ox00000000 - Configuration Base & Limit 1
         Bus Num Base: 0x00
         Bus Num Limit: 0x00
         Read Enable: 0x0
         Write Enable: 0x0
         Device Number Compare Enable: 0x0
         Dst Node ID: 0
         Dst Link ID: 0
0xE8: Ox00000000 - Configuration Base & Limit 2
         Bus Num Base: 0x00
         Bus Num Limit: 0x00
         Read Enable: 0x0
         Write Enable: 0x0
         Device Number Compare Enable: 0x0
         Dst Node ID: 0
         Dst Link ID: 0
0xEC: Ox00000000 - Configuration Base & Limit 3
         Bus Num Base: 0x00
         Bus Num Limit: 0x00
         Read Enable: 0x0
         Write Enable: 0x0
         Device Number Compare Enable: 0x0
         Dst Node ID: 0
         Dst Link ID: 0
0xF0: Ox00000000 - DRAM Hole Address
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address 
Map
00: 22 10 01 11 00 00 00 00 00 00 00 06 00 00 80 00
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40: 03 00 00 00 00 00 7f 00 00 00 00 00 01 00 00 00
50: 00 00 00 00 02 00 00 00 00 00 00 00 03 00 00 00
60: 00 00 00 00 04 00 00 00 00 00 00 00 05 00 00 00
70: 00 00 00 00 06 00 00 00 00 00 00 00 07 00 00 00
80: 03 00 e0 00 80 ff ef 00 03 b0 fe 00 80 c0 fe 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 03 0a 00 00 00 0b 00 00 03 00 80 00 00 d3 fe 00
c0: 00 00 00 00 00 00 00 00 13 10 00 00 00 f0 0f 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 03 00 00 ff 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

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

Reply via email to