On Thu, Mar 16, 2000 at 03:21:12PM -0800, Brian Pomerantz wrote:
> I was still unable to compile this. First I was bombing with an error
> in include/asm/delay.h where it was trying to dereference a pointer of
> unknown type in the cpu_data array.
Bother. Here's a fix for it.
> Then I came across the NCR driver which bombed. The macro INB_OFF(o)
> is trying to reference the member 'base_io' in variable np which is of type
> 'struct ncb *' and doesn't have this member in its definition.
Yes, I saw this too. I worked around it, but it appears that
something else is wrong because it doesn't pass cache tests.
I was able to the get old 53c7,8xx driver working though...
r~
diff -rup linux/include/asm-alpha/delay.h 2.3.99-2-2/include/asm-alpha/delay.h
--- linux/include/asm-alpha/delay.h Thu Mar 16 19:31:28 2000
+++ 2.3.99-2-2/include/asm-alpha/delay.h Thu Mar 16 19:46:47 2000
@@ -31,21 +31,16 @@ __delay(int loops)
}
extern __inline__ void
-udelay(unsigned long usecs)
+__udelay(unsigned long usecs, unsigned long lps)
{
- unsigned long lps;
+ usecs *= ((1UL << 32) / 1000000) * lps;
+ __delay((long)usecs >> 32);
+}
#ifdef __SMP__
- lps = cpu_data[smp_processor_id()].loops_per_sec;
+#define udelay(u) __udelay((u), cpu_data[smp_processor_id()].loops_per_sec)
#else
- lps = loops_per_sec;
+#define udelay(u) __udelay((u), loops_per_sec);
#endif
-
- /* Compute (usecs * 2**32 / 10**6) * loops_per_sec / 2**32. */
-
- usecs *= 0x10c6; /* 2^32 / 10^6 */
- usecs *= lps;
- __delay((long)usecs >> 32);
-}
#endif /* defined(__ALPHA_DELAY_H) */
--- linux/drivers/scsi/53c7,8xx.c Tue Nov 23 10:29:15 1999
+++ 2.3.99-1/drivers/scsi/53c7,8xx.c Thu Mar 16 14:34:14 2000
@@ -1396,7 +1396,7 @@ ncr_pci_init (Scsi_Host_Template *tpnt,
int i, irq;
struct pci_dev *pdev = pci_find_slot(bus, device_fn);
- printk("scsi-ncr53c7,8xx : at PCI bus %d, device %d, function %d\n",
+ printk("scsi-ncr53c7,8xx : at PCI bus %d, device %d, function %d\n",
bus, (int) (device_fn & 0xf8) >> 3,
(int) device_fn & 7);
@@ -1406,10 +1406,8 @@ ncr_pci_init (Scsi_Host_Template *tpnt,
return -1;
}
- if ((error = pcibios_read_config_word (bus, device_fn, PCI_COMMAND,
- &command)) ||
- (error = pcibios_read_config_byte (bus, device_fn, PCI_CLASS_REVISION,
- &revision))) {
+ if ((error = pci_read_config_word (pdev, PCI_COMMAND, &command)) ||
+ (error = pci_read_config_byte (pdev, PCI_CLASS_REVISION, &revision))) {
printk ("scsi-ncr53c7,8xx : error %d not initializing due to error reading
configuration space\n"
" perhaps you specified an incorrect PCI bus, device, or
function.\n", error);
return -1;
@@ -1451,24 +1449,21 @@ ncr_pci_init (Scsi_Host_Template *tpnt,
*/
if (command & PCI_COMMAND_IO) {
- if ((io_port & 3) != 1) {
- printk ("scsi-ncr53c7,8xx : disabling I/O mapping since base address 0
(0x%x)\n"
- " bits 0..1 indicate a non-IO mapping\n",
- (unsigned) io_port);
+ if (!(pdev->resource[0].flags & IORESOURCE_IO)) {
+ printk ("scsi-ncr53c7,8xx : disabling I/O mapping since base "
+ "address 0\n contains a non-IO mapping\n");
io_port = 0;
- } else
- io_port &= PCI_BASE_ADDRESS_IO_MASK;
+ }
} else {
io_port = 0;
}
if (command & PCI_COMMAND_MEMORY) {
- if ((base & PCI_BASE_ADDRESS_SPACE) != PCI_BASE_ADDRESS_SPACE_MEMORY) {
- printk("scsi-ncr53c7,8xx : disabling memory mapping since base address 1\n"
- " contains a non-memory mapping\n");
+ if (!(pdev->resource[1].flags & IORESOURCE_MEM)) {
+ printk("scsi-ncr53c7,8xx : disabling memory mapping since base "
+ "address 1\n contains a non-memory mapping\n");
base = 0;
- } else
- base &= PCI_BASE_ADDRESS_MEM_MASK;
+ }
} else {
base = 0;
}