<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Decoding the DIMM geometry in Software Tuning, Performance Optimization &amp; Platform Monitoring</title>
    <link>https://community.intel.com/t5/Software-Tuning-Performance/Decoding-the-DIMM-geometry/m-p/1182168#M7474</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Querying the PCi MCHBAR(0x44) of chipset 945 series, I try to decode the geometry of DIMMs in terms of rows, columns, banks, ranks&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Using my Linux kernel module &lt;A href="https://github.com/cyring/CoreFreq/blob/master/corefreqk.c"&gt;code&lt;/A&gt;, I'm getting the number of channels(2), banks and ranks and major latencies; but that's not enough to&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;compute the size of each DIMM and total memory.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;(&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;&lt;EM&gt;Hardware is made of two 512MB PC2-5300 CL5 SODIMM&lt;/EM&gt; )&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;I don't find the specific bits to compute the number of &lt;/SPAN&gt;&lt;STRONG style="font-size: 1em;"&gt;populated slots&lt;/STRONG&gt;&lt;SPAN style="font-size: 1em;"&gt;, rows, and columns ?&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;CoreFreq(0:-1): Processor [ 06_0F] Architecture [Core2/Conroe/Merom] CPU [2/2]
C0DRA0=3	C0DRA2=0
C0DRB=10101010
C0DRC0=40000a06
C0DRC1=f40e1900	C0DRC2=e000000
C0DCLK=3
C0BNKARC=0
C0DRAMW=1
C1DRA0=3	C1DRA2=0
C1DRB=1010
C1DRC0=40000a06
C1DRC1=f40e1900	C1DRC2=e000000
C1DCLK=3
C1BNKARC=0
C1DRAMW=0
&lt;/PRE&gt;

&lt;PRE class="brush:cpp;"&gt;typedef union
{	// Offset Channel0: 120h
	unsigned int		value;
	struct {
		unsigned int
		DT				:  2-0,
		ReservedBits1	:  4-2,
		SMS				:  7-4,
		ReservedBits2	:  8-7,
		RMS				: 11-8,
		ReservedBits3	: 29-11,
		IC				: 30-29,
		ReservedBits4	: 32-30;
	};
} P945_MC_DRC0;

typedef union
{	// Offset Channel0: 200h
	unsigned int		value;
	struct {
		unsigned int
		DAMC			:  2-0,
		SCS				:  3-2,
		ReservedBits1	:  9-3,
		Channel_XOR		: 10-9,
		Cha_XOR_Random	: 11-10,
		ReservedBits2	: 14-11,
		ReservedBits3	: 16-14,
		SMS				: 19-16,
		IC				: 20-19,
		IC_SMS_Ctrl		: 21-20,
		EMRS			: 23-21,
		ReservedBits4	: 24-23,
		ReservedBits5	: 29-24,
		ReservedBits6	: 32-29;
	};
} P945_MC_DCC;

void Query_P945(void __iomem *mchmap)
{	// Source: Mobile Intel 945 Express Chipset Family
	unsigned short channelCount, cha;
	unsigned int DRA0 = 0, DRA2 = 0, DRC1 = 0, DRC2 = 0, DRB = 0,
			BNKARC = 0, DCLK = 0, DRAMW = 0;
	P945_MC_DRC0 DRC0;
	P945_MC_DCC DCC;

	DCC.value = readl(mchmap + 0x200);

	switch (DCC.DAMC) {
	case 0b00:
	case 0b11:
		channelCount = 1;
		break;
	case 0b01:
	case 0b10:
		channelCount = 2;
		break;
	}

	for (cha = 0; cha &amp;lt; channelCount; cha++) {
		DRAMW = readw(mchmap + 0x40c + 0x80 * cha);
		DRA0 = readb(mchmap + 0x108 + 0x80 * cha);
		if (cha == 0) {
			DRAMW &amp;amp;= 0b11111111;
			DRA2 = readb(mchmap + 0x109 + 0x80 * cha);
			DRB = readl(mchmap + 0x100);
		} else {
			DRAMW &amp;amp;= 0b1111;
			DRA2 = 0;
			DRB = readw(mchmap + 0x180);
		}
		DCLK = readb(mchmap + 0x10c + 0x80 * cha);
		BNKARC = readw(mchmap + 0x10e + 0x80 * cha);
		DRC0.value = readl(mchmap + 0x120 + 0x80 * cha);
		DRC1 = readl(mchmap + 0x124 + 0x80 * cha);
		DRC2 = readl(mchmap + 0x128 + 0x80 * cha);

		printk("C%uDRA0=%x\tC%uDRA2=%x\n", cha, DRA0, cha, DRA2);
		printk("C%uDRB=%x\n", cha, DRB);
		printk("C%uDRC0=%x\n",cha, DRC0.value);
		printk("C%uDRC1=%x\tC%uDRC2=%x\n",cha, DRC1, cha, DRC2);
		printk("C%uDCLK=%x\n", cha, DCLK);
		printk("C%uBNKARC=%x\n", cha, BNKARC);
		printk("C%uDRAMW=%x\n", cha, DRAMW);
	}
}&lt;/PRE&gt;

&lt;P&gt;Documentation is the datasheet of the Intel 945 Express Chipset Family; June 2008; Document Number: &lt;A href="https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/mobile-945-express-chipset-datasheet.pdf"&gt;309219-006&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks for any help&lt;/P&gt;

