Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7309282c authored by Feng Tang's avatar Feng Tang Committed by Thomas Gleixner
Browse files

x86: mrst: Add vrtc driver which serves as a wall clock device



Moorestown platform doesn't have a m146818 RTC device like traditional
x86 PC, but a firmware emulated virtual RTC device(vrtc), which provides
some basic RTC functions like get/set time. vrtc serves as the only
wall clock device on Moorestown platform.

[ tglx: Changed the exports to _GPL ]

Signed-off-by: default avatarFeng Tang <feng.tang@intel.com>
Signed-off-by: default avatarJacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
LKML-Reference: <20101110172837.3311.40483.stgit@localhost.localdomain>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent cfb505a7
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -117,6 +117,10 @@ enum fixed_addresses {
	FIX_TEXT_POKE1,	/* reserve 2 pages for text_poke() */
	FIX_TEXT_POKE1,	/* reserve 2 pages for text_poke() */
	FIX_TEXT_POKE0, /* first page is last, because allocation is backward */
	FIX_TEXT_POKE0, /* first page is last, because allocation is backward */
	__end_of_permanent_fixed_addresses,
	__end_of_permanent_fixed_addresses,

#ifdef	CONFIG_X86_MRST
	FIX_LNW_VRTC,
#endif
	/*
	/*
	 * 256 temporary boot-time mappings, used by early_ioremap(),
	 * 256 temporary boot-time mappings, used by early_ioremap(),
	 * before ioremap() is functional.
	 * before ioremap() is functional.
+9 −0
Original line number Original line Diff line number Diff line
#ifndef _MRST_VRTC_H
#define _MRST_VRTC_H

extern unsigned char vrtc_cmos_read(unsigned char reg);
extern void vrtc_cmos_write(unsigned char val, unsigned char reg);
extern unsigned long vrtc_get_time(void);
extern int vrtc_set_mmss(unsigned long nowtime);

#endif
+9 −1
Original line number Original line Diff line number Diff line
@@ -14,7 +14,9 @@
#include <linux/sfi.h>
#include <linux/sfi.h>


extern int pci_mrst_init(void);
extern int pci_mrst_init(void);
int __init sfi_parse_mrtc(struct sfi_table_header *table);
extern int __init sfi_parse_mrtc(struct sfi_table_header *table);
extern int sfi_mrtc_num;
extern struct sfi_rtc_table_entry sfi_mrtc_array[];


/*
/*
 * Medfield is the follow-up of Moorestown, it combines two chip solution into
 * Medfield is the follow-up of Moorestown, it combines two chip solution into
@@ -54,4 +56,10 @@ extern void hsu_early_console_init(void);
extern void intel_scu_devices_create(void);
extern void intel_scu_devices_create(void);
extern void intel_scu_devices_destroy(void);
extern void intel_scu_devices_destroy(void);


/* VRTC timer */
#define MRST_VRTC_MAP_SZ	(1024)
/*#define MRST_VRTC_PGOFFSET	(0xc00) */

extern void mrst_rtc_init(void);

#endif /* _ASM_X86_MRST_H */
#endif /* _ASM_X86_MRST_H */
+1 −0
Original line number Original line Diff line number Diff line
obj-$(CONFIG_X86_MRST)		+= mrst.o
obj-$(CONFIG_X86_MRST)		+= mrst.o
obj-$(CONFIG_X86_MRST)		+= vrtc.o
+0 −6
Original line number Original line Diff line number Diff line
@@ -37,7 +37,6 @@
#include <asm/apb_timer.h>
#include <asm/apb_timer.h>
#include <asm/reboot.h>
#include <asm/reboot.h>



/*
/*
 * the clockevent devices on Moorestown/Medfield can be APBT or LAPIC clock,
 * the clockevent devices on Moorestown/Medfield can be APBT or LAPIC clock,
 * cmdline option x86_mrst_timer can be used to override the configuration
 * cmdline option x86_mrst_timer can be used to override the configuration
@@ -242,11 +241,6 @@ void __init mrst_time_init(void)
	apbt_time_init();
	apbt_time_init();
}
}


void __init mrst_rtc_init(void)
{
	sfi_table_parse(SFI_SIG_MRTC, NULL, NULL, sfi_parse_mrtc);
}

void __cpuinit mrst_arch_setup(void)
void __cpuinit mrst_arch_setup(void)
{
{
	if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x27)
	if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 0x27)
Loading