rpms/kernel/devel linux-2.6-chrp-build.patch, NONE, 1.1 kernel-2.6.spec, 1.1852, 1.1853

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Sat Jan 14 00:18:26 UTC 2006


Author: dwmw2

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv27543

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-chrp-build.patch 
Log Message:
Fix CHRP

linux-2.6-chrp-build.patch:
 arch/powerpc/platforms/chrp/pci.c   |   27 +++++++++++++++++----------
 arch/powerpc/platforms/chrp/setup.c |    7 ++++---
 arch/powerpc/platforms/chrp/time.c  |    7 +++++--
 drivers/macintosh/macio-adb.c       |   13 ++++++++-----
 4 files changed, 34 insertions(+), 20 deletions(-)

--- NEW FILE linux-2.6-chrp-build.patch ---
--- linux/arch/powerpc/platforms/chrp/setup.c~	2006-01-13 15:26:41.000000000 +0000
+++ linux/arch/powerpc/platforms/chrp/setup.c	2006-01-13 23:44:29.000000000 +0000
@@ -352,9 +352,10 @@ static void __init chrp_find_openpic(voi
 		opaddr = opprop[na-1];	/* assume 32-bit */
 		oplen /= na * sizeof(unsigned int);
 	} else {
-		if (np->n_addrs == 0)
+		struct resource r;
+		if (of_address_to_resource(np, 0, &r))
 			return;
-		opaddr = np->addrs[0].address;
+		opaddr = r.start;
 		oplen = 0;
 	}
 
@@ -377,7 +378,7 @@ static void __init chrp_find_openpic(voi
 	 */
 	if (oplen < len) {
 		printk(KERN_ERR "Insufficient addresses for distributed"
-		       " OpenPIC (%d < %d)\n", np->n_addrs, len);
+		       " OpenPIC (%d < %d)\n", oplen, len);
 		len = oplen;
 	}
 
--- linux/arch/powerpc/platforms/chrp/time.c~	2006-01-03 03:21:10.000000000 +0000
+++ linux/arch/powerpc/platforms/chrp/time.c	2006-01-13 23:54:44.000000000 +0000
@@ -21,6 +21,7 @@
 #include <linux/mc146818rtc.h>
 #include <linux/init.h>
 #include <linux/bcd.h>
+#include <linux/ioport.h>
 
 #include <asm/io.h>
 #include <asm/nvram.h>