&lt;P&gt;CyrIng&lt;/P&gt;</description>
    <pubDate>Sun, 13 May 2018 07:53:20 GMT</pubDate>
    <dc:creator>CyrIng</dc:creator>
    <dc:date>2018-05-13T07:53:20Z</dc:date>
    <item>
      <title>Decoding the DIMM geometry</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/Decoding-the-DIMM-geometry/m-p/1182168#M7474</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Querying the PCi MCHBAR(0x44) of chipset 945 series, I try to decode the geometry of DIMMs in terms of rows, columns, banks, ranks&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Using my Linux kernel module &lt;A href="https://github.com/cyring/CoreFreq/blob/master/corefreqk.c"&gt;code&lt;/A&gt;, I'm getting the number of channels(2), banks and ranks and major latencies; but that's not enough to&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;compute the size of each DIMM and total memory.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;(&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;&lt;EM&gt;Hardware is made of two 512MB PC2-5300 CL5 SODIMM&lt;/EM&gt; )&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;I don't find the specific bits to compute the number of &lt;/SPAN&gt;&lt;STRONG style="font-size: 1em;"&gt;populated slots&lt;/STRONG&gt;&lt;SPAN style="font-size: 1em;"&gt;, rows, and columns ?&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;CoreFreq(0:-1): Processor [ 06_0F] Architecture [Core2/Conroe/Merom] CPU [2/2]
C0DRA0=3	C0DRA2=0
C0DRB=10101010
C0DRC0=40000a06
C0DRC1=f40e1900	C0DRC2=e000000
C0DCLK=3
C0BNKARC=0
C0DRAMW=1
C1DRA0=3	C1DRA2=0
C1DRB=1010
C1DRC0=40000a06
C1DRC1=f40e1900	C1DRC2=e000000
C1DCLK=3
C1BNKARC=0
C1DRAMW=0
&lt;/PRE&gt;

&lt;PRE class="brush:cpp;"&gt;typedef union
{	// Offset Channel0: 120h
	unsigned int		value;
	struct {
		unsigned int
		DT				:  2-0,
		ReservedBits1	:  4-2,
		SMS				:  7-4,
		ReservedBits2	:  8-7,
		RMS				: 11-8,
		ReservedBits3	: 29-11,
		IC				: 30-29,
		ReservedBits4	: 32-30;
	};
} P945_MC_DRC0;

typedef union
{	// Offset Channel0: 200h
	unsigned int		value;
	struct {
		unsigned int
		DAMC			:  2-0,
		SCS				:  3-2,
		ReservedBits1	:  9-3,
		Channel_XOR		: 10-9,
		Cha_XOR_Random	: 11-10,
		ReservedBits2	: 14-11,
		ReservedBits3	: 16-14,
		SMS				: 19-16,
		IC				: 20-19,
		IC_SMS_Ctrl		: 21-20,
		EMRS			: 23-21,
		ReservedBits4	: 24-23,
		ReservedBits5	: 29-24,
		ReservedBits6	: 32-29;
	};
} P945_MC_DCC;

void Query_P945(void __iomem *mchmap)
{	// Source: Mobile Intel 945 Express Chipset Family
	unsigned short channelCount, cha;
	unsigned int DRA0 = 0, DRA2 = 0, DRC1 = 0, DRC2 = 0, DRB = 0,
			BNKARC = 0, DCLK = 0, DRAMW = 0;
	P945_MC_DRC0 DRC0;
	P945_MC_DCC DCC;

	DCC.value = readl(mchmap + 0x200);

	switch (DCC.DAMC) {
	case 0b00:
	case 0b11:
		channelCount = 1;
		break;
	case 0b01:
	case 0b10:
		channelCount = 2;
		break;
	}

	for (cha = 0; cha &amp;lt; channelCount; cha++) {
		DRAMW = readw(mchmap + 0x40c + 0x80 * cha);
		DRA0 = readb(mchmap + 0x108 + 0x80 * cha);
		if (cha == 0) {
			DRAMW &amp;amp;= 0b11111111;
			DRA2 = readb(mchmap + 0x109 + 0x80 * cha);
			DRB = readl(mchmap + 0x100);
		} else {
			DRAMW &amp;amp;= 0b1111;
			DRA2 = 0;
			DRB = readw(mchmap + 0x180);
		}
		DCLK = readb(mchmap + 0x10c + 0x80 * cha);
		BNKARC = readw(mchmap + 0x10e + 0x80 * cha);
		DRC0.value = readl(mchmap + 0x120 + 0x80 * cha);
		DRC1 = readl(mchmap + 0x124 + 0x80 * cha);
		DRC2 = readl(mchmap + 0x128 + 0x80 * cha);

		printk("C%uDRA0=%x\tC%uDRA2=%x\n", cha, DRA0, cha, DRA2);
		printk("C%uDRB=%x\n", cha, DRB);
		printk("C%uDRC0=%x\n",cha, DRC0.value);
		printk("C%uDRC1=%x\tC%uDRC2=%x\n",cha, DRC1, cha, DRC2);
		printk("C%uDCLK=%x\n", cha, DCLK);
		printk("C%uBNKARC=%x\n", cha, BNKARC);
		printk("C%uDRAMW=%x\n", cha, DRAMW);
	}
}&lt;/PRE&gt;

&lt;P&gt;Documentation is the datasheet of the Intel 945 Express Chipset Family; June 2008; Document Number: &lt;A href="https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/mobile-945-express-chipset-datasheet.pdf"&gt;309219-006&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks for any help&lt;/P&gt;

&lt;P&gt;CyrIng&lt;/P&gt;</description>
      <pubDate>Sun, 13 May 2018 07:53:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/Decoding-the-DIMM-geometry/m-p/1182168#M7474</guid>
      <dc:creator>CyrIng</dc:creator>
      <dc:date>2018-05-13T07:53:20Z</dc:date>
    </item>
  </channel>
</rss>

