Add option NO_SIO to work-around the hardcoded dependency on sio(4).

Without this option it is not possible to omit the driver from the
configuration file and successfully build a kernel.

This option is specific to alpha.
This commit is contained in:
Marcel Moolenaar 2003-08-25 03:43:08 +00:00
parent cc56683de7
commit 875e2e9ca9
14 changed files with 246 additions and 201 deletions

View File

@ -49,18 +49,21 @@ __FBSDID("$FreeBSD$");
#include <alpha/pci/irongatereg.h>
#include <alpha/pci/irongatevar.h>
#ifndef NO_SIO
#ifndef CONSPEED
#define CONSPEED TTYDEF_SPEED
#endif
static int comcnrate = CONSPEED;
extern int comconsole;
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
#endif
extern int sccnattach(void);
void api_up1000_init(void);
static void api_up1000_cons_init(void);
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
extern int sccnattach(void);
void
api_up1000_init()
{
@ -75,38 +78,38 @@ api_up1000_init()
platform.cons_init = api_up1000_cons_init;
}
extern int comconsole;
static void
api_up1000_cons_init()
{
struct ctb *ctb;
irongate_init();
#ifndef NO_SIO
#ifdef DDB
siogdbattach(0x2f8, 57600);
#endif
#endif
ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
switch (ctb->ctb_term_type) {
case 2:
case 2:
#ifndef NO_SIO
/* serial console ... */
/* XXX */
{
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10))
*/
DELAY(160000000 / comcnrate);
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10))
*/
DELAY(160000000 / comcnrate);
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
boothowto |= RB_SERIAL;
break;
}
boothowto |= RB_SERIAL;
#endif
break;
case 3:
/* display console ... */

View File

@ -94,15 +94,21 @@ __FBSDID("$FreeBSD$");
#include <dev/pci/pcivar.h>
#ifndef NO_SIO
#ifndef CONSPEED
#define CONSPEED TTYDEF_SPEED
#endif
static int comcnrate = CONSPEED;
extern int comconsole;
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
#endif
extern int sccnattach(void);
void dec_1000a_init(int);
static void dec_1000a_cons_init(void);
static void dec_1000_intr_map(void *);
static void dec_1000_intr_disable(int);
static void dec_1000_intr_enable(int);
@ -113,11 +119,6 @@ static void dec_1000a_intr_disable(int);
static void dec_1000a_intr_enable(int);
static void dec_1000a_intr_init(void);
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
extern int sccnattach(void);
static const struct alpha_variation_table dec_1000_variations[] = {
{ 0, "AlphaServer 1000" },
{ 0, NULL },
@ -172,8 +173,6 @@ dec_1000a_init(int cputype)
}
/* XXX for forcing comconsole when srm serial console is used */
extern int comconsole;
static void
dec_1000a_cons_init()
@ -186,35 +185,36 @@ dec_1000a_cons_init()
apecs_init();
}
#ifndef NO_SIO
#ifdef DDB
siogdbattach(0x2f8, 57600);
#endif
#endif
ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
switch (ctb->ctb_term_type) {
case 2:
#ifndef NO_SIO
/* serial console ... */
/* XXX */
{
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10)).
*/
DELAY(160000000 / comcnrate);
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10)).
*/
DELAY(160000000 / comcnrate);
/*
* Force a comconsole on com1 if the SRM has a serial
* console.
*/
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
/*
* Force a comconsole on com1 if the SRM has a serial
* console.
*/
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
boothowto |= RB_SERIAL;
break;
}
boothowto |= RB_SERIAL;
#endif
break;
case 3:
/* display console ... */

View File

