Linux PARISC architecture development
 help / color / mirror / Atom feed
* [parisc-linux] Turn off CONFIG_PCI
@ 2001-08-17  7:11 Matthew Wilcox
  2001-08-18 19:37 ` Helge Deller
  0 siblings, 1 reply; 6+ messages in thread
From: Matthew Wilcox @ 2001-08-17  7:11 UTC (permalink / raw)
  To: parisc-linux

A number of people have been asking for the ability to turn off CONFIG_PCI,
and while I was reviewing the outstanding diff vs 2.4.9, I noticed I could
take out some of the patch if I just made some slight alterations.  Please
test this patch; it compiles for me.

Index: drivers/char/serial.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/char/serial.c,v
retrieving revision 1.25
diff -u -p -r1.25 serial.c
--- serial.c	2001/08/17 06:10:06	1.25
+++ serial.c	2001/08/17 07:06:02
@@ -414,11 +414,7 @@ static _INLINE_ unsigned int serial_in(s
 		return readb((unsigned long) info->iomem_base +
 			     (offset<<info->iomem_reg_shift));
 	default:
-#if defined(CONFIG_PCI) || defined(CONFIG_ISA)
 		return inb(info->port + offset);
-#else
-		BUG();
-#endif
 	}
 }
 
@@ -437,11 +433,7 @@ static _INLINE_ void serial_out(struct a
 			      (offset<<info->iomem_reg_shift));
 		break;
 	default:
-#if defined(CONFIG_PCI) || defined(CONFIG_ISA)
 		outb(value, info->port+offset);
-#else
-		BUG();
-#endif
 	}
 }
 
Index: include/asm-parisc/io.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/io.h,v
retrieving revision 1.22
diff -u -p -r1.22 io.h
--- io.h	2001/07/15 22:30:29	1.22
+++ io.h	2001/08/17 07:06:03
@@ -43,9 +43,6 @@
 #endif /* USE_HPPA_IOREMAP */
 
 #if defined(CONFIG_PCI) || defined(CONFIG_ISA)
-/*
- *	So we get clear link errors 
- */
 extern unsigned char inb(unsigned long addr);
 extern unsigned short inw(unsigned long addr);
 extern unsigned int inl(unsigned long addr);
@@ -53,7 +50,28 @@ extern unsigned int inl(unsigned long ad
 extern void outb(unsigned char b, unsigned long addr);
 extern void outw(unsigned short b, unsigned long addr);
 extern void outl(unsigned int b, unsigned long addr);
+#else
+static inline char inb(unsigned long addr)
+{
+	BUG();
+	return -1;
+}
 
+static inline short inw(unsigned long addr)
+{
+	BUG();
+	return -1;
+}
+
+static inline int inl(unsigned long addr)
+{
+	BUG();
+	return -1;
+}
+
+#define outb(x, y)	BUG()
+#define outw(x, y)	BUG()
+#define outl(x, y)	BUG()
 #endif
 
 extern void memcpy_fromio(void *dest, unsigned long src, int count);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [parisc-linux] Turn off CONFIG_PCI
  2001-08-17  7:11 [parisc-linux] Turn off CONFIG_PCI Matthew Wilcox
@ 2001-08-18 19:37 ` Helge Deller
  2001-08-18 22:37   ` Matthew Wilcox
  0 siblings, 1 reply; 6+ messages in thread
From: Helge Deller @ 2001-08-18 19:37 UTC (permalink / raw)
  To: Matthew Wilcox, parisc-linux

Hi Matthew,

I tested your patch sucessfully on my c3k and my 715/64.
I've only added a small security check to setup.c to prevent PA2.x machines
from booting without CONFIG_PCI and to print a small panic-message
at bootup instead of just HPMC'ing.
Please commit if nobody else complains, 

Greetings,
Helge

Index: linux/arch/parisc/kernel/setup.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/setup.c,v
retrieving revision 1.88
diff -u -r1.88 setup.c
--- setup.c	2001/08/16 20:57:18	1.88
+++ setup.c	2001/08/18 19:21:47
@@ -401,6 +401,18 @@
 	cache_init();
 	paging_init();
 
+#ifndef CONFIG_PCI
+	/* security check: PA2.x processor machines won't detect their main
+	 * PCI-based devices (screen, serial, SCSI, ...), so it's better to
+	 * stop them from booting right here. If we would continue we would
+	 * only get a HPMC without any other information. */
+	if (boot_cpu_data.cpu_type >= pcxu) { /* >=PA8000 (PCX-U) CPU ? */
+		/* switch back to PDC console for panic */
+		pdc_console_restart();
+		panic("This system will not boot without PCI-support in the kernel !\n");
+	}
+#endif
+	
 #ifdef CONFIG_CHASSIS_LCD_LED
 	/* initialize the LCD/LED after boot_cpu_data is available ! */
         led_init();				/* LCD/LED initialization */
Index: linux/drivers/char/serial.c
===================================================================
RCS file: /home/cvs/parisc/linux/drivers/char/serial.c,v
retrieving revision 1.25
diff -u -r1.25 serial.c
--- serial.c	2001/08/17 06:10:06	1.25
+++ serial.c	2001/08/18 19:21:56
@@ -414,11 +414,7 @@
 		return readb((unsigned long) info->iomem_base +
 			     (offset<<info->iomem_reg_shift));
 	default:
-#if defined(CONFIG_PCI) || defined(CONFIG_ISA)
 		return inb(info->port + offset);
-#else
-		BUG();
-#endif
 	}
 }
 
@@ -437,11 +433,7 @@
 			      (offset<<info->iomem_reg_shift));
 		break;
 	default:
-#if defined(CONFIG_PCI) || defined(CONFIG_ISA)
 		outb(value, info->port+offset);
-#else
-		BUG();
-#endif
 	}
 }
 
Index: linux/include/asm-parisc/io.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/io.h,v
retrieving revision 1.22
diff -u -r1.22 io.h
--- io.h	2001/07/15 22:30:29	1.22
+++ io.h	2001/08/18 19:22:08
@@ -43,9 +43,6 @@
 #endif /* USE_HPPA_IOREMAP */
 
 #if defined(CONFIG_PCI) || defined(CONFIG_ISA)
-/*
- *	So we get clear link errors 
- */
 extern unsigned char inb(unsigned long addr);
 extern unsigned short inw(unsigned long addr);
 extern unsigned int inl(unsigned long addr);
@@ -53,7 +50,28 @@
 extern void outb(unsigned char b, unsigned long addr);
 extern void outw(unsigned short b, unsigned long addr);
 extern void outl(unsigned int b, unsigned long addr);
+#else
+static inline char inb(unsigned long addr)
+{
+	BUG();
+	return -1;
+}
 
+static inline short inw(unsigned long addr)
+{
+	BUG();
+	return -1;
+}
+
+static inline int inl(unsigned long addr)
+{
+	BUG();
+	return -1;
+}
+
+#define outb(x, y)	BUG()
+#define outw(x, y)	BUG()
+#define outl(x, y)	BUG()
 #endif
 
 extern void memcpy_fromio(void *dest, unsigned long src, int count);




On Friday 17 August 2001 09:11, Matthew Wilcox wrote:
> A number of people have been asking for the ability to turn off CONFIG_PCI,
> and while I was reviewing the outstanding diff vs 2.4.9, I noticed I could
> take out some of the patch if I just made some slight alterations.  Please
> test this patch; it compiles for me.
>
... <original patch deleted>...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [parisc-linux] Turn off CONFIG_PCI
  2001-08-18 19:37 ` Helge Deller
