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

Commit 382b4480 authored by Russell King's avatar Russell King
Browse files

ARM: footbridge: trim down old ISA rtc setup



This fixes a "start_kernel(): bug: interrupts were enabled early".

rtc_cmos now takes care of initializing the ISA RTC and reading the
current time and date from it; there's no need to repeat that here,
thereby causing interrupts to be enabled too early.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 6dc995a3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

# Object file lists.

obj-y			:= common.o dc21285.o dma.o isa-irq.o time.o
obj-y			:= common.o dc21285.o dma.o isa-irq.o
obj-m			:=
obj-n			:=
obj-			:=
@@ -25,4 +25,4 @@ obj-$(CONFIG_ARCH_PERSONAL_SERVER) += personal.o dc21285-timer.o
obj-$(CONFIG_PCI)	+=$(pci-y)
obj-$(CONFIG_LEDS)	+=$(leds-y)

obj-$(CONFIG_ISA)	+= isa.o
obj-$(CONFIG_ISA)	+= isa.o isa-rtc.o
+0 −2
Original line number Diff line number Diff line
@@ -56,8 +56,6 @@ static void __init footbridge_timer_init(void)
	*CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16;

	setup_irq(IRQ_TIMER1, &footbridge_timer_irq);

	isa_rtc_init();
}

struct sys_timer footbridge_timer = {
+57 −0
Original line number Diff line number Diff line
/*
 *  arch/arm/mach-footbridge/isa-rtc.c
 *
 *  Copyright (C) 1998 Russell King.
 *  Copyright (C) 1998 Phil Blundell
 *
 * CATS has a real-time clock, though the evaluation board doesn't.
 *
 * Changelog:
 *  21-Mar-1998	RMK	Created
 *  27-Aug-1998	PJB	CATS support
 *  28-Dec-1998	APH	Made leds optional
 *  20-Jan-1999	RMK	Started merge of EBSA285, CATS and NetWinder
 *  16-Mar-1999	RMK	More support for EBSA285-like machines with RTCs in
 */

#define RTC_PORT(x)		(0x70+(x))
#define RTC_ALWAYS_BCD		0

#include <linux/init.h>
#include <linux/mc146818rtc.h>
#include <linux/bcd.h>
#include <linux/io.h>

#include "common.h"

void __init isa_rtc_init(void)
{
	int reg_d, reg_b;

	/*
	 * Probe for the RTC.
	 */
	reg_d = CMOS_READ(RTC_REG_D);

	/*
	 * make sure the divider is set
	 */
	CMOS_WRITE(RTC_REF_CLCK_32KHZ, RTC_REG_A);

	/*
	 * Set control reg B
	 *   (24 hour mode, update enabled)
	 */
	reg_b = CMOS_READ(RTC_REG_B) & 0x7f;
	reg_b |= 2;
	CMOS_WRITE(reg_b, RTC_REG_B);

	if ((CMOS_READ(RTC_REG_A) & 0x7f) == RTC_REF_CLCK_32KHZ &&
	    CMOS_READ(RTC_REG_B) == reg_b) {
		/*
		 * We have a RTC.  Check the battery
		 */
		if ((reg_d & 0x80) == 0)
			printk(KERN_WARNING "RTC: *** warning: CMOS battery bad\n");
	}
}
+0 −2
Original line number Diff line number Diff line
@@ -76,8 +76,6 @@ static struct irqaction isa_timer_irq = {

static void __init isa_timer_init(void)
{
	isa_rtc_init();

	/* enable PIT timer */
	/* set for periodic (4) and LSB/MSB write (0x30) */
	outb(0x34, 0x43);
+14 −4
Original line number Diff line number Diff line
@@ -11,6 +11,9 @@
#include <linux/serial_8250.h>

#include <asm/irq.h>
#include <asm/hardware/dec21285.h>

#include "common.h"

static struct resource rtc_resources[] = {
	[0] = {
@@ -77,11 +80,18 @@ static struct platform_device serial_device = {

static int __init footbridge_isa_init(void)
{
	int err;
	int err = 0;

	if (!footbridge_cfn_mode())
		return 0;

	/* Personal server doesn't have RTC */
	if (!machine_is_personal_server()) {
		isa_rtc_init();
		err = platform_device_register(&rtc_device);
		if (err)
			printk(KERN_ERR "Unable to register RTC device: %d\n", err);
	}
	err = platform_device_register(&serial_device);
	if (err)
		printk(KERN_ERR "Unable to register serial device: %d\n", err);
Loading