@ -54,21 +54,21 @@ __FBSDID("$FreeBSD$");
#include <alpha/pci/apecsreg.h>
#include <alpha/pci/apecsvar.h>
#ifndef NO_SIO
#ifndef CONSPEED
#define CONSPEED TTYDEF_SPEED
#endif
static int comcnrate = CONSPEED;
extern int comconsole;
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
#endif
extern int sccnattach(void);
void dec_2100_a50_init(void);
static void dec_2100_a50_cons_init(void);
static void dec_2100_a50_intr_map(void *);
void sio_intr_establish(int);
void sio_intr_disestablish(int);
void sio_intr_setup(void);
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
extern int sccnattach(void);
const struct alpha_variation_table dec_2100_a50_variations[] = {
{ SV_ST_AVANTI, "AlphaStation 400 4/233 (\"Avanti\")" },
@ -103,9 +103,6 @@ dec_2100_a50_init()
platform.pci_intr_map = dec_2100_a50_intr_map;
}
/* XXX for forcing comconsole when srm serial console is used */
extern int comconsole;
static void
dec_2100_a50_cons_init()
{
@ -113,32 +110,34 @@ dec_2100_a50_cons_init()
apecs_init();
#ifndef NO_SIO
#ifdef DDB
siogdbattach(0x2f8, 9600);
#endif
#endif
ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
switch (ctb->ctb_term_type) {
case 2:
#ifndef NO_SIO
/* serial console ... */
/* XXX */
{
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10)).
*/
DELAY(160000000 / comcnrate);
/*
* Force a comconsole on com1 if the SRM has a serial console.
*/
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10)).
*/
DELAY(160000000 / comcnrate);
/*
* Force a comconsole on com1 if the SRM has a serial console.
*/
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
boothowto |= RB_SERIAL;
break;
}
boothowto |= RB_SERIAL;
#endif
break;
case 3:
/* display console ... */

View File

@ -47,19 +47,22 @@ __FBSDID("$FreeBSD$");
#include <alpha/pci/t2var.h>
#include <alpha/pci/t2reg.h>
#ifndef NO_SIO
#ifndef CONSPEED
#define CONSPEED TTYDEF_SPEED
#endif
static int comcnrate = CONSPEED;
extern int comconsole;
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
#endif
extern int sccnattach(void);
void dec_2100_a500_init(int);
static void dec_2100_a500_cons_init(void);
static void dec_2100_a500_intr_init(void);
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
extern int sccnattach(void);
void
dec_2100_a500_init(int cputype)
{
@ -91,8 +94,6 @@ dec_2100_a500_init(int cputype)
t2_init();
}
/* XXX for forcing comconsole when srm serial console is used */
extern int comconsole;
static void
dec_2100_a500_cons_init()
@ -100,15 +101,18 @@ dec_2100_a500_cons_init()
struct ctb *ctb;
t2_init();
#ifndef NO_SIO
#ifdef DDB
siogdbattach(0x2f8, 9600);
#endif
#endif
ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
switch (ctb->ctb_term_type) {
case 2:
#ifndef NO_SIO
/* serial console ... */
/* XXX */
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
@ -123,6 +127,7 @@ dec_2100_a500_cons_init()
panic("can't init serial console");
boothowto |= RB_SERIAL;
#endif
break;
case 3:

View File

@ -51,19 +51,22 @@ __FBSDID("$FreeBSD$");
#include <dev/pci/pcivar.h>
#include <alpha/pci/lcavar.h>
#ifndef NO_SIO
#ifndef CONSPEED
#define CONSPEED TTYDEF_SPEED
#endif
static int comcnrate = CONSPEED;
extern int comconsole;
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
#endif
extern int sccnattach(void);
void dec_axppci_33_init(void);
static void dec_axppci_33_cons_init(void);
static int dec_axppci_33_intr_route (device_t, device_t, int);
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
extern int sccnattach(void);
const struct alpha_variation_table dec_axppci_33_variations[] = {
{ 0, "Alpha PC AXPpci33 (\"NoName\")" },
{ 0, NULL },
@ -114,8 +117,6 @@ dec_axppci_33_init()
outb(NSIO_PORT + NSIO_DATA, cfg0val);
}
/* XXX for forcing comconsole when srm serial console is used */
extern int comconsole;
static void
dec_axppci_33_cons_init()
@ -124,32 +125,34 @@ dec_axppci_33_cons_init()
lca_init();
#ifndef NO_SIO
#ifdef DDB
siogdbattach(0x2f8, 9600);
#endif
#endif
ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
switch (ctb->ctb_term_type) {
case 2:
#ifndef NO_SIO
/* serial console ... */
/* XXX */
{
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10))
*/
DELAY(160000000 / comcnrate);
/*
* force a comconsole on com1 if the SRM has a serial console
*/
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10))
*/
DELAY(160000000 / comcnrate);
/*
* force a comconsole on com1 if the SRM has a serial console
*/
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
boothowto |= RB_SERIAL;
break;
}
boothowto |= RB_SERIAL;
#endif
break;
case 3:
/* display console ... */

