Skip to contentSkip to conversation

powerpc/srio: Update the SRIO LIODN registers and ID table macro

PATCH New Liu Gang 1 participant 3 messages Jun 25, 2013 PowerPC

lore
Share & tools
lore

Liu Gang

author
#0 lore raw

PATCH 1/3 powerpc/srio: Update the SRIO LIODN registers and ID table macro

For some PowerPC platforms, LIODN registers for SRIO ports are in SRIO register address space. So the ccsr_rio structure should be updated for those LIODN registers.

In addition, add a new macro "SET_SRIO_LIODN_BASE" to create the SRIO LIODN ID table based on the SRIO LIODN register address.

---
 arch/powerpc/include/asm/fsl_liodn.h  |    7 +++++++
 arch/powerpc/include/asm/immap_85xx.h |   16 ++++++++++++++++
 2 files changed, 23 insertions(+)
arch/powerpc/include/asm/fsl_liodn.h +7 -0
index d759de9..926fa7c 100644
@@ -45,6 +45,13 @@ struct srio_liodn_id_table {
 		+ CONFIG_SYS_MPC85xx_GUTS_OFFSET + CONFIG_SYS_CCSRBAR, \
 	}
 
+#define SET_SRIO_LIODN_BASE(port, id_a) \
+	{ .id = { id_a }, .num_ids = 1, .portid = port, \
+	  .reg_offset[0] = offsetof(struct ccsr_rio, liodn) \
+		+ (port - 1) * 0x200 \
+		+ CONFIG_SYS_FSL_SRIO_ADDR, \
+	}
+
 struct liodn_id_table {
 	const char * compat;
 	u32 id[2];
arch/powerpc/include/asm/immap_85xx.h +16 -0
index db70d04..324e0f8 100644
@@ -1560,6 +1560,18 @@ struct rio_pw {
 };
 #endif
 
+#ifdef CONFIG_SYS_FSL_SRIO_LIODN
+struct rio_liodn {
+	u32	plbr;
+	u8	res0[28];
+	u32	plaor;
+	u8	res1[12];
+	u32	pludr;
+	u32	plldr;
+	u8	res2[456];
+};
+#endif
+
 /* RapidIO Registers */
 struct ccsr_rio {
 	struct rio_arch	arch;
@@ -1582,6 +1594,10 @@ struct ccsr_rio {
 	u8	res7[100];
 	struct rio_pw	pw;
 #endif
+#ifdef CONFIG_SYS_FSL_SRIO_LIODN
+	u8	res5[8192];
+	struct rio_liodn liodn[CONFIG_SYS_FSL_SRIO_MAX_PORTS];
+#endif
 };
 #endif
 
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 2/3 powerpc/b4860: Correct LIODN assignment for SRIO

For B4, the SRIO LIODN registers are in SRIO address space and not in GUTs.

---
 arch/powerpc/cpu/mpc85xx/b4860_ids.c      |    4 ++--
 arch/powerpc/include/asm/config_mpc85xx.h |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/powerpc/cpu/mpc85xx/b4860_ids.c +2 -2
index 0f4e82e..f910486 100644
@@ -57,8 +57,8 @@ struct qportal_info qp_info[CONFIG_SYS_QMAN_NUM_PORTALS] = {
 
 #ifdef CONFIG_SYS_SRIO
 struct srio_liodn_id_table srio_liodn_tbl[] = {
-	SET_SRIO_LIODN_1(1, 307),
-	SET_SRIO_LIODN_1(2, 387),
+	SET_SRIO_LIODN_BASE(1, 307),
+	SET_SRIO_LIODN_BASE(2, 387),
 };
 int srio_liodn_tbl_sz = ARRAY_SIZE(srio_liodn_tbl);
 #endif
arch/powerpc/include/asm/config_mpc85xx.h +1 -0
index 1d46b14..bfcabab 100644
@@ -590,6 +590,7 @@
 #define CONFIG_SYS_FSL_SRIO_MAX_PORTS	2
 #define CONFIG_SYS_FSL_SRIO_OB_WIN_NUM	9
 #define CONFIG_SYS_FSL_SRIO_IB_WIN_NUM	5
+#define CONFIG_SYS_FSL_SRIO_LIODN
 #else
 #define CONFIG_MAX_CPUS			2
 #define CONFIG_SYS_FSL_CORES_PER_CLUSTER 2
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH 3/3 powerpc/t4: Correct LIODN assignment for SRIO

In reply to Liu Gang

For T4 platform, the SRIO LIODN registers are in SRIO address space and not in GUTs.

---
 arch/powerpc/cpu/mpc85xx/t4240_ids.c      |    4 ++--
 arch/powerpc/include/asm/config_mpc85xx.h |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/powerpc/cpu/mpc85xx/t4240_ids.c +2 -2
index a8f16b1..7e6d96e 100644
@@ -81,8 +81,8 @@ struct qportal_info qp_info[CONFIG_SYS_QMAN_NUM_PORTALS] = {
 #endif
 
 struct srio_liodn_id_table srio_liodn_tbl[] = {
-	SET_SRIO_LIODN_1(1, 307),
-	SET_SRIO_LIODN_1(2, 387),
+	SET_SRIO_LIODN_BASE(1, 307),
+	SET_SRIO_LIODN_BASE(2, 387),
 };
 int srio_liodn_tbl_sz = ARRAY_SIZE(srio_liodn_tbl);
 
arch/powerpc/include/asm/config_mpc85xx.h +1 -0
index bfcabab..8ba199f 100644
@@ -550,6 +550,7 @@
 #define CONFIG_SYS_FSL_SRIO_MAX_PORTS	2
 #define CONFIG_SYS_FSL_SRIO_OB_WIN_NUM	9
 #define CONFIG_SYS_FSL_SRIO_IB_WIN_NUM	5
+#define CONFIG_SYS_FSL_SRIO_LIODN
 #define CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE
 #define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY
 #define CONFIG_SYS_FSL_ERRATUM_A004468
Signature · 1 line
1.7.9.5