Skip to contentSkip to conversation

powerpc/85xx: Rework MPC8536 SERDES is_serdes_configured support

PATCH New Kumar Gala 1 participant 1 message May 24, 2010 PowerPC

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 powerpc/85xx: Rework MPC8536 SERDES is_serdes_configured support

Move serdes init until after we are in ram so we can keep track of a global static protocal map for the particular serdes config we are in. This makes is_serdes_configured() much simplier and not constantly reading registers to determine if a given device is enabled based on the protocol.

---
 arch/powerpc/cpu/mpc85xx/cpu_init.c       |   12 ++---
 arch/powerpc/cpu/mpc85xx/mpc8536_serdes.c |   66 ++++++++++++++--------------
 arch/powerpc/include/asm/fsl_serdes.h     |    1 +
 include/configs/MPC8536DS.h               |    1 +
 4 files changed, 40 insertions(+), 40 deletions(-)
arch/powerpc/cpu/mpc85xx/cpu_init.c +5 -7
index 99431dc..e957677 100644
@@ -39,10 +39,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_MPC8536
-extern void fsl_serdes_init(void);
-#endif
-
 #ifdef CONFIG_QE
 extern qe_iop_conf_t qe_iop_conf_tab[];
 extern void qe_config_iopin(u8 port, u8 pin, int dir,
@@ -239,9 +235,6 @@ void cpu_init_f (void)
 	/* Config QE ioports */
 	config_qe_ioports();
 #endif
-#if defined(CONFIG_MPC8536)
-	fsl_serdes_init();
-#endif
 #if defined(CONFIG_FSL_DMA)
 	dma_init();
 #endif
@@ -386,6 +379,11 @@ int cpu_init_r(void)
 	qe_reset();
 #endif
 
+#if defined(CONFIG_SYS_HAS_SERDES)
+	/* needs to be in ram since code uses global static vars */
+	fsl_serdes_init();
+#endif
+
 #if defined(CONFIG_MP)
 	setup_mp();
 #endif
arch/powerpc/cpu/mpc85xx/mpc8536_serdes.c +33 -33

99 lines not on this page · raw message

arch/powerpc/include/asm/fsl_serdes.h +1 -0
index d4839f4..c7877b9 100644
@@ -44,5 +44,6 @@ enum srds_prtcl {
 };
 
 int is_serdes_configured(enum srds_prtcl device);
+void fsl_serdes_init(void);
 
 #endif /* __FSL_SERDES_H */
include/configs/MPC8536DS.h +1 -0
index da4313a..ab33c6c 100644
@@ -63,6 +63,7 @@
 #define CONFIG_FSL_PCI_INIT	1	/* Use common FSL init code */
 #define CONFIG_FSL_PCIE_RESET	1	/* need PCIe reset errata */
 #define CONFIG_SYS_PCI_64BIT	1	/* enable 64-bit PCI resources */
+#define CONFIG_SYS_HAS_SERDES	1	/* has SERDES */
 
 #define CONFIG_FSL_LAW		1	/* Use common FSL init code */
 #define CONFIG_E1000		1	/* Defind e1000 pci Ethernet card*/
Signature · 1 line
1.6.0.6