void __init plat_time_init(void) { unsigned long hz = 0; /* */ write_c0_count(0); write_c0_compare(0xffff); switch (bcm47xx_bus_type) { #ifdef CONFIG_BCM47XX_SSB case BCM47XX_BUS_TYPE_SSB: hz = ssb_cpu_clock(&bcm47xx_bus.ssb.mipscore) / 2; break; #endif #ifdef CONFIG_BCM47XX_BCMA case BCM47XX_BUS_TYPE_BCMA: hz = bcma_cpu_clock(&bcm47xx_bus.bcma.bus.drv_mips) / 2; break; #endif } if (!hz) hz = 100000000; /* */ mips_hpt_frequency = hz; }
void __init bcm47xx_time_init(void) { unsigned long hz; /* * Use deterministic values for initial counter interrupt * so that calibrate delay avoids encountering a counter wrap. */ write_c0_count(0); write_c0_compare(0xffff); hz = ssb_cpu_clock(&ssb.mipscore) / 2; if (!hz) hz = 100000000; /* Set MIPS counter frequency for fixed_rate_gettimeoffset() */ mips_hpt_frequency = hz; }