Skip to contentSkip to conversation

powerpc: Fix Maple build

PATCH New Benjamin Herrenschmidt 1 participant 1 message Jan 14, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix Maple build

The changes to the device node structure broke Maple build. This fixes it. Unfortunately I coudn't test as my Maple board appears to be dead.

arch/powerpc/platforms/maple/pci.c +0 -1
Index: linux-work/arch/powerpc/platforms/maple/pci.c
===================================================================
@@ -316,7 +316,6 @@ static int __init add_bridge(struct devi
 	char* disp_name;
 	int *bus_range;
 	int primary = 1;
-	struct property *of_prop;
 
 	DBG("Adding PCI host bridge %s\n", dev->full_name);
 
arch/powerpc/platforms/maple/setup.c +50 -35

130 lines not on this page · raw message

arch/powerpc/platforms/maple/time.c +18 -5
Index: linux-work/arch/powerpc/platforms/maple/time.c
===================================================================
@@ -168,11 +168,24 @@ unsigned long __init maple_get_boot_time
 	struct rtc_time tm;
 	struct device_node *rtcs;
 
-	rtcs = find_compatible_devices("rtc", "pnpPNP,b00");
-	if (rtcs && rtcs->addrs) {
-		maple_rtc_addr = rtcs->addrs[0].address;
-		printk(KERN_INFO "Maple: Found RTC at 0x%x\n", maple_rtc_addr);
-	} else {
+	rtcs = of_find_compatible_node(NULL, "rtc", "pnpPNP,b00");
+	if (rtcs) {
+		struct resource r;
+		if (of_address_to_resource(rtcs, 0, &r)) {
+			printk(KERN_EMERG "Maple: Unable to translate RTC"
+			       " address\n");
+			goto bail;
+		}
+		if (!(r.flags & IORESOURCE_IO)) {
+			printk(KERN_EMERG "Maple: RTC address isn't PIO!\n");
+			goto bail;
+		}
+		maple_rtc_addr = r.start;
+		printk(KERN_INFO "Maple: Found RTC at IO 0x%x\n",
+		       maple_rtc_addr);
+	}
+ bail:
+	if (maple_rtc_addr == 0) {
 		maple_rtc_addr = RTC_PORT(0); /* legacy address */
 		printk(KERN_INFO "Maple: No device node for RTC, assuming "
 		       "legacy address (0x%x)\n", maple_rtc_addr);