Patchwork errata#89 patch for Family 0Fh Prozessors

login
register
about
Submitter Rudolf Marek
Date 2011-02-02 21:20:28
Message ID <4D49CA9C.8000402@assembler.cz>
Download mbox | patch
Permalink /patch/2605/
State Superseded
Headers show

Comments

Rudolf Marek - 2011-02-02 21:20:28
While we are at it. I'm attaching some very old patch (r2978 ;)
which contains some errata fixes too, if you have some spare time please try to 
check if it is correct.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>


Thanks,
Rudolf
Alexandru Gagniuc - 2011-02-02 22:02:05
src/northbridge/amd/amdk8/coherent_ht_car.c was renamed to someting else
since then (I wasn't around then), and the patch can no longer be applied.

Can you please check this?

Alex

On 02/02/2011 11:20 PM, Rudolf Marek wrote:
> While we are at it. I'm attaching some very old patch (r2978 ;)
> which contains some errata fixes too, if you have some spare time please
> try to check if it is correct.
> 
> Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
> 
> 
> Thanks,
> Rudolf
>
Josef Kellermann - 2011-02-03 08:17:40
Am 02.02.2011 22:20, schrieb Rudolf Marek:
> While we are at it. I'm attaching some very old patch (r2978 ;)
> which contains some errata fixes too, if you have some spare time 
> please try to check if it is correct.
>
> Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
>
>
> Thanks,
> Rudolf
>
Hi,
are you sure ?

-#if K8_REV_F_SUPPORT == 1
-        /* Erratum 131... */
+        /* Erratum 131 is fixed together with erratum 169 */
          msr = rdmsr(NB_CFG_MSR);
-        msr.lo |= 1<<  20;
+        msr.lo |= 1<<  32;<=======================
          wrmsr(NB_CFG_MSR, msr);

Josef
Alexandru Gagniuc - 2011-02-03 09:14:22
On 02/03/2011 10:17 AM, Josef Kellermann wrote:
>> e are at it. I'm attaching some very old patch (r2978 ;)
>> which contains some errata fixes too, if you have some spare time
>> please try to check if it is correct.
>>
>> Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
>>
>>
>> Thanks,
>> Rudolf
>>
> Hi,
> are you sure ?

You're right:

AMD Publication #33610, page34

"[Regarding erratum #131]
Systems implementing the workaround for erratum #169 should not apply
this workaround."

So it seems AMD recommends either or, but not both.

Page 59:
"[Regarding erratum #169]
The workaround for this erratum supersedes the workaround for erratum
#131. When implementing
this workaround, the workaround for erratum #131 should not be applied."

So we better implement only 169, and explain in the comments why 131 is
left out.

Alex
Josef Kellermann - 2011-02-03 10:26:53
Am 03.02.2011 10:14, schrieb Alex G.:
> On 02/03/2011 10:17 AM, Josef Kellermann wrote:
>>> e are at it. I'm attaching some very old patch (r2978 ;)
>>> which contains some errata fixes too, if you have some spare time
>>> please try to check if it is correct.
>>>
>>> Signed-off-by: Rudolf Marek<r.marek@assembler.cz>
>>>
>>>
>>> Thanks,
>>> Rudolf
>>>
>> Hi,
>> are you sure ?
> You're right:
>
> AMD Publication #33610, page34
>
> "[Regarding erratum #131]
> Systems implementing the workaround for erratum #169 should not apply
> this workaround."
>
> So it seems AMD recommends either or, but not both.
>
> Page 59:
> "[Regarding erratum #169]
> The workaround for this erratum supersedes the workaround for erratum
> #131. When implementing
> this workaround, the workaround for erratum #131 should not be applied."
>
> So we better implement only 169, and explain in the comments why 131 is
> left out.
>
> Alex
>
>
Hi,
sorry for the misunderstanding.
Setting bit 32 in msr should be ->  'msr.hi |= (1<<  0)', no?

Josef
Alexandru Gagniuc - 2011-02-03 11:35:00
> Hi,
> sorry for the misunderstanding.
> Setting bit 32 in msr should be ->  'msr.hi |= (1<<  0)', no?
LOL! Nice catch.

This is what happens when you're still up at 6AM, obsessive drawing
lines on a Google Earth printscreen in order to finish a project due in
a few hours. :P

It's funny to see those logic mistakes made with so much ease. As for
#169, we should set 'msr.hi |= (1<<  0)' :P, "set
F0x68[22:21](DsNpReqLmt0) to 01b," and drop #131 altogether.

I'm assuming the second part means 0:18.0, register 0x6b-0x68[22:21], or
Rx6a[6-5].

reg = pci_read_config8(0:18.0, 0x6a);
reg |= 0x20;
pci_write_config8(0:18.0, 0x6a, reg);

Alex

Patch

Index: src/cpu/amd/model_fxx/model_fxx_init.c
===================================================================
--- src/cpu/amd/model_fxx/model_fxx_init.c	(revision 2978)
+++ src/cpu/amd/model_fxx/model_fxx_init.c	(working copy)
@@ -368,6 +368,7 @@ 
 static inline void k8_errata(void)
 {
 	msr_t msr;
+	u32 cpuid;
 #if K8_REV_F_SUPPORT == 0
 	if (is_cpu_pre_c0()) {
 		/* Erratum 63... */
@@ -439,7 +440,7 @@ 
 #endif
 
 #if K8_REV_F_SUPPORT == 0
-	if (!is_cpu_pre_e0()) 
+	if (!is_cpu_pre_d0())
 #endif
 	{
 		/* Erratum 110 ... */
@@ -453,13 +454,19 @@ 
 	msr.lo |= 1 << 6;
 	wrmsr(HWCR_MSR, msr);
 
-#if K8_REV_F_SUPPORT == 1
-        /* Erratum 131... */
+        /* Erratum 131 is fixed together with erratum 169 */
         msr = rdmsr(NB_CFG_MSR);
-        msr.lo |= 1 << 20;
+        msr.lo |= 1 << 32;
         wrmsr(NB_CFG_MSR, msr);
-#endif
 
+	cpuid = cpuid_eax(0x1);
+
+	/* Fixme erratum 113 JH-E1 DH-E3 */
+	if ((cpuid == 0x20f10) || (cpuid == 0x20FF0) || (cpuid == 0x20FC0)) {
+		msr = rdmsr_amd(BU_CFG_MSR);
+		msr.hi |= (1 << (48 - 32));
+		wrmsr_amd(BU_CFG_MSR, msr);
+	}
 }
 
 extern void model_fxx_update_microcode(unsigned cpu_deviceid);
===================================================================
--- src/northbridge/amd/amdk8/coherent_ht.c	(revision 2978)
+++ src/northbridge/amd/amdk8/coherent_ht.c	(working copy)
@@ -1704,6 +1704,12 @@ 
 				needs_reset = 1; /* Needed? */
 			}
 		}
+		/* Errata 169 */
+		dev = NODE_HT(node);
+		cmd = pci_read_config32(dev, 0x68);
+		cmd &= ~(3 << 21);
+		cmd |= (1 << 21);
+		pci_write_config32(dev, 0x68, cmd);
 #endif
 	}
 	return needs_reset;
