/* * Estimate CPU and GIC frequencies.
*/ staticvoid __init estimate_frequencies(void)
{ unsignedlong flags; unsignedint count, start; unsignedchar secs1, secs2, ctrl; int secs;
u64 giccount = 0, gicstart = 0;
local_irq_save(flags);
if (mips_gic_present())
clear_gic_config(GIC_CONFIG_COUNTSTOP);
/* * Read counters exactly on rising edge of update flag. * This helps get an accurate reading under virtualisation.
*/ while (CMOS_READ(RTC_REG_A) & RTC_UIP); while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
start = read_c0_count(); if (mips_gic_present())
gicstart = read_gic_counter();
/* Wait for falling edge before reading RTC. */ while (CMOS_READ(RTC_REG_A) & RTC_UIP);
secs1 = CMOS_READ(RTC_SECONDS);
/* Read counters again exactly on rising edge of update flag. */ while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
count = read_c0_count(); if (mips_gic_present())
giccount = read_gic_counter();
/* Wait for falling edge before reading RTC again. */ while (CMOS_READ(RTC_REG_A) & RTC_UIP);
secs2 = CMOS_READ(RTC_SECONDS);
int get_c0_fdc_int(void)
{ /* * Some cores claim the FDC is routable through the GIC, but it doesn't * actually seem to be connected for those Malta bitstreams.
*/ switch (current_cpu_type()) { case CPU_INTERAPTIV: case CPU_PROAPTIV: return -1;
}
/* Set 32KHz time base if not already set */
freq = CMOS_READ(RTC_FREQ_SELECT); if ((freq & RTC_DIV_CTL) != RTC_REF_CLCK_32KHZ)
CMOS_WRITE(RTC_REF_CLCK_32KHZ, RTC_FREQ_SELECT);
/* Ensure SET bit is clear so RTC can run */
ctrl = CMOS_READ(RTC_CONTROL); if (ctrl & RTC_SET)
CMOS_WRITE(ctrl & ~RTC_SET, RTC_CONTROL);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.