Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205469
b: refs/heads/master
c: a0c173b
h: refs/heads/master
i:
  205467: 2df0547
v: v3
  • Loading branch information
Jacob Pan authored and H. Peter Anvin committed May 19, 2010
1 parent 60d8330 commit 970c423
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1dedefd1a066a795a87afca9c0236e1a94de9bf6
refs/heads/master: a0c173bd8a3fd0541be8e4ef962170e48d8811c7
19 changes: 19 additions & 0 deletions trunk/arch/x86/include/asm/mrst.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,27 @@
#ifndef _ASM_X86_MRST_H
#define _ASM_X86_MRST_H
extern int pci_mrst_init(void);
extern int mrst_identify_cpu(void);
int __init sfi_parse_mrtc(struct sfi_table_header *table);

/*
* Medfield is the follow-up of Moorestown, it combines two chip solution into
* one. Other than that it also added always-on and constant tsc and lapic
* timers. Medfield is the platform name, and the chip name is called Penwell
* we treat Medfield/Penwell as a variant of Moorestown. Penwell can be
* identified via MSRs.
*/
enum mrst_cpu_type {
MRST_CPU_CHIP_LINCROFT = 1,
MRST_CPU_CHIP_PENWELL,
};

enum mrst_timer_options {
MRST_TIMER_DEFAULT,
MRST_TIMER_APBT_ONLY,
MRST_TIMER_LAPIC_APBT,
};

#define SFI_MTMR_MAX_NUM 8
#define SFI_MRTC_MAX 8

Expand Down
26 changes: 26 additions & 0 deletions trunk/arch/x86/kernel/mrst.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

static u32 sfi_mtimer_usage[SFI_MTMR_MAX_NUM];
static struct sfi_timer_table_entry sfi_mtimer_array[SFI_MTMR_MAX_NUM];
static int mrst_cpu_chip;

int sfi_mtimer_num;

struct sfi_rtc_table_entry sfi_mrtc_array[SFI_MRTC_MAX];
Expand Down Expand Up @@ -216,6 +218,28 @@ static void __init mrst_setup_boot_clock(void)
setup_boot_APIC_clock();
};

int mrst_identify_cpu(void)
{
return mrst_cpu_chip;
}
EXPORT_SYMBOL_GPL(mrst_identify_cpu);

void __cpuinit mrst_arch_setup(void)
{
if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x27)
mrst_cpu_chip = MRST_CPU_CHIP_PENWELL;
else if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x26)
mrst_cpu_chip = MRST_CPU_CHIP_LINCROFT;
else {
pr_err("Unknown Moorestown CPU (%d:%d), default to Lincroft\n",
boot_cpu_data.x86, boot_cpu_data.x86_model);
mrst_cpu_chip = MRST_CPU_CHIP_LINCROFT;
}
pr_debug("Moorestown CPU %s identified\n",
(mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT) ?
"Lincroft" : "Penwell");
}

/*
* Moorestown specific x86_init function overrides and early setup
* calls.
Expand All @@ -230,6 +254,8 @@ void __init x86_mrst_early_setup(void)

x86_init.irqs.pre_vector_init = x86_init_noop;

x86_init.oem.arch_setup = mrst_arch_setup;

x86_cpuinit.setup_percpu_clockev = mrst_setup_secondary_clock;

x86_platform.calibrate_tsc = mrst_calibrate_tsc;
Expand Down

0 comments on commit 970c423

Please sign in to comment.