@ 2001-08-18 22:37   ` Matthew Wilcox
  2001-08-18 22:59     ` Helge Deller
       [not found]     ` <E15YF67-0000tK-00@master.debian.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Matthew Wilcox @ 2001-08-18 22:37 UTC (permalink / raw)
  To: Helge Deller; +Cc: Matthew Wilcox, parisc-linux

On Sat, Aug 18, 2001 at 09:37:06PM +0200, Helge Deller wrote:
> I tested your patch sucessfully on my c3k and my 715/64.
> I've only added a small security check to setup.c to prevent PA2.x machines
> from booting without CONFIG_PCI and to print a small panic-message
> at bootup instead of just HPMC'ing.

> +#ifndef CONFIG_PCI
> +	/* security check: PA2.x processor machines won't detect their main
> +	 * PCI-based devices (screen, serial, SCSI, ...), so it's better to
> +	 * stop them from booting right here. If we would continue we would
> +	 * only get a HPMC without any other information. */
> +	if (boot_cpu_data.cpu_type >= pcxu) { /* >=PA8000 (PCX-U) CPU ? */
> +		/* switch back to PDC console for panic */
> +		pdc_console_restart();
> +		panic("This system will not boot without PCI-support in the kernel !\n");
> +	}
> +#endif

I don't believe this is appropriate.  Cxxx / Jxxx machines use Lasi for
their serial port, so it's theoretically possible to boot one without
CONFIG_PCI.  If the user wants to turn it off, let them.  It's not like
any other architecture does anything like this.

-- 
Revolutions do not require corporate support.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [parisc-linux] Turn off CONFIG_PCI
  2001-08-18 22:37   ` Matthew Wilcox
