Skip to contentSkip to conversation

arm: ls102xa: Add silicon version detection for QDS and TWR boards

PATCH New Alison Wang 1 participant 2 messages Feb 13, 2015 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 arm: ls102xa: Add silicon version detection for QDS and TWR boards

For LS102xA, some workarounds are only used in VER1.0, so silicon version detection are added for QDS and TWR boards.

---
 arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h |  3 +
 board/freescale/ls1021aqds/ls1021aqds.c           | 69 ++++++++++++++++-------
 board/freescale/ls1021atwr/ls1021atwr.c           | 19 +++++--
 3 files changed, 64 insertions(+), 27 deletions(-)
arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h +3 -0
index f70d568..4b1cd3b 100644
@@ -17,6 +17,9 @@
 #define SOC_VER_LS1021		0x11
 #define SOC_VER_LS1022		0x12
 
+#define SOC_VER_1_0		0x1
+#define SOC_VER_2_0		0x2
+
 #define CCSR_BRR_OFFSET		0xe4
 #define CCSR_SCRATCHRW1_OFFSET	0x200
 
board/freescale/ls1021aqds/ls1021aqds.c +48 -21

109 lines not on this page · raw message

board/freescale/ls1021atwr/ls1021atwr.c +13 -6
index bc8b006..bd6068f 100644
@@ -264,6 +264,11 @@ int board_early_init_f(void)
 {
 	struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
 	struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
+	struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+	unsigned int svr, major;
+
+	svr = in_be32(&gur->svr);
+	major = SVR_MAJ(svr);
 
 #ifdef CONFIG_TSEC_ENET
 	out_be32(&scfg->etsecdmamcr, SCFG_ETSECDMAMCR_LE_BD_FR);
@@ -289,12 +294,14 @@ int board_early_init_f(void)
 	out_le32(&cci->slave[4].snoop_ctrl,
 		 CCI400_DVM_MESSAGE_REQ_EN | CCI400_SNOOP_REQ_EN);
 
-	/*
-	 * Set CCI-400 Slave interface S1, S2 Shareable Override Register
-	 * All transactions are treated as non-shareable
-	 */
-	out_le32(&cci->slave[1].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
-	out_le32(&cci->slave[2].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
+	if (major == SOC_VER_1_0) {
+		/*
+		 * Set CCI-400 Slave interface S1, S2 Shareable Override
+		 * Register All transactions are treated as non-shareable
+		 */
+		out_le32(&cci->slave[1].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
+		out_le32(&cci->slave[2].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
+	}
 
 	return 0;
 }
Signature · 1 line
2.1.0.27.g96db324
#1 lore raw

PATCH 2/2 arm: ls102xa: Fix interleaving issue on CCI400 slave interface S2

On silicon VER1.0, there is an interleaving issue on CCI400 slave interface S2. The workaround is to enable regulation of outstanding read transactions for slave interface S2.

---
 arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h | 2 ++
 board/freescale/ls1021aqds/ls1021aqds.c           | 7 +++++++
 board/freescale/ls1021atwr/ls1021atwr.c           | 7 +++++++
 3 files changed, 16 insertions(+)
arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h +2 -0
index 4b1cd3b..1a61d4a 100644
@@ -463,6 +463,8 @@ struct ccsr_ddr {
 #define CCI400_SHAORD_NON_SHAREABLE	0x00000002
 #define CCI400_DVM_MESSAGE_REQ_EN	0x00000002
 #define CCI400_SNOOP_REQ_EN		0x00000001
+#define CCI400_REGULATION_READ_EN	0x00000008
+#define CCI400_INT_MAX_OUT_TRANS	0x01000000
 
 /* CCI-400 registers */
 struct ccsr_cci400 {
board/freescale/ls1021aqds/ls1021aqds.c +7 -0
index b6bba6c..93df046 100644
@@ -217,6 +217,13 @@ int board_early_init_f(void)
 		 */
 		out_le32(&cci->slave[1].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
 		out_le32(&cci->slave[2].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
+		/*
+		 * To fix interleaving issue on VER1.0, regulation of
+		 * outstanding read transactions for slave interface S2
+		 * is enabled
+		 */
+		out_le32(&cci->slave[2].qos_ctrl, CCI400_REGULATION_READ_EN);
+		out_le32(&cci->slave[2].max_ot, CCI400_INT_MAX_OUT_TRANS);
 
 		/* Workaround for the issue that DDR could not respond to
 		 * barrier transaction which is generated by executing DSB/ISB
board/freescale/ls1021atwr/ls1021atwr.c +7 -0
index bd6068f..9101bd6 100644
@@ -301,6 +301,13 @@ int board_early_init_f(void)
 		 */
 		out_le32(&cci->slave[1].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
 		out_le32(&cci->slave[2].sha_ord, CCI400_SHAORD_NON_SHAREABLE);
+		/*
+		 * To fix interleaving issue on VER1.0, regulation of
+		 * outstanding read transactions for slave interface S2
+		 * is enabled
+		 */
+		out_le32(&cci->slave[2].qos_ctrl, CCI400_REGULATION_READ_EN);
+		out_le32(&cci->slave[2].max_ot, CCI400_INT_MAX_OUT_TRANS);
 	}
 
 	return 0;
Signature · 1 line
2.1.0.27.g96db324