Skip to contentSkip to conversation

mpc8610hpcd: set the guarded bit to DBAT of system memory

PATCH New Dave Liu 3 participants 4 messages Mar 25, 2010 – Mar 27, 2010

lore
Share & tools
lore

Dave Liu

author
#0 lore raw

PATCH 1/1 mpc8610hpcd: set the guarded bit to DBAT of system memory

The BAT of system memory is setting as 2GB block, however the mpc8610hpcd is shipping with 512MB DDR2 memory, there will be a hole in the 2GB memory space, no any physical memory cover the hole. It will cause PPC speculative data access to the hole, the result is machine check.

There are two options to resolve the issue, one is changing the block size to 512MB, another one is setting the G bit to DBAT. but the mpc8610hpcd memory is DIMM-based, the size is variable. so the second option is the best.

The issue is seen by Timur Tabi with the latest u-boot tree when boot up the Linux kernel.

---
 include/configs/MPC8610HPCD.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
include/configs/MPC8610HPCD.h +7 -2
index 1d2d659..629c971 100644
@@ -338,10 +338,15 @@
 #endif	/* CONFIG_PCI */
 
 /*
- * BAT0		2G	Cacheable, non-guarded
+ * BAT0		2G	Cacheable, guarded for data side. it will avoid
+ *                      speculative data access to the memory hole when
+ *                      the board use the DIMM memory size < 2GB, such as
+ *                      512MB. If you need better performance in u-boot,
+ *                      use the matching memory size to BAT.
+ *
  * 0x0000_0000	2G	DDR
  */
-#define CONFIG_SYS_DBAT0L	(BATL_PP_RW | BATL_MEMCOHERENCE)
+#define CONFIG_SYS_DBAT0L	(BATL_PP_RW | BATL_MEMCOHERENCE | BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT0U	(BATU_BL_2G | BATU_VS | BATU_VP)
 #define CONFIG_SYS_IBAT0L	(BATL_PP_RW | BATL_MEMCOHERENCE )
 #define CONFIG_SYS_IBAT0U	CONFIG_SYS_DBAT0U
Signature · 1 line
1.6.4
#1 lore raw

PATCH 1/1 mpc8610hpcd: set the guarded bit to DBAT of system memory

Quoted 11 lines · Dave Liu

The BAT of system memory is setting as 2GB block, however the mpc8610hpcd is shipping with 512MB DDR2 memory, there will be a hole in the 2GB memory space, no any physical memory cover the hole. It will cause PPC speculative data access to the hole, the result is machine check.

There are two options to resolve the issue, one is changing the block size to 512MB, another one is setting the G bit to DBAT. but the mpc8610hpcd memory is DIMM-based, the size is variable. so the second option is the best.

Quoted 8 lines

The issue is seen by Timur Tabi with the latest u-boot tree when boot up the Linux kernel.

---
include/configs/MPC8610HPCD.h | 9 +++++++--

1 files changed, 7 insertions(+), 2 deletions(-)

Wolfgang, can you pick this up for v2010.03

- k

Quoted 25 lines
include/configs/MPC8610HPCD.h +7 -2
index 1d2d659..629c971 100644
@@ -338,10 +338,15 @@
 #endif	/* CONFIG_PCI */
 
 /*
- * BAT0		2G	Cacheable, non-guarded
+ * BAT0		2G	Cacheable, guarded for data side. it will avoid
+ *                      speculative data access to the memory hole when
+ *                      the board use the DIMM memory size < 2GB, such as
+ *                      512MB. If you need better performance in u-boot,
+ *                      use the matching memory size to BAT.
+ *
 * 0x0000_0000	2G	DDR
 */
-#define CONFIG_SYS_DBAT0L	(BATL_PP_RW | BATL_MEMCOHERENCE)
+#define CONFIG_SYS_DBAT0L	(BATL_PP_RW | BATL_MEMCOHERENCE | BATL_GUARDEDSTORAGE)
 #define CONFIG_SYS_DBAT0U	(BATU_BL_2G | BATU_VS | BATU_VP)
 #define CONFIG_SYS_IBAT0L	(BATL_PP_RW | BATL_MEMCOHERENCE )
 #define CONFIG_SYS_IBAT0U	CONFIG_SYS_DBAT0U
Signature · 1 line
1.6.4
#2 lore raw

PATCH 1/1 mpc8610hpcd: set the guarded bit to DBAT of system memory

Quoted 3 lines · Kumar Gala

Wolfgang, can you pick this up for v2010.03

No, don't pick this up. Making all of DDR guarded is not the right fix for this problem. I have a better patch coming that provides a real fix.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
#3 lore raw

PATCH 1/1 mpc8610hpcd: set the guarded bit to DBAT of system memory

Quoted 9 lines · Timur Tabi
Quoted 3 lines · Kumar Gala

Wolfgang, can you pick this up for v2010.03

No, don't pick this up. Making all of DDR guarded is not the right fix for this problem. I have a better patch coming that provides a real fix.

Unless that makes it really soon, I'd rather have a fix in for v2010.03 even if its not quite right. I'd prefer the solution I believe you are looking at to dynamically set the BAT size based on the ddr size.

- k