#define CPU_CLOCK 240000000
#define MACH_BCM MACH_BCM96338
#endif
-#if defined(CONFIG_BCM96345)
-#define CPU_CLOCK 140000000
-#define MACH_BCM MACH_BCM96345
-#endif
#if defined(CONFIG_BCM96348)
void __init calculateCpuSpeed(void);
static unsigned long cpu_speed;
#define CPU_CLOCK cpu_speed
#define MACH_BCM MACH_BCM96348
#endif
+#if defined(CONFIG_BCM96358)
+void __init calculateCpuSpeed(void);
+static unsigned long cpu_speed;
+#define CPU_CLOCK cpu_speed
+#define MACH_BCM MACH_BCM96358
+#endif
const char *get_system_type(void)
{
strcpy(arcs_cmdline, CONFIG_ROOT_FLASHFS);
#endif
+#if defined(CONFIG_BCM96358) && defined(CONFIG_BCM_ENDPOINT_MODULE)
+ add_memory_region(0, (getMemorySize() - 1024*1024), BOOT_MEM_RAM);
+#else
add_memory_region(0, (getMemorySize() - ADSL_SDRAM_IMAGE_SIZE), BOOT_MEM_RAM);
+#endif
-#if defined(CONFIG_BCM96348)
+#if defined(CONFIG_BCM96348) || defined(CONFIG_BCM96358)
calculateCpuSpeed();
#endif
/* Count register increments every other clock */
}
#endif
+#if defined(CONFIG_BCM96358)
+/* *********************************************************************
+ * calculateCpuSpeed()
+ * Calculate the BCM6358 CPU speed by reading the PLL Config register
+ * and applying the following formula:
+ * Fcpu_clk = (25 * MIPSDDR_NDIV) / MIPS_MDIV
+ * Input parameters:
+ * none
+ * Return value:
+ * none
+ ********************************************************************* */
+void __init calculateCpuSpeed(void)
+{
+ UINT32 pllConfig = DDR->MIPSDDRPLLConfig;
+ int numerator;
+
+ cpu_speed = 64000000 / ((pllConfig & MIPS_MDIV_MASK) >> MIPS_MDIV_SHFT);
+ numerator = (((pllConfig & MIPSDDR_N2_MASK) >> MIPSDDR_N2_SHFT) * ((pllConfig & MIPSDDR_N1_MASK) >> MIPSDDR_N1_SHFT));
+ cpu_speed = (cpu_speed * numerator) / 4;
+
+}
+#endif