diff options
| -rw-r--r-- | arch/arm/mach-footbridge/Makefile | 4 | ||||
| -rw-r--r-- | arch/arm/mach-footbridge/dc21285-timer.c | 2 | ||||
| -rw-r--r-- | arch/arm/mach-footbridge/isa-rtc.c | 57 | ||||
| -rw-r--r-- | arch/arm/mach-footbridge/isa-timer.c | 2 | ||||
| -rw-r--r-- | arch/arm/mach-footbridge/isa.c | 18 | ||||
| -rw-r--r-- | arch/arm/mach-footbridge/time.c | 164 |
6 files changed, 73 insertions, 174 deletions
diff --git a/arch/arm/mach-footbridge/Makefile b/arch/arm/mach-footbridge/Makefile index 32f8609e4f85..3afb1b25946f 100644 --- a/arch/arm/mach-footbridge/Makefile +++ b/arch/arm/mach-footbridge/Makefile | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | # Object file lists. | 5 | # Object file lists. |
| 6 | 6 | ||
| 7 | obj-y := common.o dc21285.o dma.o isa-irq.o time.o | 7 | obj-y := common.o dc21285.o dma.o isa-irq.o |
| 8 | obj-m := | 8 | obj-m := |
| 9 | obj-n := | 9 | obj-n := |
| 10 | obj- := | 10 | obj- := |
| @@ -25,4 +25,4 @@ obj-$(CONFIG_ARCH_PERSONAL_SERVER) += personal.o dc21285-timer.o | |||
| 25 | obj-$(CONFIG_PCI) +=$(pci-y) | 25 | obj-$(CONFIG_PCI) +=$(pci-y) |
| 26 | obj-$(CONFIG_LEDS) +=$(leds-y) | 26 | obj-$(CONFIG_LEDS) +=$(leds-y) |
| 27 | 27 | ||
| 28 | obj-$(CONFIG_ISA) += isa.o | 28 | obj-$(CONFIG_ISA) += isa.o isa-rtc.o |
diff --git a/arch/arm/mach-footbridge/dc21285-timer.c b/arch/arm/mach-footbridge/dc21285-timer.c index da35bc5c5ccc..bc5e83fb5819 100644 --- a/arch/arm/mach-footbridge/dc21285-timer.c +++ b/arch/arm/mach-footbridge/dc21285-timer.c | |||
| @@ -56,8 +56,6 @@ static void __init footbridge_timer_init(void) | |||
| 56 | *CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16; | 56 | *CSR_TIMER1_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_AUTORELOAD | TIMER_CNTL_DIV16; |
| 57 | 57 | ||
| 58 | setup_irq(IRQ_TIMER1, &footbridge_timer_irq); | 58 | setup_irq(IRQ_TIMER1, &footbridge_timer_irq); |
| 59 | |||
| 60 | isa_rtc_init(); | ||
| 61 | } | 59 | } |
| 62 | 60 | ||
| 63 | struct sys_timer footbridge_timer = { | 61 | struct sys_timer footbridge_timer = { |
diff --git a/arch/arm/mach-footbridge/isa-rtc.c b/arch/arm/mach-footbridge/isa-rtc.c new file mode 100644 index 000000000000..07fde4051f78 --- /dev/null +++ b/arch/arm/mach-footbridge/isa-rtc.c | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-footbridge/isa-rtc.c | ||
| 3 | * | ||
| 4 | * Copyright (C) 1998 Russell King. | ||
| 5 | * Copyright (C) 1998 Phil Blundell | ||
| 6 | * | ||
| 7 | * CATS has a real-time clock, though the evaluation board doesn't. | ||
| 8 | * | ||
| 9 | * Changelog: | ||
| 10 | * 21-Mar-1998 RMK Created | ||
| 11 | * 27-Aug-1998 PJB CATS support | ||
| 12 | * 28-Dec-1998 APH Made leds optional | ||
| 13 | * 20-Jan-1999 RMK Started merge of EBSA285, CATS and NetWinder | ||
| 14 | * 16-Mar-1999 RMK More support for EBSA285-like machines with RTCs in | ||
| 15 | */ | ||
| 16 | |||
| 17 | #define RTC_PORT(x) (0x70+(x)) | ||
| 18 | #define RTC_ALWAYS_BCD 0 | ||
| 19 | |||
| 20 | #include <linux/init.h> | ||
| 21 | #include <linux/mc146818rtc.h> | ||
| 22 | #include <linux/bcd.h> | ||
| 23 | #include <linux/io.h> | ||
| 24 | |||
| 25 | #include "common.h" | ||
| 26 | |||
| 27 | void __init isa_rtc_init(void) | ||
| 28 | { | ||
| 29 | int reg_d, reg_b; | ||
| 30 | |||
| 31 | /* | ||
| 32 | * Probe for the RTC. | ||
| 33 | */ | ||
| 34 | reg_d = CMOS_READ(RTC_REG_D); | ||
| 35 | |||
| 36 | /* | ||
| 37 | * make sure the divider is set | ||
| 38 | */ | ||
| 39 | CMOS_WRITE(RTC_REF_CLCK_32KHZ, RTC_REG_A); | ||
| 40 | |||
| 41 | /* | ||
| 42 | * Set control reg B | ||
| 43 | * (24 hour mode, update enabled) | ||
| 44 | */ | ||
| 45 | reg_b = CMOS_READ(RTC_REG_B) & 0x7f; | ||
| 46 | reg_b |= 2; | ||
| 47 | CMOS_WRITE(reg_b, RTC_REG_B); | ||
| 48 | |||
| 49 | if ((CMOS_READ(RTC_REG_A) & 0x7f) == RTC_REF_CLCK_32KHZ && | ||
| 50 | CMOS_READ(RTC_REG_B) == reg_b) { | ||
| 51 | /* | ||
| 52 | * We have a RTC. Check the battery | ||
| 53 | */ | ||
| 54 | if ((reg_d & 0x80) == 0) | ||
| 55 | printk(KERN_WARNING "RTC: *** warning: CMOS battery bad\n"); | ||
| 56 | } | ||
| 57 | } | ||
diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c index 0c8390082fa8..f488fa2082d7 100644 --- a/arch/arm/mach-footbridge/isa-timer.c +++ b/arch/arm/mach-footbridge/isa-timer.c | |||
| @@ -76,8 +76,6 @@ static struct irqaction isa_timer_irq = { | |||
| 76 | 76 | ||
| 77 | static void __init isa_timer_init(void) | 77 | static void __init isa_timer_init(void) |
| 78 | { | 78 | { |
| 79 | isa_rtc_init(); | ||
| 80 | |||
| 81 | /* enable PIT timer */ | 79 | /* enable PIT timer */ |
| 82 | /* set for periodic (4) and LSB/MSB write (0x30) */ | 80 | /* set for periodic (4) and LSB/MSB write (0x30) */ |
| 83 | outb(0x34, 0x43); | 81 | outb(0x34, 0x43); |
diff --git a/arch/arm/mach-footbridge/isa.c b/arch/arm/mach-footbridge/isa.c index 725a219d0ed5..4d9276c27d6f 100644 --- a/arch/arm/mach-footbridge/isa.c +++ b/arch/arm/mach-footbridge/isa.c | |||
| @@ -11,6 +11,9 @@ | |||
| 11 | #include <linux/serial_8250.h> | 11 | #include <linux/serial_8250.h> |
| 12 | 12 | ||
| 13 | #include <asm/irq.h> | 13 | #include <asm/irq.h> |
| 14 | #include <asm/hardware/dec21285.h> | ||
| 15 | |||
| 16 | #include "common.h" | ||
| 14 | 17 | ||
| 15 | static struct resource rtc_resources[] = { | 18 | static struct resource rtc_resources[] = { |
| 16 | [0] = { | 19 | [0] = { |
| @@ -77,11 +80,18 @@ static struct platform_device serial_device = { | |||
| 77 | 80 | ||
| 78 | static int __init footbridge_isa_init(void) | 81 | static int __init footbridge_isa_init(void) |
| 79 | { | 82 | { |
| 80 | int err; | 83 | int err = 0; |
| 81 | 84 | ||
| 82 | err = platform_device_register(&rtc_device); | 85 | if (!footbridge_cfn_mode()) |
| 83 | if (err) | 86 | return 0; |
| 84 | printk(KERN_ERR "Unable to register RTC device: %d\n", err); | 87 | |
| 88 | /* Personal server doesn't have RTC */ | ||
| 89 | if (!machine_is_personal_server()) { | ||
| 90 | isa_rtc_init(); | ||
| 91 | err = platform_device_register(&rtc_device); | ||
| 92 | if (err) | ||
| 93 | printk(KERN_ERR "Unable to register RTC device: %d\n", err); | ||
| 94 | } | ||
| 85 | err = platform_device_register(&serial_device); | 95 | err = platform_device_register(&serial_device); |
| 86 | if (err) | 96 | if (err) |
| 87 | printk(KERN_ERR "Unable to register serial device: %d\n", err); | 97 | printk(KERN_ERR "Unable to register serial device: %d\n", err); |
diff --git a/arch/arm/mach-footbridge/time.c b/arch/arm/mach-footbridge/time.c deleted file mode 100644 index cd1b54ff9fe2..000000000000 --- a/arch/arm/mach-footbridge/time.c +++ /dev/null | |||
| @@ -1,164 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * arch/arm/mach-footbridge/include/mach/time.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 1998 Russell King. | ||
| 5 | * Copyright (C) 1998 Phil Blundell | ||
| 6 | * | ||
| 7 | * CATS has a real-time clock, though the evaluation board doesn't. | ||
| 8 | * | ||
| 9 | * Changelog: | ||
| 10 | * 21-Mar-1998 RMK Created | ||
| 11 | * 27-Aug-1998 PJB CATS support | ||
| 12 | * 28-Dec-1998 APH Made leds optional | ||
| 13 | * 20-Jan-1999 RMK Started merge of EBSA285, CATS and NetWinder | ||
| 14 | * 16-Mar-1999 RMK More support for EBSA285-like machines with RTCs in | ||
| 15 | */ | ||
| 16 | |||
| 17 | #define RTC_PORT(x) (rtc_base+(x)) | ||
| 18 | #define RTC_ALWAYS_BCD 0 | ||
| 19 | |||
| 20 | #include <linux/timex.h> | ||
| 21 | #include <linux/init.h> | ||
| 22 | #include <linux/sched.h> | ||
| 23 | #include <linux/mc146818rtc.h> | ||
| 24 | #include <linux/bcd.h> | ||
| 25 | #include <linux/io.h> | ||
| 26 | |||
| 27 | #include <mach/hardware.h> | ||
| 28 | |||
| 29 | #include <asm/mach/time.h> | ||
| 30 | #include "common.h" | ||
| 31 | |||
| 32 | static int rtc_base; | ||
| 33 | |||
| 34 | static unsigned long __init get_isa_cmos_time(void) | ||
| 35 | { | ||
| 36 | unsigned int year, mon, day, hour, min, sec; | ||
| 37 | |||
| 38 | // check to see if the RTC makes sense..... | ||
| 39 | if ((CMOS_READ(RTC_VALID) & RTC_VRT) == 0) | ||
| 40 | return mktime(1970, 1, 1, 0, 0, 0); | ||
| 41 | |||
| 42 | do { | ||
| 43 | sec = CMOS_READ(RTC_SECONDS); | ||
| 44 | min = CMOS_READ(RTC_MINUTES); | ||
| 45 | hour = CMOS_READ(RTC_HOURS); | ||
| 46 | day = CMOS_READ(RTC_DAY_OF_MONTH); | ||
| 47 | mon = CMOS_READ(RTC_MONTH); | ||