View File

@ -48,10 +48,17 @@ __FBSDID("$FreeBSD$");
#include <alpha/pci/ciavar.h>
#ifndef NO_SIO
#ifndef CONSPEED
#define CONSPEED TTYDEF_SPEED
#endif
static int comcnrate = CONSPEED;
extern int comconsole;
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
#endif
extern int sccnattach(void);
void dec_eb164_init(void);
static void dec_eb164_cons_init(void);
@ -61,10 +68,6 @@ extern void eb164_intr_disable(int irq);
extern void eb164_intr_enable_icsr(int irq);
extern void eb164_intr_disable_icsr(int irq);
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
extern int sccnattach(void);
void
dec_eb164_init()
{
@ -88,7 +91,6 @@ dec_eb164_init()
}
}
extern int comconsole; /* XXX for forcing comconsole when srm serial console is used */
static void
dec_eb164_cons_init()
{
@ -96,35 +98,36 @@ dec_eb164_cons_init()
cia_init();
#ifndef NO_SIO
#ifdef DDB
siogdbattach(0x2f8, 57600);
#endif
#endif
ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
switch (ctb->ctb_term_type) {
case 2:
#ifndef NO_SIO
/* serial console ... */
/* XXX */
{
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10))
*/
DELAY(160000000 / comcnrate);
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10))
*/
DELAY(160000000 / comcnrate);
/*
* Force a comconsole on com1 if the SRM has a serial
* console.
*/
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
/*
* Force a comconsole on com1 if the SRM has a serial
* console.
*/
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
boothowto |= RB_SERIAL;
break;
}
boothowto |= RB_SERIAL;
#endif
break;
case 3:
/* display console ... */

View File

@ -68,10 +68,16 @@ __FBSDID("$FreeBSD$");
#include <alpha/pci/apecsreg.h>
#include <alpha/pci/apecsvar.h>
#ifndef NO_SIO
#ifndef CONSPEED
#define CONSPEED TTYDEF_SPEED
#endif
static int comcnrate = CONSPEED;
extern int comconsole;
extern int siocnattach(int, int);
#endif
extern int sccnattach(void);
void dec_eb64plus_init(void);
static void dec_eb64plus_cons_init(void);
@ -83,9 +89,6 @@ extern void eb64plus_intr_disable(int irq); /* ../pci/pci_eb64plus_intr.s */
extern const char * bootdev_protocol(void);
extern int bootdev_boot_dev_type(void);
extern int siocnattach(int, int);
extern int sccnattach(void);
const struct alpha_variation_table dec_eb64plus_variations[] = {
{ 0, "DEC EB64-plus" },
{ 0, NULL },
@ -116,8 +119,6 @@ dec_eb64plus_init()
}
/* XXX for forcing comconsole when srm serial console is used */
extern int comconsole;
/* init the console, serial or graphics */
static void
@ -131,27 +132,26 @@ dec_eb64plus_cons_init()
switch (ctb->ctb_term_type) {
case 2:
#ifndef NO_SIO
/* serial console ... */
/* XXX */
{
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10))
*/
DELAY(160000000 / comcnrate);
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10))
*/
DELAY(160000000 / comcnrate);
/*
* force a comconsole on com1 if the SRM has a serial
* console.
*/
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
/*
* force a comconsole on com1 if the SRM has a serial
* console.
*/
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
boothowto |= RB_SERIAL;
break;
}
boothowto |= RB_SERIAL;
#endif
break;
case 3:
#ifdef DEV_SC

