Date: Thu, 1 May 2003 13:57:26 -0700 (PDT) From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 30343 for review Message-ID: <200305012057.h41KvQSw090147@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=30343 Change 30343 by marcel@marcel_nfs on 2003/05/01 13:57:09 Integrate (using -I) all sio changes on the ia64 branch with this branch. Two exceptions: files.i386 and files.ia64 were edited because they contained vga(4) changes. The changes manually made in files.ia64 are identical to those on the ia64 branch. The changes made in files.i386 include the addition of a second sio_isa.c rule: sio_isa.c needs to be included if both the sio and acpi options are defined, irrespective of whether isa is defined. This merge includes: o Seperation of the sio(4) low-level console code in sio_cons.c. We use a static softc for the UART used as console and replace the dynamic softc with the static softc when we find the sio during bus enumeration. This guarantees that we preserve state and also automagically avoids that we have to know in advance which sio device is the console (since we don't care anymore). o Addition of sio_machdep.c to provide the low-level console code with tag and handle information (among other things) to keep MI code clean. The MD code can use whatever means suitable to come up with the right tag and handle: on i386 this is done by using the hints, on ia64 we use the HCDP table first and then the hints and on alpha we use the console structures for that. Support of sparc64, amd64 and powerpc. needs to be added when appropriate. o Add code to detect the (receiver) FIFO size. This avoids having to fiddle with hints and flags. The assumption is that the transmitter FIFO is at least the same size currently (we don't try to detect that seperately). o Add support for hint.sio.X.baud so that we can step away from depending on pre-compiled default baudrates. o In case it's not clear already: this merge adds support for memory mapped I/O. The driver is fully newbusified, except for the barriers. This merge axes (either permanently or temporarily): o Remove support for multi-port cards. The intend is to us puc(4) for that. The sio driver is to remain pure as much as possible. Handling multi-port cards somewhere else also avoids adding MD code in an otherwise MI driver. o Remove most of the sio flags. Some are redundant now, other need to find there way back. Hopefully we can avoid the same mess. o Remove support for GDB. This definitely has to come back, but needs to be done in the same MI/MD way as for the console. On ia64 (at least) the firmware can provide the port to use for debugging, which makes it a dynamic property that should be handled pretty much the same as the console itself. NOTE: pc98 seems to be the odd-ball due to having the sio driver in pc98 specific source files. I don't know to what extend sio/pc98 is different and whether we can integrate it here. NOTE ALSO: most (if not all) if this change the interaction with the hardware, not the high level code that deals with it being a tty. Provided the hardware is properly accessed, nothing should change functionally. NOTE ALSO WIK: this driver has so far been used successfully on ia64 and has had testing on both i386 and alpha. Affected files ... .. //depot/projects/sio/sys/alpha/alpha/api_up1000.c#2 integrate .. //depot/projects/sio/sys/alpha/alpha/dec_1000a.c#2 integrate .. //depot/projects/sio/sys/alpha/alpha/dec_2100_a50.c#2 integrate .. //depot/projects/sio/sys/alpha/alpha/dec_2100_a500.c#2 integrate .. //depot/projects/sio/sys/alpha/alpha/dec_axppci_33.c#2 integrate .. //depot/projects/sio/sys/alpha/alpha/dec_eb164.c#2 integrate .. //depot/projects/sio/sys/alpha/alpha/dec_eb64plus.c#2 integrate .. //depot/projects/sio/sys/alpha/alpha/dec_kn20aa.c#2 integrate .. //depot/projects/sio/sys/alpha/alpha/dec_kn300.c#2 integrate .. //depot/projects/sio/sys/alpha/alpha/dec_st550.c#2 integrate .. //depot/projects/sio/sys/alpha/alpha/dec_st6600.c#2 integrate .. //depot/projects/sio/sys/alpha/alpha/machdep.c#2 integrate .. //depot/projects/sio/sys/alpha/alpha/sio_machdep.c#1 branch .. //depot/projects/sio/sys/conf/files#2 integrate .. //depot/projects/sio/sys/conf/files.alpha#2 integrate .. //depot/projects/sio/sys/conf/files.i386#2 edit .. //depot/projects/sio/sys/conf/files.ia64#2 edit .. //depot/projects/sio/sys/conf/files.sparc64#2 integrate .. //depot/projects/sio/sys/dev/puc/puc.c#2 integrate .. //depot/projects/sio/sys/dev/puc/pucdata.c#2 integrate .. //depot/projects/sio/sys/dev/sio/sio_cons.c#1 branch .. //depot/projects/sio/sys/dev/sio/sio_ebus.c#2 integrate .. //depot/projects/sio/sys/dev/sio/sio_isa.c#2 integrate .. //depot/projects/sio/sys/dev/sio/sio_puc.c#2 integrate .. //depot/projects/sio/sys/dev/sio/siovar.h#2 integrate .. //depot/projects/sio/sys/ia64/ia64/sio_machdep.c#1 branch Differences ... ==== //depot/projects/sio/sys/alpha/alpha/api_up1000.c#2 (text+ko) ==== @@ -55,8 +55,6 @@ 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 @@ -81,30 +79,13 @@ struct ctb *ctb; irongate_init(); -#ifdef DDB - siogdbattach(0x2f8, 57600); -#endif ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); switch (ctb->ctb_term_type) { case 2: /* 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; - } + break; case 3: /* display console ... */ ==== //depot/projects/sio/sys/alpha/alpha/dec_1000a.c#2 (text+ko) ==== @@ -93,11 +93,6 @@ #include "opt_dev_sc.h" -#ifndef CONSPEED -#define CONSPEED TTYDEF_SPEED -#endif -static int comcnrate = CONSPEED; - void dec_1000a_init(int); static void dec_1000a_cons_init(void); @@ -112,8 +107,6 @@ 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); @@ -185,35 +178,12 @@ apecs_init(); } -#ifdef DDB - siogdbattach(0x2f8, 57600); -#endif - ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); switch (ctb->ctb_term_type) { case 2: /* 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; - } + break; case 3: /* display console ... */ ==== //depot/projects/sio/sys/alpha/alpha/dec_2100_a50.c#2 (text+ko) ==== @@ -51,10 +51,6 @@ #include <alpha/pci/apecsvar.h> #include "opt_dev_sc.h" -#ifndef CONSPEED -#define CONSPEED TTYDEF_SPEED -#endif -static int comcnrate = CONSPEED; void dec_2100_a50_init(void); static void dec_2100_a50_cons_init(void); @@ -63,8 +59,6 @@ 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[] = { @@ -110,32 +104,12 @@ apecs_init(); -#ifdef DDB - siogdbattach(0x2f8, 9600); -#endif ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); switch (ctb->ctb_term_type) { case 2: /* 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; - } + break; case 3: /* display console ... */ ==== //depot/projects/sio/sys/alpha/alpha/dec_2100_a500.c#2 (text+ko) ==== @@ -44,17 +44,11 @@ #include <alpha/pci/t2reg.h> #include "opt_dev_sc.h" -#ifndef CONSPEED -#define CONSPEED TTYDEF_SPEED -#endif -static int comcnrate = CONSPEED; 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 @@ -97,29 +91,11 @@ struct ctb *ctb; t2_init(); -#ifdef DDB - siogdbattach(0x2f8, 9600); -#endif ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); switch (ctb->ctb_term_type) { case 2: /* 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; case 3: ==== //depot/projects/sio/sys/alpha/alpha/dec_axppci_33.c#2 (text+ko) ==== @@ -48,17 +48,11 @@ #include <alpha/pci/lcavar.h> #include "opt_dev_sc.h" -#ifndef CONSPEED -#define CONSPEED TTYDEF_SPEED -#endif -static int comcnrate = CONSPEED; 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[] = { @@ -121,32 +115,12 @@ lca_init(); -#ifdef DDB - siogdbattach(0x2f8, 9600); -#endif ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); switch (ctb->ctb_term_type) { case 2: /* 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; - } + break; case 3: /* display console ... */ ==== //depot/projects/sio/sys/alpha/alpha/dec_eb164.c#2 (text+ko) ==== @@ -47,11 +47,6 @@ #include "opt_dev_sc.h" -#ifndef CONSPEED -#define CONSPEED TTYDEF_SPEED -#endif -static int comcnrate = CONSPEED; - void dec_eb164_init(void); static void dec_eb164_cons_init(void); static void eb164_intr_init(void); @@ -60,8 +55,6 @@ 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 @@ -95,35 +88,12 @@ cia_init(); -#ifdef DDB - siogdbattach(0x2f8, 57600); -#endif - ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); switch (ctb->ctb_term_type) { case 2: /* 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; - } + break; case 3: /* display console ... */ ==== //depot/projects/sio/sys/alpha/alpha/dec_eb64plus.c#2 (text+ko) ==== @@ -67,11 +67,6 @@ #include "opt_dev_sc.h" -#ifndef CONSPEED -#define CONSPEED TTYDEF_SPEED -#endif -static int comcnrate = CONSPEED; - void dec_eb64plus_init(void); static void dec_eb64plus_cons_init(void); static void dec_eb64plus_intr_init(void); @@ -82,7 +77,6 @@ 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[] = { @@ -131,26 +125,7 @@ switch (ctb->ctb_term_type) { case 2: /* 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; - } + break; case 3: #ifdef DEV_SC ==== //depot/projects/sio/sys/alpha/alpha/dec_kn20aa.c#2 (text+ko) ==== @@ -49,11 +49,6 @@ #include "opt_dev_sc.h" -#ifndef CONSPEED -#define CONSPEED TTYDEF_SPEED -#endif -static int comcnrate = CONSPEED; - void dec_kn20aa_init(void); static void dec_kn20aa_cons_init(void); static void dec_kn20aa_intr_init(void); @@ -61,8 +56,6 @@ 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 @@ -104,29 +97,12 @@ cia_init(); -#ifdef DDB - siogdbattach(0x2f8, 9600); -#endif ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); switch (ctb->ctb_term_type) { case 2: /* 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; - } + break; case 3: /* display console ... */ ==== //depot/projects/sio/sys/alpha/alpha/dec_kn300.c#2 (text+ko) ==== @@ -57,11 +57,6 @@ #include "opt_dev_sc.h" -#ifndef CONSPEED -#define CONSPEED TTYDEF_SPEED -#endif -static int comcnrate = CONSPEED; - void dec_kn300_init(void); void dec_kn300_cons_init(void); @@ -73,8 +68,6 @@ }; -extern int siocnattach(int, int); -extern int siogdbattach(int, int); extern int sccnattach(void); void @@ -103,26 +96,12 @@ struct ctb *ctb; mcbus_init(); -#ifdef DDB - siogdbattach(0x2f8, 57600); -#endif ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); switch (ctb->ctb_term_type) { case 2: /* 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; case 3: ==== //depot/projects/sio/sys/alpha/alpha/dec_st550.c#2 (text+ko) ==== @@ -54,11 +54,6 @@ #include "opt_dev_sc.h" -#ifndef CONSPEED -#define CONSPEED TTYDEF_SPEED -#endif -static int comcnrate = CONSPEED; - void st550_init(void); static void st550_cons_init(void); static void st550_intr_init(void); @@ -70,8 +65,6 @@ #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 @@ -102,27 +95,11 @@ cia_init(); -#ifdef DDB - siogdbattach(0x2f8, 57600); -#endif - ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); switch (ctb->ctb_term_type) { case 2: /* 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; case 3: ==== //depot/projects/sio/sys/alpha/alpha/dec_st6600.c#2 (text+ko) ==== @@ -46,11 +46,6 @@ #include "opt_dev_sc.h" -#ifndef CONSPEED -#define CONSPEED TTYDEF_SPEED -#endif -static int comcnrate = CONSPEED; - void st6600_init(void); static void st6600_cons_init(void); static void st6600_intr_init(void); @@ -58,8 +53,6 @@ #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 @@ -85,30 +78,13 @@ struct ctb *ctb; tsunami_init(); -#ifdef DDB - siogdbattach(0x2f8, 57600); -#endif ctb = (struct ctb *)(((caddr_t)hwrpb) + hwrpb->rpb_ctb_off); switch (ctb->ctb_term_type) { case 2: /* 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; - } + break; case 3: /* display console ... */ ==== //depot/projects/sio/sys/alpha/alpha/machdep.c#2 (text+ko) ==== @@ -119,6 +119,7 @@ #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> @@ -579,10 +580,11 @@ * Initalize the real console, so the the bootstrap console is * no longer necessary. */ - if (platform.cons_init) { + if (platform.cons_init) platform.cons_init(); - promcndetach(); - } + promcndetach(); + cninit(); + /* NO MORE FIRMWARE ACCESS ALLOWED */ #ifdef _PMAP_MAY_USE_PROM_CONSOLE /* ==== //depot/projects/sio/sys/conf/files#2 (text+ko) ==== @@ -649,6 +649,8 @@ dev/si/si_eisa.c optional si eisa dev/si/si_isa.c optional si isa dev/si/si_pci.c optional si pci +dev/sio/sio.c optional sio +dev/sio/sio_cons.c optional sio dev/sio/sio_ebus.c optional sio ebus dev/sio/sio_pccard.c optional sio card dev/sio/sio_pccard.c optional sio pccard ==== //depot/projects/sio/sys/conf/files.alpha#2 (text+ko) ==== @@ -78,6 +78,7 @@ alpha/alpha/promcons.c standard alpha/alpha/prom_disp.s standard alpha/alpha/sgmap.c standard +alpha/alpha/sio_machdep.c optional sio alpha/alpha/support.s standard alpha/alpha/swtch.s standard alpha/alpha/sys_machdep.c standard @@ -178,7 +179,6 @@ dev/kbd/kbd.c optional kbd dev/kbd/kbd.c optional sc dev/kbd/kbd.c optional ukbd -dev/sio/sio.c optional sio dev/sio/sio_isa.c optional sio isa dev/syscons/schistory.c optional sc dev/syscons/scmouse.c optional sc ==== //depot/projects/sio/sys/conf/files.i386#2 (text+ko) ==== @@ -131,7 +131,7 @@ dev/sbni/if_sbni.c optional sbni dev/sbni/if_sbni_isa.c optional sbni isa dev/sbni/if_sbni_pci.c optional sbni pci -dev/sio/sio.c optional sio +dev/sio/sio_isa.c optional sio acpi dev/sio/sio_isa.c optional sio isa dev/sr/if_sr_isa.c optional sr isa dev/syscons/apm/apm_saver.c optional apm_saver apm @@ -230,6 +230,7 @@ i386/i386/perfmon.c optional perfmon i386/i386/perfmon.c optional perfmon profiling-routine i386/i386/pmap.c standard +i386/i386/sio_machdep.c optional sio i386/i386/support.s standard i386/i386/swtch.s standard i386/i386/sys_machdep.c standard ==== //depot/projects/sio/sys/conf/files.ia64#2 (text+ko) ==== @@ -34,7 +34,7 @@ dev/kbd/kbd.c optional kbd dev/kbd/kbd.c optional sc dev/kbd/kbd.c optional ukbd -dev/sio/sio.c optional sio +dev/sio/sio_isa.c optional sio acpi dev/sio/sio_isa.c optional sio isa dev/syscons/schistory.c optional sc dev/syscons/scmouse.c optional sc @@ -85,6 +85,7 @@ ia64/ia64/sal.c standard ia64/ia64/sapic.c standard ia64/ia64/setjmp.s standard +ia64/ia64/sio_machdep.c optional sio ia64/ia64/ssc.c optional ski ia64/ia64/sscdisk.c optional ski ia64/ia64/support.s standard ==== //depot/projects/sio/sys/conf/files.sparc64#2 (text+ko) ==== @@ -15,7 +15,6 @@ dev/ofw/ofw_console.c optional ofw_console dev/ofw/openfirm.c standard dev/ofw/openfirmio.c standard -dev/sio/sio.c optional sio dev/sio/sio_isa.c optional sio isa geom/geom_bsd.c standard geom/geom_bsd_enc.c standard ==== //depot/projects/sio/sys/dev/puc/puc.c#2 (text+ko) ==== @@ -315,9 +315,6 @@ continue; } device_set_ivars(sc->sc_ports[i].dev, pdev); - device_set_desc(sc->sc_ports[i].dev, sc->sc_desc->name); - if (!bootverbose) - device_quiet(sc->sc_ports[i].dev); #ifdef PUC_DEBUG printf("puc: type %d, bar %x, offset %x\n", sc->sc_desc->ports[i].type, ==== //depot/projects/sio/sys/dev/puc/pucdata.c#2 (text+ko) ==== @@ -49,6 +49,17 @@ const struct puc_device_description puc_devices[] = { + { "Diva Serial [GSP] Multiport UART", + NULL, + { 0x103c, 0x1048, 0x103c, 0x1282 }, + { 0xffff, 0xffff, 0xffff, 0xffff }, + { + { PUC_PORT_TYPE_COM, 0x10, 0x00, 0, PUC_FLAGS_MEMORY }, + { PUC_PORT_TYPE_COM, 0x10, 0x10, 0, PUC_FLAGS_MEMORY }, + { PUC_PORT_TYPE_COM, 0x10, 0x38, 0, PUC_FLAGS_MEMORY }, + }, + }, + { "Comtrol RocketPort 550/4 RJ45", NULL, { 0x11fe, 0x8014, 0, 0 }, ==== //depot/projects/sio/sys/dev/sio/sio_ebus.c#2 (text+ko) ==== @@ -34,6 +34,9 @@ #include <sys/tty.h> #include <machine/bus.h> +#include <machine/resource.h> + +#include <sys/rman.h> #include <dev/sio/siovar.h> @@ -55,11 +58,9 @@ static driver_t sio_ebus_driver = { sio_driver_name, sio_ebus_methods, - 0, + sizeof(struct com_s), }; -DRIVER_MODULE(sio, ebus, sio_ebus_driver, sio_devclass, 0, 0); - /* Needed for EBus attach and sparc64 console support */ char *sio_ofw_names[] = { "serial", @@ -91,23 +92,31 @@ } static int -sio_ebus_probe(dev) - device_t dev; +sio_ebus_probe(device_t dev) { - char *n; + struct com_s *com; + char *n; n = ebus_get_name(dev); if (!sio_ofw_inlist(n, sio_ofw_names) && (strcmp(n, "serial") != 0 || !sio_ofw_inlist(ebus_get_compat(dev), sio_ofw_compat))) return (ENXIO); - /* Do not probe IRQ - isa_irq_pending() does not work for ebus. */ - return (sioprobe(dev, 0, 0UL, 1)); + + com = device_get_softc(dev); + com->addr_rid = 0; + com->addr_type = SYS_RES_IOPORT; + com->addr_res = bus_alloc_resource(dev, com->addr_type, &com->addr_rid, + 0, ~0, 8, RF_ACTIVE); + if (com->addr_res == NULL) + return (ENXIO); + return (sioprobe(dev)); } static int -sio_ebus_attach(dev) - device_t dev; +sio_ebus_attach(device_t dev) { - return (sioattach(dev, 0, 0UL)); + return (sioattach(dev)); } + +DRIVER_MODULE(sio, ebus, sio_ebus_driver, sio_devclass, 0, 0); ==== //depot/projects/sio/sys/dev/sio/sio_isa.c#2 (text+ko) ==== @@ -24,6 +24,8 @@ * $FreeBSD: src/sys/dev/sio/sio_isa.c,v 1.10 2003/03/11 16:49:06 takawata Exp $ */ +#include "opt_isa.h" + #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> @@ -33,10 +35,13 @@ #include <sys/malloc.h> #include <sys/mutex.h> #include <sys/module.h> +#include <sys/timepps.h> #include <sys/tty.h> -#include <machine/bus_pio.h> + #include <machine/bus.h> -#include <sys/timepps.h> +#include <machine/resource.h> + +#include <sys/rman.h> #include <dev/sio/siovar.h> @@ -50,14 +55,13 @@ /* Device interface */ DEVMETHOD(device_probe, sio_isa_probe), DEVMETHOD(device_attach, sio_isa_attach), - { 0, 0 } }; static driver_t sio_isa_driver = { sio_driver_name, sio_isa_methods, - 0, + sizeof(struct com_s), }; static struct isa_pnp_id sio_ids[] = { @@ -148,21 +152,38 @@ }; static int -sio_isa_probe(dev) - device_t dev; +sio_isa_probe(device_t dev) { + struct com_s *com; + /* Check isapnp ids */ if (ISA_PNP_PROBE(device_get_parent(dev), dev, sio_ids) == ENXIO) return (ENXIO); - return (sioprobe(dev, 0, 0UL, 0)); + + com = device_get_softc(dev); + com->addr_rid = 0; + com->addr_type = SYS_RES_IOPORT; + com->addr_res = bus_alloc_resource(dev, com->addr_type, &com->addr_rid, + 0, ~0, 8, RF_ACTIVE); + if (com->addr_res == NULL) { + com->addr_rid = 0; + com->addr_type = SYS_RES_MEMORY; + com->addr_res = bus_alloc_resource(dev, com->addr_type, + &com->addr_rid, 0, ~0, 8, RF_ACTIVE); + if (com->addr_res == NULL) + return (ENXIO); + } + return (sioprobe(dev)); } static int -sio_isa_attach(dev) - device_t dev; +sio_isa_attach(device_t dev) { - return (sioattach(dev, 0, 0UL)); + + return (sioattach(dev)); } +DRIVER_MODULE(sio, acpi, sio_isa_driver, sio_devclass, 0, 0); +#ifdef DEV_ISA DRIVER_MODULE(sio, isa, sio_isa_driver, sio_devclass, 0, 0); -DRIVER_MODULE(sio, acpi, sio_isa_driver, sio_devclass, 0, 0); +#endif ==== //depot/projects/sio/sys/dev/sio/sio_puc.c#2 (text+ko) ==== @@ -36,9 +36,10 @@ #include <sys/mutex.h> #include <sys/module.h> #include <sys/tty.h> -#include <machine/bus_pio.h> #include <machine/bus.h> >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305012057.h41KvQSw090147>