diff options
author | marcel <marcel@FreeBSD.org> | 2003-08-25 03:43:08 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-08-25 03:43:08 +0000 |
commit | 42e6660d727f28fb591a8ad3baac804da17a08d0 (patch) | |
tree | 0eb9650ba11db04a8743a160dbd1b728928db7be /sys | |
parent | 64d376606d6eecb889a8f88bfccd4aef1ee306b9 (diff) | |
download | FreeBSD-src-42e6660d727f28fb591a8ad3baac804da17a08d0.zip FreeBSD-src-42e6660d727f28fb591a8ad3baac804da17a08d0.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/alpha/api_up1000.c | 47 | ||||
-rw-r--r-- | sys/alpha/alpha/dec_1000a.c | 56 | ||||
-rw-r--r-- | sys/alpha/alpha/dec_2100_a50.c | 55 | ||||
-rw-r--r-- | sys/alpha/alpha/dec_2100_a500.c | 19 | ||||
-rw-r--r-- | sys/alpha/alpha/dec_axppci_33.c | 51 | ||||
-rw-r--r-- | sys/alpha/alpha/dec_eb164.c | 53 | ||||
-rw-r--r-- | sys/alpha/alpha/dec_eb64plus.c | 50 | ||||
-rw-r--r-- | sys/alpha/alpha/dec_kn20aa.c | 44 | ||||
-rw-r--r-- | sys/alpha/alpha/dec_kn300.c | 18 | ||||
-rw-r--r-- | sys/alpha/alpha/dec_st550.c | 17 | ||||
-rw-r--r-- | sys/alpha/alpha/dec_st6600.c | 45 | ||||
-rw-r--r-- | sys/alpha/alpha/machdep.c | 9 | ||||
-rw-r--r-- | sys/alpha/conf/NOTES | 3 | ||||
-rw-r--r-- | sys/conf/options.alpha | 2 |
14 files changed, 257 insertions, 212 deletions
diff --git a/sys/alpha/alpha/api_up1000.c b/sys/alpha/alpha/api_up1000.c index 12626f6..f21ec34 100644 --- a/sys/alpha/alpha/api_up1000.c +++ b/sys/alpha/alpha/api_up1000.c @@ -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; - -void api_up1000_init(void); -static void api_up1000_cons_init(void); - +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); + 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"); - - boothowto |= RB_SERIAL; - break; - } + /* + * 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; +#endif + break; case 3: /* display console ... */ diff --git a/sys/alpha/alpha/dec_1000a.c b/sys/alpha/alpha/dec_1000a.c index 113eca2..a1d1d39 100644 --- a/sys/alpha/alpha/dec_1000a.c +++ b/sys/alpha/alpha/dec_1000a.c @@ -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); - - /* - * 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; - } + /* + * 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; +#endif + break; case 3: /* display console ... */ diff --git a/sys/alpha/alpha/dec_2100_a50.c b/sys/alpha/alpha/dec_2100_a50.c index 11ea268..79138b2 100644 --- a/sys/alpha/alpha/dec_2100_a50.c +++ b/sys/alpha/alpha/dec_2100_a50.c @@ -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"); - - boothowto |= RB_SERIAL; - break; - } + /* + * 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; +#endif + break; case 3: /* display console ... */ diff --git a/sys/alpha/alpha/dec_2100_a500.c b/sys/alpha/alpha/dec_2100_a500.c index ac53a9e6..547d4ed 100644 --- a/sys/alpha/alpha/dec_2100_a500.c +++ b/sys/alpha/alpha/dec_2100_a500.c @@ -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: diff --git a/sys/alpha/alpha/dec_axppci_33.c b/sys/alpha/alpha/dec_axppci_33.c index 6188ac0..13e04ea 100644 --- a/sys/alpha/alpha/dec_axppci_33.c +++ b/sys/alpha/alpha/dec_axppci_33.c @@ -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"); - - boothowto |= RB_SERIAL; - break; - } + /* + * 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; +#endif + break; case 3: /* display console ... */ diff --git a/sys/alpha/alpha/dec_eb164.c b/sys/alpha/alpha/dec_eb164.c index 7ee174d..fb7e701 100644 --- a/sys/alpha/alpha/dec_eb164.c +++ b/sys/alpha/alpha/dec_eb164.c @@ -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); - - /* - * 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; - } + /* + * 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; +#endif + break; case 3: /* display console ... */ diff --git a/sys/alpha/alpha/dec_eb64plus.c b/sys/alpha/alpha/dec_eb64plus.c index 900f1c9..670e2ea 100644 --- a/sys/alpha/alpha/dec_eb64plus.c +++ b/sys/alpha/alpha/dec_eb64plus.c @@ -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); - - /* - * 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; - } + /* + * 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; +#endif + break; case 3: #ifdef DEV_SC diff --git a/sys/alpha/alpha/dec_kn20aa.c b/sys/alpha/alpha/dec_kn20aa.c index e2acd2d..de9b91b 100644 --- a/sys/alpha/alpha/dec_kn20aa.c +++ b/sys/alpha/alpha/dec_kn20aa.c @@ -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"); - - boothowto |= RB_SERIAL; - break; - } + /* + * 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; +#endif + break; case 3: /* display console ... */ diff --git a/sys/alpha/alpha/dec_kn300.c b/sys/alpha/alpha/dec_kn300.c index a03c9c0..fa1f830 100644 --- a/sys/alpha/alpha/dec_kn300.c +++ b/sys/alpha/alpha/dec_kn300.c @@ -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: diff --git a/sys/alpha/alpha/dec_st550.c b/sys/alpha/alpha/dec_st550.c index 3a8a32c..e81e982 100644 --- a/sys/alpha/alpha/dec_st550.c +++ b/sys/alpha/alpha/dec_st550.c @@ -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: diff --git a/sys/alpha/alpha/dec_st6600.c b/sys/alpha/alpha/dec_st6600.c index 528ea7d..c940c62 100644 --- a/sys/alpha/alpha/dec_st6600.c +++ b/sys/alpha/alpha/dec_st6600.c @@ -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"); - - boothowto |= RB_SERIAL; - break; - } + /* + * 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; +#endif + break; case 3: /* display console ... */ diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c index fe9b276..8c79853 100644 --- a/sys/alpha/alpha/machdep.c +++ b/sys/alpha/alpha/machdep.c @@ -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 /* diff --git a/sys/alpha/conf/NOTES b/sys/alpha/conf/NOTES index f963934..55f2da4 100644 --- a/sys/alpha/conf/NOTES +++ b/sys/alpha/conf/NOTES @@ -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 diff --git a/sys/conf/options.alpha b/sys/conf/options.alpha index 3f46d2c..407ce03 100644 --- a/sys/conf/options.alpha +++ b/sys/conf/options.alpha @@ -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 |