summaryrefslogtreecommitdiff
path: root/src/mainboard/totalimpact/briq/clock.c
blob: 76827653a6af5ad4a87e8a51a09266f47974ab3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <stdint.h>
#include "../../../northbridge/ibm/cpc710/cpc710.h"

/*
 * Bus clock jumper settings on SIOR0 27:28
 */
static uint32_t BusClockSpeed[] = {
	66000000,	/* 00 */
	83000000,	/* 01 */
	100000000,	/* 10 */
	133000000	/* 11 */
};

/*
 * Timer frequency is 1/4 of the bus clock frequency.
 *
 * For the briQ, bits 27:28 of SIOR0 encode bus clock frequency.
 */
unsigned long 
get_timer_freq(void)
{
	uint32_t sior0 = getCPC710(CPC710_SDRAM0_SIOR0);

	return BusClockSpeed[(sior0 >> 3) & 0x2] / 4;
}

/*
 * Frequency of PCI bus.
 * 
 * For the briQ, bit 29 of SIOR0 is 66MHz enable (active low).
 */
unsigned long 
get_pci_bus_freq(void)
{
	uint32_t sior0 = getCPC710(CPC710_SDRAM0_SIOR0);

	if (sior0 & 0x4 == 0x4)
		return 33000000;

	return 66000000;
}