[parisc-linux-cvs] [PATCH] Fix SoftPower and DINO for 64-bit (CONFIG_PDC_NARROW) systems.

Ryan Bradetich rbradetich@uswest.net
07 Apr 2002 15:09:26 -0600


--=-QKKvpm6YVBvwldWQF8zA
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hello parisc-linux hackers,


This patch fixes the following issues and allows my C200 to boot a
64-bit kernel with the CONFIG_PDC_NARROW option defined.

	* Fix pdc_soft_power_info to work with the CONFIG_PDC_NARROW.
	* Fix dino to use 64-bit addresses instead of 32-bit addresses.
	* In dino_fixup_bus ... Adjust the I/O port space for all
		PCI Resources, not just the first 6.
	* Bump the -pa number to -pa16

Thanks,

- Ryan



--=-QKKvpm6YVBvwldWQF8zA
Content-Disposition: attachment; filename=2.4.18-pa16.diff
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-patch; charset=ISO-8859-1

Index: Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/linux/Makefile,v
retrieving revision 1.286
diff -u -p -r1.286 Makefile
--- Makefile	2002/04/06 22:14:57	1.286
+++ Makefile	2002/04/07 21:02:34
@@ -1,7 +1,7 @@
 VERSION =3D 2
 PATCHLEVEL =3D 4
 SUBLEVEL =3D 18
-EXTRAVERSION =3D -pa15
+EXTRAVERSION =3D -pa16
=20
 KERNELRELEASE=3D$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
=20
Index: arch/parisc/kernel/firmware.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/linux/arch/parisc/kernel/firmware.c,v
retrieving revision 1.42
diff -u -p -r1.42 firmware.c
--- arch/parisc/kernel/firmware.c	2002/04/06 22:14:57	1.42
+++ arch/parisc/kernel/firmware.c	2002/04/07 21:02:36
@@ -703,8 +703,10 @@ int __init pdc_soft_power_info(unsigned=20
 =09
 	spin_lock_irq(&pdc_lock);
 	retval =3D mem_pdc_call(PDC_SOFT_POWER, PDC_SOFT_POWER_INFO, __pa(pdc_res=
ult), 0);
-	if (retval =3D=3D PDC_OK)
-		*power_reg =3D pdc_result[0];
+	if (retval =3D=3D PDC_OK) {
+                convert_to_wide(pdc_result);
+                *power_reg =3D f_extend(pdc_result[0]);
+	}
 	spin_unlock_irq(&pdc_lock);
=20
 	return retval;
Index: drivers/gsc/dino.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/linux/drivers/gsc/dino.c,v
retrieving revision 1.59
diff -u -p -r1.59 dino.c
--- drivers/gsc/dino.c	2002/02/28 07:15:36	1.59
+++ drivers/gsc/dino.c	2002/04/07 21:02:37
@@ -478,7 +478,7 @@ dino_card_setup(struct pci_bus *bus, uns
 	res->flags =3D IORESOURCE_MEM;
=20
 	if (ccio_allocate_resource(dino_dev->hba.dev, res, _8MB,
-				0xf0000000 | _8MB, 0xffffffff &~ _8MB, _8MB,
+				0xfffffffff0000000 | _8MB, 0xffffffffffffffff &~ _8MB, _8MB,
 				NULL, NULL) < 0) {
 		printk(KERN_WARNING "Dino: Failed to allocate memory region\n");
 		return;
@@ -488,7 +488,7 @@ dino_card_setup(struct pci_bus *bus, uns
=20
 	/* Now tell dino what range it has */
 	for (i =3D 1; i < 31; i++) {
-		if (res->start =3D=3D (0xf0000000 | i * _8MB))
+		if (res->start =3D=3D (0xfffffffff0000000 | i * _8MB))
 			break;
 	}
 	gsc_writel(1 << i, base_addr + DINO_IO_ADDR_EN);
@@ -569,7 +569,7 @@ dino_fixup_bus(struct pci_bus *bus)
 			continue;
=20
 		/* Adjust the I/O Port space addresses */
-		for (i =3D 0; i < 6; i++) {
+		for (i =3D 0; i < PCI_NUM_RESOURCES; i++) {
 			struct resource *res =3D &dev->resource[i];
 			if (res->flags & IORESOURCE_IO) {
 				res->start |=3D port_base;
@@ -582,7 +582,6 @@ dino_fixup_bus(struct pci_bus *bus)
 				res->end   |=3D 0xffffffff00000000UL;
 			}
 #endif
-=20
 		}
=20
 		/* Adjust INT_LINE for that busses region */
@@ -657,8 +656,8 @@ dino_card_init(struct dino_device *dino_
 static int __init
 dino_bridge_init(struct dino_device *dino_dev, const char *name)
 {
-	unsigned long io_addr;
-	int bpos, result;
+	unsigned long io_addr, bpos;
+	int result;
 	struct resource *res;
 	/*
 	 * Decoding IO_ADDR_EN only works for Built-in Dino
@@ -676,7 +675,8 @@ dino_bridge_init(struct dino_device *din
=20
 	res =3D &dino_dev->hba.lmmio_space;
 	res->flags =3D IORESOURCE_MEM;
-	res->start =3D (unsigned long) 0xfffffffff0000000 | bpos << 23;
+
+	res->start =3D (unsigned long)(signed int)(0xf0000000 | (bpos << 23));
 	res->end =3D res->start + 8 * 1024 * 1024 - 1;
=20
 	result =3D ccio_request_resource(dino_dev->hba.dev, res);
@@ -782,8 +782,8 @@ static int __init dino_common_init(struc
 	return 0;
 }
=20
-#define CUJO_RAVEN_ADDR		0xf1000000UL
-#define CUJO_FIREHAWK_ADDR	0xf1604000UL
+#define CUJO_RAVEN_ADDR		0xfffffffff1000000UL
+#define CUJO_FIREHAWK_ADDR	0xfffffffff1604000UL
 #define CUJO_RAVEN_BADPAGE	0x01003000UL
 #define CUJO_FIREHAWK_BADPAGE	0x01607000UL
=20

--=-QKKvpm6YVBvwldWQF8zA--