diff options
| -rw-r--r-- | arch/x86/include/asm/mrst.h | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/mrst.c | 45 |
2 files changed, 47 insertions, 0 deletions
diff --git a/arch/x86/include/asm/mrst.h b/arch/x86/include/asm/mrst.h index fa144f2dd256..451d30e7f62d 100644 --- a/arch/x86/include/asm/mrst.h +++ b/arch/x86/include/asm/mrst.h | |||
| @@ -11,7 +11,9 @@ | |||
| 11 | #ifndef _ASM_X86_MRST_H | 11 | #ifndef _ASM_X86_MRST_H |
| 12 | #define _ASM_X86_MRST_H | 12 | #define _ASM_X86_MRST_H |
| 13 | extern int pci_mrst_init(void); | 13 | extern int pci_mrst_init(void); |
| 14 | int __init sfi_parse_mrtc(struct sfi_table_header *table); | ||
| 14 | 15 | ||
| 15 | #define SFI_MTMR_MAX_NUM 8 | 16 | #define SFI_MTMR_MAX_NUM 8 |
| 17 | #define SFI_MRTC_MAX 8 | ||
| 16 | 18 | ||
| 17 | #endif /* _ASM_X86_MRST_H */ | 19 | #endif /* _ASM_X86_MRST_H */ |
diff --git a/arch/x86/kernel/mrst.c b/arch/x86/kernel/mrst.c index bb6e45c71dde..b7fa049c826c 100644 --- a/arch/x86/kernel/mrst.c +++ b/arch/x86/kernel/mrst.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 14 | #include <linux/sfi.h> | 14 | #include <linux/sfi.h> |
| 15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
| 16 | #include <linux/module.h> | ||
| 16 | 17 | ||
| 17 | #include <asm/setup.h> | 18 | #include <asm/setup.h> |
| 18 | #include <asm/mpspec_def.h> | 19 | #include <asm/mpspec_def.h> |
| @@ -27,6 +28,10 @@ static u32 sfi_mtimer_usage[SFI_MTMR_MAX_NUM]; | |||
| 27 | static struct sfi_timer_table_entry sfi_mtimer_array[SFI_MTMR_MAX_NUM]; | 28 | static struct sfi_timer_table_entry sfi_mtimer_array[SFI_MTMR_MAX_NUM]; |
| 28 | int sfi_mtimer_num; | 29 | int sfi_mtimer_num; |
| 29 | 30 | ||
| 31 | struct sfi_rtc_table_entry sfi_mrtc_array[SFI_MRTC_MAX]; | ||
| 32 | EXPORT_SYMBOL_GPL(sfi_mrtc_array); | ||
| 33 | int sfi_mrtc_num; | ||
| 34 | |||
| 30 | static inline void assign_to_mp_irq(struct mpc_intsrc *m, | 35 | static inline void assign_to_mp_irq(struct mpc_intsrc *m, |
| 31 | struct mpc_intsrc *mp_irq) | 36 | struct mpc_intsrc *mp_irq) |
| 32 | { | 37 | { |
| @@ -126,6 +131,46 @@ void sfi_free_mtmr(struct sfi_timer_table_entry *mtmr) | |||
| 126 | } | 131 | } |
| 127 | } | 132 | } |
| 128 | 133 | ||
| 134 | /* parse all the mrtc info to a global mrtc array */ | ||
| 135 | int __init sfi_parse_mrtc(struct sfi_table_header *table) | ||
| 136 | { | ||
| 137 | struct sfi_table_simple *sb; | ||
| 138 | struct sfi_rtc_table_entry *pentry; | ||
| 139 | struct mpc_intsrc mp_irq; | ||
| 140 | |||
| 141 | int totallen; | ||
| 142 | |||
| 143 | sb = (struct sfi_table_simple *)table; | ||
| 144 | if (!sfi_mrtc_num) { | ||
| 145 | sfi_mrtc_num = SFI_GET_NUM_ENTRIES(sb, | ||
| 146 | struct sfi_rtc_table_entry); | ||
| 147 | pentry = (struct sfi_rtc_table_entry *)sb->pentry; | ||
| 148 | totallen = sfi_mrtc_num * sizeof(*pentry); | ||
| 149 | memcpy(sfi_mrtc_array, pentry, totallen); | ||
| 150 | } | ||
| 151 | |||
| 152 | printk(KERN_INFO "SFI: RTC info (num = %d):\n", sfi_mrtc_num); | ||
| 153 | pentry = sfi_mrtc_array; | ||
| 154 | for (totallen = 0; totallen < sfi_mrtc_num; totallen++, pentry++) { | ||
| 155 | printk(KERN_INFO "RTC[%d]: paddr = 0x%08x, irq = %d\n", | ||
| 156 | totallen, (u32)pentry->phys_addr, pentry->irq); | ||
| 157 | mp_irq.type = MP_IOAPIC; | ||
| 158 | mp_irq.irqtype = mp_INT; | ||
| 159 | mp_irq.irqflag = 0; | ||
| 160 | mp_irq.srcbus = 0; | ||
| 161 | mp_irq.srcbusirq = pentry->irq; /* IRQ */ | ||
| 162 | mp_irq.dstapic = MP_APIC_ALL; | ||
| 163 | mp_irq.dstirq = pentry->irq; | ||
| 164 | save_mp_irq(&mp_irq); | ||
| 165 | } | ||
| 166 | return 0; | ||
| 167 | } | ||
| 168 | |||
| 169 | void __init mrst_rtc_init(void) | ||
| 170 | { | ||
| 171 | sfi_table_parse(SFI_SIG_MRTC, NULL, NULL, sfi_parse_mrtc); | ||
| 172 | } | ||
| 173 | |||
| 129 | /* | 174 | /* |
| 130 | * Moorestown specific x86_init function overrides and early setup | 175 | * Moorestown specific x86_init function overrides and early setup |
| 131 | * calls. | 176 | * calls. |
