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

Commit 35aefb26 authored by Greg Ungerer's avatar Greg Ungerer
Browse files

m68knommu: modify timer init code to make it consistent with m68k code



With a few small changes we can make the m68knommu timer init code the
same as the m68k code. By using the mach_sched_init function pointer
and reworking the current timer initializers to keep track of the common
m68k timer_interrupt() handler we end up with almost identical code for
m68knommu.

This will allow us to more easily merge the mmu and non-mmu m68k time.c
in future patches.

Signed-off-by: default avatarGreg Ungerer <gerg@uclinux.org>
parent 95177461
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -33,9 +33,8 @@ extern void (*mach_l2_flush) (int);
extern void (*mach_beep) (unsigned int, unsigned int);

/* Hardware clock functions */
extern void hw_timer_init(void);
extern void hw_timer_init(irq_handler_t handler);
extern unsigned long hw_timer_offset(void);
extern irqreturn_t arch_timer_interrupt(int irq, void *dummy);

extern void config_BSP(char *command, int len);

+1 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ EXPORT_SYMBOL(memory_end);
char __initdata command_line[COMMAND_LINE_SIZE];

/* machine dependent timer functions */
void (*mach_sched_init)(irq_handler_t handler) __initdata = NULL;
int (*mach_set_clock_mmss)(unsigned long);
int (*mach_hwclk) (int, struct rtc_time*);

+3 −5
Original line number Diff line number Diff line
@@ -32,12 +32,11 @@ static inline int set_rtc_mmss(unsigned long nowtime)
	return -1;
}

#ifndef CONFIG_GENERIC_CLOCKEVENTS
/*
 * timer_interrupt() needs to keep up the real-time clock,
 * as well as call the "xtime_update()" routine every clocktick
 */
irqreturn_t arch_timer_interrupt(int irq, void *dummy)
static irqreturn_t timer_interrupt(int irq, void *dummy)
{

	if (current->pid)
@@ -49,7 +48,6 @@ irqreturn_t arch_timer_interrupt(int irq, void *dummy)

	return(IRQ_HANDLED);
}
#endif

void read_persistent_clock(struct timespec *ts)
{
@@ -72,7 +70,7 @@ int update_persistent_clock(struct timespec now)
	return set_rtc_mmss(now.tv_sec);
}

void time_init(void)
void __init time_init(void)
{
	hw_timer_init();
	mach_sched_init(timer_interrupt);
}
+1 −0
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ void __init config_BSP(char *commandp, int size)
#endif /* CONFIG_NETtel */

	mach_reset = m5206_cpu_reset;
	mach_sched_init = hw_timer_init;
	m5206_timers_init();
	m5206_uarts_init();

+1 −0
Original line number Diff line number Diff line
@@ -291,6 +291,7 @@ static void m520x_cpu_reset(void)
void __init config_BSP(char *commandp, int size)
{
	mach_reset = m520x_cpu_reset;
	mach_sched_init = hw_timer_init;
	m520x_uarts_init();
	m520x_fec_init();
#if defined(CONFIG_SPI_COLDFIRE_QSPI) || defined(CONFIG_SPI_COLDFIRE_QSPI_MODULE)
Loading