Re: rtc and chrony on Ultra 1 and Ultra 5
On Tue, 19 Apr 2005 21:28:21 +0200
Frans Pop <aragorn@tiscali.nl> wrote:
> On Tuesday 19 April 2005 20:47, David S. Miller wrote:
> > Can someone provide "/usr/sbin/prtconv -pv" on either the Ultra5 or
> > Ultra10 system which fails like this? It may provide the clue.
> Attached.
Why did the rename the device node to "eeprom"? :-/
Node 0xf0066414
address: fffba000
reg: 00000014.00000000.00002000
model: 'mk48t59'
name: 'eeprom'
That's your clock chip.
Give this patch a try (should apply cleanly to just about any 2.6.x)
drivers/char/rtc.c: 0af5fb0c19e378bc3c660c70873cdf22d806f9b8
--- drivers/char/rtc.c
+++ drivers/char/rtc.c 2005-04-19 12:29:00.000000000 -0700
@@ -889,6 +889,28 @@
static irqreturn_t (*rtc_int_handler_ptr)(int irq, void *dev_id, struct pt_regs *regs);
#endif
+#ifdef __sparc__
+static int is_rtc_device(char *name, int prom_node)
+{
+ unsigned char model[32];
+
+ if (!strcmp(name, "rtc"))
+ return 1;
+
+ prom_getstring(prom_node, "model", model, sizeof(model));
+ if (!strcmp(model, "mk48t02") ||
+ !strcmp(model, "mk48t08") ||
+ !strcmp(model, "mk48t59") ||
+ !strcmp(model, "m5819") ||
+ !strcmp(model, "m5819p") ||
+ !strcmp(model, "m5823") ||
+ !strcmp(model, "ds1287"))
+ return 1;
+
+ return 0;
+}
+#endif
+
static int __init rtc_init(void)
{
struct proc_dir_entry *ent;
@@ -909,7 +931,8 @@
#ifdef __sparc__
for_each_ebus(ebus) {
for_each_ebusdev(edev, ebus) {
- if(strcmp(edev->prom_name, "rtc") == 0) {
+ if (is_rtc_device(edev->prom_name,
+ edev->prom_node)) {
rtc_port = edev->resource[0].start;
rtc_irq = edev->irqs[0];
goto found;
@@ -919,7 +942,8 @@
#ifdef __sparc_v9__
for_each_isa(isa_br) {
for_each_isadev(isa_dev, isa_br) {
- if (strcmp(isa_dev->prom_name, "rtc") == 0) {
+ if (is_rtc_device(isa_dev->prom_name,
+ isa_dev->prom_node)) {
rtc_port = isa_dev->resource.start;
rtc_irq = isa_dev->irq;
goto found;
Reply to: