Commit 85d0b3a5 authored by Richard Henderson's avatar Richard Henderson Committed by Matt Turner
Browse files

alpha: Reorganize rtc handling



Discontinue use of GENERIC_CMOS_UPDATE; rely on the RTC subsystem.

The marvel platform requires that the rtc only be touched from the
boot cpu.  This had been partially implemented with hooks for
get/set_rtc_time, but read/update_persistent_clock were not handled.
Move the hooks from the machine_vec to a special rtc_class_ops struct.

We had read_persistent_clock managing the epoch against which the
rtc hw is based, but this didn't apply to get_rtc_time or set_rtc_time.
This resulted in incorrect values when hwclock(8) gets involved.

Allow the epoch to be set from the kernel command-line, overriding
the autodetection, which is doomed to fail in 2020.  Further, by
implementing the rtc ioctl function, we can expose this epoch to
userland.

Elide the alarm functions that RTC_DRV_CMOS implements.  This was
highly questionable on Alpha, since the interrupt is used by the
system timer.

Signed-off-by: default avatarRichard Henderson <rth@twiddle.net>
parent 7f3bbb82
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ config ALPHA
	select ARCH_HAVE_NMI_SAFE_CMPXCHG
	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
	select GENERIC_SMP_IDLE_THREAD
	select GENERIC_CMOS_UPDATE
	select GENERIC_STRNCPY_FROM_USER
	select GENERIC_STRNLEN_USER
	select HAVE_MOD_ARCH_SPECIFIC
+1 −3
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ struct alpha_machine_vector

	int nr_irqs;
	int rtc_port;
	int rtc_boot_cpu_only;
	unsigned int max_asn;
	unsigned long max_isa_dma_address;
	unsigned long irq_probe_mask;
@@ -95,9 +96,6 @@ struct alpha_machine_vector

	struct _alpha_agp_info *(*agp_info)(void);

	unsigned int (*rtc_get_time)(struct rtc_time *);
	int (*rtc_set_time)(struct rtc_time *);

	const char *vector_name;

	/* NUMA information */
+0 −11
Original line number Diff line number Diff line
#ifndef _ALPHA_RTC_H
#define _ALPHA_RTC_H

#if defined(CONFIG_ALPHA_MARVEL) && defined(CONFIG_SMP) \
 || defined(CONFIG_ALPHA_GENERIC)
# define get_rtc_time		alpha_mv.rtc_get_time
# define set_rtc_time		alpha_mv.rtc_set_time
#endif

#include <asm-generic/rtc.h>

#endif
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ obj-$(CONFIG_PCI) += pci.o pci_iommu.o pci-sysfs.o
obj-$(CONFIG_SRM_ENV)	+= srm_env.o
obj-$(CONFIG_MODULES)	+= module.o
obj-$(CONFIG_PERF_EVENTS) += perf_event.o
obj-$(CONFIG_RTC_DRV_ALPHA) += rtc.o

ifdef CONFIG_ALPHA_GENERIC

+1 −4
Original line number Diff line number Diff line
@@ -43,10 +43,7 @@
#define CAT1(x,y)  x##y
#define CAT(x,y)   CAT1(x,y)

#define DO_DEFAULT_RTC \
	.rtc_port = 0x70, \
	.rtc_get_time = common_get_rtc_time, \
	.rtc_set_time = common_set_rtc_time
#define DO_DEFAULT_RTC			.rtc_port = 0x70

#define DO_EV4_MMU							\
	.max_asn =			EV4_MAX_ASN,			\
Loading