View File

@ -51,10 +51,17 @@ __FBSDID("$FreeBSD$");
#include <alpha/pci/ciareg.h>
#include <alpha/pci/ciavar.h>
#ifndef NO_SIO
#ifndef CONSPEED
#define CONSPEED TTYDEF_SPEED
#endif
static int comcnrate = CONSPEED;
extern int comconsole;
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
#endif
extern int sccnattach(void);
void dec_kn20aa_init(void);
static void dec_kn20aa_cons_init(void);
@ -63,10 +70,6 @@ static void dec_kn20aa_intr_map(void *);
static void dec_kn20aa_intr_disable(int);
static void dec_kn20aa_intr_enable(int);
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
extern int sccnattach(void);
#if 0
static void dec_kn20aa_device_register(struct device *, void *);
#endif
@ -75,7 +78,6 @@ const struct alpha_variation_table dec_kn20aa_variations[] = {
{ 0, "AlphaStation 500 or 600 (KN20AA)" },
{ 0, NULL },
};
extern int comconsole; /* XXX for forcing comconsole when srm serial console is used */
void
dec_kn20aa_init()
@ -106,29 +108,31 @@ dec_kn20aa_cons_init()
cia_init();
#ifndef NO_SIO
#ifdef DDB
siogdbattach(0x2f8, 9600);
#endif
#endif
ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
switch (ctb->ctb_term_type) {
case 2:
#ifndef NO_SIO
/* serial console ... */
/* XXX */
{
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10))
*/
DELAY(160000000 / comcnrate);
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10))
*/
DELAY(160000000 / comcnrate);
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
boothowto |= RB_SERIAL;
break;
}
boothowto |= RB_SERIAL;
#endif
break;
case 3:
/* display console ... */

View File