@@ -37,14 +38,16 @@ static int nvram_data = NVRAM_DATA;
 long __init chrp_time_init(void)
 {
 	struct device_node *rtcs;
+	struct resource r;
 	int base;
 
 	rtcs = find_compatible_devices("rtc", "pnpPNP,b00");
 	if (rtcs == NULL)
 		rtcs = find_compatible_devices("rtc", "ds1385-rtc");
-	if (rtcs == NULL || rtcs->addrs == NULL)
+	if (rtcs == NULL || of_address_to_resource(rtcs, 0, &r))
 		return 0;
-	base = rtcs->addrs[0].address;
+	
+	base = r.start;
 	nvram_as1 = 0;
 	nvram_as0 = base;
 	nvram_data = base + 1;
--- linux/arch/powerpc/platforms/chrp/pci.c~	2006-01-03 03:21:10.000000000 +0000
+++ linux/arch/powerpc/platforms/chrp/pci.c	2006-01-14 00:03:36.000000000 +0000
@@ -135,12 +135,13 @@ int __init
 hydra_init(void)
 {
 	struct device_node *np;
+	struct resource r;
 
 	np = find_devices("mac-io");
-	if (np == NULL || np->n_addrs == 0)
+	if (np == NULL || of_address_to_resource(np, 0, &r))
 		return 0;
-	Hydra = ioremap(np->addrs[0].address, np->addrs[0].size);
-	printk("Hydra Mac I/O at %lx\n", np->addrs[0].address);
+	Hydra = ioremap(r.start, r.end-r.start);
+	printk("Hydra Mac I/O at %lx\n", r.start);
 	printk("Hydra Feature_Control was %x",
 	       in_le32(&Hydra->Feature_Control));
 	out_le32(&Hydra->Feature_Control, (HYDRA_FC_SCC_CELL_EN |
@@ -177,18 +178,24 @@ setup_python(struct pci_controller *hose
 {
 	u32 __iomem *reg;
 	u32 val;
-	unsigned long addr = dev->addrs[0].address;
+	struct resource r;
 
-	setup_indirect_pci(hose, addr + 0xf8000, addr + 0xf8010);
+	if (of_address_to_resource(dev, 0, &r)) {
+		printk(KERN_ERR "No address for Python PCI controller\n");
+		return;
+	}
 
 	/* Clear the magic go-slow bit */
-	reg = ioremap(dev->addrs[0].address + 0xf6000, 0x40);
+	reg = ioremap(r.start + 0xf6000, 0x40);
+	BUG_ON(!reg); 
 	val = in_be32(&reg[12]);
 	if (val & PRG_CL_RESET_VALID) {
 		out_be32(&reg[12], val & ~PRG_CL_RESET_VALID);
 		in_be32(&reg[12]);
 	}
 	iounmap(reg);
+
+	setup_indirect_pci(hose, r.start + 0xf8000, r.start + 0xf8010);
 }
 
 /* Marvell Discovery II based Pegasos 2 */
@@ -218,7 +225,7 @@ chrp_find_bridges(void)
 	char *model, *machine;
 	int is_longtrail = 0, is_mot = 0, is_pegasos = 0;
 	struct device_node *root = find_path_device("/");
-
+	struct resource r;
 	/*
 	 * The PCI host bridge nodes on some machines don't have
 	 * properties to adequately identify them, so we have to
@@ -238,7 +245,7 @@ chrp_find_bridges(void)
 			continue;
 		++index;
 		/* The GG2 bridge on the LongTrail doesn't have an address */
-		if (dev->n_addrs < 1 && !is_longtrail) {
+		if (of_address_to_resource(dev, 0, &r) && !is_longtrail) {
 			printk(KERN_WARNING "Can't use %s: no address\n",
 			       dev->full_name);
 			continue;
@@ -255,8 +262,8 @@ chrp_find_bridges(void)
 			printk(KERN_INFO "PCI buses %d..%d",
 			       bus_range[0], bus_range[1]);
 		printk(" controlled by %s", dev->type);
-		if (dev->n_addrs > 0)
-			printk(" at %lx", dev->addrs[0].address);
+		if (!is_longtrail)
+			printk(" at %lx", r.start);
 		printk("\n");
 
 		hose = pcibios_alloc_controller();
--- linux/drivers/macintosh/macio-adb.c~	2006-01-03 03:21:10.000000000 +0000
+++ linux/drivers/macintosh/macio-adb.c	2006-01-14 00:13:43.000000000 +0000
@@ -17,6 +17,7 @@
 #include <asm/irq.h>
 #include <asm/system.h>
 #include <linux/init.h>
+#include <linux/ioport.h>
 
 struct preg {
 	unsigned char r;
@@ -88,24 +89,26 @@ int macio_probe(void)
 int macio_init(void)
 {
 	struct device_node *adbs;
+	struct resource r;
 
 	adbs = find_compatible_devices("adb", "chrp,adb0");
 	if (adbs == 0)
 		return -ENXIO;
 
 #if 0
-	{ int i;
+	{ int i = 0;
 
 	printk("macio_adb_init: node = %p, addrs =", adbs->node);
-	for (i = 0; i < adbs->n_addrs; ++i)
-		printk(" %x(%x)", adbs->addrs[i].address, adbs->addrs[i].size);
+	while(!of_address_to_resource(adbs, i, &r))
+		printk(" %x(%x)", r.start, r.end - r.start);
 	printk(", intrs =");
 	for (i = 0; i < adbs->n_intrs; ++i)
 		printk(" %x", adbs->intrs[i].line);
 	printk("\n"); }
 #endif
-	
-	adb = ioremap(adbs->addrs->address, sizeof(struct adb_regs));
+	if (of_address_to_resource(adbs, 0, &r))
+		return -ENXIO;
+	adb = ioremap(r.start, sizeof(struct adb_regs));
 
 	out_8(&adb->ctrl.r, 0);
 	out_8(&adb->intr.r, 0);


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.1852
retrieving revision 1.1853
diff -u -r1.1852 -r1.1853
--- kernel-2.6.spec	13 Jan 2006 15:50:35 -0000	1.1852
+++ kernel-2.6.spec	14 Jan 2006 00:18:19 -0000	1.1853
@@ -225,6 +225,7 @@
 # 300 - 399   ppc(64)
 Patch300: linux-2.6.15-default-powerpc.patch
 Patch301: linux-2.6.15-cell-numa-init.patch
+Patch302: linux-2.6-chrp-build.patch
 Patch304: linux-2.6.15-mv643xx-fixes.patch
 Patch305: linux-2.6-cell-mambo-drivers.patch
 Patch306: linux-2.6-hvc-console.patch
@@ -628,6 +629,8 @@
 %patch300 -p1
 # Arnd says don't call cell_spumem_init() till he fixes it.
 %patch301 -p1
+# Make CHRP build again
+%patch302 -p1
 # Fix the MV643xx Gigabit Ethernet driver
 %patch304 -p1
 # Support the IBM Mambo simulator; core as well as disk and network drivers.
@@ -1359,6 +1362,9 @@
 %endif
 
 %changelog
+* Sat Jan 14 2006 David Woodhouse <dwmw2 at redhat.com>
+- Make CHRP build again
+
 * Fri Jan 13 2006 David Woodhouse <dwmw2 at redhat.com>
 - Update softmac and add WPA support to bcm43xx driver
 - 2.6.15-git9 




More information about the fedora-cvs-commits mailing list