Index: src/northbridge/amd/amdk8/amdk8.h
===================================================================
--- src/northbridge/amd/amdk8/amdk8.h	(revision 2978)
+++ src/northbridge/amd/amdk8/amdk8.h	(working copy)
@@ -135,6 +135,8 @@ 
 #define	 DCL_QFC_EN	   (1<<2)
 #define	 DCL_DisDqsHys	   (1<<3)
 #define	 DCL_Burst2Opt     (1<<5)
+/* Check errata 115 for JH-E1 */
+/* Check errata 116 */
 #define	 DCL_DramInit	   (1<<8)
 #define	 DCL_DualDIMMen    (1<<9)
 #define	 DCL_DramEnable	   (1<<10)
Index: src/northbridge/amd/amdk8/coherent_ht_car.c
===================================================================
--- src/northbridge/amd/amdk8/coherent_ht_car.c	(revision 2978)
+++ src/northbridge/amd/amdk8/coherent_ht_car.c	(working copy)
@@ -1703,6 +1703,12 @@ 
 				needs_reset = 1; /* Needed? */
 			}
 		}
+		/* Errata 169 */
+		dev = NODE_HT(node);
+		cmd = pci_read_config32(dev, 0x68);
+		cmd &= ~(3 << 21);
+		cmd |= (1 << 21);
+		pci_write_config32(dev, 0x68, cmd);
 #endif
 	}
 	return needs_reset;