@ 2001-08-18 22:59     ` Helge Deller
  2001-08-21  7:18       ` Grant Grundler
       [not found]     ` <E15YF67-0000tK-00@master.debian.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Helge Deller @ 2001-08-18 22:59 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Matthew Wilcox, parisc-linux

On Sunday 19 August 2001 00:37, Matthew Wilcox wrote:
> On Sat, Aug 18, 2001 at 09:37:06PM +0200, Helge Deller wrote:
> > I tested your patch sucessfully on my c3k and my 715/64.
> > I've only added a small security check to setup.c to prevent PA2.x
> > machines from booting without CONFIG_PCI and to print a small
> > panic-message at bootup instead of just HPMC'ing.
> >
> > +#ifndef CONFIG_PCI
> > +	/* security check: PA2.x processor machines won't detect their main
> > +	 * PCI-based devices (screen, serial, SCSI, ...), so it's better to
> > +	 * stop them from booting right here. If we would continue we would
> > +	 * only get a HPMC without any other information. */
> > +	if (boot_cpu_data.cpu_type >= pcxu) { /* >=PA8000 (PCX-U) CPU ? */
> > +		/* switch back to PDC console for panic */
> > +		pdc_console_restart();
> > +		panic("This system will not boot without PCI-support in the kernel
> > !\n"); +	}
> > +#endif
>
> I don't believe this is appropriate.  Cxxx / Jxxx machines use Lasi for
> their serial port, so it's theoretically possible to boot one without
> CONFIG_PCI.  If the user wants to turn it off, let them.  It's not like
> any other architecture does anything like this.

Sure, Cxxx and Jxxx may have LASI, but if I'm correct they all have a 32bit PA7XXX 
CPU and thus won't be catched by this check.
Machines with a PA8XXX CPU don't have any LASI/GSC devices and would _always_ 
HPMC without PCI support. So I still think it is better to panic() with a nice message 
instead of just let the user guess why the machine suddenly HPMC'ed with this kernel 
and start asking on the parisc-linux list.
  
Helge

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [parisc-linux] Turn off CONFIG_PCI
       [not found]     ` <E15YF67-0000tK-00@master.debian.org>
@ 2001-08-18 23:04       ` Matthew Wilcox
  0 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2001-08-18 23:04 UTC (permalink / raw)
  To: Helge Deller; +Cc: Matthew Wilcox, Matthew Wilcox, parisc-linux

On Sun, Aug 19, 2001 at 12:59:41AM +0200, Helge Deller wrote:
> Sure, Cxxx and Jxxx may have LASI, but if I'm correct they all have a 32bit PA7XXX 
> CPU and thus won't be catched by this check.

Nope, C200+, C240+, C360 (and equivalent J class) all have PA8x00 CPUs.

> Machines with a PA8XXX CPU don't have any LASI/GSC devices and would _always_ 
> HPMC without PCI support. So I still think it is better to panic() with a nice message 
> instead of just let the user guess why the machine suddenly HPMC'ed with this kernel 
> and start asking on the parisc-linux list.

Everyone who's asked about compilng a kernel with CONFIG_PCI off has had a
715/712-era machine.  I don't think people with PCI slots will turn it off.

-- 
Revolutions do not require corporate support.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [parisc-linux] Turn off CONFIG_PCI
  2001-08-18 22:59     ` Helge Deller
@ 2001-08-21  7:18       ` Grant Grundler
  0 siblings, 0 replies; 6+ messages in thread
From: Grant Grundler @ 2001-08-21  7:18 UTC (permalink / raw)
  To: Helge Deller; +Cc: parisc-linux

Helge Deller wrote:
> Machines with a PA8XXX CPU don't have any LASI/GSC devices and would _always_
> HPMC without PCI support.

Later K-class models have no PCI (except "card-mode Dino add-on cards)
and PA2.0 CPU's.

> So I still think it is better to panic() with a nice message 

Better to just not link if the kernel configuration permits a driver to get
included which needs inb/outb functions. We should be able to catch stuff
like this at link time.

grant

Grant Grundler
parisc-linux {PCI|IOMMU|SMP} hacker
+1.408.447.7253

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-08-21  7:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-17  7:11 [parisc-linux] Turn off CONFIG_PCI Matthew Wilcox
2001-08-18 19:37 ` Helge Deller
2001-08-18 22:37   ` Matthew Wilcox
2001-08-18 22:59     ` Helge Deller
2001-08-21  7:18       ` Grant Grundler
     [not found]     ` <E15YF67-0000tK-00@master.debian.org>
2001-08-18 23:04       ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox