Browse Source

poweprc/85xx: add QMan frequency info and fdt fixup.

Starting from QMan3.0, the QMan clock cycle needs be exposed so that the kernel
driver can use it to calculate the shaper prescaler and rate.

Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Haiying Wang 12 years ago
parent
commit
990e1a8ce1

+ 4 - 0
arch/powerpc/cpu/mpc85xx/cpu.c

@@ -217,6 +217,10 @@ int checkcpu (void)
 	}
 	}
 #endif
 #endif
 
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+	printf("       QMAN:  %s MHz\n", strmhz(buf1, sysinfo.freqQMAN));
+#endif
+
 #ifdef CONFIG_SYS_DPAA_PME
 #ifdef CONFIG_SYS_DPAA_PME
 	printf("       PME:   %s MHz\n", strmhz(buf1, sysinfo.freqPME));
 	printf("       PME:   %s MHz\n", strmhz(buf1, sysinfo.freqPME));
 #endif
 #endif

+ 5 - 0
arch/powerpc/cpu/mpc85xx/fdt.c

@@ -411,6 +411,11 @@ static void ft_fixup_dpaa_clks(void *blob)
 #endif
 #endif
 #endif
 #endif
 
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+	do_fixup_by_compat_u32(blob, "fsl,qman",
+			"clock-frequency", sysinfo.freqQMAN, 1);
+#endif
+
 #ifdef CONFIG_SYS_DPAA_PME
 #ifdef CONFIG_SYS_DPAA_PME
 	do_fixup_by_compat_u32(blob, "fsl,pme",
 	do_fixup_by_compat_u32(blob, "fsl,pme",
 		"clock-frequency", sysinfo.freqPME, 1);
 		"clock-frequency", sysinfo.freqPME, 1);

+ 4 - 0
arch/powerpc/cpu/mpc85xx/speed.c

@@ -167,6 +167,10 @@ void get_sys_info (sys_info_t * sysInfo)
 	}
 	}
 #endif
 #endif
 
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+	sysInfo->freqQMAN = sysInfo->freqSystemBus / 2;
+#endif
+
 #ifdef CONFIG_SYS_DPAA_FMAN
 #ifdef CONFIG_SYS_DPAA_FMAN
 	switch ((rcw_tmp & FM1_CLK_SEL) >> FM1_CLK_SHIFT) {
 	switch ((rcw_tmp & FM1_CLK_SEL) >> FM1_CLK_SHIFT) {
 	case 1:
 	case 1:

+ 3 - 0
include/e500.h

@@ -18,6 +18,9 @@ typedef struct
 #ifdef CONFIG_SYS_DPAA_FMAN
 #ifdef CONFIG_SYS_DPAA_FMAN
   unsigned long freqFMan[CONFIG_SYS_NUM_FMAN];
   unsigned long freqFMan[CONFIG_SYS_NUM_FMAN];
 #endif
 #endif
+#ifdef CONFIG_SYS_DPAA_QBMAN
+  unsigned long freqQMAN;
+#endif
 #ifdef CONFIG_SYS_DPAA_PME
 #ifdef CONFIG_SYS_DPAA_PME
   unsigned long freqPME;
   unsigned long freqPME;
 #endif
 #endif