@ -54,10 +54,17 @@ __FBSDID("$FreeBSD$");
#include <alpha/mcbus/mcbusreg.h>
#include <alpha/mcbus/mcbusvar.h>
#ifndef NO_SIO
#ifndef CONSPEED
#define CONSPEED TTYDEF_SPEED
#endif
static int comcnrate = CONSPEED;
extern int comconsole;
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
#endif
extern int sccnattach(void);
void dec_kn300_init(void);
void dec_kn300_cons_init(void);
@ -70,10 +77,6 @@ const struct alpha_variation_table dec_kn300_variations[] = {
};
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
extern int sccnattach(void);
void
dec_kn300_init()
{
@ -92,22 +95,24 @@ dec_kn300_init()
platform.cons_init = dec_kn300_cons_init;
}
extern int comconsole;
void
dec_kn300_cons_init()
{
struct ctb *ctb;
mcbus_init();
#ifndef NO_SIO
#ifdef DDB
siogdbattach(0x2f8, 57600);
#endif
#endif
ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
switch (ctb->ctb_term_type) {
case 2:
#ifndef NO_SIO
/* serial console ... */
/*
* Delay to allow PROM putchars to complete.
@ -120,6 +125,7 @@ dec_kn300_cons_init()
panic("can't init serial console");
boothowto |= RB_SERIAL;
#endif
break;
case 3:

View File

@ -56,10 +56,17 @@ __FBSDID("$FreeBSD$");
#include <alpha/pci/ciareg.h>
#include <alpha/pci/ciavar.h>
#ifndef NO_SIO
#ifndef CONSPEED
#define CONSPEED TTYDEF_SPEED
#endif
static int comcnrate = CONSPEED;
extern int comconsole;
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
#endif
extern int sccnattach(void);
void st550_init(void);
static void st550_cons_init(void);
@ -72,10 +79,6 @@ static void st550_intr_map(void *);
#define ST550_PCI_IRQ_BEGIN 8
#define ST550_PCI_MAX_IRQ 47
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
extern int sccnattach(void);
void
st550_init()
{
@ -95,8 +98,6 @@ st550_init()
platform.pci_intr_enable = st550_intr_enable;
}
extern int comconsole;
static void
st550_cons_init()
{
@ -104,14 +105,17 @@ st550_cons_init()
cia_init();
#ifndef NO_SIO
#ifdef DDB
siogdbattach(0x2f8, 57600);
#endif
#endif
ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
switch (ctb->ctb_term_type) {
case 2:
#ifndef NO_SIO
/* serial console ... */
/* XXX */
/*
@ -125,6 +129,7 @@ st550_cons_init()
panic("can't init serial console");
boothowto |= RB_SERIAL;
#endif
break;
case 3:

View File

@ -48,10 +48,17 @@ __FBSDID("$FreeBSD$");
#include <dev/pci/pcivar.h>
#include <alpha/pci/tsunamivar.h>
#ifndef NO_SIO
#ifndef CONSPEED
#define CONSPEED TTYDEF_SPEED
#endif
static int comcnrate = CONSPEED;
extern int comconsole;
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
#endif
extern int sccnattach(void);
void st6600_init(void);
static void st6600_cons_init(void);
@ -60,10 +67,6 @@ static void st6600_intr_init(void);
#define ST6600_PCI_IRQ_BEGIN 8
#define ST6600_PCI_MAX_IRQ 63
extern int siocnattach(int, int);
extern int siogdbattach(int, int);
extern int sccnattach(void);
void
st6600_init()
{
@ -79,38 +82,38 @@ st6600_init()
platform.pci_intr_init = st6600_intr_init;
}
extern int comconsole;
static void
st6600_cons_init()
{
struct ctb *ctb;
tsunami_init();
#ifndef NO_SIO
#ifdef DDB
siogdbattach(0x2f8, 57600);
#endif
#endif
ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off);
switch (ctb->ctb_term_type) {
case 2:
#ifndef NO_SIO
/* serial console ... */
/* XXX */
{
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10))
*/
DELAY(160000000 / comcnrate);
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
/*
* Delay to allow PROM putchars to complete.
* FIFO depth * character time,
* character time = (1000000 / (defaultrate / 10))
*/
DELAY(160000000 / comcnrate);
comconsole = 0;
if (siocnattach(0x3f8, comcnrate))
panic("can't init serial console");
boothowto |= RB_SERIAL;
break;
}
boothowto |= RB_SERIAL;
#endif
break;
case 3:
/* display console ... */

View File

@ -122,6 +122,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <sys/uio.h>
#include <sys/linker.h>
#include <sys/cons.h>
#include <net/netisr.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
@ -585,10 +586,18 @@ alpha_init(pfn, ptb, bim, bip, biv)
* Initalize the real console, so the the bootstrap console is
* no longer necessary.
*/
#ifndef NO_SIO
if (platform.cons_init) {
platform.cons_init();
promcndetach();
}
#else
if (platform.cons_init)
platform.cons_init();
promcndetach();
cninit();
#endif
/* NO MORE FIRMWARE ACCESS ALLOWED */
#ifdef _PMAP_MAY_USE_PROM_CONSOLE
/*

View File

@ -40,6 +40,9 @@ options DEC_KN8AE # AlphaServer 8200/8400 (Turbolaser)
options DEC_KN300 # AlphaServer 4100 (Rawhide),
# AlphaServer 1200 (Tincup)
# Allow building a kernel without sio(4).
options NO_SIO
#####################################################################
# HARDWARE BUS CONFIGURATION

View File

@ -16,6 +16,8 @@ DEC_AXPPCI_33 opt_cpu.h
DEC_1000A opt_cpu.h
API_UP1000 opt_cpu.h
NO_SIO opt_global.h
MAXMEM
PPC_PROBE_CHIPSET opt_ppc.h